<    April 2017    >
Su Mo Tu We Th Fr Sa  
                   1  
 2  3  4  5  6  7  8  
 9 10 11 12 13 14 15  
16 17 18 19 20 21 22  
23 24 25 26 27 28 29  
30
00:00 <monochrom> y is like two levels of tables.
00:00 splanch joined
00:02 orhan89 joined
00:03 infinity0 joined
00:04 tv joined
00:04 acidjnk22 joined
00:05 <monochrom> No, better description of y: y is a dependent table --- which table you get depends on the first parameter you give.
00:05 SeMas joined
00:05 <actualHuman_452> Ok, thanks folks - I think I mostly get it. At the very least, I now understand why/how the liftM(n) functions are super nice for composing a bunch of predicates
00:05 infinity0 joined
00:06 <monochrom> Ah yes
00:06 ertes joined
00:06 vaibhavsagar joined
00:07 ublubu joined
00:08 Guest85534 joined
00:08 infinity0 joined
00:09 <actualHuman_452> So, (hopefully) final question -
00:10 smillmorel joined
00:11 infinity0 joined
00:11 <actualHuman_452> Where does "a" go, if (a->e) is like (->) e ? Can type constructors be partially applied, or is the (a) just somehow implicit?
00:11 wroathe joined
00:12 filterfish joined
00:12 godfrey joined
00:12 <monochrom> No, e->a is (->) e a
00:12 <actualHuman_452> Oh, right, because it's infix
00:12 eacameron joined
00:13 Aruro_ joined
00:13 jer1 joined
00:13 <monochrom> And then, partially applied, (->) e
00:13 <monochrom> We absolutely want the partially applied (->)e in "instance Monad ((->)e) where"
00:14 infinity0 joined
00:15 kvda joined
00:15 <godfrey> hey there, anyone know about the IDE Haskell for Mac? How is it?
00:16 <monochrom> I have heard of it, I'm happy it exists, but I don't have a Mac, so I haven't tried.
00:17 <jle`> i've heard good things about it, but i always feel weird about the name
00:17 <monochrom> Last evening I ate a Big Mac.
00:17 <glguy> Just keep in mind that it's not a generic development environment, it's more of an interactive workbook a la iPython
00:17 mkollaro joined
00:18 Aruro joined
00:18 slemonide1 joined
00:18 sgronblo joined
00:20 newhoggy joined
00:20 juhp joined
00:20 <monochrom> Oh too bad, ircbrowse is still throwing libpq exceptions.
00:21 <monochrom> Should have sent kamyar down the well-intended path of buying a Mac so as to use Haskell for Mac.
00:21 mivael joined
00:24 latro`a joined
00:24 <mniip> jle`, it's simple
00:24 <mniip> I never use scopedtyvars
00:24 codesoup joined
00:25 <jle`> :o
00:26 Rodya_ joined
00:26 <mniip> jle`, change that 'Proxy' into a 'proxy' (and get rid of the import) and I'd merge it
00:26 fresheyeball joined
00:26 <fresheyeball> what the heck does intersectionWith do?
00:26 <monochrom> Whose intersectionWith?
00:27 <fresheyeball> Map
00:27 wroathe joined
00:27 <jle`> mniip: i don't think it is possible
00:27 <mniip> iirc it lets you supply a combination functino
00:27 <fresheyeball> :t Data.Map.intersectionWith
00:27 <lambdabot> Ord k => (a -> b -> c) -> M.Map k a -> M.Map k b -> M.Map k c
00:27 <jle`> mniip: Proxy is used as a value there
00:27 <mniip> :t GHC.TypeLits.natVal
00:27 <lambdabot> GHC.TypeLits.KnownNat n => proxy n -> Integer
00:27 fXl joined
00:27 <mniip> finites = finitesProxy undefined
00:27 <jle`> :O
00:27 <monochrom> The a->b->c function manipulates the values.
00:28 <mniip> or
00:28 <jle`> was it always that way?
00:28 <mniip> finites = let result = ... natVal (head result) ... in result
00:28 <fXl> hello guys, how can we pretty print yaml to a file ?
00:28 <jle`> huh i seem to remember natVal taking Proxy for some reason
00:28 <jle`> alright
00:28 <monochrom> When and only when (k,x) and (k,y) are in the two input maps, respectively, the output map has (k, f x y), where f is the a->b->c function.
00:28 <jle`> i know now what i must do
00:29 <lyxia> finites = finitesProxy []
00:29 <fresheyeball> :t (\f x y -> Data.Map.map f $ Data.Map.intersection x y)
00:29 <lambdabot> Ord k => (a -> b1) -> M.Map k a -> M.Map k b -> M.Map k b1
00:29 <mniip> lyxia, wrong
00:29 <lyxia> :(
00:29 <mniip> cannot unify [a] with proxy a
00:29 <lyxia> what
00:29 <mniip> er
00:29 <mniip> cannot unify [a] with proxy n, where n :: Nat
00:29 <fresheyeball> monochrom: ok that makes sensish
00:29 <lyxia> aah
00:30 <jle`> yeah the first thing i tried was Nothing
00:30 <jle`> i thought i was being clever
00:31 <monochrom> (\f x y -> Data.Map.map f $ Data.Map.intersection x y) is different. It ignores the values in the y map. It only cares that the keys are present at all.
00:31 <actualHuman_452> fresheyeball : sample usecase for Map.intersectionWith - You want to see the overlapping set of values in two maps where the keys are the same, but there is some condition by which you'd want values from one map instead of the other
00:31 <monochrom> Because that's what intersect does.
00:31 louispan joined
00:32 <fresheyeball> monochrom: oh no!
00:32 <fresheyeball> the keys just have to match
00:33 <fresheyeball> ok I got it now
00:33 <fresheyeball> thanks folks
00:34 jer1 joined
00:34 <jle`> mniip: i feel slightly uneasy but, adjustments made
00:34 <jle`> how do you live like this
00:34 <* jle`> shudders
00:34 conal joined
00:34 <mniip> oh you haven't seen the *stuff*
00:35 <monochrom> Eh? Living with general "proxy" is happier than living with specific Proxy.
00:35 <* mniip> tries to find an example of stuff
00:36 <jle`> monochrom: i mean, living without ScopedTypeVariables
00:36 <jle`> and not using Proxy when something expects general proxy :o
00:36 <monochrom> Ah. More proxies and fewer handwritten type sigs I guess.
00:36 <mniip> unfortunately I'm all out
00:37 halogenandtoast joined
00:40 ali_bush joined
00:40 ali_bush joined
00:40 <dopey_> is there a way to leave attributes of a dataType out of toJSON and fromJSON encoding/serialization?
00:40 <dopey_> w/out rewriting the implementations
00:40 tathougies joined
00:40 <tathougies> is there a name for arrows without `arr`?
00:41 opios joined
00:41 harfangk joined
00:42 <mniip> Category?
00:42 <lyxia> There's still &&& and ***
00:42 <pacak> tathougies: Category + Profunctor
00:43 wroathe joined
00:43 <tathougies> but profunctor let's me map arbitrary functions over the input and output
00:43 <tathougies> i don't want that
00:43 <tathougies> only functions that can be expressed in my arrow
00:43 <pacak> So does arrow
00:43 <tathougies> not without arr?
00:43 <mniip> I think they want a whatsitcalled
00:43 <tathougies> basically i want a strong profunctor without the profunctor bits :/
00:44 <mniip> no
00:44 Rodya_ joined
00:44 <mniip> abelian category wasn't it
00:44 fXl joined
00:44 <tathougies> i think it might be a cartesian category?
00:44 <mniip> no, that's too strong
00:44 <tathougies> why?
00:44 <johnw> tathougies: what is it that you want to do?
00:44 <mniip> that involves coproducts too
00:45 <johnw> I thought only cocartesian or bicartesian involved coproducts
00:45 <johnw> just cartesian is category + products
00:45 <tathougies> johnw: i want arrow without arr. Then I could create a GADT for my primitive arrow operations, and ones for first, second, (&&&), and (***). This GADT would represent a computation and could be serialized
00:46 <johnw> tathougies: I ask because I might have sometheing better to offer you
00:46 <tathougies> @johnw :o what?
00:46 <lambdabot> Not enough privileges
00:46 <johnw> tathougies: what about lifting your computations to arbitrary categorical terms that can be serialized by instantiating them in a different target category
00:46 <johnw> all you'd need is as much categorical structure as your computation demains; from just composition, all the way up to bicartesian closed
00:46 <johnw> s/demains/demands
00:47 <jle`> tathougies: not sure why you "need" a typeclass
00:47 <johnw> for example, I recently used this approach to transport regular Haskell functions into Z3 solver equations -- without needing to "speak Z3"
00:47 <jle`> can't you just write your methods directly for your GADT?
00:47 <tathougies> jle` I don't want a type class, I just want the name of the thing so I can read more about it
00:47 <jle`> ah
00:48 <tathougies> i figure finding a type class would probably lead to a link to a paper
00:48 <tathougies> :D
00:48 <johnw> tathougies: http://conal.net/papers/compiling-to-categories/
00:48 sproingie joined
00:48 <johnw> tathougies: if you have questions after reading that, find me; I'm using categories for lots of things recently
00:48 <tathougies> Ah this was a recent paper, right? I read it
00:48 <tathougies> let me re-read it with my problem in mind
00:52 sgronblo joined
00:53 sellout- joined
00:53 markasoftware joined
00:54 sellout- joined
00:54 jer1 joined
00:55 nighty-- joined
00:56 arand joined
00:58 louispan joined
00:58 wroathe joined
00:59 vaibhavsagar joined
00:59 crave_ joined
01:00 <mniip> jle`, https://hackage.haskell.org/package/finite-typelits-0.1.2.0/docs/Data-Finite.html#v:finites
01:00 <jle`> :D
01:01 <jle`> i wasn't sure about the name either
01:01 <jle`> i suppose it could also have been called 'range' or something
01:01 roconnor joined
01:02 HoierM joined
01:02 <mniip> universe
01:02 <mniip> more like
01:03 sproingie joined
01:04 <jle`> perhaps more fitting
01:04 <mniip> oh fun
01:04 <mniip> I have a reverse dependency \o
01:04 <jle`> i popped you into vector-unsized :3
01:04 <jle`> er, vector-sized
01:06 emmanuel_erc joined
01:07 <tathougies> @johnw this looks great! Is this GHC plugin already available?
01:07 <lambdabot> Not enough privileges
01:08 <tathougies> woops. johnw: this looks great, is the ghc plugin already available?
01:11 Moto-chan joined
01:11 Moto-chan joined
01:11 slemonide joined
01:13 wroathe joined
01:13 tdammers joined
01:13 <mniip> jle`, have you seen my tysystem extension proposal :o
01:14 <ezyang> anyone here know doctest and can tell me how the -package-db command line parsing is supposed to work
01:15 jer1 joined
01:18 <johnw> tathougies: yes, it works fine, please see the open issues though
01:18 <johnw> tathougies: I'd be happy to talk with you more about it after dinner, say in 3-4 hours
01:18 lavalike_ joined
01:19 Pilfers joined
01:20 dmwit joined
01:20 newhoggy joined
01:23 Shatnerz joined
01:23 <jle`> mniip: i have not :o
01:23 <mniip> thread on ML
01:24 dbmikus joined
01:27 jer1 joined
01:28 e14 joined
01:29 takle joined
01:31 louispan joined
01:31 <tathougies> johnw: thanks . i'll ping you in a bit. thanks!
01:32 Stanley00 joined
01:33 vektorweg11 joined
01:33 Supersonic112_ joined
01:35 latro`a joined
01:38 Welkin joined
01:41 slemonide joined
01:43 cschneid_ joined
01:45 geekosaur joined
01:46 ploop joined
01:50 uiop_ joined
01:50 doomlord joined
01:53 jmcarthur joined
01:54 tswe_tt joined
01:55 mandolin joined
01:57 kmels joined
01:57 MindlessDrone joined
01:57 nicknovi1 joined
01:58 eacameron joined
01:58 descender joined
01:59 newhoggy joined
02:00 hucksy joined
02:00 smillmorel joined
02:01 tathougies joined
02:03 dfordivam joined
02:04 whaletechho joined
02:04 roconnor joined
02:04 orhan89 joined
02:04 takle joined
02:05 louispan joined
02:06 flatmap13 joined
02:07 rblaze1 joined
02:07 Aruro joined
02:09 danthemyth joined
02:11 doomlord joined
02:13 beanbagula joined
02:16 xall joined
02:16 mmachenry joined
02:17 ryxai joined
02:18 darjeeling_ joined
02:18 brynedwards joined
02:20 augur joined
02:20 nomicflux joined
02:20 takle joined
02:22 Destol joined
02:23 <mniip> hmm
02:23 <mniip> then (~>), (->) :: * ~> * ~> *
02:24 splanch joined
02:26 <ezyang> I'm writing newcomer tasks for Cabal. Here's one https://github.com/haskell/cabal/issues/4044
02:29 LuckyRawApe joined
02:30 mmachenry joined
02:34 sleffy joined
02:35 exferenceBot joined
02:36 takle joined
02:38 NeverDie_ joined
02:39 tathougies joined
02:39 meghnath joined
02:43 Rodya_ joined
02:44 XorSwap joined
02:44 SpikeMaster joined
02:45 wroathe joined
02:47 Xanather joined
02:47 exferenceBot joined
02:48 chlong joined
02:50 darjeeling_ joined
02:51 hexagoxel joined
02:51 dbmikus joined
02:52 louispan joined
02:54 falafel joined
02:54 rootnode joined
03:00 vtomole joined
03:00 geekosaur joined
03:01 wroathe joined
03:01 SpikeMaster left
03:03 Don_John joined
03:04 connrs joined
03:08 doomlord joined
03:10 pavonia joined
03:10 danthemyth joined
03:10 sproingie joined
03:10 sproingie joined
03:11 takle joined
03:14 fakenerd joined
03:14 louispan joined
03:17 wroathe joined
03:17 otto_s joined
03:19 taksuyu joined
03:19 glamas joined
03:19 fugyk joined
03:20 felixsch__ joined
03:21 splanch joined
03:25 hazyPurple joined
03:30 sgronblo joined
03:30 nomicflux joined
03:31 systemfault joined
03:32 a3Dman joined
03:32 wroathe joined
03:32 xall joined
03:33 modal joined
03:36 atomi joined
03:36 baweaver joined
03:36 lavalike joined
03:39 dfeuer joined
03:39 snowalpaca joined
03:40 flobberlet joined
03:41 ewk joined
03:41 mmachenry joined
03:42 hazyPurple joined
03:43 indi_ joined
03:43 sdothum joined
03:44 mmachenry1 joined
03:45 sdothum_ joined
03:48 tathougies joined
03:48 cyborg-one joined
03:51 juhp joined
03:53 robotroll joined
03:53 howdoi joined
03:54 moet joined
03:57 tommd joined
03:58 isenmann joined
03:59 Aruro joined
04:02 BartAdv joined
04:02 takle joined
04:02 sdothum joined
04:03 splanch joined
04:04 wroathe joined
04:04 splanch_ joined
04:05 _sras_ joined
04:06 dbmikus joined
04:10 <_sras_> Why is using generics better than template haskell?
04:10 <Koterpillar> _sras_: Is it?
04:11 <_sras_> Koterpillar: I am not sure. People seem to avoid TH, but does not seem to have a problem with generics.
04:12 danthemyth joined
04:12 <pacak> TH makes compiling stuff more troublesome.
04:12 <Koterpillar> TH breaks your module compilation into phases, so you can't refer to later symbols from earlier. And it is, after all, running arbitrary code at compile time.
04:13 <pacak> It makes compiling with profiling more fun.
04:13 <pacak> And crosscompilation.
04:13 <pacak> Generics on the other hand can slowdown compilation speed
04:14 <pacak> And produce crappy runtime performance
04:14 <pacak> So both are worse :)
04:14 jaziz joined
04:14 {emptyset} joined
04:15 filterfish_ joined
04:15 <_sras_> Koterpillar: Regarding the compiling in phases, isn't it solved by placing TH calls at the bottom of the module?
04:16 <_sras_> pacak: Why does generics produce slower code?
04:16 <Koterpillar> yeah, but what if you want to actually use the generated definitions?
04:16 ridho joined
04:16 danza joined
04:16 <pacak> _sras_: It relies on ghc being smart which is not always the case.
04:17 <pacak> I've seen examples when adding one more field reduced performance by about 2 orders of magnitue
04:18 takle joined
04:20 <_sras_> Koterpillar: Yes. That can get tricky. But I guess one can always split modules....
04:20 <pacak> _sras_: That won't solve profiling issue
04:21 <_sras_> pacak: What is the profiling issue?
04:21 <pacak> You'll have to compile module that defines TH code without profiling to get splices you can run and then with profiling to get something you can run
04:21 nomicflux joined
04:22 dan_f joined
04:22 <pacak> p_o files and so on.
04:22 <pacak> And if your project is big - that's doubles compilation time
04:26 oaao joined
04:26 mattp__ joined
04:27 louispan joined
04:27 fakenerd joined
04:28 LuckyRawApe joined
04:30 sgronblo joined
04:33 takle joined
04:33 castlelore joined
04:34 jhrcek joined
04:34 aarvar joined
04:35 eklavya joined
04:36 wroathe joined
04:36 ewk left
04:38 <johnw> tathougies: hi
04:42 dbmikus joined
04:45 vtomole joined
04:46 parsnip joined
04:47 <parsnip> i wanted a newer hledger on a VPS, so i tried to install with haskell-stack, but it was running out of space. i increased the size some, but still the same issue. maybe an issue with how some VPS do /tmp?
04:49 vaibhavsagar joined
04:50 sirreal joined
04:51 takle joined
04:52 <johnw> parsnip: have you tried Docker? I'd think that would be easier
04:52 <parsnip> johnw: might not have the weird /tmp issue?
04:53 <johnw> and it's easier to throw away intermediate images
04:53 ner0x652 joined
04:54 biglambda joined
04:54 orhan89 joined
04:55 ofdm joined
04:58 plot joined
04:59 soniku joined
05:00 <Lokathor> i have a type that is trivially a DeepSeq instance, but i also don't want my library to depend on deepseq
05:00 <Lokathor> such a quandry
05:00 <MarcelineVQ> why not
05:01 orhan89 joined
05:01 <jhrcek> Anyone here got experience with lens-aeson? I want to do some quick data extraction from HAR (HTTP Archive = json format listing http communication between client and server).
05:01 <pacak> Lokathor: Isn't it bundled with ghc those days?
05:01 <Lokathor> pacak, maybe?
05:02 <jhrcek> I'd like to basically filter out aeson's Array to keep only some of its contests ..http://lpaste.net/354977
05:02 <Lokathor> MarcelineVQ, because having more dependencies is inherently bad compared to having less when possible :P
05:04 xtreak joined
05:04 seliopou joined
05:04 <MarcelineVQ> ah, hmm, if that's the case then you know what must be done
05:05 takle joined
05:05 connrs joined
05:05 <Lokathor> i wish haskell had a better way to say "if they've got this typeclass, include this instance, but otherwise just forget about it"
05:05 crobbins joined
05:05 <MarcelineVQ> but tangentially, inherent is one of those words I distrust a little more each time I see it
05:07 malt3 joined
05:07 <Lokathor> "inherent" means "i can't explain it you gotta go with it"
05:08 fakenerd_ joined
05:10 jaziz joined
05:10 pungi-man joined
05:12 splanch joined
05:13 danthemyth joined
05:15 insitu joined
05:15 oish joined
05:16 JoshS joined
05:17 <cocreature> Lokathor: can you do that with TH?
05:17 <Lokathor> cocreature, you can probably do it really clunkily with the CPP even
05:17 <cocreature> Lokathor: how do you check if an instance exists with CPP?
05:18 <Lokathor> but either way I want it to be a better supported thing than that
05:18 <Lokathor> cocreature, you can check a package's minimum version with CPP
05:18 dbmikus joined
05:19 <cocreature> right but then I need to check myself which version provides the instance
05:19 <Lokathor> no i'm suggesting that you check if the typclass you want to make an instance of exists within the build, and if it does you write your instance
05:19 <cocreature> oh ok
05:20 louispan joined
05:20 <Lokathor> eg, if they will use RandomGen, make this RNG thingy a RandomGen, but if not just keep going because you can use the type without that instance
05:20 <tathougies> johnw: hello!
05:20 <tathougies> if you're still around, i would appreciate some more info on the compilation to categories idea
05:20 castlelore joined
05:20 castlelore joined
05:21 <Lokathor> how does one specify to stack which build profile it should load into ghci?
05:22 <Lokathor> oops, nevermind
05:22 <johnw> tathougies: sure, I'm here
05:22 <Lokathor> (--main-is TARGET)
05:22 <johnw> tathougies: we can privmsg if you'd rather not occupy the channel
05:22 <tathougies> yah sounds good
05:22 yellowj joined
05:23 wroathe joined
05:23 <MarcelineVQ> Lokathor: you might not even need main-is, the TARGET syntax should be able to cover that by letting you select your stanza
05:23 <Lokathor> huh, main-is didn't seem to work
05:23 <Lokathor> i want to pick a benchmark named "pcgen-bench"
05:23 <Lokathor> but i don't know how :(
05:23 splanch joined
05:25 <MarcelineVQ> stack build --bench pcgen-bench no good?
05:25 <Lokathor> that runs the benchmark, but i want to run ghci with the benchmark profile loaded in
05:26 splanch_ joined
05:26 <cocreature> stack ghci --bench pcgen-bench doesn’t work?
05:26 <Lokathor> says it's not found
05:27 <Lokathor> but it gives a help URL i guess
05:27 <Lokathor> let's check that i support
05:27 <Lokathor> su8ppose*
05:27 splanch__ joined
05:27 <Lokathor> oh, okay, "stack ghci --bench" is what it wanted
05:28 SysRun joined
05:28 darjeeling_ joined
05:29 <MarcelineVQ> TARGET syntax explained here: https://docs.haskellstack.org/en/stable/build_command/#target-syntax
05:29 splanch joined
05:31 <Lokathor> yeah the answer is apparently "don't give a target you idiot"
05:31 Moto-chan joined
05:31 Moto-chan joined
05:31 splanch_ joined
05:32 <MarcelineVQ> hmm, depends if you want all your benches loaded or not
05:32 <Lokathor> aside, http://lpaste.net/354979 yay benchmarks also run now, and my type beats the standard type by about 2x-3x
05:32 <MarcelineVQ> is it uniform?
05:33 splanch__ joined
05:33 <Lokathor> is the RNG's output uniform?
05:33 <Lokathor> naw, it's always 4, https://xkcd.com/221/
05:33 <MarcelineVQ> yeah, though idk if that's a valid question
05:34 <Lokathor> well, I don't actually know much about RNGs, but there's this website here http://www.pcg-random.org/ by the professor who came up with it i guess
05:34 <Lokathor> and i was like "hey it's 1 struct and 1 function, I can do that in haskell", and then this is like the version 2 where i'm making it into its own reusable package instead of being mixed into other things
05:35 mstruebing joined
05:35 xall_ joined
05:36 splanch joined
05:36 <MarcelineVQ> neat stuff
05:37 <Lokathor> now to do the unboxed version, which i can assume will be faster based on previous work
05:37 <Lokathor> but which doesn't run on 32 bit machines :P
05:38 <jle`> mniip: it's interesting. is it possible
05:40 <Lokathor> cocreature, http://lpaste.net/354980 like this
05:40 splanch_ joined
05:41 <Lokathor> i wish that GHC knew how to derive Read for Word#
05:42 <pacak> Lokathor: O_o
05:42 <Lokathor> pacak, ?
05:42 <pacak> Word# is unboxed, read returns boxed value
05:43 <Lokathor> yeah but it should be able to derive a Read for a value that as a Word# field and just do the unboxing in the process
05:43 henriksod joined
05:43 <pacak> o_O
05:43 <Lokathor> https://github.com/Lokathor/galaxy-break/blob/master/lib/PCGen.hs#L177 it's not hard
05:44 <pacak> data PCGen = PCGen Word# Word#
05:45 <pacak> Why not data PCGen = PCGen !Word !Word ?
05:45 <Lokathor> because that's slower
05:45 erikd joined
05:45 <pacak> Do you have benchmarks?
05:45 <Lokathor> I do have that version as well, and it works on 32bit machines
05:46 <pacak> With optimizations recent ghc will unbox those values so code will be the same as you wrote
05:46 <Lokathor> I do not have benchmarks any more currently. I took some long ago when I wrote that file
05:46 infy joined
05:46 vlatkoB joined
05:46 <Lokathor> I'll get you some more benchmarks as soon as I get the unboxed version in order in the new project
05:46 JoshS joined
05:47 <pacak> I'm pretty sure you can get exactly the same performance by doing strictness annotation
05:47 unK_ joined
05:48 <Lokathor> welp, i'll get back to you in like 20 minutes on taht
05:48 halogenandtoast joined
05:48 castlelore joined
05:48 castlelore joined
05:48 <pacak> Try passing -O2 -ddump-simpl -ddump-stg -ddump-to-file and compare whatever ghc produces
05:49 <MarcelineVQ> are you sure you're not thinking of {- UNPACK -}
05:49 <Lokathor> i invite you to do that, but i wanna finish getting the unboxed version in place first :P
05:49 <jle`> Lokathor: it's the wrong kind, though
05:49 <jle`> read :: forall (a :: *). Read a => String -> a
05:50 <Lokathor> jle`, but it's not a Read for a Word#, it's a read for some type Foo that has a Word# in it, so it should try to read a Word, and then do the unpacking, and put that into the final Foo (which is of Kind *)
05:50 hamishmack joined
05:50 <MarcelineVQ> actually I guess since the first example didn't unpack it wouldn't matter for the second
05:52 osa1 joined
05:52 <Lokathor> question: If you put an UNPACK on a Word64, but the machine isn't 64 bits, will it silently ignore it and use Word64 as a boxed value?
05:53 <pacak> It's been a while since I last time saw 32bit machine...
05:53 <Lokathor> raspberry pi is 32 bits
05:54 ThomasLocke joined
05:54 ThomasLocke joined
05:54 wroathe joined
05:55 <opqdonut> Lokathor: if it can unpack !(Int,Int), it surely can unpack a Word64
05:55 <opqdonut> (see https://downloads.haskell.org/~ghc/7.0.3/docs/html/users_guide/pragmas.html)
05:55 takuan joined
05:56 <Lokathor> opqdonut, the issue is that a Word64 needs to still be 64 bits after unpacking, but unpacking makes it into a machine width word, but the machine's width is only 32 bits
05:57 <opqdonut> why does unpacking make it into one word?
05:57 <opqdonut> the docs don't say so
05:57 <pacak> Lokathor: unpacking of product types "inlines" them.
05:57 Sampuka joined
05:57 <opqdonut> yeah, think C structs
05:57 juhp joined
05:57 <Lokathor> well, let me back up then, a Word# is always the machine width in size
05:58 <Lokathor> i guess it doesn't specify that a Word64 unpacks into a Word# precisely
05:58 <pacak> Word64 will be unpacked into Word64#, no?
05:58 <Lokathor> there is no such type
05:59 parsnip joined
05:59 <pacak> O_o
05:59 <pacak> data {-# CTYPE "HsWord64" #-} Word64 = W64# Word64#
05:59 <opqdonut> yeah that's what the haskell source looks like... but I would assume all Word# stuff is magic
05:59 hurkan joined
05:59 <pacak> https://hackage.haskell.org/package/base-4.9.0.0/docs/src/GHC.Word.html
05:59 <opqdonut> https://hackage.haskell.org/package/base-4.9.1.0/docs/src/GHC.Word.html#Word64
05:59 <opqdonut> heh, that's changed :)
06:00 <opqdonut> oh, no, it isn't
06:00 <opqdonut> #if WORD_SIZE_IN_BITS < 64
06:00 <opqdonut> there's two definitions
06:00 <opqdonut> great!
06:00 soniku joined
06:02 mbuf joined
06:03 cschneid_ joined
06:03 biglambda joined
06:06 vargeek joined
06:09 <Lokathor> Word32# doesn't seem to be a type you can access
06:10 <Lokathor> it's not exported anywhere in GHC.Prim or similar, that I can see
06:10 wroathe joined
06:11 raichoo joined
06:11 Gurkenglas joined
06:12 cgfbee joined
06:13 <MarcelineVQ> GHC.Word
06:14 <MarcelineVQ> it has a W32# for Word32 but the Word# inside it will vary by arch I suppose
06:16 oish joined
06:16 <MarcelineVQ> though maybe not, the dichotomy is mostly between 32 and 64, it's only in ghc source that I've seen concerns over units smaller than 32
06:16 yoneda joined
06:16 fakenerd joined
06:17 <parsnip> out of space :( http://sprunge.us/ZaJA
06:18 <dmj`> parsnip: time to ditch stack for nix
06:18 connrs joined
06:19 exferenceBot joined
06:19 <pacak> Stack was fixed some time ago to clean up stuff from /tmp
06:20 <pacak> Probably before nobody actually used stack to compile big projects.
06:20 <MarcelineVQ> further there's an option for finer control from 1.3.0 onwards, https://docs.haskellstack.org/en/stable/faq/#can-i-change-stacks-default-temporary-directory but the item downloaded fine and failed on extraction idk if it'll help
06:21 <parsnip> using stack version 1.4.0
06:22 <dmj`> parsnip: the nix store is large it won’t run out of space this easily. All builds are isolated as well, obviated the need for containers
06:22 <Lokathor> wordify (a,b) = (fromIntegral a :: Word, b)
06:22 <dmj`> obviating*
06:22 <Lokathor> i make all the best functions
06:22 jaziz joined
06:23 eacameron joined
06:23 <MarcelineVQ> then he unpacked all the tuples and shouted to the sky, finally I am a haskell lib author
06:24 <dmj`> Lokathor: cabal upload wordify
06:24 <Lokathor> MarcelineVQ, oh i see, GHC.Word is in base but it has a flag to not be documented :P
06:25 <MarcelineVQ> ye anything on that module list is reachable, things that aren't don't get listed, mm afaik
06:26 <Lokathor> {-# OPTIONS_HADDOCK hide #-}
06:26 <MarcelineVQ> that's sneaky-speak for "why are you using this module?"
06:27 <MarcelineVQ> just like GHC.Arr
06:28 <Lokathor> https://youtu.be/jdbBS9rK5XI?t=20s
06:29 _kit_ joined
06:30 heurist joined
06:31 <Lokathor> oh no!
06:31 <Lokathor> I am made the fool!
06:32 <Lokathor> without UNPACK the unboxed version is faster, but when you add UNPACK to the boxed version it's faster
06:32 <Lokathor> very close though either way
06:33 SpinTensor joined
06:33 <pacak> Lokathor: Benchmarking is hard, ghc should generate exactly the same code.
06:33 dbmikus joined
06:33 <pacak> Plus you don't even need UNPACK - recent ghc contains -funbox-small-strict-fields which is on by default
06:34 <Lokathor> ah, hmm, i guess they're so close that different runs make them float above and below each other
06:35 <pacak> clean up your code, allow ghc to do it's thing.
06:35 <MarcelineVQ> you don't have to guess :> you can compare core
06:35 <Lokathor> pacak, incorrect on the "you don't need UNPACK front", there is a repeatable difference of more than 10% if you leave out the UNPACK
06:36 <pacak> (13:48:55) pacak: Try passing -O2 -ddump-simpl -ddump-stg -ddump-to-file and compare whatever ghc produces
06:36 fakenerd joined
06:36 <Lokathor> ~58ms without unpack, and ~40-45 with unpack
06:36 <Lokathor> okay
06:36 <Lokathor> ...how do i pass that through stack?
06:36 <Lokathor> i'll jsut add it to cabal
06:36 <pacak> {-# OPTIONS ....
06:37 edsko joined
06:37 <pacak> on top of your file
06:37 <Lokathor> alright okay
06:38 <MarcelineVQ> I prefer -ddump-prep is there a reason to prefer simpl? you might also want some of the -dsuppress-* flags
06:38 <Lokathor> okay but
06:38 <Lokathor> i'm not seeing where it dumped it to
06:39 <pacak> Lokathor: Should be right next to object file
06:39 oleo joined
06:39 oleo joined
06:39 <Lokathor> Bench.dump-hi ?
06:39 <pacak> Bench.dump-simpl
06:40 <Lokathor> only have a dump-hi
06:40 <pacak> Oh noes!
06:40 <Lokathor> should i lpaste that anyway?
06:40 <pacak> dump-hi? No, it's interface stuff
06:41 <Lokathor> oh, okay
06:41 <Lokathor> so
06:41 <Lokathor> it only works for executables?
06:41 <Lokathor> i just changed the benchmark type to executable type and now it works
06:41 wroathe joined
06:42 uiop_ joined
06:43 <MarcelineVQ> it wortks for other things, but it's possible there might be some nonsense in getting it to work right for bench's and tests with stack
06:43 willprice94 joined
06:43 dm3 joined
06:44 <Lokathor> packed, http://lpaste.net/354981 and unpacked, http://lpaste.net/354982
06:44 <Lokathor> i have no idea what any of this means
06:46 <pacak> http://stackoverflow.com/questions/6121146/reading-ghc-core
06:46 laplacian joined
06:47 <Lokathor> you're the one who wanted to read the core and see that it was the same no matter what or whatever
06:47 <MarcelineVQ> you probably want to try all of the -dsuppress-* flags except for -all and -unfoldings and maybe -uniques as well to keep things readable, ymmv
06:47 <MarcelineVQ> https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/flags.html#compiler-debugging-options
06:48 <pacak> Right. I'm looking at those files side by side and except for variable names there's no difference.
06:48 insitu joined
06:48 ubsan_ joined
06:48 forgottenone joined
06:48 <Lokathor> well then it's alignment in memory or something, i dunno, i just know what the benchmark says
06:48 xtreak joined
06:49 ccomb joined
06:50 <Lokathor> the unboxed version runs faster than the boxed and unpacked version most of the time though, so oh well
06:50 pie_ joined
06:50 <pacak> Core is the same => in memory representation and all operations are the same.
06:50 erikd joined
06:51 <pacak> Boxed version with strictness annotation is more maintainable.
06:51 <pacak> Doing low level stuff you not 100% understand can result in fun process of bughunting.
06:52 exferenceBot joined
06:52 <pacak> Lower level is - more extreme fun can be.
06:52 <pacak> But feel free to ignore whatever I'm saying.
06:54 dbmikus joined
06:55 freusque joined
06:55 <Lokathor> regardless of if the version with or without the UNPACK pragma runs the same
06:55 <Lokathor> the unboxed version using primops runs faster
06:55 pikhq joined
06:56 <jchia> Sometimes when I define an 'inner' function with a let inside an 'outer' function, and I give the 'inner' function a type signature, GHC complains "Couldn't match type ..." but when I remove the signature, the problem goes away. I don't think the signature is wrong because if I move the inner function with its signature out, the problem also goes away. Why is that?
06:56 <jchia> I don't have a simple example right now, though.
06:56 takle joined
06:56 guiben joined
06:56 <Lokathor> jchia, can you give an example?
06:56 <pacak> jchia: ScopedTypeVariables?
06:56 <MarcelineVQ> the type variables aren't the same variable without ScopedTypeVariables on
06:56 <Koterpillar> jchia: monomorphism restriction?
06:57 Swizec joined
06:58 wroathe joined
06:58 mivael_ joined
06:58 <Lokathor> i should have read the last line
06:58 <jchia> I have a big example in a project. Let me see if I I can distill it.
06:58 ventonegro joined
06:59 <Lokathor> well you can just give the entire file as an lpaste if you want, and include the error
06:59 <Lokathor> assuming it's like, less than a billion lines
06:59 tathougies joined
07:00 dfeuer joined
07:00 <MarcelineVQ> @let foo :: a -> a; foo ex = (ex :: a)
07:00 <lambdabot> .L.hs:169:11: error:
07:00 <lambdabot> • Couldn't match expected type ‘a1’ with actual type ‘a’
07:00 <lambdabot> ‘a’ is a rigid type variable bound by
07:01 <MarcelineVQ> the a of ex :: a is an entirely new a completely unrelated to the a of foo's signature
07:01 <pacak> unless you add forall a. and ScopedTypeVariables
07:01 GeorgeEdward joined
07:02 guiben joined
07:03 juhp joined
07:03 <MarcelineVQ> alternatively in the case you're likely preparing where it's a new function you're defining, just use different letters, unless you really mean to make the compiler check that it's the same a, most often it's not needed
07:04 burtons joined
07:05 <MarcelineVQ> since parametricity will do that checking for you when you use it
07:06 Itkovian joined
07:07 cloudhead joined
07:07 javjarfer joined
07:07 skeuomorf joined
07:07 eklavya joined
07:08 dpepsilon joined
07:08 dpepsilon joined
07:09 jdt joined
07:10 <* dysfun> isn't quite sure how nobody has fixed the "GHC tells you to enable dangerous extensions without warning you they're dangerous" by now
07:10 kuribas joined
07:10 <MarcelineVQ> which once? undecidable?
07:11 <dysfun> oh various things. undecidable is probably the most common
07:12 raichoo joined
07:12 <dysfun> ambiguous types, overlapping instances and incoherent instances are others
07:12 louispan joined
07:13 baldrick joined
07:13 vlatkoB_ joined
07:13 <MarcelineVQ> ah, hmm overlapping has been relegated to source annotation pragmas now I think, or is at least in the process of depreciating
07:13 wroathe joined
07:13 <dysfun> aha
07:14 <MarcelineVQ> dunno about the rest
07:14 <dysfun> i mean i know when i need to turn them on, but newbies don't
07:14 detrumi joined
07:15 danthemyth joined
07:15 <MarcelineVQ> :> on the plus(minus) side, most people don't read the errors well enough when they start out to take the errors advice anyway, based on questions that have been fielded here repeatedly
07:15 ThomasLocke joined
07:15 <jchia> Here's the distilled example of the GHC compilation problem I mentioned earlier: http://lpaste.net/354983
07:16 <jchia> I'm going to refine it further and add necessary imports
07:16 <kuribas> undecidable is scary sounding, but it is actually common
07:16 <MarcelineVQ> jchia: thank you, see above
07:17 <lpaste> MarcelineVQ annotated “Couldn't match type ‘d1’ with ‘d’” with “Couldn't match type ‘d1’ with ‘d’ (annotation)” at http://lpaste.net/354983#a354984
07:18 tsdh joined
07:19 <Lokathor> MarcelineVQ, I've read the errors before and started turning on flags wildly to make things work
07:19 <Lokathor> they did not work
07:19 <jchia> MarcelineVQ: In my case where should I add the forall? I added "forall m rd d ." for both foo and bar but it didn't help.
07:20 seaman joined
07:20 <Koterpillar> Lokathor: I had a case of that, GHC scared me with stating that it was attempting to perform something that is known to be Turing complete
07:21 <MarcelineVQ> ah, did the version I put not work? that should have been enough. I believe that implicity they already have those foralls in both spots so repeating that is possibly self-defeating
07:21 <jchia> MarcelineVQ: I see you added it only to foo. What's the most straightforward way to understand the logic GHC is using in this sort of situation?
07:21 <Lokathor> solve $ M.lookup "Halting" problemsMap
07:21 <Koterpillar> Lokathor: at compile time
07:21 <MarcelineVQ> possibly 'everything in foo shares the type variable scope I define for foo'
07:21 <Lokathor> Koterpillar, means it'll run faster at runtime though!
07:22 albertid joined
07:23 <MarcelineVQ> I'm not a great person to ask about the why of forall :>
07:24 <jchia> Changing the type variable names for bar's context didn't work, either
07:24 aloiscochard joined
07:25 tomphp joined
07:26 bvad joined
07:27 hazyPurple joined
07:27 <MarcelineVQ> didn't work isn't a particularly useful error report
07:27 mattyw joined
07:27 <Saizan> jchia: changing the type variable names would probably make things worse
07:28 <Saizan> jchia: btw, it's easier to help if you give the full error from ghc, even better if you provide source we can load in ghci
07:28 qwr joined
07:29 wroathe joined
07:29 <jchia> Saizan: http://lpaste.net/354983#a354985
07:30 coot joined
07:30 <jchia> Error is still on the line "Just ss -> pure . Just ..."
07:30 <jchia> I do have SCT on
07:30 cgfbee joined
07:31 raichoo joined
07:32 ddere joined
07:32 Bashmetim joined
07:33 <Saizan> jchia: you need the "forall m rd d. .." part on foo and to keep the same names on bar
07:33 <Saizan> or maybe just remove the type signature from bar
07:35 jdt joined
07:36 <Saizan> your signature for bar is promising to work for every d', but actually it can only work for d' = d, where d is the one in the signature for foo
07:36 andyhuzhill joined
07:37 <Saizan> just reusing the variable names does not work though, because they are implicitly freshly bound at the ::
07:37 <Lokathor> so is there a way to get a CPP option enabled while compiling a package for my global stack project?
07:37 bennofs joined
07:37 <MarcelineVQ> Lokathor: as a pre-check, why would you need that?
07:37 <Saizan> that's why of the forall and the SCT, the forall acts as an explicit binders and SCT allows that scope to extend to the signature of bar
07:38 <Lokathor> https://github.com/haskell-game/sdl2/issues/139
07:38 <Lokathor> i could do it in a project, but i also like being able to install stuff to the global stack project if it's possible
07:40 <jchia> Saizan: Yeah, I saw that adding the forall outside helped, but MarcelineVQ also suggested "just use different letters", so I'm just saying it doesn't work.
07:40 kreetx joined
07:41 biglama joined
07:42 magthe joined
07:42 daniel-s joined
07:42 cgfbee joined
07:42 <jchia> It's still quite mysterious to me, so I'm looking for ways to understand the error.
07:42 <kreetx> hi! question: I'm using declareFields to derive a classy lens, but get a 'Ambiguous occurrance of lensName', what gives? I.e isn't the whole purpose of classy lenses to overcome this?
07:43 <MarcelineVQ> Lokathor: passing custom flag options doesn't seem to apply for snapshot packages :(
07:43 heurist joined
07:43 connrs joined
07:44 newhoggy_ joined
07:44 alfredo joined
07:44 Beetny joined
07:45 wroathe joined
07:45 <MarcelineVQ> Lokathor: but give this a shot anyway stack install sdl2 --ghc-options="-D_SDL_main_h"
07:45 <Lokathor> nope :(
07:46 <Lokathor> oh well
07:46 grayjoc joined
07:46 BartAdv joined
07:49 insitu joined
07:49 Koterpillar left
07:50 thc202 joined
07:55 augur joined
07:56 willprice94 joined
07:56 koneko joined
07:56 mjora7 joined
07:56 takle joined
08:00 soniku joined
08:00 toppler joined
08:00 Gloomy joined
08:02 hazyPurple joined
08:02 flatmap13 joined
08:02 dm3 joined
08:03 Andy2011Zoe joined
08:05 Elhamer joined
08:06 dbmikus joined
08:07 <johnw> does anyone build diagrams programs with Nix?
08:09 <phadej> johnw: I guess you miss some libs?
08:09 <phadej> (c-libs?)
08:09 <johnw> yeah, Cocoa
08:09 <johnw> it works with nix-build, but not with nix-shell
08:09 Yuras joined
08:10 <phadej> Cocoa :O, that's far from my comfort zone (haven't tried nix on macOS)
08:10 zeroed joined
08:10 zeroed joined
08:11 Itkovian joined
08:12 <phadej> johnw: wild guess; have you tried nix-shell --pure?
08:12 <johnw> that makes other problems
08:12 Gloomy joined
08:12 <phadej> johnw: :/
08:13 blender3 joined
08:13 Gloomy joined
08:14 biglambda joined
08:14 Gloomy joined
08:15 Gloomy joined
08:15 mmn80 joined
08:16 Gloomy joined
08:16 <johnw> ok, I just needed to be inside nix-shell to run cabal build, cabal configure alone is not enough
08:16 wroathe joined
08:16 polll joined
08:16 Gloomy joined
08:17 <phadej> johnw: great you solved it
08:17 indi_ joined
08:17 Gloomy joined
08:18 Gloomy joined
08:19 Gloomy joined
08:19 indi_ joined
08:19 kvda joined
08:20 Gloomy joined
08:20 jdt joined
08:20 Gloomy joined
08:21 Gloomy joined
08:23 filterfish joined
08:23 oish_ joined
08:24 lep-delete joined
08:26 ertes joined
08:27 Gloomy joined
08:27 seveg joined
08:29 cyborg-one joined
08:31 willprice joined
08:31 simukis_ joined
08:32 beanbagula joined
08:32 wroathe joined
08:34 insitu joined
08:35 niez joined
08:36 mstruebing joined
08:37 marr joined
08:37 j4ke joined
08:38 meandi joined
08:38 jeltsch joined
08:40 richi235 joined
08:42 dbmikus joined
08:43 insitu joined
08:44 refold joined
08:44 vargeek joined
08:46 acidjnk22 joined
08:48 erikd joined
08:48 xall joined
08:48 wroathe joined
08:49 vargeek left
08:50 andyhuzhill joined
08:50 takle joined
08:53 xtreak joined
08:54 newhoggy joined
08:56 vg1 joined
08:58 mjora7 joined
08:58 drcode joined
09:00 binaryplease joined
09:00 takle joined
09:01 hallonsaft_ joined
09:01 mjora7 joined
09:02 skeuchel joined
09:04 wroathe joined
09:05 orhan89 joined
09:06 andyhuzhill joined
09:06 ub joined
09:07 beanbagula joined
09:09 crave joined
09:11 zachary12 joined
09:12 geekosaur joined
09:12 safe joined
09:12 blender3 joined
09:13 hallonsaft_ left
09:16 e_svedang joined
09:16 danthemyth joined
09:17 oisdk joined
09:18 dbmikus joined
09:21 pie_ joined
09:21 mohsen_ joined
09:27 Levex joined
09:27 Hamlet joined
09:27 <Hamlet> Need help with this program..
09:27 <lpaste> Hamlet revised “Find largest prime factor of 600851475143”: “Find largest prime factor of 600851475143” at http://lpaste.net/354950
09:28 yellowj joined
09:29 <Rembane> Hamlet: You need a = sign on line 30, maybe replace the first $ with a = ?
09:29 ralu joined
09:30 <Hamlet> No, that gives an error of a more subtle kind..
09:30 <Rembane> Hamlet: then it is that error you need to fix. Which error does it give?
09:31 <Hamlet> complicated message that I don't understand yet.. so, someone suggested using $ instead... and I get this much less complicated error
09:32 lopex joined
09:33 rcat joined
09:33 <lpaste> Hamlet pasted “Error” at http://lpaste.net/4669923305354952704
09:34 kritzcreek joined
09:35 wroathe joined
09:35 Wizek_ joined
09:36 <pacak> Hamlet: Add type signatures to every definition
09:37 <Rembane> Hamlet: The FlexibleContexts error generally means: "Hi, I'm the typechecker and I don't get what types you're using. Please give me some clues."
09:38 thunderrd_ joined
09:39 <Hamlet> If I do that, it should resolve the errors(?)
09:40 noumenon joined
09:40 <Rembane> Hamlet: Or give you another one. It is good practice regardless.
09:40 ephemeral joined
09:46 splanch joined
09:46 filterfish joined
09:47 eklavya_ joined
09:48 a3Dman joined
09:48 coot____ joined
09:48 filterfish_ joined
09:50 mmhat joined
09:52 splanch joined
09:53 <Hamlet> What should be the signature for 'findLargestPrimeFactor'?
09:53 coot____ joined
09:54 <jle`> Hamlet: what do you want it to do?
09:54 <Hamlet> It should return a number from a list of numbers
09:55 pie_ joined
09:55 <jle`> sounds like [Int] -> Int, maybe?
09:55 <jle`> or [Integer] -> Integer if that's your thing
09:55 eatman joined
09:55 eklavya joined
09:55 splanch_ joined
09:56 <jle`> Hamlet: btw, the reason you got a less complicated looking error was because you basically wrote a file that wouldn't parse
09:57 <jle`> that's like fixing a leaky boat with a bomb, because then at least it sinks in a less complicated way
09:57 <Hamlet> ... because of the $ operator instead of =?
09:57 <jle`> yes
09:58 <jle`> the syntax goes 'let ... = ... in ...'
09:58 <jle`> so there needs to be an equals sign
09:58 <jle`> or else it doesn't even make sense
09:58 <pacak> type signatures. All over the place.
09:58 <pacak> And compare what you think it is with what ghc thinks
09:58 <jle`> or, for do notation, the syntax is 'let ... = ...'
09:58 <jle`> you're defining a binding
09:58 <jle`> 'let x = 10' defines x as 10
09:59 <jle`> 'let x' doesn't fit the syntax...and, it doesn't even really make sense as something to say, heh
10:00 <jle`> but yeah, you have a type error, and you tried fixing it making a file that doesn't parse. just becuase the error is simpler doesn't mean that it's a step in the right direction :)
10:00 <jle`> i can get rid of any complicated-looking error by just erasing the entire file, after all :)
10:00 bennofs joined
10:00 <jle`> and that gives a much much less complicated error message! :o
10:01 <jle`> so yeah, instead of writing invalid syntax, a good step is to add type annotations to everything
10:01 soniku joined
10:01 zero_byte joined
10:01 <jle`> findLargestPrimeFactor :: [Integer] -> Integer, maybe?
10:01 <jle`> listOfFactors :: ??
10:01 <jle`> isPrime :: ??
10:02 <jle`> main :: ??
10:03 willprice joined
10:05 newhoggy joined
10:06 govg joined
10:07 wroathe joined
10:07 <qwr> merijn++ MonadHendrix++ thank you for telling me that Show is not for pretty printing. :)
10:07 yellowcab joined
10:08 <* qwr> hopes the karma thing worked.
10:08 takle_ joined
10:09 takle joined
10:09 <Rembane> jle`: A long time ago there was a bug in GHC which deleted all your source files if you got a type error.
10:11 <mfukar> nothing like negative reinforcement
10:15 erikd joined
10:16 gienah joined
10:17 Sampuka joined
10:18 Moyst joined
10:19 splanch joined
10:19 filterfish_ joined
10:22 mjora7 joined
10:22 newhoggy joined
10:23 wroathe joined
10:26 ixxie joined
10:26 NyanPasu joined
10:27 darlan joined
10:28 <jchia> I'm trying to use bracketP (https://hackage.haskell.org/package/conduit-1.2.10/docs/Data-Conduit.html#v:bracketP) but for the first argument, I don't have a IO a. I only have a MonadIO n => n a. For the second argument, I can also provide a a -> n (). Is there something I can do to be able to use bracketP with n a instead of IO a?
10:29 <kuribas> you don't need GADTs for phantom types, right?
10:30 <kuribas> I could do data MyData a = MyData no_a_here
10:30 <Akii> kuribas: yes
10:30 eliasr joined
10:30 <kuribas> okay, thanks
10:30 <Akii> data Proxy a = Proxy
10:31 newhoggy joined
10:31 vaibhavsagar joined
10:33 ersran9 joined
10:34 <kuribas> In my case the extra type gives more information (open curve vs closed curve).
10:34 biglambda joined
10:35 xtreak joined
10:36 <lyxia> jchia: IO is an instance of MonadIO
10:37 augur joined
10:38 nut joined
10:38 newhoggy joined
10:38 danza joined
10:38 ziocroc joined
10:39 xtreak joined
10:39 rkazak joined
10:39 richi235 joined
10:40 danthemyth joined
10:41 gmcabrita joined
10:41 danthemyth joined
10:41 indi_ joined
10:42 bennofs joined
10:44 xall joined
10:45 DocWinter joined
10:46 newhoggy joined
10:48 HoierM joined
10:51 gawen joined
10:51 kreetx joined
10:51 binaryplease1 joined
10:52 e_svedang joined
10:52 doomlord joined
10:53 m` joined
10:54 tauli joined
10:55 seveg joined
10:55 ertes joined
10:56 <jchia> lyxia: The problem is that bracketP requires IO a, not any MonadIO m => m a.
10:57 Kototama joined
10:57 Elhamer joined
10:58 <Kototama> if free monads are similar to a list of functor, is it nonetheless possible to represent a rose tree with a free monad?
10:59 boj joined
10:59 test joined
10:59 soniku joined
10:59 mmachenry joined
10:59 jer1 joined
10:59 Shock_ joined
11:01 cschneid_ joined
11:01 bennofs joined
11:01 newhoggy joined
11:02 Snircle joined
11:03 <dibblego> Kototama: with Cofree
11:03 latro`a joined
11:03 Gloomy joined
11:04 pteiavn joined
11:05 beerdrop joined
11:05 <pteiavn> Hi, I'm having a problem installing diagrams with cabal: can someone look at it please? https://pastebin.com/C1vM3573
11:06 <pteiavn> I'm using Windows 7 and prior to this I installed the haskell platform (https://www.haskell.org/platform/)
11:08 <Kototama> dibblego: no chance without Cofree?
11:08 <dibblego> Kototama: sure, you can do it without Cofree, but Tree ~ Cofree []
11:09 <Kototama> do you have any examples with just Free?
11:10 wroathe joined
11:10 SeMas joined
11:10 <Kototama> when interpreting with a monad, how do you merge the monad of the children (for example)?
11:10 orhan89 joined
11:11 indi_ joined
11:11 tomboy64 joined
11:13 nut` joined
11:13 fenedor joined
11:13 blym joined
11:15 NyanPasu joined
11:20 joelthepirate joined
11:20 joelthepirate joined
11:20 blym_ joined
11:21 <lyxia> jchia: how is that a problem
11:21 <lyxia> jchia: Every MonadIO m => m a is a IO a
11:21 mkoenig joined
11:22 tauli joined
11:23 <Kototama> dibblego: can you use multiple times the quantifier variable to represent different children?
11:23 <lyxia> jchia: do you mean you're in a context where m is rigid
11:25 bvad joined
11:26 cranej joined
11:26 wroathe joined
11:26 Boomerang joined
11:29 danza joined
11:30 sepp2k joined
11:31 zachary12 joined
11:31 indi_ joined
11:32 halogenandtoast joined
11:34 <Boomerang> Hey ##haskell! What would be an appropriate parallel strategy to filter a list lazily on multiple cores? parBuffer seems close to what I would want but it may be more efficient to put the data in chunks (like parListChunk does but not lazily).
11:35 indi_ joined
11:40 IanKelling joined
11:42 wroathe joined
11:42 nighty-- joined
11:43 ph88 joined
11:45 doomlord joined
11:46 willprice joined
11:49 m` joined
11:50 pie_ joined
11:50 twanvl joined
11:50 plakband joined
11:50 wroathe joined
11:51 dddddd joined
11:52 srbaker_ joined
11:54 Shock_ joined
11:54 soniku joined
11:55 oish joined
11:56 phaji joined
11:57 splanch joined
11:58 micmus joined
11:58 coot____ joined
11:59 boj_ joined
11:59 eklavya joined
12:00 splanch_ joined
12:02 jathan joined
12:03 Shock_ joined
12:05 alqatari joined
12:05 ExpHP joined
12:05 <lyxia> I think it depends on what you consider to be costly. Chunking is okay if applying the predicate dominates over traversing the list (to chunk it)
12:07 Kreest__ joined
12:08 Elhamer joined
12:08 erikd joined
12:08 Intensity joined
12:09 mattyw joined
12:10 xtreak joined
12:10 mbw joined
12:12 danthemyth joined
12:14 <mbw> After having gotten to know Repa, I have a collection of questions that need answering. There are a few choices on where to post them. StackOverflow, the Repa google group, haskell-cafe or maybe others. Which would be the most appropriate?
12:15 <mbw> Oh, and Reddit maybe.
12:15 eklavya_ joined
12:15 filterfish_ joined
12:18 cranej joined
12:18 ertes joined
12:19 netheranthem joined
12:20 odamn joined
12:22 freusque joined
12:22 nomicflux joined
12:24 cranej joined
12:27 indi_ joined
12:27 <mbw> Hmm, seems like this was a stupid question to ask :(
12:28 michielb joined
12:28 pie_ joined
12:28 <vaibhavsagar> no, IRC is just quiet right now
12:28 <vaibhavsagar> don't take it personally :)
12:28 <mbw> Ok then. Phew.
12:28 bjz joined
12:28 <vaibhavsagar> IRC is a good place to start, but you have to be patient
12:28 joe9 joined
12:30 indi_ joined
12:30 <vaibhavsagar> I'd go StackOverflow, the google group, haskell-cafe, reddit, and the github issues for Repa in that order
12:30 plutoniix joined
12:30 coot____ joined
12:30 zereraz joined
12:31 ertes joined
12:31 cretiq joined
12:31 <phadej> SO is good place; helps others
12:31 splanch joined
12:31 <zereraz> hi how to watch for file change and build when file changes? stack has a --file-watch flag, does cabal have it?
12:32 doomlord joined
12:32 Shock_ joined
12:32 <mbw> StackOverflow seems like a reasonable choice, since it allows me to typeset Code as well as Math. And like phadej said, it might serve some documentation purpose also. I'll go with so then.
12:33 tommd joined
12:33 splanch_ joined
12:33 dqd joined
12:36 locallycompact joined
12:36 binaryplease1 joined
12:36 coot____ joined
12:36 splanch joined
12:37 tomphp joined
12:37 takuan joined
12:40 <Athas> mbw: what are you doing with Repa?
12:40 ph88 joined
12:41 cpennington joined
12:41 jer1 joined
12:43 blender3 joined
12:43 carlomagno joined
12:44 blym_ joined
12:44 erikd joined
12:45 coot____ joined
12:46 ersran9 joined
12:46 <mbw> Athas: Nothing large scale. I have implemented a few toy quantum chemistry programs, which is mostly linear algebra. And it's not like I "failed" to do anything, it's just that there isn't alot of documentation except the one found in the tutorial, the papers, Marlow's book and a few blog posts here and there.
12:47 coot____ joined
12:47 Shock_ joined
12:47 bennofs joined
12:48 theelous3 joined
12:48 ejay joined
12:48 <Tuplanolla> I did the same thing with physics, mbw.
12:48 <Tuplanolla> I only ended up publishing GHC bug reports though.
12:49 freusque joined
12:49 <mbw> That must have been discouraging.
12:50 CurryWurst joined
12:50 carlomagno1 joined
12:51 texasmynsted joined
12:52 pungi-man joined
12:54 mmachenry joined
12:56 Achylles joined
12:56 fenedor joined
12:56 <Tuplanolla> At least I learned a lot about Haskell.
12:56 jeltsch joined
12:58 ExpHP joined
12:58 <Tuplanolla> The compiler developers did too, I presume: https://ghc.haskell.org/trac/ghc/ticket/11126#ticket
12:58 cpennington joined
12:59 erisco joined
12:59 jer1 joined
12:59 <mbw> Tuplanolla: But then you HAVE to know this. The standard way to implement the "ijk matmul" seems to be a sum . zipWith on array slices. However, this doesn't scale to the more general forms of tensor contractions. If matmul is "c^i_j = a^i_k * b^k_j", then an expression like "w^i = a^i_k * b^k_j * v^j" won't work with zipWith any more. Now I could either manually zip things, since functions like zip3/zip4 do
12:59 <mbw> exist, but they return manifest, unboxed arrays, not delayed ones. I can delay those, but I don't know if that has an effect on compile-time fusion. OR I could create an intermediate delayed tensor with fromFunction and fold twice. More generally it seems like fromFunction can tackle a lot of problems, but I don't know how "structured" it is, i.e. how much information can be inferred by Repa in order to
13:00 <mbw> parallelize things. Have you encountered this kind of situation?
13:00 <mbw> Ah, I've read that bug report before I think.
13:00 meba joined
13:01 <Tuplanolla> I don't think I've done that, but I did encounter something similar when calculating vdW interactions.
13:01 kolko_ joined
13:02 cschneid_ joined
13:02 robertkennedy joined
13:03 Hunter1 joined
13:03 <mbw> Did you gain any insights?
13:03 <Tuplanolla> I duplicated the source array, did the work and finally used `traverse2` to combine them again.
13:04 <robertkennedy> I've been getting an increasing number of segfaults while using GHCi. Ideas to start debugging? My current work around was to not add lens to my build-deps, but I think that's just pigeon rites
13:04 koneko joined
13:04 <c_wraith> robertkennedy: the best place to start is anything that interacts with native libaries.
13:05 <mbw> Tuplanolla: Did you use manifest representations as intermediaries?
13:05 <Tuplanolla> You generally want to keep the `D` representation as long as possible.
13:06 <c_wraith> robertkennedy: some things are especially suspect, like the libcurl bindings.
13:06 <Tuplanolla> I only computed `U` when I wanted intermediate results.
13:06 Tesseraction joined
13:06 <c_wraith> robertkennedy: but any place there's FFI where the type annotations aren't 100% right can result in memory corruption
13:06 <robertkennedy> c_wraith: the segfaults seem to happen in code I can reasonably guess is fine (ie read a file in and decide json). I think it might be linking issues?
13:06 <Philonous> What's the type of equality called that's encoded by data a := b where Refl :: a := a ?
13:07 <robertkennedy> *decode json
13:07 <mbw> Ok, that's what I thought. I always found it confusing that sample algorithms or the stuff found in repa-algorithms returns manifest representations, which can't be fused. Why not just make returning Ds the default and let the caller computeS/P it...
13:07 na_th_an left
13:08 <mbw> A rule of thumb is probably to avoid Ds if you have an iterative algorithm, where one array depends on a the array of a previous iteration...
13:08 <c_wraith> robertkennedy: I mean.. If something is segfaulting, the code is not fine. But memory corruption is subtle. It can cause the segfault to happen in code very unrelated to where the memory actually got corrupted.
13:09 ridho joined
13:09 <robertkennedy> Maybe generic aeson or text is messing up, but those are pretty well tested. Stack hiding some cabal failure though, that seems very possible.
13:10 <c_wraith> cabal just calls the system linker. If that was broken, it would show up in a lot of other places
13:10 binaryplease joined
13:12 soniku joined
13:13 <robertkennedy> Sure, but I'm pretty sure I've had situations of cabal dependencies leading to runtime segfaults. Trying to remember that case, I think it was like: install old GHC prim, install quick check, install new containers, old GHC prim is updated, use quick check, segfault.
13:13 <Philonous> Ah, found it, it's propositional equality.
13:14 carlomagno joined
13:15 <robertkennedy> But you may be right, a linking issue seems like it would be more consistent
13:15 indi_ joined
13:15 <c_wraith> There are two major ways to get a segfault in GHC-compiled code
13:16 <c_wraith> The first is an uncorrect unsafeCoerce (or equivalent)
13:16 <c_wraith> Something that breaks the type system can result in non-functions being called as functions, which usually results in a segfault
13:16 <c_wraith> The second is broken FFI
13:16 <c_wraith> Which is far more common.
13:16 <LiaoTao> FFI?
13:17 <c_wraith> Foreign Function Interface
13:17 <LiaoTao> c_wraith, Right, thanks
13:17 beanbagula joined
13:17 <c_wraith> the FFI library basically gives you all the unsafety of C, even without linking to C code. :)
13:18 texasmynsted joined
13:18 <robertkennedy> My segfaulting usually looks like "load ghci, run your environment initialization commands (:set -XTypeApplications et al), pull in massive data stores from files, and if that all works I'm in the clear and the rest of my code is great.
13:18 zero_byte joined
13:19 iAmerikan joined
13:20 kuribas joined
13:20 sz0 joined
13:20 cpennington joined
13:20 jer1 joined
13:21 <robertkennedy> I'll try debugging the mongoDB package - I noticed unsafe functionality, it's probably my least trusted package, and maybe one of the leafs of my json decoding goes through bson. It's a possibility ...
13:22 dm3 joined
13:24 asmyers joined
13:24 indi_ joined
13:25 xificurC joined
13:26 newhoggy joined
13:26 wroathe joined
13:26 GeorgeEdward joined
13:28 insitu joined
13:30 JagaJaga joined
13:30 shivansh joined
13:30 shivansh left
13:30 buglebudabey joined
13:30 oish_ joined
13:31 buglebudabey joined
13:31 blym_ joined
13:31 `^_^v joined
13:33 eschnett joined
13:33 jangsutsr joined
13:33 DragonWolf joined
13:35 m` joined
13:35 cschneid_ joined
13:35 jmiven joined
13:36 <vaibhavsagar> can I parametrise a TypeApplication?
13:36 robkennedy joined
13:37 <vaibhavsagar> e.g. encodeDecode c = coerce @c . fromJust. decode . encode . c
13:37 noam joined
13:38 acidjnk22 joined
13:38 <erisco> vaibhavsagar, c is a value by being a parameter, and c is a type by being a @-arg, and in Haskell types and values are distinct
13:38 <vaibhavsagar> can I use scopedtypevariables or something to allow me to do this?
13:39 <erisco> maybe, but you need to describe more of your problem
13:39 <vaibhavsagar> it's not a problem, just a curiousity
13:39 <erisco> then no, as-is it is an impossibility because types and values are distinct
13:39 <vaibhavsagar> so I find that I have to do a bit of newtyping to declare ToJSON instances for my types
13:40 <vaibhavsagar> and coerce from Data.Coerce has been a big help, but sometimes it needs a hint
13:40 <vaibhavsagar> and in Aeson, an obvious test is encoding and decoding
13:40 <vaibhavsagar> e.g. fromJust . decode . encode
13:41 <vaibhavsagar> with coercion on both sides
13:41 jluttine joined
13:41 jer1 joined
13:41 juliagoda joined
13:41 <vaibhavsagar> e.g. coerce . fromJust . decode . encode . coerce
13:41 <erisco> scoped type variables will bring the type of c into scope
13:41 kmels joined
13:43 <vaibhavsagar> so I could define a roundtrip :: c -> Bool; roundtrip constructor = coerce @c . fromJust . decode . encode . constructor?
13:43 crave joined
13:43 ystael joined
13:44 <erisco> I am not sure what the interaction between TypeApplications and ScopedTypeVariables is, but that seems reasonable, other than I think you want to supply c as the second parameter
13:44 <erisco> :t coerce
13:44 <lambdabot> error:
13:44 <lambdabot> • Variable not in scope: coerce
13:44 <lambdabot> • Perhaps you meant ‘coerced’ (imported from Control.Lens)
13:44 <erisco> okay well I don't know the type of coerce. I was thinking unsafeCoerce
13:45 <vaibhavsagar> :import Data.Coerce
13:45 <lyxia> vaibhavsagar: roundtrip :: forall c. c -> Bool ; ...
13:47 newhoggy joined
13:47 <lyxia> With ScopedTypeVariables, the forall brings the type variable c in scope so that you can write coerce @c. But what you wrote will still be ill-typed because you did not specify what to coerce from, and the result is not Bool-typed.
13:47 <vaibhavsagar> lyxia: would roundtrip :: forall c. c -> c work?
13:47 Levex joined
13:47 ersran9 joined
13:47 ersran9 joined
13:47 <vaibhavsagar> roundtrip :: forall c. (ToJSON c, FromJSON c) => c -> c
13:47 <lyxia> that fixes the second issue I mentioned
13:48 <lyxia> but why do you even need to coerce
13:48 dbmikus joined
13:48 <vaibhavsagar> newtypes
13:48 <c_wraith> why not just use the constructor? then the type system is your ally
13:48 <lyxia> Do you mean that decode is not decoding to Maybe c?
13:49 zero_byte joined
13:49 <vaibhavsagar> c_wraith: I could definitely use the constructor
13:49 splanch joined
13:50 <vaibhavsagar> lyxia: I'm really just trying to make coerce @c make sense :)
13:50 <Unode> I'm trying to understand infix vs prefix syntax while using applicatives but I'm getting a little stumped with the details. How do you write "(+) <$> a <*> b" in a prefix way? "fmap (+) a <*> b" isn't correct.
13:50 coot____ joined
13:50 <erisco> Unode, how does (+) <$> a <*> b not qualify as prefix? I am confused
13:50 <lyxia> vaibhavsagar: You haven't described enough of the problem for us to see the relevance of coerce.
13:51 <vaibhavsagar> ToJSON and FromJSON instances of coerce
13:51 <Unode> erisco: <$> is infix right?
13:51 <vaibhavsagar> oops
13:51 indi_ joined
13:51 bodisiw joined
13:51 <ystael> Unode: liftA2 (+) ?
13:51 <erisco> Unode, oh, you're trying to use <$> as prefix, alright. Well then you can (fmap (+) a) <*> b . You just had a precedence problems
13:51 <vaibhavsagar> lyxia: I'm newtype wrapping types from other modules and defining ToJSON and FromJSON instances for them
13:52 <vaibhavsagar> and trying to test these with a cute roundtrip function
13:52 <vaibhavsagar> and wondering if I can generalise it
13:52 <Unode> erisco: thanks, that's it. I was thinking that the <*> applied first.
13:53 <Unode> I think I don't quite get what part is the function in the b argument after <*>
13:54 BlueRavenGT joined
13:54 <erisco> sorry back up a minute, I misread
13:55 <Unode> oh, nevermind I see what my mistake is
13:55 <erisco> fmap (+) a <*> b and (fmap (+) a) <*> b are the same thing
13:55 <Unode> the first fmap turns all 'a' into (x +) functions.
13:55 Denthir joined
13:55 <Unode> x being the value contained in a
13:55 <erisco> (+) <$> a <*> b is ((+) <$> a) <*> b is (fmap (+) a) <*> b is fmap (+) a <*> b
13:56 Big_G joined
13:57 <Unode> I could swear I had tried the last form...
13:57 newhoggy joined
13:57 <Unode> I was doing fmap (+) (a <*> b)
13:58 vicfred joined
13:58 <erisco> yes, that's the incorrect form
13:58 <Unode> thanks for the clarification
13:58 coot____ joined
13:58 <erisco> we like to think as applying the function over the operands, so that form feels intuitive
13:58 sgronblo joined
13:59 descender joined
13:59 mbw joined
13:59 <erisco> but it is as wrong as thinking f x y is f (x y)
13:59 <Unode> yup that was my mistake
13:59 cdg joined
13:59 <Unode> still trying to wrap my head around it
13:59 <mbw> Apparently, fromListUnboxed (Z:.100:.100) [1,1..] :: Array U DIM2 Double is bottom :(
14:00 mmachenry joined
14:00 <erisco> Unode, another way to think about it is pure (+) <*> a <*> b
14:01 mekeor joined
14:02 <erisco> so like we read f x y as "f applied to x then applied to y" we read f <*> x <*> y as "f applied to x then applied to y"
14:02 jer1 joined
14:02 <erisco> which is why another name for <*> is ap
14:02 <erisco> now we're lifted in the Applicative, so that is why pure (+) rather than just (+)
14:03 <erisco> but otherwise it is designed to mimic function application
14:04 <vaibhavsagar> I did it! roundTrip :: forall a b. (Coercible a b, FromJSON a, ToJSON a) => a -> b
14:04 <Unode> I still haven't quite understood pure. Working on it.
14:04 mizu_no_oto_work joined
14:05 <vaibhavsagar> roundTrip = coerce @a . fromJust . decode . encode
14:05 <vaibhavsagar> thanks lyxiz and erisco!
14:05 eklavya joined
14:05 Durbley joined
14:06 fizbin joined
14:06 fizbin joined
14:06 pie_ joined
14:06 <erisco> Unode, it is the simpler of the two and should be mostly understood by the type pure :: a -> f a
14:06 <Unode> erisco: thanks for the parallelisms. I'll keep reading. Still not at the intuitive level.
14:06 <erisco> crudely, it takes a value and sticks it in the Applicative
14:07 <erisco> so if it is a list it just makes the singleton list
14:07 <erisco> if it is a function it just returns the value
14:07 coot____ joined
14:07 <erisco> if it is Maybe then it sticks it in Just
14:08 <erisco> the rest of the understanding of pure comes from the Applicative laws, but for the most part the intuitive definition of pure is the right one
14:08 rinn7e joined
14:09 ExpHP joined
14:09 Denthir_ joined
14:10 richi235 joined
14:11 <erisco> Unode, https://en.wikibooks.org/wiki/Haskell/Applicative_functors#Applicative_functor_laws
14:11 Denthir joined
14:11 newhoggy joined
14:11 glamas joined
14:12 crobbins joined
14:12 <erisco> Unode, the homomorphism pure f <*> pure x = pure (f x) may be particularly enlightening
14:12 Apocalisp joined
14:13 <erisco> this is directly establishing the relationship between <*> and $
14:15 <erisco> from this you get pure (+) <*> pure x <*> pure y = pure (x + y)
14:16 <mniip> homomorphism?
14:16 <Unode> the jargon makes my understanding engine hurt :D
14:17 <mniip> homomorphism of what algebraic structures o
14:17 tomboy64 joined
14:17 <mniip> :o
14:17 mada joined
14:17 hackebeilchen joined
14:18 ephemeral joined
14:18 dm3 joined
14:19 fotonzade joined
14:19 danthemy_ joined
14:19 <erisco> Unode, you can ignore the jargon. it just the equivalence that matters
14:20 <erisco> mniip, I don't know, that's just what the Wiki deems it, and it bears the shape of one
14:20 crobbins joined
14:20 jleon joined
14:21 <Unode> erisco: yeah I still don't quite get it. in this context 'f' is a structure, not a function right?
14:21 refold joined
14:21 <erisco> in pure f <*> pure x = pure (f x) ?
14:21 <Unode> yes
14:21 Elhamer_ joined
14:21 <Unode> nevermind I see it can be also a function.
14:21 <erisco> it is a function
14:21 newhoggy joined
14:22 <Unode> I think I'm confusing things.
14:22 <erisco> well it has to be because of the type
14:22 cobreadmonster joined
14:22 <erisco> I don't know if it is particularly useful thinking of functions and structures (I presume you mean data types) as being all that different
14:22 jer1 joined
14:22 <Unode> but the type of pure is "a -> f a". I don't get where the f comes from in that context
14:23 osa1 joined
14:23 <erisco> at the type level there isn't anything additionally interesting about it
14:23 <erisco> at the value level you have constructors for data types, sure, but you also have syntaxes to construct functions (like lambda)
14:23 <c_wraith> Unode: it comes from the instance
14:24 <mniip> these are two different f's
14:24 <Unode> c_wraith: the instance of?
14:24 <c_wraith> Unode: that is, to be an instance of Applicative, a type needs to define pure for its specific type f
14:24 <Unode> c_wraith: so in that context, the instance is 'a'?
14:24 <c_wraith> Unode: no, the instance is Applicative f
14:24 <c_wraith> :t pure
14:24 <lambdabot> Applicative f => a -> f a
14:24 <Phlogistique> Unode: in other words, you can think of "a -> b" as "(->) a b"
14:25 <Phlogistique> and "a -> f a" as "(->) a (f a)"
14:25 <erisco> a big unlearning for me has been treating functions as different from data
14:25 <erisco> of course there are differences, but they're not so special as to forget the similarities
14:26 <erisco> most especially at the types where -> is just any other type constructor
14:26 <erisco> (other than specialties like with RankNTypes and so on, but w/e)
14:26 <Unode> Phlogistique: doesn't help. Still confused
14:26 bennofs joined
14:27 <erisco> the surprise of seeing Applicative ((->) a) is just that of forgetting this similarity
14:28 <erisco> can you implement pure :: a -> Maybe a? sure, pure a = Just a. pure :: a -> (b -> a) ? sure, pure a = \_ -> a
14:28 <erisco> it is not all that crazy to see the similarity between Just and (\_ ->)
14:29 filterfish_ joined
14:30 <Unode> except that one leaves structure afterwards
14:30 <erisco> my point is they both do
14:30 <Unode> really?
14:30 filterfish_ joined
14:30 <Unode> I didn't follow then
14:30 <erisco> when comes down to the semantics of the language functions have a special place, yes
14:31 <erisco> but in a syntactic sense it is similar
14:31 cdg_ joined
14:31 Boomerang joined
14:31 eazar001 joined
14:31 <erisco> Just constructs Maybe a, and \_ -> constructs a -> b
14:31 <Unode> ok so pure is more like a constructor in other languages? i.e. it ensures things have the same type?
14:31 <erisco> particularly Just :: a -> Maybe a and (\_ ->) :: a -> (b -> a)
14:32 ertes joined
14:32 <erisco> now of course \_ -> is not valid syntax, but this is really a small point
14:32 dsh joined
14:32 <erisco> because const x = \_ -> x
14:33 <erisco> and if we had foo x = f x we'd normally be allowed to eta-reduce to foo = f
14:33 <erisco> and so seeing const = \_ -> is not so crazy, thought not allowed in Haskell
14:33 <erisco> though*
14:33 filterfish_ joined
14:33 tommd joined
14:34 <erisco> can we pattern match on \_ -> x ? no, and that is a difference
14:35 <Unode> I think there's more to that than I can currently grasp.
14:35 <Unode> I understand the comparison, but not the implication
14:37 <Sornaensis> @src (>>)
14:37 <lambdabot> m >> k = m >>= \_ -> k
14:38 electrostat joined
14:38 <erisco> Unode, that's okay. and to answer your question, no pure is not like an OOP constructor, if that is what you meant
14:39 <Unode> erisco: yes, that's what I meant
14:39 <erisco> the only resemblance is that both can take a value and give you a new value of a different type
14:39 <erisco> but so can many functions
14:40 jleon joined
14:40 <Unode> but pure itself as a function is useless right? it only makes sense in the presence of an instance that defines its behavior
14:40 <ski> `pure' is just a type class method
14:40 <erisco> data constructors have more resemblance in that they're also authoritative (i.e. this is the only way to construct this type)
14:40 <Unode> in other words, ^ yes that's what I was going to say
14:40 <Unode> what ski said
14:41 <ski> a use of `pure' will either determine the type class instance to use, determining its behaviour, or it will cause the operation using `pure' to itself be overloaded, deferring the choice of instance to the caller of the operation
14:41 <erisco> well no, it is not useless
14:41 <Unode> so is it correct to say that 'pure's behavior is undefined until a type is given as context?
14:41 <erisco> if we want to run a program then yes, we need an instance, but we can still write algorithms on pure without any instance
14:42 ixxie joined
14:42 <erisco> no, that is not correct, as it is defined by the Applicative laws
14:42 <ski> Unode : if you're fine with saying that the behaviour of `(+)' (addition) is undefined until a type is given as context, then yeah, sure
14:42 <erisco> (as well as the type and theorems derived thereof)
14:42 <ski> .. though i'd not express it as "undefined"
14:43 jer1 joined
14:43 <ski> it's a matter of whether the specific instance to use is resolved here, or somewhere else. at some point it must be resolved, however, in order for the code using `pure' (or whatever type class method) to be evaluated
14:43 <Unode> ski addition has constrains but yes, I was hinting at the fact that different numeric types could implement different kinds of addition.
14:44 <Unode> ok I think I'll go with that for now
14:44 <erisco> but you always expect addition to be commutative, associative, have an identity, and so on
14:44 <Unode> it's not correct but lets see how far it gets me
14:44 <erisco> which is why Float is a right bastard :P
14:44 sproingie joined
14:44 <ski> `pure' is useful in base cases, "trivial" branches
14:45 tommd joined
14:46 <Unode> thanks everyone
14:47 <erisco> here is another way to word it, Unode. "pure" is a specification. To run it, we need an implementation (i.e. instance). Nonetheless, we can still write programs just using the specification of pure
14:47 <Unode> always nice to talk to humans when the book and the interpreter don't quite get what I'm trying to say :)
14:47 <erisco> also the word "interface" works in place of "specification"
14:47 <Unode> erisco: that's how I'm thinking about it, yes
14:47 <Sornaensis> :t pure
14:47 <lambdabot> Applicative f => a -> f a
14:48 <Sornaensis> I thought pure was applicative injection
14:48 <Unode> is this also true of every function that has a ":: Type x =>" constraint?
14:48 <erisco> and the specification is the type plus the Applicative laws
14:48 electrostat joined
14:48 <Sornaensis> :t return 5
14:48 <lambdabot> (Num a, Monad m) => m a
14:49 <erisco> Unode, type classes are not types, so Type x => seems suspect
14:49 <ski> it shouldn't say `Type', it's not a (concrete) type, it's a type class. better say `Class' then
14:49 <Sornaensis> > Just (+3) <*> pure 6
14:49 <lambdabot> Just 9
14:49 <Unode> ski, erisco right, sorry, that's what I meant
14:50 <ski> Unode : but yes. every such operation is either itself a type class method, or its definition uses a type class method, or an operation which uses ...
14:50 <Unode> I still get confused with this distinction. Need to get the hands a bit more into the code.
14:50 <ski> (unless you frivolously add a constraint where none were needed ..)
14:50 <Unode> ok
14:50 <erisco> when we say f :: a -> B we're requiring the specification "a is any type". when we say f :: C a => a -> B we're requiring the specification "a is any type and a has an instance of C"
14:51 <erisco> or "is an instance" perhaps, since in Haskell we only get one
14:51 <Unode> ah!
14:51 <ski> s/and/such that/
14:51 seveg joined
14:51 <ventonegro> > (+) <$> Just 3 <*> pure 42
14:51 <lambdabot> Just 45
14:51 <Sornaensis> the power of applicative
14:52 <ventonegro> > Just (+) <*> pure 3 <*> pure 6
14:52 <lambdabot> Just 9
14:52 <ventonegro> and so on
14:52 newhoggy joined
14:52 <erisco> the similarity in OOP is generic constraints
14:52 Levex joined
14:53 <erisco> unconstrained we're welcoming any type. constrained we're welcoming any type which also implements an interface
14:53 burtons joined
14:54 <erisco> a key difference being that in Haskell type classes are not types
14:54 <erisco> whereas in OOP interfaces are types
14:55 <erisco> in Haskell, type classes construct constraints (that's what goes left of =>)
14:55 ArchaicLord joined
14:55 <erisco> :k Applicative
14:55 <lambdabot> (* -> *) -> Constraint
14:55 <ski> @kind Eq
14:55 <lambdabot> * -> Constraint
14:56 <sproingie> trust me you'll accidentally try to use a class as a type more than once
14:56 <Sornaensis> :k StateT
14:56 <lambdabot> * -> (* -> *) -> * -> *
14:56 <Sornaensis> scary
14:56 <sproingie> the fact that they look identical doesn't help of course
14:56 <erisco> should have required script case :P
14:56 aglorei joined
14:57 al-damiri joined
14:57 bodisjw joined
15:00 vimk joined
15:00 <sproingie> maybe outline letters: (>>=) :: 𝕄𝕠𝕟𝕒𝕕 m => m a -> (a -> m b) -> m b
15:01 nut joined
15:01 <shapr> whoa
15:01 <nut> Hello could anyone install stack on Windows subsystem for linux?
15:02 newhoggy joined
15:02 <thang1> "it's possible"
15:02 <Unode> nut: it runs Ubuntu so in theory should be possible
15:02 <thang1> https://www.reddit.com/r/haskell/comments/5h9npf/ghc_now_runs_in_windows_subsystem_for_linux/
15:02 <nut> i know that ghc runs on it
15:03 <ongy> not all syscalls are implement/fully compatible on the WSL stuff. And the 1TiB VMEM usage of newer ghc-compiled stuff seems to make problems
15:03 <thang1> Unode: it's not a full Ubuntu. They're translating individual system calls natively back and forth
15:03 nscott76 joined
15:03 <sproingie> lot of OS's use syscall translation, doesn't make it second-class
15:03 jer1 joined
15:03 <sproingie> 'course if the translation layer isn't complete...
15:04 Elhamer__ joined
15:04 <thang1> (which the Windows <-> Ubuntu layer isn't, iirc)
15:05 mohsen_1 joined
15:05 <sproingie> well so much of modern linux distros is tied up in systemd, i don't guess they have that translated
15:05 <shapr> tromp: want to write an article for The Monad.Reader in your copious spare time?
15:05 <sproingie> er, ported
15:05 Filip joined
15:06 <shapr> I wonder what tmoertel is doing these days?
15:06 mizu_no_oto_work joined
15:06 <shapr> !seen tmoertel
15:06 <sproingie> creator update broke the gcc that was bundled with ghc. i imagine stack has fixed that by now?
15:06 <ongy> sproingie: what that's tied to systemd would make sense in WSL? o.0
15:06 <sproingie> ongy: if you wanted a full distribution that behaved like ubuntu, basically
15:07 <ongy> that's not what wsl can do at the moment either way
15:07 <sproingie> but yeah it wouldn't make a lot of sense for MS to support something so completely parallel to services.exe
15:07 richi235 joined
15:08 sampuka joined
15:09 flatmap13 joined
15:09 Vector_ joined
15:10 <c_wraith> it works, but there's some bug in the translation layers that makes the way ghc does IO slow. like, it takes ghci 30 seconds to start
15:10 tsmish joined
15:11 Vector_ left
15:12 Achylles joined
15:12 spatial joined
15:12 <liste> @seen tmoertel
15:12 <lambdabot> +MOER731
15:13 <liste> so @seen == @leet apparently
15:13 <shapr> too bad
15:13 <ongy> there was also some stuff about the 1TiB memory usage and windows memory manager really not liking forks with that. Iirc that's going to be fixed soonTM
15:13 sellout- joined
15:13 <Sornaensis> @seen yer mam
15:13 <lambdabot> yEr M4m
15:14 <Squarism> I have a function that now is : IO (SomeType, Writer x y) - i understand that can be written in done in a nicer way with some monad transformer right?
15:14 <spatial> http://lpaste.net/354997 Can anyone point out the mistake here ?
15:14 <Squarism> -done
15:14 <shapr> liste: want to write a tutorial on writing rogue-links in Haskell for TMR?
15:14 <liste> shapr: no thanks
15:14 <shapr> aw, ok
15:14 <tfc[m]> hi there. i am using the persistent library for my DB related work. now i have the problem that i can hardly haddock-document the record fields of the data types i define through the persistent framework. can i somehow "afterward" document them in some markup format? didnt see that in the haddock documentation.
15:15 <sproingie> rogue-links?
15:15 <shapr> rogue-like, typo
15:15 <sproingie> ooh i've been itching to start a roguelike in haskell
15:15 insitu joined
15:15 <tsani> Squarism: WriterT x IO (SomeType, y) should be equivalent I believe
15:15 <sproingie> not too fond of curses tho, i'd want to target gloss or sdl
15:15 vimk joined
15:15 <shapr> sproingie: want to write a short tutorial about it for The Monad.Reader?
15:16 <spatial> Trying to get a list of those random numbers in order to convert into a matrix later.
15:16 newhoggy joined
15:16 <sproingie> shapr: sure, once i actually figure it out. i've been catching up on my theory lately, my actual haskell has rusted away to nearly nothing
15:16 <shapr> well, I'm hoping I can get five articles by July, so you have a few weeks.
15:17 cschneid_ joined
15:17 uglyfigurine joined
15:18 <shapr> I'm planning on writing an article on going from clash-lang source to a working design on the ice40 FPGAs
15:18 <sproingie> interesting.. what's the application?
15:19 <liste> shapr: how long an article? maybe on second thought I could write that tutorial, I'm working on a roguelike-like survival/settler game in Haskell
15:19 <shapr> I started learning about FPGAs a week ago, so I don't really have one yet; but I did get thoughtpolice' example to build and load onto the ice40
15:19 <MarcelineVQ> shapr: that is tangentially relevant to my interests and I wish to subscribe to your newsletter
15:19 <shapr> liste: yeah, that's why I asked you :-) Even a few pages of "how to structure a rogue-like and here's a small example" would be good.
15:19 dfeuer joined
15:20 <shapr> I prefer LaTeX literate Haskell, but I'll take what I can get.
15:20 <shapr> MarcelineVQ: FPGAs?
15:20 jao joined
15:20 <MarcelineVQ> Yep
15:21 <shapr> I'm taking over as editor for The Monad.Reader again, so I'm looking for articles
15:21 <* shapr> hops excitedly
15:21 <shapr> MarcelineVQ: want to write something?
15:21 <sproingie> bird-style literate haskell works nice for blogs
15:22 <MarcelineVQ> oh no I got you excited :O I don't know anything, they're becoming relevant to other things I'm learning about so I'm interested in them
15:22 erikd joined
15:23 xplat joined
15:23 <MarcelineVQ> *I'm interested in them but know very little about them
15:24 jer1 joined
15:24 <shapr> MarcelineVQ: I learned a bunch in the past week, it's much easier with the yosys/icestorm/arachne-pnr open source toolchain for the ice40
15:25 raichoo joined
15:25 <sproingie> "striving for backwards compatibility is stupid, and we should stop doing it."
15:25 <sproingie> sigh. yeah, screw stable software ecosystems
15:25 JonReed joined
15:26 <robkennedy> Man, the subreddit has been spammed quite a bit lately by news bots
15:27 <kosmikus> shapr: http://www.cs.uu.nl/docs/vakken/afp/doc/assignments.pdf still contains (Section 4.3) my old AFP project description to implement a simple rogue-like in Haskell. this is what LambdaHack / Allure on hackage originated from. the task description is hardly Haskell-specific, but it perhaps contains a nice breakdown of a few simple ingredient so that the project of implementing a roguelike appear a bit
15:27 <kosmikus> less intimidating.
15:27 <sproingie> what is the deal with those news bots anyway? does the bot owner get anything of value from it?
15:27 <sproingie> is it just some misguided public service or some kind of spam?
15:28 <shapr> kosmikus: ooh, want to contribute an article to TMR? perhaps you are familiar with lhs2TeX? ;-)
15:28 <robkennedy> I think it's building up reps for accounts to votespam marketing
15:28 <sproingie> so basically report them as spam every time
15:28 <kosmikus> shapr: sorry, but I have too many commitments right now already. perhaps another time :)
15:28 <shapr> Not surprised
15:29 <shapr> kosmikus: commitments that involved writing Haskell, yeah?
15:29 <sproingie> kosmikus: that's a pretty neat tutorial right there
15:29 newhoggy joined
15:29 <kosmikus> sproingie: thanks
15:29 codesoup joined
15:29 <shapr> kosmikus: will you be at the next ICFP?
15:29 <kosmikus> shapr: a mixture of writing Haskell, preparing talks, teaching, admin and so on :)
15:29 <shapr> sounds like fun!
15:29 <kosmikus> shapr: yes, I'm planning to be
15:30 <shapr> oh good, I haven't seen you since .. er I forget when.
15:30 <kosmikus> shapr: will you be?
15:30 <shapr> I'm planning on it, yes.
15:30 <kosmikus> since Uppsala?
15:30 <shapr> yow, that long?
15:30 <kosmikus> I don't know
15:30 <kosmikus> I know for sure you've been there
15:30 <kosmikus> not certain about any ICFPs after that
15:31 <kosmikus> but I think I'm missing one
15:31 <shapr> I was at the one in Portland 2006, were you there?
15:31 <kosmikus> right
15:31 <kosmikus> that's plausible
15:31 <kosmikus> yes, I have
15:31 mmn80 joined
15:31 <shapr> oh yeah, you crawled in the hotel room window, I remember that.
15:31 <kosmikus> what?
15:31 dm3 joined
15:32 <sproingie> functional programmers be a wild and crazy bunch
15:32 <shapr> The hotel room windows all led to a rooftop, and you were walking by while edwardk and I were chatting, so I yelled at you, and you came in the window.
15:32 augur joined
15:33 <kosmikus> ok, that again sounds somewhat plausible :)
15:33 <shapr> :-)
15:34 halogenandtoast joined
15:36 richi235 joined
15:36 revtintin joined
15:36 nicknovi1 joined
15:37 ragepandemic joined
15:38 urodna joined
15:38 kuribas joined
15:40 trism joined
15:40 <sm> sproingie: re backwards compatibility, check the date on that post
15:42 Itkovian joined
15:42 robotroll joined
15:42 geekosaur joined
15:42 <sproingie> heh. ok, i am seeing some of the tongue in cheek tone
15:42 fotonzade joined
15:43 blym_ joined
15:43 <sm> I was a bit disappointed :)
15:44 Levex joined
15:44 <sproingie> one thing i like about cpan is that installs run the unit tests by default, and every installer can opt-in to have results reported
15:45 jer1 joined
15:45 <c_wraith> hmm. having cabal report build failures on package installation would be pretty cool.
15:46 <sproingie> distribution networks could still learn a lot from cpan. i like being able to browse by author.
15:46 newhoggy joined
15:46 <sproingie> the vague stab at hierarchial package naming helps, too
15:46 Durbley joined
15:47 <sproingie> tho that seems to be a lost battle in most other languages' package networks
15:48 <shapr> I like the idea of running unit tests on install, how do we make that happen?
15:48 Noldorin joined
15:48 fragamus joined
15:48 ephemeral joined
15:49 <sm> prototype it in the Cabal lib, I guess
15:49 rockfordal joined
15:49 <sm> so maybe it'll work for both cabal-install & stack
15:49 <sproingie> depends what the state of 'cabal test' is. last i used cabal in anger, it was ... well, anger was the appropriate word
15:50 <sproingie> stack probably doesn't need it so much for stable stackage versions. might help suss out platform-related problems tho
15:50 <sm> well for stackage an alternative is to run tests at snapshot build time. Maybe they do that already
15:51 <sproingie> i imagine that's how a package makes it into a curated version. no idea what really happens tho.
15:52 osa1 joined
15:53 ephemeral joined
15:53 conal joined
15:54 eschnett joined
15:54 sirreal joined
15:55 newhoggy joined
15:56 ephemeral joined
15:57 Lex[m] joined
15:57 baweaver left
15:57 tommd joined
15:58 dm3 joined
15:59 jmelesky joined
16:00 eklavya joined
16:00 ephemeral joined
16:03 earldouglas joined
16:03 ephemeral joined
16:04 dbmikus joined
16:04 splanch joined
16:05 jer1 joined
16:06 jamestastic joined
16:06 ephemeral joined
16:07 govg joined
16:08 chlong_ joined
16:09 <MitchellSalad> sproingie: i believe it's just 'stack test' with the default flags
16:10 splanch joined
16:10 newhoggy joined
16:10 ephemeral joined
16:11 splanch_ joined
16:12 inkbottle joined
16:12 Gloomy joined
16:12 meandi_2 joined
16:12 <orion> Would it be terribly controversial for me to suggest that MPTC and fundeps get added to the language, and for MonadBase and MonadBaseControl to get added to base, while MonadIO is removed?
16:12 Sonolin joined
16:12 pungi-man joined
16:13 <MitchellSalad> yes...
16:13 <MitchellSalad> MonadIO removed? LOL
16:13 <EvanR> exactly what is MonadBaseControl good for
16:14 <EvanR> all belonging to us?
16:14 Jesin joined
16:14 <Sornaensis> why remove MonadIO?
16:14 <cocreature> EvanR: for passing non IO things to things like forkIO
16:14 carlomagno1 joined
16:14 sleffy joined
16:14 <orion> MonadIO is redundant in the face of MonadBase.
16:15 <cocreature> non IO meaning monad transformer stacks on top of IO
16:15 <Sornaensis> what does MonadBase do
16:15 <EvanR> so its for using forkIO in an IO based transformer
16:15 <orion> "Lift a computation from the base monad"
16:15 <MarcelineVQ> it gives you liftIO for something not neccesarily IO
16:16 <cocreature> EvanR: except it’s not specific to forkIO, it also allows for things like bracket, …
16:16 <EvanR> i have yet to delve into this embracing IO but not really kind of haskell
16:16 <EvanR> im still on purely functional
16:16 sssilver joined
16:17 <EvanR> or just IO
16:17 Elhamer joined
16:17 mmachenry joined
16:18 {emptyset} joined
16:18 <cocreature> EvanR: no ReaderT config IO for you? :)
16:18 <EvanR> i am so over that
16:19 <EvanR> is that an example of when you need monad base control?
16:19 fakenerd joined
16:19 <cocreature> try passing something of type "ReaderT config IO a" to "forkIO" and you’ll get a type error :)
16:20 dm3 joined
16:20 <EvanR> dright
16:21 EvanR_ joined
16:21 <cocreature> monad-control allows you to implement https://hackage.haskell.org/package/lifted-base-0.2.3.10/docs/Control-Concurrent-Lifted.html#v:fork
16:21 newhoggy joined
16:21 <EvanR_> and if i try passing a StateT foo IO a to a forkIO, i also get a brain error
16:22 <Philonous> You mean because it violates linearity of the state?
16:22 <EvanR_> whats linearity of the state
16:23 carlomagno joined
16:24 <MitchellSalad> there's a good blog post called "MonadBaseControl is tricky" by Ed Yang... I will try to find it. that's what Philonous is referring to
16:24 <MitchellSalad> http://blog.ezyang.com/2012/01/monadbasecontrol-is-unsound/
16:24 <Philonous> I mean that the graph of state dependencies is linear
16:25 <Philonous> I.e. each state only depends on it's previous state and only has one successor state
16:25 <EvanR> linear graph... state dependencies...
16:25 <cocreature> MonadBaseControl feels like a very clunky abstraction but it can be useful sometimes
16:25 Wuzzy joined
16:26 jer1 joined
16:26 neutraltc joined
16:26 <sproingie> once you're forking something with state, isn't linearity pretty much out the window?
16:27 <EvanR> speaking of IO... heres a weird incongruity i am running into. lets say i have an algebraic data type for making "primitives or combinations of other foos", and one of the constructors encloses an IO action
16:27 <sproingie> assuming said forks actually join somewhere
16:27 <EvanR> now to build values of this type, i can use global IO actions that are always available
16:28 <EvanR> or i can pass in IO actions that i made somewhere else, like if im hooking up a new system
16:28 <EvanR> it seems odd i have to pass IO actions in on one hand, but not another, they are global
16:28 <EvanR> like "would be nice if it was all global"
16:29 <EvanR> or set uppable so the ones i wanted to use were global
16:29 <EvanR> which i know we dont like
16:29 <EvanR> yet we have putStrLn
16:29 buttbutter joined
16:29 <sproingie> which tends to be globally useful
16:29 buttbutt1r joined
16:29 <MarcelineVQ> sounds like your issue is more to do with implicit prelude yeah?
16:30 <EvanR> i mean, the ones we use a lot arent passed into a main function from somewhere else after being set up
16:30 <EvanR> then passed to "whatever needs it"
16:31 <EvanR> i guess i could set up global IVars and have global IO actions based on their resources, which i instantiate later
16:32 <EvanR> i could justify it by saying "look, getChar is the same way"
16:32 <sproingie> can always use modules to limit visibility. or pass 'em around if you really want fine-grained control
16:32 <sproingie> Prelude is not exactly a paragon of modularity
16:32 <EvanR> its not just prelude
16:33 <sproingie> well sure. in general the "import all the things" behavior.
16:33 <EvanR> its the difference between your program set up the IO or it was set up by GHC runtime
16:33 iomonad joined
16:33 <sproingie> i prefer to not rely on static initialization behavior :)
16:34 <Sornaensis> @info IVar
16:34 <lambdabot> IVar
16:34 <EvanR> if you didnt need it, it would make a lot more sense to be a global action
16:34 <EvanR> if you didnt need initialization
16:34 <sproingie> there's less damage such behavior can do in haskell, but once you're dealing with mutable junk in IO, all the same caveats are there
16:35 <EvanR> heres my use case
16:35 modal joined
16:35 <EvanR> embed "playSound
16:35 <EvanR> embed "playSoundEffect" inside values
16:35 zero_byte joined
16:35 newhoggy joined
16:35 <EvanR> playSoundEffect is on the same level as putStrLn
16:36 <sproingie> you might want to distance your app's action of "play sound" from the actual IO action
16:36 <EvanR> except GHC didnt already initialize my sound system for me, it initialized stdio
16:36 richi235 joined
16:36 <EvanR> well, im un-overnegineering right now and getting rid of a lot of framework
16:37 <EvanR> having Monoid, IO () makes it really easy
16:38 <EvanR> otherwise, i guess putStrLn should also be viewed with suspicion, dont print directly, create a framework for representing the need to print and a separate system to actually do it
16:38 <sproingie> FRP is a lot of what that's about
16:38 Gurkenglas joined
16:39 Achylles joined
16:39 <sproingie> you stream out effects that eventually boil down to IO actions
16:39 <erisco> how can I find a list of classes [a] implements?
16:39 <erisco> with Hoogle or Hayoo or something perhaps
16:39 <sproingie> :i []
16:39 <EvanR> sproingie: for my purposes, it seems like a giant waste of time
16:39 <EvanR> and code
16:40 <sproingie> it's a waste if you don't need it. not if you do.
16:40 <EvanR> how much separation of code into two cooperating code bases can occur
16:40 <sproingie> separating effects from their execution means you can test things easier
16:40 <EvanR> before your hands get injured
16:41 <EvanR> im not writing a test suite
16:41 <EvanR> but yeah
16:41 <sproingie> if you play around with any of your functions in ghci or write a stub to try it out, you're writing tests
16:41 orhan89 joined
16:42 insitu joined
16:42 <sproingie> your test runner just happens to be a Mk 1 Eyeball
16:42 <EvanR> i went this route and ended up with like 9 systems with their own runners, testers, version of IO
16:43 <erisco> sproingie, this only lists for classes you have imported
16:43 <sproingie> there's an infinite number of classes you haven't imported
16:44 splanch joined
16:44 <sproingie> browsing packages by types and classes would be A Neat Idea
16:44 <EvanR> ok i reified the IO actions as you suggested
16:44 <sproingie> hayoo's probably as close as you'll get but it's kind of the reverse of the index you want
16:45 doomlord joined
16:45 pera joined
16:46 danthemyth joined
16:46 fenedor joined
16:46 jer1 joined
16:46 <erisco> sproingie, I realise this
16:47 umib0zu joined
16:47 <erisco> but for a library writer trying to export a newtype, it is good to provide the most common instances
16:47 beerdrop joined
16:47 <erisco> even just getting everything in base is a bit of work
16:47 Hamlet joined
16:48 gillesmajor joined
16:48 insitu joined
16:49 oisdk joined
16:49 Swizec joined
16:49 <erisco> like there is some type classes for serialisation or something or dynamic or something that I never use
16:49 <erisco> and I don't even recall the names
16:49 <sproingie> the nice thing about open classes is you don't have to think about all the instances up front
16:50 newhoggy joined
16:50 erikd joined
16:50 gillesmajor joined
16:50 <erisco> no one is enthused about standalone instances either
16:51 ersran9 joined
16:51 <erisco> right, Data and Typeable
16:51 <sproingie> well Typable is pure magic afaict
16:52 <aweinstock> win 30
16:52 <aweinstock> oops
16:52 <erisco> and Generic
16:52 EvanR_ joined
16:52 <sproingie> damn bro, that's a lot of windows
16:52 <erisco> I don't even know what that one is for
16:53 <erisco> so it'd be nice to have a list to make this easier
16:53 <EvanR> Generic is pretty dope
16:53 <EvanR> generate support from the structure of the ADT without template haskell
16:54 <lyxia> I love Generic
16:54 <erisco> ugh, and Generic1... how many am I missing XD
16:55 <glguy> But if you *are* generating code for datatypes via Template Haskell, consider looking at http://hackage.haskell.org/package/th-abstraction-0.1.0.0/docs/Language-Haskell-TH-Datatype.html
16:55 <erisco> though if I :i [] with GHC.Generics imported it only gives me Rep [a] and Rep1 [a]
16:55 <erisco> oh nvm, I see Generic and Generic1 now... blind
16:56 conal joined
16:57 newhoggy joined
16:59 <erisco> "even with cunning GeneralizedNewtypeDeriving"
16:59 paolino joined
16:59 <EvanR> -XCunningGeneralizedNewtypeDeriving ?
17:01 mmachenry joined
17:01 <erisco> didn't know DeriveTraversable was a thing... apparently newtype deriving can't get it
17:01 <sproingie> -XCunningPlan
17:02 Swizec joined
17:02 flatmap13 joined
17:02 <glguy> erisco: It's just different altogether from NewtypeDeriving
17:02 <erisco> then for some reason both Rep and Rep1 are not allowed derivings
17:02 <sproingie> GNTD is unfortunately still not kosher with Safe
17:03 cpennington joined
17:03 <sproingie> something to do with leaking private details from modules
17:03 flatmap13 joined
17:04 flatmap13 joined
17:04 <erisco> I haven't a clue how this Rep/Generic stuff works, or even what it is
17:04 <erisco> do I just need deriving Generic and Generic1 and not Rep and Rep1?
17:04 zeroed joined
17:04 <glguy> deriving Generic or Generic1 will automatically derive Rep and Rep1
17:05 <erisco> okay, thanks
17:06 carlomagno joined
17:07 newhoggy joined
17:07 jer1 joined
17:08 epsilonhalbe joined
17:10 <glguy> Generics allows you to look and normal algebraic data types as sums of constructors ((:+:)(L1,R1)) and products of fields ((:*:)(:*:)) in a sort of binary tree view. metadata is interspersed into the representation at the datatype level (D1), constructor level (C1), and field level (S1), finally you get to fields (K1): from "test" == M1 (R1 (M1 (M1 (K1 't') :*: M1 (K1 "est"))))
17:11 <glguy> D1 C1 and S1 are all type synonyms for M1, the metadata itself is accessible via phantom type parameters
17:11 Denthir joined
17:12 <adamCS> There are some libraries which are like generics but use a different representation. generics-sop uses type-level-list indexed sums (of constructors) and products (of fields) indexed by type-level lists. generics-eot is another.
17:13 danthemyth joined
17:13 <adamCS> Those representations are all derivable from the GHC generics one. I found it helpful to look at those (especially generics-sop).
17:14 raynold joined
17:17 JagaJaga joined
17:18 pierrot joined
17:20 asmyers joined
17:20 newhoggy joined
17:24 {emptyset} joined
17:25 meck joined
17:25 thunderrd joined
17:26 sgronblo joined
17:26 sigmundv_ joined
17:27 coot____ joined
17:27 jer1 joined
17:31 iomonad joined
17:31 newhoggy joined
17:31 <orion> :t (:*:)
17:31 <lambdabot> error: Data constructor not in scope: :*:
17:31 <orion> :k (:*:)
17:31 <lambdabot> error:
17:31 <lambdabot> Not in scope: type constructor or class ‘:*:’
17:31 <lambdabot> Perhaps you meant ‘:~:’ (imported from Data.Typeable)
17:31 erikm joined
17:31 <orion> Are these standard operators?
17:32 <mniip> yes
17:32 blym_ joined
17:32 <mniip> :k GHC.Generics.:*:
17:32 Deide joined
17:32 <lambdabot> error:
17:32 <lambdabot> Operator applied to too few arguments: GHC.Generics.:*:
17:32 <mniip> :k (GHC.Generics.:*:)
17:32 <lambdabot> (* -> *) -> (* -> *) -> * -> *
17:33 uglyfigurine joined
17:33 chrisdotcode joined
17:33 connrs joined
17:33 robotroll joined
17:34 coot____ joined
17:34 mizu_no_oto_work joined
17:34 jaykay123 joined
17:35 <jaykay123> hey
17:35 <jaykay123> so what does it mean when a Haskell expression is referentially transparent?
17:35 <jaykay123> it always evaluates to the same thing
17:35 <jaykay123> what does that mean?
17:35 <EvanR> i dont think thats the right answer
17:35 yellowj joined
17:35 <jaykay123> what siis it?
17:35 <jaykay123> is8
17:35 <jaykay123> *
17:36 <EvanR> people mix up that longer phrase with "pure" a lot
17:36 <jaykay123> pure just means it doesn't consult memory right?
17:36 <mniip> no
17:37 buttbutter joined
17:37 <jaykay123> what does it mean then?
17:37 <EvanR> both terms lead to separate universes of interpretations
17:37 <c_wraith> referentially transparent means that there's no difference between an expression and the result of that expression.
17:37 buttbutt1r joined
17:37 shivansh joined
17:37 <jaykay123> c_wraith do you have an example?
17:37 shivansh left
17:37 <EvanR> result of an expression
17:38 oish joined
17:38 <mniip> jaykay123, (1+2) in every aspect is equivalent to 3
17:38 <mniip> you cannot tell them apart
17:38 <jaykay123> yeah
17:38 <c_wraith> jaykay123, the important part is that it applies to *all* expressions.
17:38 <c_wraith> you can't write a function that does anything more than just calculate its result.
17:39 <EvanR> that gets into purity
17:39 <mniip> EvanR, I'm probably guilty of that too, RT is the part where a function's definition can be substituted at call site, right?
17:39 <c_wraith> it's also part of referential transparency.
17:39 <EvanR> and in explaining what functions cant do, when they obviously cant by definition of function, its confusing as hell
17:39 newhoggy joined
17:39 <EvanR> as for referential transparency, i think its been diluted and misinterpreted to all hell to become almost useless
17:40 eliasr joined
17:40 e_svedang joined
17:40 <Tuplanolla> I thought referential transparency meant that this 42 over here is indistinguishable from that 42 over there.
17:40 <jaykay123> this is confusing af
17:40 <EvanR> that sounds like yet another kind of RT, from OOP
17:40 <sproingie> it means you can replace a function with its result everywhere
17:40 <Hamlet> Q: Does anyone know of / has used Helium (compiler)? It's supposed to be for newbie Haskellers.
17:41 <sproingie> you can think of a function in that sense as a "reference" to its result, ergo it's transparent
17:41 <EvanR> sproingie: do you mean, replace a function application with a result?
17:41 crobbins joined
17:41 <sproingie> naturally. the function itself is a value, application yields its result.
17:41 <c_wraith> Hamlet, it is primarily for avoiding ghc's error messages, which often refer to much more advanced concepts than a beginner is ready for.
17:41 <sproingie> (precise terminology being at odds with clarity sometimes)
17:41 <jaykay123> an expression is 1+2 yeah:?
17:42 <jaykay123> so 1+2 is always 3
17:42 <jaykay123> never changes
17:42 <c_wraith> Hamlet, but the cost is that it doesn't support more advanced features at all.
17:42 <jaykay123> thus why that expression is referentially transparent
17:42 <EvanR> sproingie: alright, so in what sense can i NOT replace unsafePerformIO launchMissiles with ()
17:42 <sproingie> learning to read ghc's error messages is a skill people should learn from day 1
17:42 <Hamlet> I don't mind. I'm new to the language.
17:43 <EvanR> what missing thing from your explanation did that run afoul on
17:43 <sproingie> EvanR: in that it has side effects you expect it to execute on every call. if you substituted it, then it would only launch ze missiles once (presumably after you evaluated it once for the result)
17:43 <c_wraith> Hamlet, in many cases, you could. those advanced features include things like (+) working with more than the pre-defined set of types.
17:43 raichoo joined
17:43 <jaykay123> am I right in what I'm saying about for the referentailly transparent?
17:43 <EvanR> sproingie: thats so far afield from referntial transparency...
17:44 <sproingie> if you consider the effect part of the returned value, then it's RT again
17:44 <EvanR> jaykay123: youll need to take literally everything people "know" with a grain of salt here, and look up some book references
17:44 <EvanR> sproingie: :|
17:44 <c_wraith> Hamlet, or along those lines but even simpler, supporting (==) for user-defined types
17:44 <jaykay123> but that means the whole concept of it is screwed then right?
17:44 <EvanR> jaykay123: do you know what a pure function is?
17:45 gienah_ joined
17:45 <jaykay123> it's when you take an input into a function and there's no side effects
17:45 <EvanR> hrm.
17:45 alien8d joined
17:45 <EvanR> the level of precision here is lacking
17:45 <EvanR> oh well
17:45 <sproingie> your function that calls launchMissiles can still be pure in other respects, so if there's no observable effect outside of functionThatCallsLaunchMissiles, you're fine
17:45 <EvanR> launchMissiles isnt a function
17:45 <sproingie> just that launching missiles tends to be observable :)
17:46 Filip_ joined
17:46 <jaykay123> side effects being that nothing else can change the state
17:46 <jaykay123> what you put in is what you get out
17:46 <jaykay123> always
17:46 fenedor joined
17:46 <EvanR> theres not necessarily any state in sight here
17:47 newhoggy joined
17:47 <erisco> ski, did we ever figure out the Applicative/Alternative interaction?
17:47 <sproingie> launchMissilesAndAdd
17:47 <EvanR> sorry youre looking for a quick answer that i havent seen any evidence for the existence of in a few years
17:47 <sproingie> can still have a perfectly pure add function in there
17:47 tathougies joined
17:48 jer1 joined
17:49 epsilonhalbe joined
17:49 crobbins joined
17:50 <sproingie> unsafePerformIO is a deliberate backdoor though
17:50 crobbins joined
17:51 <pikajude> is safePerformIO in the standard library anywhere
17:51 <erisco> I also remember something like data X a b = This a | That b | Both a b but cannot remember X
17:51 <pikajude> These
17:51 <erisco> thanks
17:52 <pikajude> sure thing
17:52 <mniip> pikajude, id
17:52 <EvanR> jaykay123: you will find people referring to referentially transparent programming languages, referentially transparent expressions, referentially transparent functions, referentially transparent contexts, at least. without more effort you may find yourself or other people making up some sort of meanings these on the spot based on the fact that they all use the same words, so it must mean the same thing somehow
17:52 <Tuplanolla> You could say the runtime has it and calls it once with `main`, pikajude.
17:52 <pikajude> how can I be sure id is safe
17:52 <erisco> a nice use for tie :: (These a b -> c) -> [a] -> [b] -> [c]
17:53 edsko joined
17:53 <mniip> annotated by safehaskell
17:53 <sproingie> there's only one thing id can do
17:53 <erisco> like zip, but consumes up to the longer list
17:53 <mniip> sproingie, about 3 things actually
17:53 dbmikus joined
17:53 richi235 joined
17:53 <sproingie> paying no attention to bottom, yeah
17:55 <Hamlet> How do I start using it? [I just downloaded the file from https://hackage.haskell.org/package/helium]
17:55 iAmerikan joined
17:55 <EvanR> jaykay123: try this one https://plato.stanford.edu/entries/belief/#2.3
17:55 <sproingie> mniip: with bottom there's two things it could do, what's the third?
17:55 newhoggy joined
17:56 gawen joined
17:56 ryxai joined
17:57 daniel-s joined
17:58 coot____ joined
18:00 <erisco> lol... if only the "these" package wasn't silly in its dependencies...
18:00 <erisco> I need attoparsec? oO
18:00 <sproingie> helium's homepage recommends cabal-installing it
18:00 <erisco> because it has ToJSON instances I think
18:00 <EvanR> erisco: i know...
18:00 <sproingie> looks like it hasn't been touched in a whole, not sure if it even still works
18:01 zeroed joined
18:01 replay joined
18:03 <dolio> EvanR: That article won't help explain what people mean by "referential transparency" in the context of functional programming.
18:03 Gloomy joined
18:04 Gloomy joined
18:05 LunaIsHere joined
18:05 <EvanR> it seems that some instances of what people mean could be explained by taking that articles critical sentence and changing a couple words to match haskell, and then probably open up a few more questions
18:05 ubsan_ joined
18:05 danza joined
18:05 <EvanR> first of all, what kind of thing can be RT
18:06 <* ski> . o O ( "Referential Transparency, Definiteness and Unfoldability" by Harald Søndergaard,Peter Sestoft in 1987-11-30 - 1990-01-04 at <http://www.itu.dk/people/sestoft/papers/SondergaardSestoft1990.pdf> )
18:06 mmachenry joined
18:06 <Hamlet> I tried running 'cabal' to install Helium, but got error messages. | I think it best to install from source [which I downloaded].
18:06 newhoggy joined
18:06 flatmap13 joined
18:06 <sproingie> looks like the epistemological definition of referential transparency lines up just fine with the CS definition
18:07 <Hamlet> I.e. How do I install directly from source?
18:07 <mniip> sproingie, hmm, maybe you're right
18:07 <mniip> I was confusing with () -> ()
18:07 <EvanR> sproingie: *the* definitioins?
18:08 <c_wraith> ok, I've got a better definition now. referential transparency is when let x = exp1 in exp2 is always the same as inlining exp1 for all uses of x in exp2
18:08 halogenandtoast joined
18:09 <sproingie> if Quine in fact coined the term, then it would be the same definition (har har)
18:09 <EvanR> is the same, so they have the same meaning, same interpretation?
18:09 <sproingie> unlike, say, "monad"
18:09 <Tuplanolla> Good find, ski.
18:09 jer1 joined
18:09 <glguy> Hamlet: Helium doesn't appear to build because one of its dependencies, lvmlib, hasn't been updated to work on recent versions of GHC and the author didn't both documenting the versions that it does work on
18:09 <EvanR> not necessarily the same result when reduced, since that doesnt capture side effects
18:10 augur joined
18:10 t7 joined
18:10 <* mniip> . o O ( have you tried proton-proton synthesis )
18:10 <dolio> The whole point is that side effects break this property.
18:10 <erisco> so... let x = exp1 in exp2 ≡ [x/exp1]exp2 ?
18:10 <Hamlet> Yes. So I'm attempting to install from downloaded source (via Hackage)
18:10 Swizec joined
18:11 <EvanR> yes, so its a very roundable way to say that
18:11 <dolio> Or, they may.
18:11 <EvanR> roundabout
18:11 <sproingie> easy with stack for maintained packages. otherwise, you get to figure out which stackage version it might build with, if any at all
18:11 <ski> hm, <http://www.cs.tufts.edu/~nr/cs257/archive/peter-sestoft/ref-trans.pdf> may be a better link
18:11 Swizec joined
18:11 <EvanR> and so purity is the shorter more direct way to talk about that
18:11 iomonad joined
18:12 <dolio> "Purity" is sometimes used for a different property.
18:12 <sproingie> the interesting thing about helium to me was the graphical stuff. ghc error messages aren't actually that cryptic, just very verbose
18:12 alien8d joined
18:12 <erisco> let x = exp1 in exp2 can also be seen as (\x -> exp2) exp1 (then you get EvanR's statement)
18:12 <sproingie> they used to be worse. i remember when hugs had the better error messages
18:13 jao joined
18:13 <EvanR> now its a question of function purity
18:13 <ski> @where purely-functional
18:13 <lambdabot> "What is a Purely Functional Language?" by Amr Sabry in 1993-01 at <https://www.cs.indiana.edu/~sabry/papers/purelyFunctional.ps>
18:13 freusque joined
18:13 <Hamlet> <Ahem...>
18:14 <Tuplanolla> Cabal already installs from source, Hamlet. Your question is too vague.
18:14 flatmap13 joined
18:15 <Tuplanolla> (Cabal Install, really.)
18:15 <erisco> EvanR, I am not sure if function purity really touches on the same thing though, because c_wraith was getting at the equivalence after substitution
18:16 <EvanR> "you can exchange equal things with equal things to get an equal thing"
18:16 flatmap13 joined
18:16 <Hamlet> I downloaded tar file of helium-1.8 from Hackage.. unpacked it.. .. Am trying to build it or whatever to use it
18:16 <EvanR> which at least sweeps several different issues under the same rug
18:16 <erisco> yes, which doesn't answer the same question
18:16 <dolio> No, there are two somewhat related properties in question.
18:16 <dolio> One is that you can factor out or inline subexpressions without changing the answer.
18:17 <dolio> One is that you can evaluate expressions in different orders without changing the answer.
18:17 <erisco> if we suppose f does care about the reference x, then it doesn't matter whether x refers to m or to n
18:17 <EvanR> thats two more issues yes
18:17 <EvanR> which isnt addressing the sending of email as a result of evaluation
18:18 <EvanR> or depending on the time of day
18:18 <sproingie> helium doesn't even have type classes. you want that experience, try Elm
18:18 <sproingie> elm has the advantage of actually being maintained and having a community
18:18 <dolio> Okay. I misspoke. I don't care about "the answer" I care about what I care about. What matters is that those transformations don't change anything that I care about.
18:19 <EvanR> interesting
18:19 <dolio> Whether or not my program sends an e-mail, or what order it sends them in, is something I care about.
18:19 oish joined
18:19 <EvanR> ok
18:19 Gurkenglas joined
18:20 ryxai joined
18:20 <EvanR> now that we elucidated that much, the word "reference" here now seems pretty contrived
18:20 newhoggy joined
18:20 <EvanR> we should call it what-i-care-about-durability
18:20 <Hamlet> ... ahem! ...
18:21 <sproingie> don't need first class "references" to talk about "referential"
18:21 <dolio> No, the 'reference' part is there because I have no way to even talk about inlining/factoring without having names/references.
18:21 <monochrom> My http://www.vex.net/~trebla/haskell/prerequisite.xhtml#leibniz explains the equal-for-equal thing.
18:21 <monochrom> But yeah evaluation order is an orthogonal issue.
18:21 <EvanR> expressions dont have to be references or names or anything, its just syntax
18:22 <sproingie> "name" works pretty well too. fully applied function is just another name.
18:22 <monochrom> Hamlet: Are you sick? Is your throat doing OK? Do you need to see a doctor?
18:22 <EvanR> if there are no references or reeferring going on, whats the point
18:23 sgflt joined
18:23 <dolio> EvanR: The point isn't the 'what-I-care-about-durability'. The point is that there are multiple different things that I want to be durable.
18:24 <sproingie> in my house, reefering doesn't go on til around 4:20 if i want any work done
18:24 <EvanR> if the whole program is being analyzed, and what-i-care-about is the subject
18:24 <dolio> Each different thing has its own name.
18:24 <EvanR> why are we coopting this linguistics term that is about something entirely else
18:24 <EvanR> yes
18:24 <dolio> Because someone 15 years ago borrowed terminology and language has evolved.
18:24 <Hamlet> waiting to start building the Helium package from source. ... Haven't the foggiest idea how to do that. :)
18:24 <erisco> because humans operate on analogy
18:25 Wizek_ joined
18:25 <sproingie> as for the semantics of using a name, that's actually a pretty deep rabbit hole
18:25 <dolio> Maybe more than 15.
18:25 unK_ joined
18:25 <EvanR> analogy, the situation is as dolio described, and more or less often we deal with it by making up a retroactive reason for these words to be used
18:25 <EvanR> i guess thats analogous
18:25 <EvanR> in some way
18:26 <erisco> I am using "ZigZag" in my new module
18:26 Boomerang joined
18:26 RegEchse joined
18:26 <Hamlet> there is a 'Setup.hs' script.. but loading that gives a '*Main>' prompt
18:26 <erisco> because if you squint and draw a picture it looks like a zig-zag
18:26 <EvanR> i guess id like to see a principled reconstruction of jargon here
18:27 <erisco> and it is a short name
18:27 sgronblo joined
18:27 <erisco> intuition + short name = excellent nomenclature
18:28 <Hamlet> ... there is also a Cabal configure file
18:28 <sproingie> Hamlet: runhaskell Setup.hs
18:28 <sproingie> that's the entry point to cabal
18:28 <sproingie> i can just about guarantee you it won't work out of the box tho
18:28 <erisco> in conversations with other people I say things like toasted (onion <> butter <> bread) = excellent sandwich
18:29 SeMas joined
18:29 newhoggy joined
18:29 <sproingie> building bit-rotted haskell projects was sheer hell before stack
18:29 <sproingie> now it's only slightly hell
18:29 <Hamlet> it loads a module, nothing else
18:29 jer1 joined
18:29 <erisco> and to my surprise they ask me if this instance of <> commutes
18:30 nicknovi1 joined
18:30 <sproingie> it loads a module that parses the CLI. i believe running it without args gives help
18:30 adpx joined
18:30 augur joined
18:30 chaosmasttter joined
18:30 <sproingie> whoever designed the interface obviously liked how python distutils does it
18:31 sssilver joined
18:33 simukis joined
18:33 <erisco> I asked the worker at Subway to fix me a sandwich but they said their register could not prove the total
18:34 filterfish__ joined
18:34 ixxie joined
18:34 <sproingie> fix sandwich = sandwich(sandwich(sandwich(sandwich...
18:35 <kuribas> is it possible to have unboxed vectors with compacted fields? Unboxed tuples vectors are tuples of vectors, which have bad locality...
18:38 <sproingie> Data.Vector.Unboxed?
18:38 jao joined
18:38 newhoggy joined
18:38 <kuribas> sproingie: yes
18:38 <kuribas> Vector (Double, Double) is (Vector Double, Vector Double).
18:38 <kuribas> It has bad locality
18:38 BlueRavenGT joined
18:38 <dolio> No, it has good locality for some things and bad for others.
18:38 <Hamlet> Q: How do I use cabal to run configure file [helium.cabal] file?
18:38 <dolio> Just like the alternate way of storing it.
18:38 arw_ joined
18:38 c0smo_ joined
18:38 <sproingie> usual thing when you want a packed vector is to just flatten it and use n-length spans of that vector
18:38 worch_ joined
18:38 saurik_ joined
18:38 <sproingie> at least that's how all the opengl code i've had to write goes
18:38 spacebug joined
18:38 nshepperd_ joined
18:38 Ornedan_ joined
18:38 froztbyt1 joined
18:38 wto_ joined
18:38 <monochrom> batman_song = fix Na -- while we're at it
18:38 RGamma_ joined
18:38 liyang_ joined
18:38 ridho joined
18:38 ssedov joined
18:38 <dolio> Anyhow, there could be tuple instances for Prim (I think that's the class), but there aren't right now.
18:38 kav_ joined
18:38 <kuribas> sproingie: right
18:38 <sproingie> (not in haskell though, i never got past immediate mode in haskell opengl)
18:38 cods_ joined
18:38 dysfun_ joined
18:38 <dolio> Storable vectors are array of structures.
18:42 irclogger_com joined
18:42 Topic for
18:42 mmachenry joined
18:42 <lyxia> History
18:43 ryxai joined
18:43 <erisco> oh, hmm... so has the campaign for Semigroup m => Monoid m begun?
18:43 leat joined
18:43 flatmap1_ joined
18:43 codesoup joined
18:45 <sproingie> may as well add Magma too
18:45 <erisco> I don't think that one makes any sense
18:45 <sproingie> associativity not being enforceable, they'd be the same thing i guess
18:46 <lyxia> Boomerang: http://mail.haskell.org/pipermail/haskell-cafe/2006-July/016559.html basically people get lost in bikeshedding every time it coomes up
18:46 <sproingie> i just like Magma, i'm a DF fan :)
18:46 <erisco> it doesn't make sense because we already have closure by the type
18:47 <erisco> so not only is there an absurd number of Magma instances for most types, but there is nothing added
18:48 Levex joined
18:48 erikd joined
18:49 flatmap13 joined
18:49 jmg8766 joined
18:50 newhoggy joined
18:50 jer1 joined
18:50 rkazak joined
18:51 <erisco> you even have const and flip const for free
18:52 <erisco> I also wonder how long it will take after DT Haskell (which is already somewhere over the rainbow) to get class laws added to the classes
18:53 grumble joined
18:53 rightfold joined
18:54 sssilver joined
18:54 JagaJaga joined
18:54 <erisco> might be harder than DT Haskell itself :P
18:55 <rightfold> Is there a nice way to signal to a thread that is probably waiting on a TQueue to cancel this operation? Do I have to use throwTo?
18:55 <Boomerang> lyxia: thanks for the link! I've been implementing my own splitOn function for many HackerRank problems. Turns out, the split library is included anyway ^^
18:55 <erisco> :t splitOn
18:55 <lambdabot> Eq a => [a] -> [a] -> [[a]]
18:56 phyrex1an joined
18:56 <erisco> weird
18:56 dm3 joined
18:56 Costar joined
18:57 <erisco> for many problems? what problems is it used in?
18:57 laplacian joined
18:57 <sproingie> > "foobarbazbarxyzzy" `splitOn` "bar"
18:57 <lambdabot> ["bar"]
18:58 sssilver joined
18:58 <sproingie> well that was less than expected
18:58 <Boomerang> all hackerrank problems require to parse some input. I tend to use interact as the only IO function and then have to split the String properly
18:58 zeroed joined
18:58 <rightfold> sproingie: flip splitOn
18:58 <sproingie> > splitOn "bar" "foobarbazbarxyzzy"
18:58 <lambdabot> ["foo","baz","xyzzy"]
18:58 <erisco> > splitOn [1,2,3] [9,8,1,5,2,5,4,3,0]
18:58 <lambdabot> [[9,8,1,5,2,5,4,3,0]]
18:58 <erisco> well I don't understand it actually
18:59 <erisco> oh, so this is PHP's explode
18:59 <erisco> or preg_split I guess because I think explode is just on a single char... been years :P
18:59 <Boomerang> > splitOn "\n" "hello\nworld\n!!!" -- same as lines
18:59 <lambdabot> ["hello","world","!!!"]
19:00 <erisco> make sense... not sure why I thought of some other weird thing
19:00 <ski> > splitOn "" "abcd"
19:00 <lambdabot> ["","a","b","c","d"]
19:00 JeanCarloMachado joined
19:00 <sproingie> the leading "" is kind of unexpected
19:00 newhoggy joined
19:00 <ski> weird with the initial empty string ..
19:00 <Boomerang> why isn't there an extra "" at the end?
19:01 hiyatt joined
19:01 meoblast001 joined
19:01 codesoup joined
19:01 danthemyth joined
19:01 <Boomerang> The reason they have extra empty strings is to you can reverse it with intercalate
19:01 <Boomerang> *so
19:02 sedeki joined
19:02 <Boomerang> But with empty string as separator it doesn't matter anyway
19:02 <erisco> I find the notion of splitting on the empty string strange, never mind what it actually does
19:02 jmg8766 left
19:03 <ephemeral> http://hackage.haskell.org/package/base-4.9.1.0/docs/Data-List.html#v:intercalate
19:03 <Tuplanolla> I would've expected an infinite list of empty strings.
19:03 <ephemeral> hmm, where can I find the actual function definition, and not just the type signature?
19:04 <geekosaur> that should have a Source link at the far right
19:04 <geekosaur> but, it might actually be in Data.Foldable...
19:04 <ephemeral> right on, sitting on a very wide screen, so totally missed it
19:04 <rightfold> When I read a TVar, then block on a TQueue read inside the same transaction A. And then a different transaction B modifies the TVar, is transaction A retried immediately?
19:04 tathougies joined
19:04 <sproingie> always advancing at least one position makes sense for a split algorithm, so no infinite lists
19:04 <sproingie> *of ""
19:05 <sproingie> which also makes the leading "" make some sense, even if it's useless
19:05 <erisco> lets see... if we look at the problem non-deterministically then we can start with all the 2-partitions of the string
19:05 <ephemeral> heh, so xss is the usual way to refer to the value of a list of lists?
19:06 JoshS joined
19:06 <erisco> so "foobarqux" has ("f","oo","barqux") for example as a 2-partition
19:06 <erisco> then we find just those with a middle group of the needle and conquer on the left and right groups
19:07 <erisco> then we can observe that all paths lead to the same answer
19:07 caumeslasal joined
19:08 <lyxia> rightfold: Having just tried it, it seems to work that way
19:08 <erisco> so to answer the empty string problem we just have to be careful about how we define the 2-partitions
19:08 <ski> i suppose with `splitOn sep list' you want no element of the resulting list to have `sep' as a contiguous sublist
19:08 <rightfold> lyxia: that's very nice, but I couldn't make it up from the docs
19:08 <erisco> so ("","foo","barqux") might be one, as well as ("foo","","barqux"), and also ("foo","barqux","")
19:08 lavalike joined
19:08 <lyxia> rightfold: for you initial question you can use <|>
19:08 <erisco> or ("foobarqux","","") and so on
19:08 <ski> which makes the case with `sep = []' problematic
19:09 <sproingie> which suggests to me empty results should just be elided
19:09 <ski> hm .. i suppose that specification isn't though
19:09 <lyxia> rightfold: I don't think the docs explain that
19:09 <erisco> so... we certainly have ("","","foobarqux") then, so "" has to be a split
19:09 <ski> > splitOn "aba" "xababay"
19:09 <lambdabot> ["x","bay"]
19:09 <ski> (why not `["xab","y"]' ?)
19:09 <erisco> but so is ("foobarqux","","") and so "" is another split on the end
19:09 <rightfold> lyxia: thanks, I'll get to my PC and give it a try
19:10 <erisco> and there are a bunch of empty splits in the middle
19:10 <erisco> so they've gone with it differently where the partitions may coincide on the start but not in the middle nor the end
19:11 halogenandtoast joined
19:11 <ski> sproingie : a somewhat similar problem arises in Prolog, with a concat/2 predicate, where `append(ListOfLists,Concatenation)' is to hold when `Concatenation' is the concatenation of all the lists in `Concatenation'
19:11 <sproingie> > splitOn "foo" "foobar"
19:11 jer1 joined
19:11 <lambdabot> ["","bar"]
19:11 <sproingie> aha
19:11 <erisco> > splitOn "bar" "foobar"
19:11 <lambdabot> ["foo",""]
19:11 <erisco> oh wow
19:11 <Boomerang> @check ((\x sep -> (intercalate sep .
19:11 <Boomerang> splitOn sep) x == x) :: [Char] -> [Char]
19:11 <lambdabot> <unknown>.hs:1:32:Parse error: EOF
19:11 <Tuplanolla> > splitOn "foo" "foo"
19:11 <lambdabot> ["",""]
19:11 <erisco> well actually this one is fine, because that is ("foo","bar","")
19:12 <Tuplanolla> > splitOn "" ""
19:12 <lambdabot> [""]
19:12 <lyxia> rightfold: I guess it's implicit that blocking is implemented with 'retry'
19:12 <ski> sproingie : in case `Concatenation' is known, and `ListOfLists' is solved for, there's infinitely many solutions, unless we disallow the empty list being an element of `ListOfLists' .. but in that case, for consistency, we should fail if `ListOfLists' known to contain an empty list, and `Concatenation' is solved for ..
19:12 <Tuplanolla> I'm unsatisfied with this.
19:12 <Boomerang> @check ((\x sep -> (intercalate sep . splitOn sep) x == x) :: [Char] -> [Char] -> Bool)
19:12 <lambdabot> +++ OK, passed 100 tests.
19:12 <sproingie> eh. every language's "split" has odd corner cases.
19:12 <ski> Boomerang : yes, that's the least one could expect
19:12 <Tuplanolla> We should implement and provide all possible definitions.
19:12 <lyxia> rightfold: and the semantics of 'retry' are either assumed to be common knowledge, or nobody bothered to extract it from the paper and put properly in the docs.
19:13 <erisco> empty haystack is interesting because the partitions have to coincide on the start, middle, and end, but we have to exclude middles and ends
19:13 oisdk_ joined
19:13 <erisco> so that has to be a special case
19:13 <erisco> this is a good example of why their version is odd
19:14 <lyxia> somehow I doubt that QuickCheck test had a lot of coverage.
19:15 <Boomerang> Doesn't QuickCheck prioritise the obvious edge cases? Such as empty lists?
19:15 <erisco> well actually it is just the base case, isn't it, so whatever
19:15 newhoggy joined
19:15 edsko joined
19:15 <erisco> ("","","") doesn't make any sense for it because then we conquer on "" again, twice, and never terminate
19:16 soniku joined
19:17 <rightfold> lyxia: I can confirm! https://glot.io/snippets/epc5vk63os
19:17 <rightfold> Thanks!
19:17 epsilonhalbe left
19:18 <lyxia> Boomerang: sure, but for intercalate to do anything remotely interesting, the string must contain the separator. This is quite improbable as the size increases.
19:19 gillesmajor left
19:19 <erisco> I thought QuickCheck could inspect definitions
19:20 <erisco> and thus find the separator case
19:20 <ski> er .. no, not at all ?
19:20 yqt joined
19:20 <erisco> well that's weird... I thought that was exactly what the guy was talking about when I watched some slides on it a long time ago
19:20 <c_wraith> the only information "available" to quickcheck is the types of the arguments to the test you provided it
19:20 <erisco> that they could infer good cases based on the definition
19:21 <erisco> phft, well that is weak sauce
19:21 <c_wraith> are you maybe thinking of quickspec?
19:21 <erisco> could be
19:21 {emptyset} joined
19:22 <Tuplanolla> @check \ x -> abs (x :: Double) >= 0
19:22 <lambdabot> +++ OK, passed 100 tests.
19:22 <Tuplanolla> @check \ x -> abs (x :: Int) >= 0
19:22 <lambdabot> +++ OK, passed 100 tests.
19:22 <Tuplanolla> Neither is true.
19:23 <mniip> what?
19:23 <erisco> why I rue test cases
19:23 mda1 joined
19:23 <c_wraith> @check \ xs -> xs == reverse xs
19:23 <lambdabot> +++ OK, passed 100 tests.
19:23 <Tuplanolla> Is there a way to tell QC to prioritize pathological cases?
19:23 <mniip> well, that's defaulting to ()
19:23 EvanR_ joined
19:23 anuxivm joined
19:23 <sproingie> ship the code, users will find the pathological case right away ;)
19:23 <c_wraith> make your Arbitrary instance produce pathological cases first.
19:24 <erisco> yeah but the last place you want gotchas is in your tests
19:24 <kadoban> Tuplanolla: Perhaps smallcheck is worth looking at, by the way.
19:24 fotonzade joined
19:24 <c_wraith> that's why you put as much in your tests as possible.
19:24 <c_wraith> err. in your types as possible.
19:24 <Tuplanolla> Why aren't `minBound`, `maxBound` and `nan` already in the instance for `Double`?
19:24 <thoughtpolice> My favorite QuickCheck failure was when its distribution was skewed very badly due to the RNG. Slide 3 is great: https://wiki.haskell.org/wikiupload/7/74/Hiw2012-michal-palka.pdf
19:24 flatmap13 joined
19:24 <erisco> > abs (minBound :: Int)
19:24 <lambdabot> -9223372036854775808
19:24 <EvanR> Tuplanolla: Double doesnt have minBound or maxBound
19:25 <c_wraith> the proves types.
19:25 <EvanR> is one reason
19:25 <Tuplanolla> Well, the equivalents, EvanR.
19:25 <erisco> does +Infinity and -Infinity work? Double is already screwed up
19:25 <kadoban> Hmm, why doesn't Double have minBound/maxBound. Because of NaN and Infinity or something?
19:25 <EvanR> whats funny is i tried coming up with tests Double actually could pass, and couldnt. they fail just because Double, ime
19:25 <Tuplanolla> Same question for `Int` though.
19:26 taktoa joined
19:26 <EvanR> erisco: Double is supposed to approximate real numbers, which are unbounded. another issue is not all values are less than Inf or greater than -Inf
19:26 <erisco> anyone know when Not-A-Number was first included as a number on CPUs? and who is responsible?
19:27 <sproingie> IEEE
19:27 <kadoban> erisco: Int is supposed to approximate the integers, isn't it? It's still Bounded.
19:27 <kadoban> EvanR: ^
19:27 <geekosaur> it some sense it is not "a" number; it's a set of bit patterns which usually record something about the origin of the NaN
19:27 <EvanR> Int is certainly supposed to be exactly Z mod something
19:27 <geekosaur> and yes, it's IEEE 754 standard
19:27 <kadoban> I thought that was just an implementation detail
19:27 <EvanR> it wraps around
19:28 newhoggy joined
19:28 <EvanR> not maxes out or errors on overflow
19:28 <erisco> it is clearly Maybe Z for some modulo
19:28 <sproingie> pre-IEEE 754, every CPU did it differently. some might have done NaN before, IEEE754 standardized it
19:28 <erisco> why didn't they settle on interrupts?
19:29 <sproingie> the behavior of NaN /= NaN is probably IEEE's fault
19:29 <erisco> who was advocating using NaNs as a regular value?
19:30 <erisco> I read someone else's memory and I get interrupted
19:30 <sproingie> who knows. NaN behavior was pretty hotly disputed back then too
19:30 <erisco> I divide by zero and we just pretend that's a thing
19:30 <EvanR> not all CPUs have division, so that solves that
19:31 taktoa joined
19:31 tathougies joined
19:31 jer1 joined
19:32 tathougies1 joined
19:32 hvr joined
19:32 hvr joined
19:33 halogenandtoast joined
19:33 iAmerikan joined
19:34 Levex joined
19:35 pie_ joined
19:35 <monochrom> They settled on "support both NaN and interrupt, let the user decide"
19:35 <erisco> there is a flag I can set? hm
19:36 <sproingie> most FPUs then were external units with slow communication to the CPU
19:36 <Tuplanolla> Too bad nobody knows about `feenableexcept`.
19:36 <mniip> I think I saw that on C jeopardy once
19:36 <sproingie> so performance could have been a real barrier to adoption
19:37 <erisco> okay, but why do you need the interrupt to be fast?
19:37 <sproingie> real time code?
19:37 DTZUZU joined
19:38 <sproingie> i dunno, standards are a sausage-making process
19:38 <erisco> I am assuming we're not programming to recover from this interrupt, it is just an abort
19:38 <monochrom> I don't think it's really the performance angle.
19:38 <monochrom> Instead I think it's more the lost of knowledge and rise of myth angle.
19:38 doomlord joined
19:39 <erisco> maybe there are some vital uses where you need a Maybe-style failure and you check for it at the end
19:39 <monochrom> C became popular, and preserving the reputation "C is oh so portable" also became popular, so people lost the knowledge that you could actually choose exception and the platform-specific API for that.
19:39 <erisco> and having a more elaborate structure (like Maybe) for this is just not acceptable
19:40 <monochrom> (Not to mention that C sucks on exceptions. Unix too.)
19:40 newhoggy joined
19:40 <erisco> but I dunno, that seems small
19:40 <Tuplanolla> The reasoning I've heard, in hpc, is that you don't want to slow the normal code path with exception handling, erisco.
19:41 <sproingie> neither C nor fortran had a standard ability to communicate the exception to the user. and those being _different_ standards bodies...
19:41 <erisco> well maybe it is an exception
19:41 <monochrom> heh
19:41 <erisco> that is a higher-level thing, and I am not even convinced you'd care to handle this exception
19:42 ekinmur joined
19:42 <erisco> in what case is it so important to recover from the interrupt versus prevent it?
19:42 <sproingie> because abort() makes for a distinctly inflexible way of handling errors
19:42 <monochrom> It is tricky to prevent.
19:43 <monochrom> Err, nevermind, I had overflow rather than NaN in mind.
19:43 <sproingie> same deal tho
19:43 sssilver joined
19:43 Boomerang joined
19:43 <erisco> no because you just evaluate the operand first and check if it is within defined bounds, if you must
19:43 <monochrom> But I do think that the scientists prefer NaN's to propagate and show up in final answers.
19:44 <sproingie> yah that's probably closer to the real answer
19:44 <c_wraith> if that's all they did, it be fine. but when they don't show up in final results, and just break conditionals instead...
19:44 <monochrom> To be fair, there is no good answer to the alternative question "OK if you run into sqrt(-1) what do you want to do?"
19:44 <erisco> I think the perceived convenience, particularly at the time, is a stronger case
19:44 <sproingie> also accounts for the NaN != NaN behavior
19:45 <monochrom> The superiority of our Maybe is predicated on actually having a plan B for the Nothing case. If you have no such plan then it doesn't matter all that much.
19:46 <erisco> that's why I say you'd probably not handle such an exception or interrupt anyways, you'd just let your program abort and file a bug report
19:46 Levex joined
19:46 <erisco> but I also have tried to make this point about Maybe in Haskell before and I failed to be convincing
19:47 <erisco> because somehow totality is seen as more important than actually having anything defined on the Nothing case
19:47 <monochrom> So take for example you have "fmap sqrt array_of_inputs" or the Fortran equivalent. It looks fairly reasonable to specify "it's OK if the output is [1,414, NaN, 4, 5]
19:47 <monochrom> I mean, not for all use cases, but certainly for some use cases.
19:48 <sproingie> i get it all the time when i'm graphing with rrd
19:48 <monochrom> In Haskell it is good to want the output to be [Just 1.414, Nothing, Just 4, Just 5]. But a floating-point unit doesn't have Maybe.
19:48 <sproingie> it just results in no plot for that period
19:49 <monochrom> And yeah if you say "throw an exception, the exception handler will do the Nothing part", that may be too much overhead.
19:50 <Tuplanolla> The solution is maybe hardware.
19:51 eazar001 joined
19:51 <EvanR> then youd need full ADT hardware
19:51 meoblast001 joined
19:51 <Tuplanolla> Sounds good to me.
19:51 <EvanR> Maybe (Maybe Double)
19:51 <* ski> . o O ( <https://mumble.net/~campbell/proposals/restart.text>,<http://www.gnu.org/software/mit-scheme/documentation/mit-scheme-ref/Restarts.html>,<http://www.gigamonkeys.com/book/beyond-exception-handling-conditions-and-restarts.html> )
19:52 <thang1> Maybe (Maybeline)
19:52 jer1 joined
19:52 <erisco> talk to conal about that, actually :P
19:52 <sproingie> huh, MIT scheme had restarts?
19:52 <ski> (has)
19:53 JoshS joined
19:54 <sproingie> i always think of it as that primitive dialect you need for SICP
19:54 newhoggy joined
19:54 <* ski> . o O ( <https://en.wikipedia.org/wiki/PCLSRing> )
19:54 eschnett joined
19:54 <sproingie> racket's #lang sicp didn't survive the transition to immutable conses very well
19:55 mjora7 joined
19:55 <sproingie> in that it works up to a point, then lots of mysterious errors about mcons
19:56 Destol joined
19:56 Don_John joined
19:57 oish joined
19:57 <erisco> does anyone else have the inseparable association of scones and cons?
19:58 <sproingie> i used to build some C projects with scons
19:58 <osfameron> perhaps it depends on how you pronounce "scone"
19:58 ryxai joined
19:59 <monochrom> Or how you pronounce cons :)
19:59 chaosmasttter joined
19:59 <monochrom> data List a = Rod | Cones a (List a)
20:00 Gurkenglas joined
20:01 <Tuplanolla> This reminds me of a great idea I had that should be standardized: `data Graph i a = Graph (Spine i) (Noodle a)`.
20:02 JeanCarloMachado joined
20:02 <monochrom> Yikes, what is Spine, what is Noodle?
20:02 <monochrom> Also, why what Spaghetti and Noodle for the kick of it? :)
20:02 <monochrom> (Just kidding!)
20:03 <Tuplanolla> The spine is the structure of the graph without the elements and the noodle is the elements without structure.
20:03 locallycompact joined
20:03 <monochrom> Hrm interesting.
20:03 augur joined
20:03 kmels joined
20:03 asmyers joined
20:04 halogenandtoast joined
20:04 <EvanR> what in the world, noodle?
20:04 <erisco> I don't know if I can be taken seriously talking about graph noodles
20:05 <sproingie> Scrap Your Sauce
20:05 <monochrom> Oh! Graph (Waffle i) (Spaghetti a). Now that's perfect. :)
20:05 ycheng joined
20:06 rkazak joined
20:06 <sproingie> waffles and spaghetti?
20:06 newhoggy joined
20:06 <monochrom> waffle has structure, spaghetti has content :)
20:07 <erisco> and maple syrup goes with either
20:07 <sproingie> monads are just like ravioli...
20:07 tathougies joined
20:07 flatmap13 joined
20:09 <monochrom> or Graph (Waffle i) (Syrup a) would also pun greatly.
20:09 grayjoc joined
20:10 srbaker_ joined
20:10 <monochrom> "A novel graph representation for high performance, high carb, high fructose, and high gluten"
20:10 <EvanR> higher order fructose corn syrup
20:11 merijn joined
20:11 StoneToad joined
20:12 <sproingie> i remember when i was first learning OO, i had no idea about class design. so i had singleton classes in production code named "Banana" and "Kumquat"
20:12 <erisco> certainly more inventive than MyClass
20:13 jer1 joined
20:13 <monochrom> What did your Banana class represent?
20:13 <sproingie> i sort of miss those days, at least i actually got code written
20:13 <sproingie> hard to recall exactly, i think one was a CGI request handler and the other was database routines
20:13 <erisco> now you just need to decide how Kumquats interact with the world, and what constitutes a Kumquat
20:13 <MonadHendrix> lol Banana
20:14 <erisco> what things a Kumquat holds secretly and what it shares
20:14 <MonadHendrix> type-level cooking
20:14 `^_^v joined
20:14 <monochrom> It's a singleton, so it's really just one Kumquat.
20:14 <sproingie> was written in Delphi, i eventually ported it to a web UI instead (newfangled concept at the time) and used perl
20:15 <monochrom> w00t Delphi
20:15 tv joined
20:15 pie_ joined
20:15 cloudhead joined
20:15 <erisco> sproingie, are you saying nowadays you can't write code?
20:16 <sproingie> feels like it. analysis paralysis has a big hold on me.
20:16 osa1 joined
20:16 osa1 joined
20:16 <monochrom> Yeah, 99% of my time is spent on "what is a good name for this?"
20:16 <sproingie> when you only know one stupid way to do something, you waste no time in getting on it
20:16 <erisco> at first it was great to just make anything that worked
20:17 Igloo joined
20:17 Denthir joined
20:17 <erisco> now it is about avoiding all the things which don't work well
20:17 <sproingie> back when doing anything that worked was rewarding in itself
20:17 <EvanR> "if its a dumb way that works, then its not dumb"
20:17 <monochrom> I think a renamer tool will help mitigate it greatly. Just call it "john" for now. Rename later.
20:17 <sproingie> i remember when people were impressed by me being able to make a computer do anything at all
20:17 newhoggy joined
20:17 soniku joined
20:18 marr joined
20:18 <erisco> at least the diamonds are out there if you sift long enough
20:18 meandi joined
20:19 andromeda-galaxy joined
20:19 <fragamus> https://gist.github.com/fragamus/3cc5ab02a9ea89c42111ed7069d7e53b
20:20 ChaiTRex joined
20:20 <sproingie> part of it's just from getting old. kids still get plenty of wonder from making stuff in minecraft
20:21 <erisco> consider me a kid then... have you played the mods?
20:21 <EvanR> working software? so old.. so passe
20:21 <andromeda-galaxy> Is there a way to ask the GHC RTS to "adopt" a foreign pointer? In particular I would like to write some C which outputs the native layout of haskell data and then hands off that data to haskell
20:21 cdg joined
20:21 <andromeda-galaxy> (e.g. a json parser that correctly creates the haskell layout but is accelerated by being written in C)
20:21 <sproingie> played a few mods, but i just couldn't get into the experience. programmable MUDs were the thing for me for a while
20:22 ycheng joined
20:22 <andromeda-galaxy> (in particular is there maybe some way to (ab)use the compact regions functionality for this?)
20:23 <merijn> It's a miracle how my code always manages to fail on Travis while working perfectly fine locally...
20:23 thallada joined
20:24 <sproingie> where "local" is your dev box that's accrued eleventy hojillion little diffs?
20:24 <sproingie> i guess that's some of the motivation for nix, run your code atop a virgin platform + only what you give it
20:24 <merijn> sproingie: I dunno, I didn't setup the Travis, I'm just trying to get some fairly simple patches merged and my pull request keeps failing on Travis
20:24 Itkovian joined
20:25 <merijn> sproingie: That doesn't solve the issue of "works fine with GHC8, but fails on some obscure old stackage lts"
20:26 <erisco> it is difficult to accept the imperfections of the product over the perfection of just the idea
20:26 <jle`> is there an Ord class with only max and min?
20:26 <jle`> cause that would be nice
20:26 <sproingie> Bounded?
20:26 <EvanR> jle`: sounds like a lattice?
20:27 <jle`> sproingie: i don't think it's bounded
20:27 <EvanR> join and meet
20:27 <erisco> I'd rather stay in toy land for that reason
20:27 <EvanR> \/ /\
20:27 newhoggy joined
20:27 pie_ joined
20:27 <jle`> oh interesting
20:28 <erisco> but it is hard to get paid for playing with toys
20:28 erikd joined
20:28 mr42 joined
20:28 <jle`> Ord is just pesky because you return something that isn't a value of the instance
20:29 <EvanR> actually lattices is a thing you put on top of a (partial) order
20:29 <Younder> As for perfect code. The minute you start handling input, errors etc code gets messy.You need to know elegant code when you see it and also when to break those rules.
20:29 <erisco> jle`, what return?
20:29 asmyers joined
20:29 <jle`> erisco: for <, >, compare, >=, <=, etc.
20:29 refold joined
20:30 <erisco> > compare GT LT
20:30 <jle`> the value of the result for Ord a is not 'a'
20:30 <lambdabot> GT
20:30 <erisco> oh I see what you mean
20:30 <jle`> contrast to classes like Num, Fractional, Floating, Monoid, Semigroup
20:31 mt42 joined
20:31 <erisco> in what context is this pesky?
20:31 <jle`> where all of the methods for an instance of 'a' return an 'a'
20:31 <EvanR> hmm maybe you dont need the underlying order. wikipedia has a "algebraic" lattice
20:31 <EvanR> with some laws
20:31 <sproingie> Younder: for me it's not even so much about making the code perfectly elegant than it is about just being fun again
20:31 <jle`> well, you can't write instances for "deferred" computation kinda things
20:31 <jle`> like, (->) r
20:31 <jle`> or IO
20:31 <sproingie> i liked how other people could immediately play around with stuff i wrote in MUDs
20:31 <erisco> Younder, I think it goes further than that though, because I'm willing to accept a lot of ugliness even when implementing good ideas in Haskell or any other language
20:31 <jle`> or, in my case, Acc from accelerate
20:32 <erisco> you always take on some noise, boilerplate, idioms
20:32 darjeeling_ joined
20:32 <erisco> it is that you're going to be faced with problems where good solutions probably exist but you haven't the time to dedicate to finding them
20:32 <erisco> that is when it becomes frustrating for me
20:33 <jle`> since if your instance is a deferred computation, then writing an Ord/Eq/Real instance requires you to "force" it
20:33 <jle`> which might not be possible for, say, IO
20:33 jer1 joined
20:33 <Tuplanolla> It doesn't help that the ideal solution to almost any problem is really intricate and complicated.
20:33 <jle`> or (->) r, or Acc
20:33 <erisco> I want to start a solution with generalising and theorising about the whole problem space
20:33 <jle`> or well it's possible for Acc but unideal
20:33 <jle`> (in my situation)
20:34 Swizec joined
20:34 <erisco> but pragmatically you're forced to specialise and stick in something that just works well enough for now
20:34 spinus joined
20:34 halogenandtoast joined
20:35 <EvanR> i made a data type for animations that can split, emit outputs and be sequenced in time http://lpaste.net/355007
20:36 <jle`> i could fake 'max' and 'min' with Num
20:36 <lpaste> mivael pasted “how to profile 'main' individual %time?” at http://lpaste.net/7402310821088329728
20:36 <fragamus> :t >~>
20:36 <lambdabot> error: parse error on input ‘>~>’
20:37 <erisco> so you could say I'd rather be a theoretician than an engineer, and I think many feel similarly
20:37 <* geekosaur> hands fragamus some parentheses
20:37 <jle`> EvanR: that's pretty cool
20:37 <EvanR> jle`: https://en.wikipedia.org/wiki/Lattice_(order)#Lattices_as_algebraic_structures
20:37 <fragamus> :t (>~>)
20:37 <lambdabot> error:
20:37 <lambdabot> • Variable not in scope: >~>
20:37 <lambdabot> • Perhaps you meant one of these:
20:37 <EvanR> a class for this is probably in one of the algebra packages
20:37 <geekosaur> also, hoogle/hayoo (I mostly use the latter)
20:38 <geekosaur> possibly http://hackage.haskell.org/package/pipes/docs/Pipes-Core.html#v:-62--126--62- ?
20:39 <EvanR> min and max is just one example of this structure
20:39 <EvanR> but you could do like Monoid and call the operations min and max ;)
20:39 <jle`> lattice makes sense here
20:39 jmelesky joined
20:40 <sproingie> standardized unicode aliases would be nice
20:40 <erisco> EvanR, can you provide an example so I can know what you intend as an Animation?
20:41 Filip_ joined
20:41 sgronblo joined
20:41 <EvanR> imagine a final visible animation as an Animation Picture, defined in terms of several other Animation Pictures running in parallel and fmap mconcatted
20:42 <EvanR> each picture could be defined in terms of fmapped rendered Primitives, like a periodic counter for frame, or path through space for offset
20:42 newhoggy joined
20:42 tomboy64 joined
20:43 takle joined
20:43 <EvanR> at known points in time one animation could Split to spawn a side animation which will be flattened under a Parallel by reduce
20:43 <EvanR> and they can disappear with Expire
20:44 <EvanR> example, a complex scripted animated picture like the beginning of super mario bros 3
20:44 <EvanR> or in my case mario bros 1983
20:44 orhan89 joined
20:45 <EvanR> Fire is there to insert sound effects at particular points, basically
20:45 biglambda joined
20:45 <erisco> is the only input Delta? if so then these are movies rather than interactive, yes?
20:45 <EvanR> yes
20:46 <EvanR> dont try to interact with an animation, you might hurt yourself
20:48 <erisco> this is the kind of way I'd prefer to approach problems
20:48 mrkgnaow joined
20:48 lambdaman joined
20:48 <erisco> we need to make an animation? okay, lets talk about a way to express animations
20:49 <erisco> other than the human problems I ran into, the other problem I found is maintenance
20:49 ChaiTRex joined
20:49 mivael_ joined
20:49 <erisco> because requirements change so does need the capability of Animation
20:50 <erisco> and if you've already spent quite a while thinking about the current definition, making sure everything is defined and makes sense, then this can throw a real wrench in things
20:50 rkazak joined
20:50 raichoo joined
20:51 <erisco> where now you're trying to incorporate what may seem like a simple new feature into an already sophisticated language
20:51 <EvanR> its possible to add new features to this, but only if they make logical sense
20:51 newhoggy joined
20:51 <erisco> and this burden comes from having to find the general solution
20:52 Achylles joined
20:52 <erisco> it is absolutely possible, yes, but maybe the cost is high
20:52 <jle`> EvanR: i'm sure you already know this, but if your only interaction with animations is through view and elapse, you can also just store the results of view/elapse in a data type, instead of having the different constructors
20:52 beanbagula joined
20:53 <EvanR> jle`: view, elapse, next, and reduce.
20:53 <jle`> then your constructors now would abstract constructors
20:53 <erisco> for example, I spent a while designing a fairly sophisticated graph query language embedded in C#
20:53 <jle`> what is 'next' ?
20:53 <EvanR> to display it in real time, before knowing how fast you want to display it?
20:53 <erisco> it was designed to cooperate with specifications like Open Graph (or whatever it is called again, can't remember)
20:53 <EvanR> i guess you can wrap it all in a Time -> a
20:53 <erisco> or JSON-LD or something
20:54 <EvanR> but youd have to start over from scratch from each frame
20:54 jer1 joined
20:54 <EvanR> jle`: next time reduce would do anything (the minimum "after" time)
20:54 <erisco> so all queries were guaranteed to be semantically valid if they type checked
20:54 <jle`> ah
20:55 <jle`> what is reduce? successive elapsing?
20:55 <erisco> but the problem was that adding some capabilities to this were actually quite difficult
20:55 <EvanR> no
20:55 <erisco> for example, a requirement comes in that we have to be able to order results by multiple columns
20:55 <EvanR> there are reduction rules for things under a Parallel
20:55 <erisco> well now I have to redesign this part of the language plus the compiler for it
20:55 <EvanR> ..., Split _ x y, ... becomes ..., x, y, ...
20:56 <EvanR> recursively (if x or y then satisfied more rules)
20:56 <erisco> and now I'm competing for time against the solution of just using strings
20:56 <erisco> SQL strings or something
20:56 MP2E joined
20:56 takle joined
20:57 <erisco> this is the frustration
20:57 dcoutts_ joined
20:57 <Tuplanolla> "Your design, erisco? You mean our intellectual property."
20:57 <EvanR> the interpretation of an Animation would indeed be (Time -> a, [(Time, Output)]) but i cant practically use that in the final product
20:58 <jle`> is reducing just grabbing all of the things that are fired?
20:58 <EvanR> thats part of it
20:58 <erisco> Tuplanolla, heh, well I suppose that code is forfeit but the idea can't be copyrighted
20:58 <Tuplanolla> Yet.
20:58 <EvanR> its also flatting trees of Split and culling Expireds
20:58 dcoutts joined
21:00 <jle`> ignoring reduce, you could have data Animation a = Animation a (AddInf Delta) (Delta -> Animation a), i believe
21:00 <EvanR> are you suggesting church encode for performance?
21:00 <mivael_> hello all! Could anyone give me a hint on ghc profiling? main's individual %time is 93.5, but how to find out what are those 93.5% consist of? All components of 'main' (except maybe (.) and ($) functions) are present in the *.prof file and show very little time: http://lpaste.net/7402310821088329728
21:00 <jle`> the first field is the result of applying view, the second field is the result of applying next, and the third is a result of applying elapse
21:01 <erisco> one day maybe I'll get it into Haskell but I haven't had a reason to interface with such things myself
21:01 <jle`> EvanR: the suggestion was more for simplicity
21:01 <EvanR> next wouldnt be much use without being able to reduce, because once you get there elapse wont work anymore until you do
21:01 flobberlet joined
21:01 <erisco> it is something that Facebook and Netflix (was it?) started figuring out
21:01 <erisco> that, hey, all this data we have can be represented as a graph, and we can query it
21:01 <EvanR> at least if i fix the code here
21:01 <erisco> so why don't we start designing our web APIs this way
21:01 pie_ joined
21:02 <erisco> and W3 is slapping their foreheads, but whatever
21:02 <sproingie> graphql is kind of along those lines
21:02 newhoggy joined
21:02 ali_bush joined
21:02 ali_bush joined
21:02 <erisco> yeah that is what I mean, GraphQL, not Open Graph, lol
21:02 <sproingie> one size really doesn't fit all
21:03 <erisco> well that explains why you have a dozen formats
21:03 <sproingie> graphql is great if all your data fits into JSON and your queries are all more or less QBE
21:04 Swizec joined
21:04 <erisco> I don't like a lot of things in GraphQL but buried in it is the simple idea of graphs, and that is all I'm after
21:05 <erisco> so you have your domain objects, like Person, Product, Article, and so on, and relationships between them, and there is your graph
21:05 danthemy_ joined
21:05 <erisco> give me the Persons that look like this and give me the Articles they author (the relationship) that look like that
21:05 <EvanR> jle`: in my imagination, i saw an animated version of the expression tree, like Time -> Animation a that periodically committed outputs to a history list. sort of abstract operational semantics
21:05 javjarfer joined
21:05 <erisco> this was all I was interested in doing
21:05 <EvanR> and viewing the final a in time was kind of an after thought
21:06 <EvanR> i mean, the point was to easily construct the animations mostly
21:06 <jle`> EvanR: in theory you could always just store the results of each function on each constructor, instead of the constructor, i believe
21:06 <jle`> this lets you construct them just as easily
21:06 <EvanR> yes church encode
21:06 Swizec joined
21:06 <jle`> instead of 'Pure'/'Parallel' being concrete, they're just abstract constructors now
21:06 <Myrl-saki> TIL, GraphQL.
21:06 <EvanR> im not sure if my brain could handle implementing the algorithms that way though
21:06 <jle`> you could even make them Pattern Synonyms
21:07 <jle`> the types would all be the same
21:07 <EvanR> huh
21:07 <jle`> before, you had Pure :: a -> Animation a
21:07 <jle`> in the abstract version, you'd have pure x = Animation x Inf (\_ -> pure x)
21:07 <jle`> same type :)
21:07 <EvanR> the implementing doesnt seem simpler
21:08 <EvanR> its like the make separate objects for each case of a switch, or just write a switch
21:08 <jle`> it's just sort moving the burden of implementation from the implementation of elapse/reduce/next to the construction of your patterns
21:08 <erisco> when designing the language it is about how you model these objects, the relationships, the constraints, and the ways they fit together
21:09 <erisco> and I found a nice inductive way to do it
21:09 <EvanR> jle`: yes any GADT can be destroyed this way and you get a performance boost, as i understand it
21:09 <erisco> where you start with an empty query and work towards a root object
21:09 mmachenry joined
21:09 mivael_ joined
21:09 dbmikus joined
21:10 mivael__ joined
21:10 <erisco> and iirc it is a category with initial and terminal objects but I'm not so versed in CT so that's about all I can say
21:10 <jle`> EvanR: it's sort of like State s a = State (s -> (a, s)) vs. State s a where Get :: State s s; Put :: s -> State s (); Pure :: a -> State s a; Bind :: ..., etc.
21:10 DocWinter joined
21:10 <EvanR> i can sort of see how the source code would look after doing that, and you think its better?
21:11 <EvanR> there would be no cases
21:11 <jle`> i think the data type itself is simpler
21:11 <* EvanR> boggles
21:11 blocky joined
21:11 <jle`> although i suppose that's a matter of taste too
21:11 BytesAndCoffee joined
21:11 <EvanR> how much simpler than a GADT AST could you get
21:12 <jle`> the advantage of making a big GADT like you have there, to me, is that you can deconstruct it and inspect it
21:12 <EvanR> i think what youre saying is its more theoretically pure, youre defining the type in terms of its universal properties
21:12 <BytesAndCoffee> what's the best YCM-like vim plugin for haskell dev?
21:12 <jle`> EvanR: what i wrote, data Animation a = Animation a (AddInf Delta) (a -> Animation a)
21:12 Gentilhomme joined
21:12 darlan joined
21:12 <jle`> * Delta -> Animation a
21:12 <EvanR> thats not really enough but yeah
21:12 <BytesAndCoffee> i love jedi/YCM for Python, and im wanting to get into Haskell
21:13 <erisco> I think denormalising is also a perf trick in Haskell, right, so there may be that
21:13 newhoggy joined
21:13 <sproingie> Animation a -> (a -> Animation b) -> Animation b
21:13 <sproingie> hmmmmm
21:13 <jle`> if you really wanted performance, there's another step you can do, as well
21:13 <EvanR> yep not sure if its the most theoreticaly, or even necessary
21:13 <EvanR> theoretical
21:14 <EvanR> sproingie: that canna be done keptin
21:14 <erisco> I spent a long time adding function predicates to Data.Set
21:15 <erisco> I have a way to do it with just one form, but I can also denormalise to something like 3 forms
21:15 <BytesAndCoffee> anyone?
21:15 <erisco> I haven't published it yet because I haven't run the benchmarks to see what the difference is
21:15 tathougies joined
21:16 <sproingie> ghc-mod seems popular for vimsters. intero also has a vim frontend.
21:16 <erisco> also there is variation where you just add complement Data.Set
21:16 <erisco> and I haven't worked out how to best organise these options
21:16 <EvanR> jle`: also called tagless final, i think
21:16 <erisco> other than just completely separate modules
21:17 moth joined
21:17 <EvanR> complement of Data.Set
21:17 <EvanR> crazy talk
21:17 <erisco> I'm insane then :P
21:19 <erisco> odds = complement (isEven `intersection` integers) I made that possible
21:20 <erisco> well, I think I did it like withCharacter isEven to form the set, rather than an overloaded (type classed) intersection function, but whatever
21:20 coot____ joined
21:21 <erisco> and there is a naive way to implement this but I spent time working out how to optimise on-the-fly
21:21 lambdama_ joined
21:21 wherwe332 joined
21:22 <erisco> so determining if a number is in odds is actually just as efficient as Set.member in this case
21:23 <EvanR> its even more efficient
21:23 <EvanR> (==0) . (`mod` 2) ;)
21:23 <EvanR> er
21:23 <EvanR> (==1) . (`mod` 2)
21:23 {emptyset} joined
21:23 <erisco> well, could be, but it doesn't know any number theory... it just knows about sets
21:24 rkazak joined
21:24 bjz joined
21:24 <erisco> so integers is a set of things and withCharacter isEven is a set of things and so on
21:25 <erisco> the challenge was finding the form that remains closed
21:25 jer1 joined
21:25 <erisco> or one such form, as obviously there are equivalents
21:25 JeanCarloMachado joined
21:26 yellowj joined
21:26 lambdaman joined
21:26 JeanCarloMachado joined
21:26 <erisco> then the benchmarking is determining whether just using the general form is better or if it is worth having the specialisations of it that I do
21:27 biglambda joined
21:27 bodisiw joined
21:27 <erisco> since I didn't go with the naive implementation to begin with, this whole exercise has to be about performance, and that is why it matters
21:27 gawen joined
21:28 <EvanR> high performance at any cost, high cost at any performance
21:29 jleon joined
21:29 ryxai joined
21:30 newhoggy joined
21:31 <erisco> and if I wanted to be scientific I'd also have to implement and bench the naive one...
21:31 augur joined
21:31 <erisco> which is why after finally working it all out and facing this remaining boring work I said "meh"
21:31 lambdaman joined
21:32 coot____ joined
21:32 oisdk joined
21:33 Itkovian joined
21:33 newhoggy joined
21:36 newhoggy joined
21:37 MarcelineVQ joined
21:38 zereraz joined
21:39 Hunter1 joined
21:39 <zereraz> hi could someone tell me why the code does not wait 5 seconds and then stop http://lpaste.net/355011
21:39 <zereraz> also is that a good way to run a timer with IO ?
21:39 boj joined
21:39 PennyNeko joined
21:40 <EvanR> because the program ends immediately
21:40 <erisco> going to guess it is because you don't wait for the thread to complete
21:40 <EvanR> your main action is over with before the other thread even gets started sleeping
21:41 <EvanR> when the main thread ends, the whole program ends
21:41 <EvanR> if you use the async library, you can spawn a thread and wait for it to finish (or crash) before continuing
21:42 <sproingie> thing is, the threads actually seem to run on top of each other
21:42 <sproingie> that's the result i get
21:42 <EvanR> that also happens
21:42 <EvanR> since they both print
21:42 yellowj joined
21:43 <EvanR> unrelated to how long the program runs for
21:43 lambdaman joined
21:43 <erisco> so what we want to do is step back and think about a general expression of concurrent computations
21:43 NoCreativity joined
21:43 <EvanR> pi calculus anyone
21:43 <EvanR> anyone
21:43 jer1 joined
21:43 <erisco> yes, actually, but don't expect me to recite it
21:43 <sproingie> oh i see where the two are overwriting
21:43 <thang1> Hmm...
21:43 <thang1> https://mail.haskell.org/pipermail/haskell-cafe/2017-April/126903.html
21:43 <thang1> What does "Strong knowledge of haskell programming language fundamentals" mean here?
21:43 darjeeling_ joined
21:43 <sproingie> didn't see the putStrLn at the end
21:44 <lyxia> zereraz: the main thread does not wait for its children to terminate
21:44 <EvanR> sproingie: its really funny to me that the threads are interleaved so fast
21:44 <EvanR> but there you have it
21:45 <EvanR> at least the output is serialized somehow, and not "half 'W' half '3' in position 0"
21:45 <erisco> thang1, well we obviously cannot know what the author intended, so are you just asking what we consider as fundamental knowledge?
21:45 bodisiw joined
21:45 <sproingie> EvanR: it makes me wonder how efficient putStrLn is, honestly
21:45 oish joined
21:45 <EvanR> @src putStrLn
21:45 <lambdabot> putStrLn s = do putStr s; putChar '\n'
21:45 <EvanR> @src putStr
21:45 <lambdabot> putStr s = hPutStr stdout s
21:45 <thang1> erisco: yeah, sorry. Should've worded that a little better.
21:46 <thang1> Chris isn't on the irc (I don't think) so I can't just ask directly. However, I'm just curious what sort of level "fundamental knowledge" is considerd at.
21:46 <EvanR> sproingie: for each Char, it evaluates to WHNF (NF) so it can get the next char to output, then it encodes into UTF-8 (or something), then does the actual write in the IO manager
21:46 <sproingie> so yeah, nothing like "shove this whole line into stdio buf"
21:46 <EvanR> String is really not fabulous
21:47 <sproingie> but hey, i'll take the nice thread scheduler any day
21:48 JeanCarl1Machado joined
21:48 <erisco> thang1, then the other implicit I get is that maybe you are not sure if you're strong enough with Haskell
21:48 bodisjw joined
21:49 <sproingie> thang1: i'd say at minimum you grok all the stuff in LYAH
21:49 <erisco> thang1, have you read through a Haskell book or completed several Haskell exercises?
21:49 JeanCarloMachado joined
21:49 <sproingie> the rest depends on how quick you learn
21:49 <sproingie> this being the sort of thing interviews are for
21:49 <sproingie> (ostensibly)
21:50 <erisco> if I asked you to, for example, write a function which found the mode of a list, could you do that?
21:50 MarioBranco joined
21:51 JeanCarloMachado joined
21:51 <* sproingie> would have to google 'mode' to remember which that was
21:51 fizbin joined
21:51 <erisco> "most occurring"
21:51 modal joined
21:52 rkazak joined
21:52 <erisco> you need to be able to write basic algorithms such as that at a minimum
21:53 hiratara joined
21:53 <erisco> then because it is particular to Haskell and not just FP generally I'd expect them to want to familiar with type classes and particularly Functor, Applicative, Monad
21:54 sssilver joined
21:54 <erisco> and then flesh this out with familiarity with the common data structures
21:55 <erisco> so unit, Maybe, Either, [], Set, Map
21:55 moth joined
21:56 peterbec` joined
21:56 <erisco> then you've got enough to sit down and write lots of programs
21:56 Gurkenglas joined
21:56 <erisco> and in many years you might write them really well too. I'm still working on it :P
21:57 sssilver joined
21:57 Noldorin joined
21:57 <erisco> oh, also tuples, can't forget those
21:57 <EvanR> or write few programs badly that make you tons of money
21:57 <EvanR> one of the two
21:58 indi_ joined
21:58 newhoggy joined
21:58 augur joined
21:58 JeanCarloMachado joined
21:59 dm3 joined
21:59 leat joined
21:59 <thang1> I'm currently on chapter 11 (almost 12) of the first principles book. I plan to be done with the book around the beginning of June
22:00 <erisco> this sounds like a bernalex project
22:01 <thang1> I am questioning whether or not I'm strong enough in Haskell, but I'm also wondering what more advanced people consider, reflexively, "fundamentals" when there are job postings or blog articles that start with (eg) "so let's assume a good grasp of the fundamentals"
22:01 <Zemyla> 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
22:01 <erisco> "You will be the team's expert on computer programming
22:01 <erisco> and the Haskell programming language."
22:01 <sproingie> that's a lotta nothing
22:02 <erisco> or a lot of something on certain architectures
22:02 <thang1> Exactly why I was wondering :p
22:02 <hexagoxel> Zemyla: your message got cut off near "0000" :D
22:02 <erisco> well it is weird of them to say that and then go into "fundamentals"
22:02 <thang1> I've seen "you're the team expert" be anything from "script kiddy" to "a PhD is a nice start"
22:02 Denthir joined
22:03 aib joined
22:03 peterbecich joined
22:03 <mniip> thang1, no one is strong enough in haskell :D
22:03 indi_ joined
22:03 <erisco> well here is what I gather from their project, in a quick glance
22:04 binaryplease joined
22:04 <erisco> they have some mathy ideas that they want to translate into Haskell for purposes of teaching
22:04 <sproingie> i'd say quick learning and effective knowledge transfer ability would be critical
22:04 <mniip> oh
22:04 <mniip> there is a specific context
22:04 <* mniip> shuts
22:04 burtons joined
22:04 <erisco> now this is ages 11-14, so I don't expect it to include complicated numerical methods and matrix transformations and so on
22:04 <thang1> sproingie: that's my strong point. Math, theory, and explaining technal things to people
22:05 jer1 joined
22:05 <sproingie> math and cs background are gravy
22:05 <mniip> IMO curry-howard is the best thing since sliced bread
22:05 <thang1> My entire family is filled with teachers and my mom has a masters in special ed && English teaching. So, I've been exposed to all of that my entire life.
22:05 <mniip> and is the most fundamental piece of logic ever
22:05 <mniip> but
22:05 <mniip> it's so impossibly hard to explain
22:05 <erisco> so if you can take problems appropriate to ages 11-14 (and don't underestimate how smart these kids can be) and implement them in Haskell then I think you're good to go
22:05 <erisco> so, that would be very much a problem like "find the mode of a list"
22:06 <thang1> Right, sounds good to me.
22:06 <sproingie> mniip: and thus eludes the rest whom it hasn't been explained to
22:06 isenmann joined
22:06 <erisco> though if these kids have never programmed before it would be even more basic problems, I imagine
22:06 <erisco> the intro to FP I took in uni was incredibly basic
22:06 <mniip> sproingie, I see people struggling with writing proofs all around me
22:06 <sproingie> i get the idea of CH, i just don't know the deeper implications
22:06 <erisco> where advanced functions were things like groupBy
22:06 <mniip> I'm like,
22:06 <mniip> man this is modus ponens
22:07 <thang1> mniip: my formal logic class last quarter was fucking brutal for that reason
22:07 <mniip> like
22:07 lambdama_ joined
22:07 <thang1> I saw the teacher just spend like 20 minutes with one guy during class once just trying to get him to understand why he couldn't do something
22:07 <mniip> 90% of the people can't reproduce the 'lim of sum = sum of lim' proof
22:07 <thang1> and it was... /super/ basic stuff we went over week 1 of class (this was two weeks before finals)
22:08 biglama joined
22:08 <mniip> and with CH it's trivial,
22:08 <erisco> I never heard of it, so I'm in the 90% :P
22:08 <mniip> you abstract over eps, and apply givens to eps/2
22:08 bodisiw joined
22:08 takle joined
22:08 <monochrom> lim of anything is actually very hard. Because you're looking at forall-exist-forall. Three levels of alternating quantifiers. Already hard for computers, so nevermind humans.
22:08 <sproingie> yep, ya lost me
22:09 <erisco> yeah, if Siri can't do it then may as well not even bother
22:09 <monochrom> But yeah if modus ponens poses an obstacle too, then we do have too much lead in our water.
22:09 <sproingie> i'd say there's clearer evidence than that
22:09 <mniip> erisco, forall sequences a_n, b_n, (lim a_n = A /\ lim b_n = B) => lim (a_n + b_n) = A + B
22:09 <monochrom> haha
22:10 <monochrom> And the pumping lemmas are yet one level more.
22:10 <erisco> mniip, I intuited as much, but then I don't know the theory of limits and sums
22:10 mikeizbicki joined
22:10 <mniip> monochrom, oh god
22:11 <thang1> Well I'll put it this way, to study for my midterm in formal logic I skipped every single homework assignment, then blindly wrote down proof solutions from the back of the book to see how things fit together. After about 4-5 proofs I understood everything, after 7 I was writing them without checking any solution, and after about 10 I was doing them instantly in my head
22:11 <erisco> I know they gave lots of problems in school and I tried to memorise them but after the exams I jettisoned it all
22:11 <mniip> pumping lemma
22:11 joe9 joined
22:11 <thang1> pumping lemma is great. We're doing that in class right now (well, just finished it)
22:11 <mniip> I think our lecturer just gave up and said "imagine you're playing a game"
22:11 <erisco> mniip, or does lim even stand for limit? that is something else isn't it
22:11 <erisco> see, I haven't a clue
22:11 <EvanR> "the only way to win is not to play"
22:11 <monochrom> YES! I feel that the game semantics is best for explaining alternating quantifiers.
22:11 <thang1> erisco: lim == limit but less typing
22:12 <mniip> monochrom, I guess,
22:12 <mniip> but mentally I'm like... this is trivial
22:12 <monochrom> http://www.vex.net/~trebla/weblog/any-all-some.html
22:12 <mniip> about as trivial as \f g x -> f x (g x)
22:12 <erisco> what is a limit of a series, even?
22:12 <thang1> Now we're on Myhill-Nerode theorem :p
22:13 <erisco> sequence, I mean
22:13 NextHendrix joined
22:13 zereraz joined
22:13 sbrg_ joined
22:13 _Adluc_ joined
22:13 <erisco> mniip, S! I know one
22:13 mehs_ joined
22:13 malthe_ joined
22:13 <mniip> erisco, definition: given a sequence a_n, lim a_n = A <=> forall eps > 0. exists N. forall n > N. |a_n - A| < eps
22:13 <thang1> A limit of anything is the behavior of it as it approaches your asymptote bound
22:13 <niez> erisco, mode of a list: http://lpaste.net/355012 (how ugly is that? :))
22:14 <monochrom> haha niez
22:14 Vbitz joined
22:14 lispy joined
22:14 OliPicard_ joined
22:14 jlouis joined
22:14 anhduy- joined
22:14 maerwald_ joined
22:14 jol joined
22:14 govg joined
22:14 zomg joined
22:14 <mniip> :t head . last . sortOn length . group . sort
22:14 <lambdabot> Ord c => [c] -> c
22:14 Quintasan_ joined
22:14 <monochrom> I think you can eliminate reverse by sorting in decreasing order to begin with
22:14 Saizan joined
22:14 <mniip> ha
22:14 Jaxan_ joined
22:15 ByronJoh1son joined
22:15 <mniip> almost the same as mine
22:15 BrAsS_mOnKeY joined
22:15 carter-znc joined
22:15 seequ joined
22:16 codesoup joined
22:16 <erisco> niez, that shows good competency actually because you are seeking to solve the problem with existing definitions
22:16 newhoggy joined
22:16 reptar_ joined
22:16 <erisco> whereas a more beginner approach is to write more things as explicit recursion
22:16 <monochrom> Yeah, my comment is not a criticism.
22:17 kwantam joined
22:17 <erisco> well I would have said the same thing monochrom, but you said it first :P
22:17 tolt joined
22:17 joehillen joined
22:17 \u joined
22:17 \u joined
22:17 <mniip> ouch
22:17 rdococ joined
22:17 wjm joined
22:17 simony joined
22:17 simony joined
22:17 dtulig joined
22:17 benoliver999_ joined
22:17 Benzi-Junior joined
22:17 <niez> ah, so it's not so bad, glad to hear that :)
22:17 ninja_in_neopren joined
22:17 statusfailed joined
22:17 <thang1> > head . maximumBy (comparing length) .group .sort $ [1,2,3,4,2,2,2,1,2]
22:17 <lambdabot> 2
22:17 chu joined
22:17 discrttm joined
22:18 flebron joined
22:18 <thang1> (shamlessly stolen from stackexchange)
22:18 bcoppens joined
22:18 bcoppens joined
22:18 canta joined
22:18 nopf joined
22:18 lachenmayer joined
22:18 cgfbee joined
22:18 lambdaman joined
22:18 Twey joined
22:18 scopedTV joined
22:18 Xe` joined
22:18 emmflo joined
22:18 hanDerPeder joined
22:19 domenkozar joined
22:19 nikolah joined
22:19 Ornedan joined
22:19 geekosaur joined
22:19 g4k joined
22:19 ertes joined
22:19 soniku joined
22:19 coot____ joined
22:19 halogenandtoast joined
22:19 scav joined
22:19 nshepperd1 joined
22:19 emily1 joined
22:20 ChongLi joined
22:20 d3lxa joined
22:20 kshannon joined
22:20 yrid joined
22:20 RevJohnnyHealey joined
22:21 ahf joined
22:21 mikedlr joined
22:21 TabAtkins joined
22:21 angerman joined
22:21 cdornan joined
22:21 lieven joined
22:21 PotatoGim joined
22:21 raibutera joined
22:21 julmac joined
22:21 <erisco> I was thinking of a different solution that counted elements
22:21 sdemos joined
22:21 mystfox joined
22:21 Tallenz joined
22:21 <erisco> well, yours of course does that by finding the group length, but I wasn't going to sort
22:21 moneytree joined
22:22 Bengi joined
22:22 JSharp joined
22:22 dwarders joined
22:22 bgyss joined
22:22 glitch_hat joined
22:22 <erisco> always nice to see alternatives
22:22 cmn joined
22:22 justanotheruser joined
22:23 <sproingie> i was trying to think of a one-liner way to do it in one pass too
22:23 tomus joined
22:23 qlkzy joined
22:23 SolarAquarion joined
22:24 <mniip> :t foldr (M.insertWith (+) 1) M.empty
22:24 <lambdabot> (Num k, Num a, Ord k, Foldable t) => t a -> M.Map k a
22:24 supki joined
22:24 barrucadu joined
22:24 Koterpillar joined
22:24 <erisco> even more concise, nice
22:24 rightfold left
22:25 <erisco> I was starting with unionsWith (+) . fmap (flip Map.singleton 1)
22:25 <mniip> it's not complete
22:25 <mniip> you need to find the key of the max element in that map
22:25 jleon joined
22:25 <erisco> I know
22:25 <mniip> it is faster though I believe
22:25 <erisco> I am browsing for what in Data.Map will let me do that :P
22:25 jer1 joined
22:26 jml joined
22:26 <mniip> M.foldrWithKey
22:26 etrepum joined
22:26 monad_cat joined
22:26 ericbmerritt_ joined
22:26 georgew joined
22:26 <mniip> M.foldrWithKey (\k x (l, y) -> if x > y then (k, x) else (l, y))
22:27 {AS} joined
22:27 <erisco> was hoping for something more direct so I didn't end up with that
22:27 <erisco> I'd have to at least figure out a pointfree version and that'd be a pain
22:27 blender3 joined
22:27 Swizec joined
22:27 <thang1> Isn't foldr is theoretically less ideal due to intrinsic inability to be parallelized (it forces a notion of linear consumption where there doesn't need to be one)? but eh, splitting hairs and Haskell's compiler doesn't do a whole lot of parallel anyway :p
22:27 <mniip> maximumBy snd . M.toAscList .
22:28 Swizec joined
22:28 <mniip> thang1, you have a data dependency on the map
22:28 ocharles joined
22:28 georgew joined
22:28 dedicated joined
22:29 <erisco> mniip, but that is ascending by key
22:29 <mniip> yes
22:29 Swizec joined
22:29 <mniip> it fuses though
22:29 <mniip> with maximumBy
22:29 <erisco> and what is different with just M.toList?
22:30 Swizec joined
22:30 <mniip> stupid me
22:30 <mniip> :t maximum
22:30 <lambdabot> (Ord a, Foldable t) => t a -> a
22:30 LordBrain joined
22:30 <mniip> it's foldable!
22:30 Swizec joined
22:30 <mniip> no wait, damn, we need the key
22:31 hiratara joined
22:31 <erisco> yeah that is part of the pain
22:31 uglyfigurine joined
22:31 <erisco> so after the maximumBy we still have to project fst
22:32 <thang1> So you don't really gain anything at that point, correct?/
22:32 <LordBrain> anyone here working on a jitted language?
22:32 <mniip> erisco, hmm
22:33 <mniip> (\k x (l, y) -> if x > y then (k, x) else (l, y))
22:33 <mniip> (\k x (y, l) -> if x > y then (x, k) else (y, l))
22:33 <mniip> (\k x (y, l) -> max (x, k) (y, l))
22:33 Swizec joined
22:33 Denthir joined
22:33 <erisco> > fst . maximumBy (comparing snd) . Map.toList . unionsWith (+) . fmap (flip Map.singleton 1) $ [3,6,2,4,2,2,9,6]
22:34 <lambdabot> error:
22:34 <lambdabot> Not in scope: ‘Map.toList’
22:34 <lambdabot> Perhaps you meant one of these:
22:34 gehmehgeh joined
22:34 sampuka_ joined
22:34 replay joined
22:34 <erisco> > fst . maximumBy (comparing snd) . M.toList . unionsWith (+) . fmap (flip M.singleton 1) $ [3,6,2,4,2,2,9,6]
22:34 <lambdabot> error:
22:34 <lambdabot> • Variable not in scope:
22:34 <lambdabot> unionsWith
22:34 <thang1> lol
22:34 ryxai joined
22:34 <erisco> ugh, well you get it, modulo mniip's variations
22:34 <mniip> :t M.foldrWithKey (\k x -> max (x, k)) (0, undefined) . foldr (M.insertWith (+) 1) M.empty
22:34 <lambdabot> (Num t, Num t1, Foldable t2, Ord t, Ord t1) => t2 t1 -> (t1, t)
22:34 <NextHendrix> @type (.) . (.)
22:34 <lambdabot> (b -> c) -> (a1 -> a -> b) -> a1 -> a -> c
22:34 <mniip> @let mode = M.foldrWithKey (\k x -> max (x, k)) (0, undefined) . foldr (M.insertWith (+) 1) M.empty
22:35 <lambdabot> Defined.
22:35 <NextHendrix> D:
22:35 <thang1> @type (.) . (.) -- heh boobies
22:35 <lambdabot> (b -> c) -> (a1 -> a -> b) -> a1 -> a -> c
22:35 <mniip> > mode [1,2,2,2,4,4]
22:35 <lambdabot> error:
22:35 <lambdabot> Ambiguous occurrence ‘mode’
22:35 <lambdabot> It could refer to either ‘Text.PrettyPrint.HughesPJ.mode’,
22:35 xacktm joined
22:35 <mniip> > L.mode [1,2,2,2,4,4]
22:35 <lambdabot> (15,1)
22:35 <mniip> hmm
22:35 <mniip> that's a bit wrong
22:35 <erisco> I'm a bit unhappy when I read undefined in the definition
22:35 <fragamus> I have a question about pipes and the >~> operator
22:35 <fragamus> https://gist.github.com/fragamus/3cc5ab02a9ea89c42111ed7069d7e53b
22:36 coot____ joined
22:36 <mniip> erisco, the overall function is partial
22:36 <mniip> mode [] = ?
22:36 <erisco> I know, but that doesn't mean we should proceed with abandon
22:36 <fragamus> Why is the first yield directed to the function argument and the remaining yields are directed to the await function?
22:37 <mniip> @undef
22:37 <lambdabot> Undefined.
22:37 <mniip> @let mode' = M.foldrWithKey (\k x -> max (x, k)) (0, undefined) . foldr (flip (M.insertWith (+)) 1) M.empty
22:37 <lambdabot> Defined.
22:37 <mniip> > mode' [1,2,2,2,4,4]
22:37 <lambdabot> (3,2)
22:37 <mniip> yeah
22:37 yellowcab joined
22:37 <mniip> > mode' ["hi","moo","hi","hi"] :: (Double, String)
22:37 <lambdabot> (3.0,"hi")
22:38 <thang1> nice
22:40 <erisco> I guess we don't get a foldr1 variant from Data.Map
22:40 <mniip> foldr1 wouldn't work
22:40 <erisco> why is that?
22:41 cheshircat joined
22:41 ridho joined
22:41 splanch joined
22:42 <erisco> > foldr1 max [1..10]
22:42 <lambdabot> 10
22:42 beanbagula joined
22:42 <mniip> look at the folding function closely
22:42 texasmynsted joined
22:43 <thang1> http://stackoverflow.com/questions/13782185/haskell-foldr-vs-foldr1
22:43 Swizec joined
22:43 uglyfigurine joined
22:43 <erisco> mniip, I am not sure what you mean
22:44 Swizec joined
22:45 Swizec joined
22:45 <erisco> I expect foldr1WithKey :: ((k, a) -> (k, a) -> (k, a)) -> Map k a -> a modulo some currying
22:45 <mniip> ah
22:45 <mniip> well, we don't need the a
22:45 jleon joined
22:45 sleffy joined
22:46 <mniip> we need the k
22:46 Swizec joined
22:46 <erisco> the return type should have been (k, a)
22:46 orhan89 joined
22:46 dedicated joined
22:46 Swizec joined
22:47 peterbecich joined
22:47 <erisco> the other way to get this is simple
22:47 <erisco> :t foldr1 max . M.toList
22:47 jer1 joined
22:47 <lambdabot> (Ord a, Ord k) => M.Map k a -> (k, a)
22:47 mda1 joined
22:47 <thang1> oooh
22:47 Swizec joined
22:47 halogenandtoast joined
22:48 cyborg-one joined
22:49 umib0zu joined
22:49 mmn80 joined
22:50 <erisco> though we have to swap the tuples, like you did mniip
22:50 <Zemyla> Is there a monad that's both a MonadFix and a MonadCont?
22:51 newhoggy joined
22:52 <erisco> :t swap
22:52 <lambdabot> (a, b) -> (b, a)
22:52 coot____ joined
22:53 <monochrom> Zemyla: I think not. I also think someone proved that it can't be done.
22:54 peterbecich joined
22:55 <erisco> we can do that with (swap ~> swap ~> swap) max with ~> from TypeCompose
22:57 e14 joined
22:57 thisisanickname joined
22:58 dbmikus joined
23:00 <erisco> also, just as a style note, it is sensible to define a function counts :: (Ord a, Num b) => [a] -> Map a b
23:01 <Zemyla> monochrom: Would this not be a conforming instance? instance MonadIO m => MonadFix (ContT r m) where mfix f = ContT $ \c -> do { (mv, a) <- liftIO $ do { mv <- newEmptyMVar; a <- unsafeInterleaveIO $ readMVar mv; return (mv, a) }; runContT (f a) (\b -> liftIO (tryPutMVar mv b) >> c b)
23:01 <erisco> or possibly eliminate the Map, but I am hesitant to make early reductions
23:01 <robkennedy> How close is the odd function to `odd n = 0 == countTrailingZeros n`?
23:02 <thang1> ಠ_ಠ
23:02 Krymise joined
23:02 <erisco> I don't understand what you wrote there robkennedy
23:03 beanbagula joined
23:03 blocky joined
23:03 <erisco> oh, I get it now, okay
23:03 <thang1> "How closely does the odd function's behavior mirror that of a theoretical function "foo n = 0 == countTrailingzeroes n"
23:03 <thang1> https://codereview.stackexchange.com/a/161606 look at this mess
23:04 <erisco> well it isn't that at all because look at the type
23:04 safe joined
23:04 <erisco> it isn't defined on bit fields, it is defined on all Integrals
23:04 <robkennedy> Yeah, Integral and Bits have nothing in common
23:04 Younder joined
23:04 Fairy joined
23:05 otulp joined
23:05 <erisco> if it were a bit field then we just need to check the smallest bit, yes? why count any more than that?
23:05 bodisiw joined
23:05 <robkennedy> Oh yeah I guess testBit 0 is better than what I wrote >.>
23:06 jleon joined
23:06 <erisco> now I think with GHC you can define special implementations for particular types
23:06 <erisco> but I haven't experience with the GHC performance kung fu
23:07 <c_wraith> yeah, rewrite rules can be triggered by types.
23:07 <sproingie> i imagine "n & 1 == 0" is as fast as it gets on most architectures
23:07 coot____ joined
23:07 jer1 joined
23:07 indi_ joined
23:07 <robkennedy> But the thrust of my question is: how much low level engineering lies behind our core functions? For instance, I've determined that Sets of ADTs with less than 64 constructors don't seem to be represented as sets.
23:07 <robkennedy> *represented as Words
23:08 <sproingie> whether ghc gets it to that, dunno
23:08 sssilver joined
23:08 <thang1> oooh you're asking about some pretty black magic tbh
23:08 <thang1> maybe check the ghc developer mailing list and the ghc trac?
23:08 <erisco> http://hackage.haskell.org/package/base-4.9.1.0/docs/src/GHC.Real.html#odd
23:08 <Zemyla> robkennedy: I think actually you could write a function bToInteger :: Bits a => a -> Integer, just by repeatedly testing and consuming the lowest bit.
23:09 <erisco> I don't see any magic in there, but it could be added I'd think
23:10 <robkennedy> erisco: I didn't find anything for `x rem 2` in there.
23:11 <erisco> well it doesn't matter beyond that I don't think
23:11 <robkennedy> Okay, cool, I like doing this sort of thing, I'll see if something's on the trac
23:11 <erisco> there'd have to be a rule specifically for \x -> x rem 2 to do anything special here
23:12 <erisco> and there could be but I am not sure
23:13 coot____ joined
23:13 mjora7 joined
23:14 <sproingie> could be done as an optimization pass much lower (like in gcc or llvm)
23:14 <erisco> http://hackage.haskell.org/package/base-4.9.1.0/docs/src/GHC.Real.html search for "Integral Int"
23:14 <erisco> then you'll see, as well as on other instances, there is no special case for 2
23:14 <erisco> well, we get to here http://hackage.haskell.org/package/base-4.9.1.0/docs/src/GHC.Base.html#remInt
23:15 <erisco> which gets us to remInt# and beyond that I don't know
23:15 Welkin joined
23:15 <erisco> so maybe there is an internal optimisation for it
23:15 <erisco> (in fact that is highly likely)
23:18 newhoggy joined
23:19 <erisco> so I am guessing you'd see in the assembly a mask for the low bit and a compare to zero
23:19 polll joined
23:20 <erisco> or whatever clever instruction does all that and makes you breakfast at once
23:20 <polll> Hi. Does anyone know how to send a command to an Intero REPL in Emacs?
23:20 <* erisco> was wondering what a mmand was for a moment
23:21 crobbins joined
23:21 <thang1> hah
23:21 jleon joined
23:21 <sproingie> far as i know you can send the whole buffer to intero, not any specific part of it
23:23 <sproingie> just to interact with it, ctrl-c ctrl-z
23:23 lambda-11235 joined
23:25 jmcarthur joined
23:27 JeanCarloMachado joined
23:27 jer1 joined
23:28 baldrick joined
23:29 <polll> Hmm, I'm surprised that feature doesn't exist. Time to dig into the elisp I guess. Thanks anyways.
23:29 <sproingie> as a worker, i turn problems into solutions. i have coworkers.
23:29 <thang1> lol
23:29 <thang1> coworkers turn solutions into problems, right?
23:29 <robkennedy> Ericso: Thanks for hunting that all the way to remInt
23:29 <Koterpillar> is solution a coproblem?
23:30 cschneid_ joined
23:30 <EvanR> :t remInt
23:30 <lambdabot> error:
23:30 <lambdabot> • Variable not in scope: remInt
23:30 <lambdabot> • Perhaps you meant one of these:
23:30 bananagram joined
23:31 augur joined
23:31 <sproingie> solutions would be the codomain of problems, yes
23:32 pandeiro joined
23:33 hkeylocal joined
23:33 <sproingie> https://yow.eventer.com/yow-2014-1222/stop-treading-water-learning-to-learn-by-edward-kmett-1750 -- skip to 6:20 for the joke
23:33 jleon joined
23:34 Qommand0r joined
23:34 beanbagula joined
23:35 e joined
23:35 <hkeylocal> decrypt bcrypt plss ???? $2a$08$Cf1f11ePArKlBJomM0F6a.xzfpEexCPc/xm.u/Tv/pK6K..cagbv.
23:35 <hkeylocal> $2a$08$Cf1f11ePArKlBJomM0F6a.YTE/dxTNZTTS/WFqp31Sk68Qm2j15EO
23:35 <EvanR> are you a b. o. t.
23:36 <sproingie> it reads "your mom was fun"
23:36 <thang1> https://github.com/ekmett/structs/blob/9ff2818f888aff4789b7a41077a674a10d15e6ee/src/Data/Struct/Internal.hs
23:36 augur joined
23:36 <thang1> goddamn this is some ugly shit. Yet, somehow not ugly. Yet, somehow terrifying
23:36 uglyfigurine joined
23:37 SCHAPiE joined
23:37 <sproingie> the commit message at top is hilarious in context
23:38 <thang1> "remove a bunch of language extensions"
23:38 subtlebot joined
23:38 <thang1> *first thing you see is 20 language extensions*
23:38 <erisco> I like it when you do a bunch of hairy ugly stuff on the inside but on the outside it looks great
23:39 <thang1> Like how in Linux, everything is a file
23:39 <hkeylocal> Does anyone know how to decrypt (bcrypt) ?? I pay !!
23:39 <sproingie> yeah that goes for more than haskell
23:39 <thang1> how the fuck they managed to make a CPU into a file I don't fucking know
23:39 <sproingie> hkeylocal: shoo
23:39 <thang1> but some genius wrote that horrifying nightmare to let me cat my CPU :p
23:39 <EvanR> no it should be gross and ugly on both sides, but the interface is nice
23:40 dfeuer joined
23:40 <sproingie> meh, you want "everything is a file" taken to extremes, try plan9
23:40 <dfeuer> Ping edwardk
23:40 <EvanR> "everything is a file" seems pretty silly
23:40 <erisco> when everyone is a file, no one is a file
23:40 <thang1> Which is the point
23:41 <thang1> When everything is a file, the pipe becomes a universal way to compose arbritrary programs and functions on the commandline
23:41 <EvanR> :|
23:41 augur joined
23:41 <EvanR> yes ByteString is so universal
23:41 <hkeylocal> Does anyone know how to decrypt (bcrypt) ?? I pay !! plsss
23:41 <erisco> it has all the allure of stringly typed programming
23:41 <thang1> code is data, data is code, everything is a file, nothing is a file, everything performs on text, text based tools work on everything, etc
23:41 <EvanR> that also explains how nice it is to write code in untyped lambda calculus
23:41 <kadoban> stringly typed programming, that's a nice one xD
23:42 <sproingie> hkeylocal: my rates start at a mere $10/hour. might take a few hours :)
23:42 jimmyrcom joined
23:42 <sproingie> figure that'll give me a modest side income
23:42 <thang1> pffh, hkeylocal, I'll do it for $50/hour
23:42 <subtlebot> seems like a low rate
23:42 <thang1> subtlebot: it's not a low rate if you do a bruteforce search for the password :p
23:43 <subtlebot> lol
23:43 <hkeylocal> sproingie??? i pay ! decrypt pls
23:43 <monochrom> Zemyla: I think maybe the unsafeInterleaveIO part is a bit unsettling. But apart from that I don't know.
23:43 <EvanR> can we not do cracking inhere
23:43 <sproingie> thang1: see, i'm undercutting you already. figure i could get a few such customers, and i won't have to run my radiator to heat the place
23:43 <thang1> sproingie: better buy some AMD GPUs
23:43 <sproingie> meh, i *am* being paid by the hour
23:44 <hkeylocal> bruteforce is password crypted bcrypt ?
23:44 zero_byte joined
23:44 <sproingie> don't want to stress my laptop i suppose
23:44 <EvanR> hkeylocal: do you have anything haskell related to ask
23:44 <sproingie> hkeylocal: brute force is what it'll take to educate you
23:44 <thang1> Yeah, but AMD gives off much more heat. Just buy like 10 GPUs and string them in a little serverfarm and you've got the whole house heated
23:45 <EvanR> so far seems like a bot, and has been doing this a few days
23:45 soniku joined
23:45 <* thang1> petitions to ban hkeylocal
23:45 <MarcelineVQ> not a bot, just unreasonably hopeful
23:45 <sproingie> any sufficiently advanced stupidity is indistinguishable from a bot
23:45 <thang1> ^
23:45 <sproingie> the co-Turing test
23:46 <monochrom> OK, I'll kick hkeylocal and see what happens. Anyone wants to veto?
23:46 <Zemyla> monochrom: Well, the same unsafeInterleaveIO is used in fixIO.
23:46 <monochrom> Also:
23:46 <monochrom> @remember sproingie any sufficiently advanced stupidity is indistinguishable from a bot
23:46 <lambdabot> It is stored.
23:46 <geekosaur> probably not a bot, just an idiot that thinks that IRC automatically is defined as skriptkiddie territory and can't possibly be anything at all else
23:47 <robkennedy> Is SL Peyton Jones just SPJ? (From his bibliography)
23:47 <sproingie> i'm not up with the blackhat community, but don't most scriptkiddies use tor sites now?
23:47 <hkeylocal> lol
23:47 <monochrom> Ah right Zemyla, OK so maybe it's the MonadIO constraint that makes one go "OK you can't do it more generally, you need one more assumption/restriction"
23:48 <hkeylocal> kick me ? because ?
23:48 <sproingie> robkennedy: what's the L?
23:48 hkeylocal left
23:48 <thang1> sproingie: yeah, the idiots do use sites. Anyone on the irc is hidden behind pretty hard to find servers because they don't wanna waste their time with morons
23:49 <thang1> thx, monochrom
23:49 <EvanR> thats an interesting kick
23:49 scared joined
23:49 <thang1> I didn't see the message, what was it?
23:49 <geekosaur> it's less than a kick
23:49 <geekosaur> [27 23:48:55] * hkeylocal (~hkeylocal@177.138.196.168) has left #haskell (requested by monochrom (hkeylocal))
23:49 <sproingie> yah me neither, i have parts filtered which apparently covers kicks
23:50 <EvanR> well you filtered it out, so you cant ask about it
23:50 hkeylocal joined
23:50 <hkeylocal> What is the purpose of this channel?
23:50 <thang1> ಠ_ಠ
23:50 <MarcelineVQ> hkeylocal: this is a channel for discussion about the haskell programming language
23:50 <subtlebot> I think this channel might have to do with Haskell
23:50 <sproingie> i love how *polite* that "requested" thing is. is there some actual irc extension that politely asks clients to /part before a kick happens?
23:50 <geekosaur> it's just a remotely induced /part
23:51 <geekosaur> s/remotely/third party/
23:51 <hkeylocal> ok, sorry
23:51 justanotheruser joined
23:51 <geekosaur> hkeylocal, this channel is about the Haskell programming language
23:51 <thang1> It's also about programming in haskell
23:51 nakal_ joined
23:51 <sproingie> which i thought /kick was. eh, not worth wasting brain cells on it
23:51 jer1 joined
23:51 <robkennedy> I was just browsing his old bibliography for ST papers and notice SL Peyton Jones but I couldn't access those papers
23:51 <thang1> sometimes people even talk about weird shit like haskell. Every now and then someone mentions category theory and we make coffee jokes
23:51 <hkeylocal> bye :/
23:51 <MonadHendrix> and the england rugby player, James Haskel
23:52 <robkennedy> Rip hkeylocal
23:52 markus1189 joined
23:52 <robkennedy> Wo ai ni
23:52 markus1199 joined
23:52 <hkeylocal> Rip? ... im are Anonymous
23:52 <thang1> sure you is
23:52 <monochrom> sproingie: I used the "remove" command which is special to freenode.
23:53 <sproingie> looks like you might need something stronger :)
23:53 <MonadHendrix> hkeylocal: learn some haskell lad
23:53 <sproingie> for great good!
23:53 <hkeylocal> bye
23:53 hkeylocal left
23:53 <monochrom> Its semantics is to have the server side simulate a client-side /leave
23:54 <monochrom> The hope is that it confuses the hell out of auto-rejoin scripts (and the human)
23:54 <robkennedy> A clojure AGI is born. It buffers 32G of open parenthesis and dies
23:54 <thang1> great weapon against bots
23:54 <MarcelineVQ> yo, this is a bit meta but, messing with people who are being off-topic people is pretty off-topic
23:54 <robkennedy> A Haskell AGI is born. It desugars to a no-op
23:54 <monochrom> What is AGI? But yeah 32G of parentheses sounds awesome :)
23:55 <thang1> AGI == artifical germ infection
23:55 <EvanR> MarcelineVQ: that is why i was getting annoyed
23:55 <sproingie> hey i just meta but here's my topic chat me maybe
23:55 <davean> Artificial general Inteligence
23:55 <robkennedy> Artificial General Intelligence
23:55 <* thang1> was close
23:56 hackebeilchen1 joined
23:56 <robkennedy> Any other good ones you can think of? If I can get one or two more I'd like to add it as an intro
23:57 infinity0_ joined
23:57 infinity0_ joined
23:57 theDon_ joined
23:57 meck joined
23:57 Moto-chan joined
23:58 <thang1> A C AGI is born. It immediately segfaults.
23:58 <sproingie> A Lisp AGI is born. it's mostly FFI calls into C.
23:58 <thang1> A Rust AGI is born. It spends all of its time rewriting itself in Rust.
23:59 <monochrom> robkennedy: SL Peyton Jones = SPJ, the L is a middle name I forgot what is.
23:59 <robkennedy> A python AGI is born. It's adopted by a mother who wants to connect to her programmer son.
23:59 <thang1> A Perl AGI is born. @#%^%%^&%^$#@$#$1)#
23:59 JeanCarloMachado joined
23:59 <EvanR> are you just copy pasting these from somewhere
23:59 <robkennedy> No
23:59 <sproingie> A PHP AGI is born and is immediately declared brain dead