<     May 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 31
00:00 afarmer joined
00:00 caumeslasal joined
00:00 _deepfire joined
00:01 Cale joined
00:02 infinity0 joined
00:04 Durbley joined
00:05 moth joined
00:05 infinity0 joined
00:05 revprez_atlanta joined
00:07 simukis_ joined
00:07 kvda joined
00:08 infinity0 joined
00:10 infinity0 joined
00:10 infinity0 joined
00:11 <* hackage> postmaster 0.3.1 - Postmaster ESMTP Server https://hackage.haskell.org/package/postmaster-0.3.1 (PeterSimons)
00:12 sgronblo joined
00:13 infinity0 joined
00:14 jer1 joined
00:14 lavalike joined
00:18 mizu_no_oto joined
00:23 ludat joined
00:26 <jle`> > (\xs -> zipWith (||) xs (drop 1 xs)) [True,False,False,True]
00:26 <lambdabot> [True,False,True]
00:26 <jle`> oh sorry
00:28 jmcarthur joined
00:28 Swizec joined
00:29 zv joined
00:31 andyhuzhill joined
00:31 justinfokes joined
00:32 juanpaucar joined
00:32 _deepfire joined
00:32 dsh joined
00:33 juanpaucar joined
00:34 juanpaucar joined
00:34 eacameron joined
00:34 jer1 joined
00:37 cp__ joined
00:38 msko joined
00:39 laplacian joined
00:40 plutoniix joined
00:40 plutoniix joined
00:42 juanpaucar joined
00:43 <exarkun> How do I get the bytes out of a https://hackage.haskell.org/package/cryptonite-0.23/docs/Crypto-Hash.html#t:Digest :/
00:43 davr0s joined
00:44 <lyxia> exarkun: https://hackage.haskell.org/package/memory-0.14.5/docs/Data-ByteArray.html#v:convert perhaps
00:44 juanpauc_ joined
00:45 <exarkun> hrm
00:46 crobbins joined
00:46 <Clint> or use withByteArray, but convert is more fun
00:47 <lyxia> there's a prism here which is implemented using convert https://hackage.haskell.org/package/jose-0.6.0.1/docs/Crypto-JOSE-JWK.html#v:digest
00:47 anoLB joined
00:48 <exarkun> I don't know about prisms yet
00:48 zv joined
00:49 <Clint> just use Data.ByteArray.convert
00:49 justinfokes joined
00:49 <lyxia> it's fine, I was just pointing out that someone else had the same question as you and convert was their answer.
00:50 eminhi joined
00:51 JeanCarloMachado joined
00:51 JeanCarl1Machado joined
00:52 orion joined
00:52 orion joined
00:54 juanpaucar joined
00:55 NeverDie joined
00:55 jer1 joined
00:56 mithrandeer joined
00:56 vaibhavsagar joined
00:57 slack1256 joined
00:58 JeanCarloMachado joined
01:00 qwertydvorak left
01:01 <exarkun> I can't seem to figure out how to use convert.
01:02 <EvanR> :t convert
01:02 <lambdabot> error: Variable not in scope: convert
01:02 <monochrom> Begin with the type.
01:02 <Clint> exarkun: what do you want to do with "the bytes"
01:02 mjora7 joined
01:03 <exarkun> Clint: Concat them with some others and then stuff the whole thing into hkdf
01:03 juanpaucar joined
01:04 e14 joined
01:04 <Clint> exarkun: so if you wanted to concat into a lazy bytestring you could do something like BL.concat [BA.convert this, BA.convert that, BA.convert theOtherThing]
01:06 darlan joined
01:07 justinfokes joined
01:07 sproingie joined
01:07 sproingie joined
01:08 varuaa joined
01:08 dfeuer joined
01:10 Supersonic112_ joined
01:13 jedws joined
01:13 juanpaucar joined
01:14 <exarkun> Clint: I get errors like No instance for (memory-0.14.3:Data.ByteArray.Types.ByteArray ByteString) arising from a use of ‘convert’
01:14 louispan joined
01:15 <Clint> exarkun: oh right, it only does strict, not lazy
01:15 jer1 joined
01:16 <exarkun> I don't understand where the type error actually happens
01:16 <exarkun> and none of the places I've tried randomly inserting a toStrict has made any difference
01:17 justinfokes joined
01:18 <EvanR> why would you want a lazy bytestring output
01:18 <EvanR> for a digest
01:18 afarmer joined
01:18 <exarkun> I don't really care if it's lazy or strict but there are two kinds of ByteString and not everyone uses the same one
01:18 <EvanR> you can convert between them "freely"
01:19 <EvanR> (one way may cost you though)
01:19 JeanCarl1Machado joined
01:19 <exarkun> I dunno
01:19 <exarkun> I feel like I've spent a good couple hours today converting between them
01:19 <exarkun> doesn't feel free to me
01:19 <EvanR> and in the case of digests, always getting a strict output is good enough, since going from strict to lazy is cheap
01:20 <exarkun> I guess I maybe see why I had that `No instance ...` error and `toStrict` didn't fix it.
01:20 <EvanR> digest is consuming input to get an accumulated output. if it was generating a lot of stuff incrementally, youd want lazy
01:20 <anoLB> lazy is the default i think exarkun
01:20 <Cale> It's really annoying that both types of ByteString have the same name
01:20 <exarkun> I really needed a `fromStrict` so that the type would line up with the declared return value of the function
01:20 <Cale> Both are useful in different circumstances
01:20 <exarkun> now the compiler is happy because it sees convert should return a strict ByteString
01:20 <anoLB> you pay a very small penalty if you have a strict chunk wrapped in a lazy bytestring, so for api, i think lazy if you are undecided
01:21 <EvanR> undecidedness based api?
01:21 renzhi joined
01:21 <Cale> Strict ByteString is much better if you're working with a lot of small files, or otherwise are in a situation where you're doing I/O with resources that you want to be careful to free.
01:21 <anoLB> well if either works and compatibility is hte main concern
01:21 <exarkun> this is where I make a monad joke right
01:21 <Cale> (sockets would be another example)
01:22 <anoLB> yeah some scenarios lazy makes no sense
01:22 ikke joined
01:22 <anoLB> but there is plenty of overlap where either would be fine, you disagree?
01:22 juanpaucar joined
01:23 <EvanR> haha Data.ByteStringAnyByteString
01:23 mac10688 joined
01:24 mmachenry joined
01:26 eschnett joined
01:28 systadmin joined
01:28 <anoLB> probably the effort of thought in compatibilty is misplaced, and you should just use strict
01:28 uglyfigurine joined
01:28 <EvanR> its a digest, use strict
01:28 <anoLB> after all, who knows what is going to be convenient
01:29 <anoLB> and strict makes more sense if you put asside the inconvenience of some users running fromChunks or whatever.
01:29 darjeeli1 joined
01:29 <anoLB> i guess lazy if your already using lazy for other things in the same library...
01:31 knapptime joined
01:31 <EvanR> toChunks
01:31 juanpaucar joined
01:34 fortruce joined
01:34 sgronblo joined
01:34 augur joined
01:36 cpennington joined
01:36 jer1 joined
01:41 juanpaucar joined
01:41 shlevy left
01:43 louispan joined
01:43 sdothum joined
01:46 Durbley joined
01:46 takle joined
01:47 pera joined
01:47 alsoLB joined
01:48 xcmw joined
01:50 juanpaucar joined
01:51 afarmer joined
01:52 afarmer joined
01:53 afarmer joined
01:54 afarmer joined
01:55 zv joined
01:55 brynedwardz joined
01:55 filterfish_ joined
01:56 lambdamu joined
01:56 eacameron joined
01:57 jer1 joined
01:59 juanpaucar joined
02:00 sproingie joined
02:00 sproingie joined
02:00 hucksy_ joined
02:02 nglsr joined
02:03 P1RATEZ joined
02:03 Humorous joined
02:03 mizu_no_oto joined
02:04 planck_ joined
02:04 takle joined
02:05 j2j joined
02:06 mmachenry1 joined
02:07 sdothum joined
02:08 _kit_ joined
02:08 juanpaucar joined
02:08 JeanCarl1Machado joined
02:12 planck_ joined
02:13 markasoftware joined
02:14 k___ joined
02:14 takle joined
02:15 doyougnu joined
02:16 <k___> hi all!
02:16 <k___> anyone have experience using the haskell autodiff library `ad`?
02:16 <k___> i've run into a strange problem using the `realToFrac` function with `ad`, documented here: http://lpaste.net/355566
02:17 <k___> in short, using `realToFrac` anywhere in the function that i take the gradient of, causes the evaluated gradient to be 0, even when it should be nonzero.
02:17 jer1 joined
02:17 mithrandeer joined
02:17 juanpauc_ joined
02:18 sleffy joined
02:18 sgronblo joined
02:18 Kmos joined
02:20 <lyxia> yes
02:20 justinfokes joined
02:20 <lyxia> don't use realToFrac
02:21 halogenandtoast joined
02:21 xiaosong joined
02:22 <lyxia> k___: it's not compatible with the way ad works
02:23 takle joined
02:23 Scip joined
02:24 joe9 joined
02:25 <joe9> I have a list of values indexed by an Int. Would a Data.List still be the best method to represent it? Or, Is there a Data.Map with Int indexes?
02:25 exferenceBot joined
02:25 varuaa joined
02:26 <peddie> joe9: see Data.IntMap :)
02:26 <EvanR> Map Int a, IntMap a, or HashMap Int a
02:26 <EvanR> or Vector a
02:27 juanpaucar joined
02:27 <joe9> EvanR: Thanks. Map Int a is probably the simplest approach.
02:27 <EvanR> the first three all have the same API pretty much
02:27 <peddie> EvanR: is there ever any reason to use `Map Int a` over `IntMap a`? I thought it was the same algorithm, just specialized to use `Int`s?
02:27 <EvanR> its not the same algorithm
02:27 <peddie> ah OK
02:27 <EvanR> but IntMap is probably better when you specifically have Ints
02:27 <EvanR> however, see HashMap Int
02:28 <peddie> for what it's worth, the last time I used this, `IntMap` was _way_ faster than `HashMap Int` for me
02:28 <EvanR> how long ago was that?
02:28 <peddie> 9 months ago or so
02:28 <EvanR> hmm
02:28 sssilver joined
02:29 <EvanR> we need some benchmark games
02:29 <peddie> heh :)
02:29 <peddie> EvanR: https://github.com/haskell-perf/dictionaries
02:30 hexagoxel joined
02:30 flatmap13 joined
02:32 pie_ joined
02:32 <Unode> in the conduit framework, is it possible to split a single source into multiple sinks where each sink receives part but not all of the data read? e.g. splitting a file into multiple of a fixed size
02:32 <k___> lyxia: thanks, do you have any resources on how `ad` works internally? i read the github description but it was too high-level
02:33 <k___> i also looked at the source for the `grad` function but didn't understand it
02:34 kvda joined
02:34 <EvanR> peddie: according to that, HashMap Int beats all on lookups... unless its not a big set
02:35 <EvanR> though not by much
02:36 <peddie> EvanR: yes, but inserting into an `IntMap` can be significantly faster, even on large sets
02:36 <EvanR> peddie: one interesting thing is.... whoever put the blood sweat and tears into any of them ... they were probably running such a bunch mark until they were competable with competition and then quit
02:36 juanpaucar joined
02:36 takle joined
02:36 <EvanR> the three probably dont have the same amount of performance hacks
02:37 <peddie> and insertion is much slower than lookups for both structures, so I would guess unless your algorithm is super lookup-heavy, the insertion time dominates
02:37 <EvanR> (that kind of cost matters more in like C where you rewrite all your data structures every time)
02:37 <peddie> EvanR: I'm not sure I understand what you mean about the blood, sweat and tears. as far as I can tell, the commit log comes from folks who are not primarily responsible for implementing those structures
02:38 jer1 joined
02:38 justinfokes joined
02:38 <EvanR> im saying, you put extra work when its not fast enough
02:38 <EvanR> but otherwise you probably dont
02:38 <EvanR> beyond the basic data structure strategy
02:39 crobbins joined
02:39 <EvanR> and here im saying, "enough" is based on the other data structures there
02:39 laplacian joined
02:39 <peddie> EvanR: I'm afraid I still don't understand what you're getting at, but it seems like all 3 of these have probably had some thought about performance put into them . . .
02:39 <lyxia> k___: if you have one hour of free time, this presentation starts from the basics https://www.youtube.com/watch?v=q1DUKEOUoxA
02:39 <EvanR> of course
02:39 <EvanR> a lot of thought
02:39 mjora7 joined
02:40 <EvanR> and the lookup performance there for 1000000 items isnt that different
02:40 <EvanR> very interesting!
02:40 plut0nic joined
02:42 <k___> lyxia: thank you!
02:42 <peddie> EvanR: it would be cool to see the `critbit` package on there
02:43 <EvanR> not familiar with Judy
02:43 <EvanR> either
02:43 louispan joined
02:44 <Rotaerk> blah >>= \case { Just x -> f x; Nothing -> return () }
02:44 <Rotaerk> there a simpler way to express that?
02:44 <Rotaerk> m (Maybe a) -> (a -> m ()) -> m ()
02:44 <EvanR> @hoogle m (Maybe a) -> (a -> m ()) -> m ()
02:44 <lambdabot> Safe scanl1May :: (a -> a -> a) -> [a] -> Maybe [a]
02:44 <lambdabot> Safe scanr1May :: (a -> a -> a) -> [a] -> Maybe [a]
02:44 <lambdabot> Agda.Utils.Maybe whenNothingM :: Monad m => m (Maybe a) -> m () -> m ()
02:44 <EvanR> whenJust is probably a thing
02:44 <peddie> EvanR: good point, I didn't look at the mutable ones. for the program in question, I did switch to using a mutable hash table from that package, which was pretty slow, and then I switched to OCaml's mutable hash table, which was so much faster I never looked back . . .
02:45 <lyxia> (>>= mapM_ f)
02:45 <EvanR> peddie: yes, HashTable has a bad reputation these days
02:45 <EvanR> HashMap is another subject
02:45 <Rotaerk> hmm yea whenJust *is* a thing; thanks
02:45 juanpaucar joined
02:46 <lyxia> whenJust = for_
02:46 <lyxia> = flip traverse = flip mapM_
02:47 electrostat joined
02:47 <Rotaerk> ah
02:47 <Rotaerk> thanks
02:47 Computist joined
02:48 justinfokes joined
02:48 <lyxia> you're welcome!
02:48 anoLB joined
02:48 xall joined
02:50 argent0 joined
02:50 JeanCarl1Machado joined
02:54 juanpaucar joined
02:57 kvda joined
02:58 jer1 joined
02:59 plutoniix joined
02:59 <k___> lyxia: okay, i think i see the problem--`ad` is carrying the evaluated gradient information in these dual numbers (which are `Reverse s a` which are an instance of `Floating`). so, when i force a `Floating a` into a `Float`, that zeroes the dual number information
02:59 <k___> does that sound accurate?
03:01 peterbecich joined
03:03 juanpauc_ joined
03:05 justinfokes joined
03:06 tripped joined
03:08 j2j left
03:10 flatmap13 joined
03:13 juanpaucar joined
03:14 lambda-11235 joined
03:14 Goplat joined
03:16 eminhi joined
03:16 JeanCarl1Machado joined
03:17 revprez_atlanta joined
03:18 Lokathor_ joined
03:19 eacameron joined
03:19 JeanCarloMachado joined
03:19 jer1 joined
03:20 robertkennedy joined
03:21 <robertkennedy> How are you guys taking the Haskell Gap/Techempower papers?
03:22 pavonia joined
03:22 juanpaucar joined
03:22 crobbins joined
03:22 <* hackage> sensu-run 0.0.0 - A tool to send command execution results to Sensu https://hackage.haskell.org/package/sensu-run-0.0.0 (MitsutoshiAoe)
03:22 <robertkennedy> My feeling is that Haskell gives us bang for buck, and the possibility that code will be optimized behind my back to eventually fix the deficits.
03:22 Swizec_ joined
03:23 JeanCarl1Machado joined
03:24 justinfokes joined
03:24 <robertkennedy> But it did partially shatter the believe that Haskell was already rewriting bad (aka readable) code to ninja C
03:24 <* hackage> tmapmvar 0.0.2 - A single-entity stateful Map in STM, similar to tmapchan https://hackage.haskell.org/package/tmapmvar-0.0.2 (athanclark)
03:26 Maxdamantus joined
03:26 orhan89 joined
03:26 j2j joined
03:27 leat joined
03:28 Xanather joined
03:28 JeanCarloMachado joined
03:29 sproingie joined
03:29 sproingie joined
03:31 juanpaucar joined
03:32 uglyfigurine joined
03:33 carlomagno joined
03:36 <dalek_> robertkennedy, does that relate to 'what goes on behind the scenes when you compile haskell' ?
03:38 <Rotaerk> https://github.com/Rotaerk/iircc/blob/master/src/daemon/Main.hs
03:38 <Rotaerk> beginnings of an IRC client \o/
03:38 leat joined
03:40 jer1 joined
03:40 juanpaucar joined
03:41 <robertkennedy> dalek_: maybe? I feels more like the benefits of a language where we expect `f x = let y = x + 2 in y + 2` to be the same as `g x = x + 4`
03:41 <dalek_> " Haskell Gap/Techempower papers?"
03:41 <robertkennedy> Would you consider Haskell to be a declarative language?
03:42 justinfokes joined
03:42 <robertkennedy> Techempower Benchmarks #14 Released with Servant, Yesod, Spock and Snap
03:42 <robertkennedy> https://www.reddit.com/r/haskell/comments/6b3dlt/techempower_benchmarks_14_released_with_servant/
03:42 <robertkennedy> "Measuring the Haskell Gap" - is that gap melted during following years? Do you think that some knowledge from newest released to public Intel HRC could be reproduced in GHC?
03:42 <robertkennedy> https://www.reddit.com/r/haskell/comments/65l3ff/measuring_the_haskell_gap_is_that_gap_melted/?ref=search_posts
03:44 sproingie joined
03:45 vlatkoB joined
03:45 CoderPuppy joined
03:46 nwf joined
03:47 alsoLB joined
03:48 eklavya joined
03:48 doyougnu left
03:49 doyougnu joined
03:50 juanpaucar joined
03:50 j2j joined
03:50 otto_s joined
03:51 justinfokes joined
03:52 amytran1997 joined
03:52 <jle`> haskell is a natural fit for libraries and platforms with declarative API's
03:52 <jle`> i'm not sure if i would go as far as calling it a declarative language
03:52 <jle`> but it's one of the best languages for alloying declarative programming
03:53 tromp joined
03:53 diegoksp joined
03:53 macalinao joined
03:54 kmels joined
03:57 takle joined
03:58 hamishmack joined
03:58 <* hackage> data-forest 0.1.0.4 - A simple multi-way tree data structure. https://hackage.haskell.org/package/data-forest-0.1.0.4 (chris_martin)
03:59 <glguy> Rotaerk: I've got a bunch of code for handling IRC if you're in the client business
03:59 juanpaucar joined
04:00 almielczarek joined
04:01 jer1 joined
04:01 lambda_foo joined
04:03 flatmap13 joined
04:03 juanpaucar joined
04:04 <glguy> Rotaerk: Also if you keep working on this you might join #haskell-irc
04:05 sgfltx joined
04:08 sproingie joined
04:08 sproingie joined
04:08 juanpaucar joined
04:08 <glguy> bye, lambda_foo
04:08 <lambda_foo> :-)
04:09 <lambda_foo> fussing about with irc web clients and then auto connecting to channels
04:09 justinfokes joined
04:10 descender joined
04:12 blym joined
04:15 systemfault joined
04:15 [[[[[ExTRa]]]]] joined
04:16 infinity0 joined
04:16 takle joined
04:16 systemfault joined
04:17 andyhuzhill joined
04:19 guardianx joined
04:20 sgronblo joined
04:21 jer1 joined
04:22 <Rotaerk> glguy, ah, cool
04:23 dm3 joined
04:23 fkurkows1 joined
04:24 <Rotaerk> the parsing basically seems to work, but it hasn't been tested much yet, against real IRC servers
04:24 LeCamarade joined
04:24 <glguy> I think you'll have to rip out most of your host parsing for Freenode
04:25 systadmin joined
04:25 <glguy> The published grammar might be useful when composing IRC messages, but it isn't useful for consuming them
04:25 <Rotaerk> yea I figured I'd have to do a lot of revision once connecting to real servers
04:26 sgronblo joined
04:26 benl23 joined
04:26 juanpaucar joined
04:27 justinfokes joined
04:30 <glguy> The core command parsing and generation of my client is pulled out there http://hackage.haskell.org/package/irc-core
04:30 <glguy> https://glguy.net/~pi/c854906056e4ceb0ff61.png
04:31 <Rotaerk> hmm if only I'd noticed this before I built the parsers
04:31 <Rotaerk> the only irc library I'd run across was "irc"
04:33 mjora7 joined
04:33 <Rotaerk> glguy, thanks, I might use that for the parsing aspect
04:34 <Rotaerk> should save me effort even at this point, given the amount of tweaking I'd likely need for mine
04:36 juanpaucar joined
04:36 gde331 joined
04:36 sdothum joined
04:37 hamishmack joined
04:37 takle joined
04:39 <Rotaerk> ah, that explains why I didn't notice it... I tend to search on stackage, and it's not there
04:39 <glguy> That'd do it, you'll miss a lot that way
04:39 <Rotaerk> didn't realize some packages were missing on stackage
04:40 <suzu> anyone have experience using snap without heist?
04:40 <suzu> i'm using lucid instead and so far i still cant tell if this is a stupid idea or a good idea
04:40 {emptyset} joined
04:41 H3lloItsPersonal joined
04:42 jer1 joined
04:42 <H3lloItsPersonal> hello
04:43 eacameron joined
04:45 juanpauc_ joined
04:45 justinfokes joined
04:46 H3lloItsPersonal left
04:47 eacamero_ joined
04:50 robertkennedy joined
04:52 augur joined
04:54 juanpaucar joined
04:55 ploop joined
04:55 justinfokes joined
04:57 afarmer joined
04:58 eacameron joined
05:02 <suzu> could be both tbh
05:03 juanpaucar joined
05:04 geekosaur joined
05:05 JoshS joined
05:05 muesli4 joined
05:05 eacameron joined
05:05 takle joined
05:08 nshepperd joined
05:08 eacamero_ joined
05:09 jer1 joined
05:09 <athan> Is there a version of STM where you can block for an indefinite period of time?
05:09 <athan> something like an ST-version of yeild/await channels or something
05:11 <athan> do {xChan <- newYeildAwaitChanIO; forkIO (threadDelay 1 * year >> yeildChan xChan "foo"); x <- awaitChan xChan; putStrLn x}
05:11 tromp joined
05:11 dec0n joined
05:11 <athan> s/1 * year/(1 * year)
05:12 cschneid_ joined
05:12 juanpaucar joined
05:12 cschneid_ joined
05:13 takle joined
05:13 justinfokes joined
05:13 jedws joined
05:13 <* hackage> extensible 0.4.2 - Extensible, efficient, optics-friendly data types and effects https://hackage.haskell.org/package/extensible-0.4.2 (FumiakiKinoshita)
05:14 connrs joined
05:14 josh5tone joined
05:17 juanpaucar joined
05:18 <athan> er, hm, I guess I'm asking this wrong
05:18 <athan> how does indefinite locking in STM actually /happen/?
05:20 eacameron joined
05:20 nshepperd joined
05:21 ExcelTronic joined
05:22 juanpauc_ joined
05:24 eacamero_ joined
05:24 kritzcreek joined
05:25 osa1 joined
05:25 osa1 joined
05:26 meandi_2 joined
05:26 takle joined
05:27 juanpaucar joined
05:27 jer1 joined
05:28 eacameron joined
05:31 juanpaucar joined
05:31 justinfokes joined
05:32 dm3 joined
05:34 takle joined
05:35 mjora7 joined
05:36 winter_ joined
05:36 conal joined
05:36 <osa1> how do I specify the resolver when running commands like `stack ghci` ?
05:37 inad922 joined
05:40 juanpauc_ joined
05:44 igniting joined
05:46 k___ joined
05:46 fizruk joined
05:49 jer1 joined
05:49 justinfokes joined
05:49 juanpaucar joined
05:51 caumeslasal joined
05:52 <ReinH> osa1: --resolver
05:52 <ReinH> stack --help will give you a list of options and commands
05:52 <glguy> You can use for_ or traverse_
05:52 takle joined
05:52 <glguy> Oh, I was scrolled way up :)
05:52 ThomasLocke joined
05:52 ThomasLocke joined
05:52 <osa1> ReinH: thanks. I created a stack project just for this.
05:52 <osa1> ReinH: stack ghci --help doesn't list it...
05:53 <glguy> Rotaerk: for_ or traverse_ in case that didn't come up earlier
05:53 <ReinH> stack --help
05:56 smwangi joined
05:57 hulufei joined
05:58 jer1 joined
05:58 <Rotaerk> glguy, yea thanks; mapM_ worked in this case, though I ended up eliminating that code anyway...
05:58 juanpaucar joined
05:59 justinfokes joined
06:02 bennofs joined
06:02 hulufei_ joined
06:03 mbuf joined
06:03 yoneda joined
06:03 danvet joined
06:04 hanna joined
06:05 jedws joined
06:08 juanpaucar joined
06:08 takle joined
06:09 micmus joined
06:10 weh joined
06:10 vikraman joined
06:11 miklcct joined
06:11 markus_ joined
06:12 solatis joined
06:12 tromp joined
06:13 jutaro joined
06:13 andyhuzhill1 joined
06:15 hamishmack joined
06:17 justinfokes joined
06:17 <dxtr> a/w 29
06:17 <dxtr> err, sorry
06:17 juanpaucar joined
06:17 jhrcek joined
06:18 ExcelTronic joined
06:19 Mortomes|Work joined
06:20 mrkgnao joined
06:20 insitu joined
06:20 ^bschafer1 joined
06:21 robkennedy joined
06:22 juanpaucar joined
06:22 xtreak joined
06:26 juanpaucar joined
06:27 connrs joined
06:28 ccomb joined
06:29 Gurkenglas joined
06:34 benl23 joined
06:35 justinfokes joined
06:35 hurkan joined
06:35 juanpaucar joined
06:36 alfredo joined
06:37 Bigcheese joined
06:39 takle joined
06:40 mjo joined
06:40 mjo joined
06:41 yobohohoz joined
06:41 mstruebing joined
06:42 jer1 joined
06:43 laplacian joined
06:44 Hunter1 joined
06:45 juanpaucar joined
06:47 cpup joined
06:48 fotonzade joined
06:48 mgttlinger joined
06:51 coot____ joined
06:51 takle joined
06:51 mohsen_1 joined
06:53 mohsen_1 joined
06:53 justinfokes joined
06:54 juanpauc_ joined
06:54 <* hackage> atlassian-connect-core 0.8.0.0 - Atlassian Connect snaplet for the Snap Framework and helper code. https://hackage.haskell.org/package/atlassian-connect-core-0.8.0.0 (RobertMassaioli)
06:56 eklavya joined
06:57 freusque joined
07:00 guiben joined
07:00 jer1 joined
07:00 paolino joined
07:01 smwangi joined
07:02 ventonegro joined
07:02 BartAdv joined
07:02 takle joined
07:02 justinfokes joined
07:03 juanpaucar joined
07:05 insitu joined
07:06 Itkovian joined
07:07 dm3 joined
07:08 mattyw joined
07:09 mkoenig joined
07:10 selthas joined
07:11 bvad joined
07:11 tromp joined
07:12 juanpaucar joined
07:14 Sampuka joined
07:15 vlatkoB_ joined
07:17 TheWolf joined
07:18 TheWolf left
07:18 ragepandemic joined
07:20 justinfokes joined
07:21 cschneid_ joined
07:21 cheater joined
07:21 jer1 joined
07:21 juanpaucar joined
07:25 filterfish_ joined
07:26 huza joined
07:26 <* hackage> Sit 0.2017.5.2 - Prototypical type checker for Type Theory with Sized Natural Numbers https://hackage.haskell.org/package/Sit-0.2017.5.2 (AndreasAbel)
07:27 raichoo joined
07:27 takle joined
07:28 xall joined
07:29 takuan joined
07:30 juanpaucar joined
07:30 vimalloc joined
07:31 frontendloader joined
07:32 ccomb1 joined
07:32 augur joined
07:32 juanpaucar joined
07:33 merijn joined
07:33 biglama joined
07:35 takle joined
07:36 mmn80 joined
07:37 mfukar joined
07:38 justinfokes joined
07:39 oish joined
07:40 ^jud joined
07:40 bennofs joined
07:41 Yuras joined
07:41 shangxiao joined
07:42 jer1 joined
07:42 juanpaucar joined
07:43 baldrick joined
07:43 lassulus joined
07:43 <merijn> Poll: I have a library for a variation on Chan which is currently using Control.Concurrent.BroadcastChan as module prefix, but now that I want to add submodules, that seems increasingly cumbersome to import...should I just move it to BroadcastChan as top level module?
07:44 lassulus joined
07:44 <jchia> Is there a hackage package for merging two already-sorted vectors? I don't want to sort their concatenation when I just need to merge them.
07:44 xtreak_ joined
07:44 aphorisme joined
07:46 thc202 joined
07:46 Itkovian joined
07:47 oisdk joined
07:48 justinfokes joined
07:48 takle joined
07:48 kuribas joined
07:49 eacameron joined
07:50 osa1 joined
07:50 osa1 joined
07:51 juanpaucar joined
07:51 wedens joined
07:52 ptek joined
07:53 CurryWurst joined
07:54 razi1 joined
07:56 eacameron joined
07:56 oisdk joined
07:56 im0nde joined
07:56 AlexRussia joined
07:56 Gloomy joined
07:57 connrs joined
07:58 piezoid joined
07:59 dni joined
07:59 benl23 joined
07:59 connrs_ joined
08:00 connrs joined
08:00 juanpaucar joined
08:02 jer1 joined
08:04 oisdk joined
08:05 juanpaucar joined
08:06 takle joined
08:06 justinfokes joined
08:07 jtobin joined
08:09 <merijn> Is ghc-core still the recommended way to investigate how GHC is optimising/compiling things?
08:09 ericsagnes joined
08:09 Itkovian joined
08:09 juanpauc_ joined
08:10 zero_byte joined
08:10 quobo joined
08:10 <phadej> merijn: I'd say so
08:12 Younder joined
08:12 augur joined
08:12 tromp joined
08:13 takle joined
08:14 aphorisme joined
08:15 acidjnk22 joined
08:15 <merijn> Fun times, ghc-core is someone getting confused about iconv again :\
08:15 eklavya joined
08:18 tomphp joined
08:18 eyck joined
08:19 juanpaucar joined
08:20 dni_ joined
08:21 marr joined
08:21 mohsen_ joined
08:23 jutaro joined
08:23 nickolay_ joined
08:24 takle joined
08:24 justinfokes joined
08:24 juanpaucar joined
08:25 kuribas` joined
08:26 sword865 joined
08:32 tomphp joined
08:32 conal joined
08:33 takle joined
08:33 justinfokes joined
08:35 juanpauc_ joined
08:35 lep-delete joined
08:36 freusque joined
08:40 eacameron joined
08:41 filterfish joined
08:43 haskell joined
08:44 xall joined
08:44 juanpaucar joined
08:45 zariuq joined
08:45 <Younder> This might seem like an odd question, but do cryptanalyst se Haskell?
08:45 <Younder> use
08:46 alfredo joined
08:46 <haskell> hmm
08:47 <Younder> It seems like a tool a mathematically minded person would like.
08:47 <LiaoTao> Younder: Do nurses use bananas?
08:48 sighingnow joined
08:48 <Younder> I understand to get a job at NSA you need a PHD in math and then on top of that you have 4 years of additional education in cryptanalysis.
08:49 xcmw joined
08:49 <peddie> Younder: you may be interested to read about Cryptol (http://www.cryptol.net/)
08:49 <Younder> LiaoTao, Yes I guess I already know the answer.
08:50 takle joined
08:50 sz0 joined
08:50 takle joined
08:51 tabaqui joined
08:51 sfcg joined
08:51 <Younder> :) is it short lived as Galois though (he died at 23)
08:51 justinfokes joined
08:51 ericsagnes joined
08:52 sighingnow_ joined
08:52 mjora7 joined
08:53 juanpaucar joined
08:53 <Younder> Haskell is after all a particularity strenuous experiment which should have died a long time ago, except it go a lot of things right
08:53 <Unode> in the conduit framework, is it possible to split a single source into multiple sinks where each sink receives part but not all of the data read? e.g. splitting a file into multiple of a fixed size
08:54 medicijnman joined
08:54 <Younder> I like serendipitous accidents
08:54 dni joined
08:55 xall joined
08:55 medicijnman left
08:56 Xanather joined
08:56 romank joined
08:57 slomo joined
08:57 slomo joined
08:58 fizruk joined
08:59 <kuribas`> Younder: that's true about any language...
09:00 <kuribas`> Younder: IMO still one of the best...
09:00 oish joined
09:01 <kuribas`> Younder: the right blend of pragmatic and elegant.
09:01 shangxiao joined
09:02 juanpaucar joined
09:03 xtreak joined
09:05 <kuribas`> That's how it goes with languages, by the time they get critical mass, they are outdated.
09:07 ccomb joined
09:07 bennofs joined
09:08 bjz joined
09:08 Grisha joined
09:09 justinfokes joined
09:09 <Grisha> what’s the best way to hoist `Either e a` to `Reader ConfigType (EitherT ErrorType IO) a`?
09:10 osa1 joined
09:10 osa1 joined
09:11 <Grisha> sorry
09:11 <Grisha> I meant `Either ErrorType a` of course
09:11 Gloomy joined
09:12 juanpaucar joined
09:12 <opqdonut> Grisha: is that ReaderT?
09:12 <Grisha> yeps
09:12 entuland joined
09:12 <Grisha> sure
09:12 <Grisha> I’m a bit defocused
09:12 bjz joined
09:13 <Grisha> and I’ve got another wierd error message on `config <- ask`, being the first line in the function body
09:14 nh2 joined
09:14 <Grisha> http://lpaste.net/4737168302638366720
09:14 <Grisha> here
09:14 cfricke joined
09:14 leat joined
09:14 <opqdonut> I think something like "lift (fmap return eithervalue)" should do that transformation
09:15 <ptek> Unode: I think you can combine the use of chunksOf to first partition your data into chunks of given size, and then pass it on to something like mapAccumWhile
09:15 <Grisha> eitherDecode :: String-like -> Either String FromJSONInstance
09:15 eacameron joined
09:16 <ptek> Unode or concatMapAccum
09:16 <Unode> ptek: ok I'll have a look at those two and ask again if I don't get it. Thanks for the directions.
09:17 <ptek> Unode, I have seen an example of concatMapAccum here recently: http://stackoverflow.com/a/11066007/140623
09:18 jutaro joined
09:18 <ptek> Unode, in my mind it could go like this: first create chunks of given size, then number the chunks with concatMapAccum, then pass it on into files named by the numbers
09:18 <Grisha> opqdonut: thanks!
09:18 <kuribas`> Grisha: either left return ?
09:18 Kreest__ joined
09:19 <Unode> ptek: ok, that could work.
09:19 justinfokes joined
09:19 <Grisha> kuribas`: thanks! i’ll check
09:19 mrkgnao joined
09:20 jaspervdj joined
09:20 <kuribas`> Grisha: or (left . convertError)
09:20 <kuribas`> Grisha: if the error type isn't the same
09:20 <Grisha> kuribas`: thanks! do you happen to see the problem with the above code?
09:20 <ptek> Unode, although I've just realised that I wold not know how to decompose the tuple so it can be given to `sinkFile`
09:21 juanpaucar joined
09:21 <Grisha> kuribas`: oh, sorry, forget that
09:21 <Unode> ptek: I was reading about zipSink yesterday but didn't get how it works. The explanations seem to go in the direction of every sink getting a copy of the data.
09:21 <Grisha> kuribas`: I was looking at a wrong line number
09:21 <kuribas`> np
09:21 <Grisha> kuribas`: thought the problem was on the line with the ask call
09:22 ertes-w joined
09:23 mpsag joined
09:24 kritzcreek joined
09:24 <Grisha> hm, I’m not quite sure I understand the problem
09:24 <Grisha> given the outer monad is `ReaderT Config (EitherT String)`
09:25 <Grisha> and the intermediate result is of type `Either String a`
09:25 <Grisha> we need to “unwrap” the `Either String` part of the intermediate result
09:25 <Grisha> and wrap it into `ReaderT Config (EitherT String`
09:25 plll joined
09:25 <Grisha> is that correct?
09:25 LordBrain joined
09:26 cranej joined
09:26 <opqdonut> sounds right. the wrapping is done with lift
09:26 <Grisha> the problem is with threading the `String` part from Either into `Reader Config (EitherT IO String)`
09:27 <Grisha> (I forgot the IO monad in the above ReaderT type obviously)
09:27 <opqdonut> you want to go from `Either String a` to `Either String (IO a)`? that's just `fmap return`
09:27 <Grisha> I’ve got an `Either String a`
09:28 <Grisha> and it should be put into the context of `ReaderT Config (EitherT IO) a`
09:28 <kuribas`> :t hoistEither
09:28 <lambdabot> error: Variable not in scope: hoistEither
09:28 <ptek> Unode, it looks like an answer exists exactly for your example problem: http://stackoverflow.com/a/23184797/140623
09:28 <Grisha> kuribas`: I saw hoistEither already
09:28 <Grisha> it hoists to EitherT
09:29 <Grisha> part of `either` package
09:29 <Grisha> hoistEither :: Monad m => Either e a -> EitherT e m a
09:29 <Grisha> I’m wondering if what I’m trying to do here does smell a bit
09:30 juanpaucar joined
09:30 <Unode> ptek: awesome! yeah indeed it seems exactly that. I didn't find this when googling. Thanks!
09:31 xall joined
09:31 <kuribas`> Grisha: then just "return . hoistEither"?
09:31 <ptek> Unode, I am really curious how you's solve that, would you mind posting the code here when you make it work?
09:32 <Unode> ptek: sure. But grab a chair this will take a while :)
09:32 <Grisha> kuribas`: it doesn’t do
09:33 <kuribas`> Grisha: what transformer library are you using?
09:33 <opqdonut> Grisha: lift . hoistEither
09:33 <Grisha> kuribas`: since (return . hoistEither) (x :: a) results in `:: Reader Config (EitherT String IO) (EitherT String a)`
09:33 nh2 joined
09:33 <opqdonut> Grisha: `(lift . hoistEither) :: Either e a -> ReaderT r (EitherT e IO) a` sez my ghci
09:33 cloudhead joined
09:34 <Grisha> kuribas`: I’m using `transformers` for ReaderT and `either` for `EitherT`
09:34 <Grisha> opqdonut: lemme check
09:34 <Grisha> `lift` coming from?
09:34 <opqdonut> Control.Monad.Trans
09:34 <opqdonut> :t lift
09:34 <Grisha> thanks
09:34 <lambdabot> (Monad m, MonadTrans t) => m a -> t m a
09:34 <opqdonut> that's how you wrap a thing into a monad transformer
09:35 <Grisha> opqdonut: is it mtl?
09:35 <opqdonut> yes
09:35 <Younder> monoids are a lot cleaner
09:35 <Grisha> I’ve already got 2 diff monad transformers libraries in the project ;)
09:35 <Younder> do it is 2 steps?
09:35 lopex joined
09:35 <opqdonut> Grisha: no sorry it's transformers
09:36 <opqdonut> http://hackage.haskell.org/package/transformers-0.5.4.0/docs/Control-Monad-Trans-Class.html#v:lift
09:36 <opqdonut> I can never remember which one was which
09:36 <Grisha> so it’s .Class
09:37 <Grisha> ok, (lift . hoistEither) did compile
09:37 <opqdonut> hmm I got it from Control.Monad.Trans, I guess somebody re-exports it
09:37 justinfokes joined
09:38 <Grisha> the func did compile
09:38 <Grisha> however!
09:38 <Grisha> (that’s where the mystery continues)
09:38 fizruk joined
09:38 <Grisha> it added a layer of [] on top my of my return data types
09:39 <Grisha> oh no, it’s stupid me again
09:39 <Grisha> before I assumed the result was a functor
09:39 rcat joined
09:39 juanpaucar joined
09:48 twanvl joined
09:48 juanpaucar joined
09:48 fendoer joined
09:49 anoLB joined
09:51 <* hackage> hsudoku 0.1.1.0 - Sudoku game with a GTK3 interface https://hackage.haskell.org/package/hsudoku-0.1.1.0 (mmo)
09:52 mmn80 joined
09:55 Elhamer joined
09:55 justinfokes joined
09:58 juanpaucar joined
10:00 psychicist__ joined
10:01 Mortomes|Work joined
10:05 ixxie joined
10:05 Elhamer_ joined
10:07 juanpaucar joined
10:07 bjz joined
10:08 xtreak joined
10:09 juanpaucar joined
10:10 Yuras joined
10:10 Wizek_ joined
10:11 rockfordal joined
10:12 ragepanda joined
10:13 justinfokes joined
10:13 Hunter1 joined
10:14 gmcabrita joined
10:14 slacker joined
10:15 xtreak joined
10:18 juanpaucar joined
10:20 Boomerang joined
10:20 Cooler joined
10:20 selthas joined
10:20 bjz_ joined
10:21 mkoenig joined
10:22 <Cooler> is there a way to have a static variable?
10:23 justinfokes joined
10:23 <Cooler> that gets modified by several functions and is different each call
10:24 <srhb> Cooler: You might want IORef
10:24 <Younder> static variable? Not sure I understand the concept
10:24 <srhb> Cooler: At least, if you by static mean mutable. :)
10:26 <Taneb> Cooler, a big part of functional programming, and Haskell especially, is the pervasive use of mutable state
10:26 <srhb> Taneb: Huh?
10:26 <Taneb> *immutable
10:26 <unsymbol> these last few messages have been quite... confusing ;)
10:26 <srhb> Ah. :-P
10:26 <Taneb> Brain error, sorry
10:27 juanpaucar joined
10:28 xtreak joined
10:28 <Cale> Cooler: Usually you'd just make that a function parameter
10:28 <Cale> Cooler: If the result of a function depends on something, that something should be a parameter to the function.
10:28 locallycompact joined
10:28 <zariuq> let f a b c = (a,b,c)
10:28 <zariuq> is there already a function for this?
10:29 <zariuq> like (,) for 3-tuples
10:29 <Cale> (,,)
10:29 <zariuq> ... T_T
10:29 <zariuq> damn, super simple bro
10:29 <zariuq> (,,,) too. Thank you Cale!
10:29 <Cale> no problem
10:30 oisdk joined
10:30 <* hackage> hail 0.1.0.2 - A service for pull-based continuous deployment based on hydra. https://hackage.haskell.org/package/hail-0.1.0.2 (shlevy)
10:31 xtreak joined
10:31 <Cooler> Cale, it gets really complicated passing around the latest version of something to every function that needs it
10:31 solex joined
10:33 <liste> Cooler: you can use scoping for that, eg. foo x = result where bar = ... do something with x ...; quux = ... do something with x ...; result = bar quux -- here you don't need to pass x everywhere
10:33 bjz joined
10:33 <Cale> Cooler: In which way is it getting complicated?
10:33 xall joined
10:33 henriksod joined
10:33 maambmb joined
10:34 <Cale> and what kind of thing are we really talking about?
10:34 <Cale> It can be a bit tough to have this sort of conversation abstractly
10:34 <maambmb> guys - im going insane trying to get my environment set up. I'm using a stack new-template. Everytime I try and import Control.Monad.State is says "failed to load interface"
10:34 <maambmb> isn't this stuff auto included?
10:35 locallycompact joined
10:35 <Cale> maambmb: Do you have mtl as a dependency?
10:35 <liste> maambmb: Control.Monad.State is part of mtl package
10:35 netheranthem joined
10:35 selthas joined
10:36 <Cale> Cooler: anyway, there are various solutions to different kinds of problems you might run into
10:36 <Cooler> liste, it looks better and more sane to write different top level functions instead of scoping further and further in
10:36 <Cooler> especially with the indentation growing out of control
10:36 juanpaucar joined
10:37 <Cale> Cooler: Usually I like adding parameters and just allowing things to be a bit messy until I can figure out what's going on -- which parts of the program depend on what
10:37 xcmw joined
10:37 <Cooler> Cale, yeah thats what i am doing now
10:37 <Cale> Cooler: and then I start defining data types or building abstractions around that
10:37 oisdk joined
10:37 <Cale> The first thing is when you see the same collections of parameters going to many places, probably those things deserve to be packaged together for some reason.
10:38 fotonzade joined
10:39 <maambmb> do I have to manually specify the version of mtl myself in the stack.yaml, or is there not an equivalent to npm install mtl --save?
10:39 <Cooler> Cale, yeah but then you have to deal with wrapping and unwrapping
10:39 <Cooler> its get really messy
10:39 <Cale> maambmb: I would expect you just need to add it to your .cabal
10:39 danthemyth joined
10:40 osa1 joined
10:40 osa1 joined
10:40 FreeBirdLjj joined
10:40 <Cale> Cooler: I'm not sure what you mean
10:40 Hunter1 joined
10:41 <Cooler> Cale, packaging stuff together
10:41 justinfokes joined
10:41 <Cale> Cooler: Use record syntax, use the field extractor functions to unpack the bits of your config or whatever it is.
10:41 <Cooler> yeah
10:42 <maambmb> jesus
10:42 <maambmb> finally
10:42 <maambmb> it works
10:42 <maambmb> thank you lads!
10:42 <maambmb> i was about to ragequit from life
10:42 Elhamer_ joined
10:43 locallycompact joined
10:44 locallycompact joined
10:45 <Unode> when importing multiple modules under the same alias "as N" does ghc warn if there are namespace clashes?
10:45 cretiq joined
10:46 locallycompact joined
10:46 Cooler joined
10:46 juanpaucar joined
10:46 <* hackage> hedgehog 0.2.2 - Hedgehog will eat all your bugs. https://hackage.haskell.org/package/hedgehog-0.2.2 (JacobStanley)
10:46 Wizek joined
10:46 louispan joined
10:46 <Cale> Cooler: So, beyond that, there's stuff like State for threading parameters along, or you can sometimes make good use of an IORef or MVar or another sort of mutable state.
10:47 yellowj joined
10:47 Aruro joined
10:48 <Cale> Cooler: Often rather than passing an IORef or MVar or whatever it is around, I will instead pass readIORef r and writeIORef r to the things which need read or write access -- often it'll be different parts of a program. Or if there's some expected access pattern to the IORef, I will make some function wrapper around that access pattern, and pass that.
10:49 <Cale> The flexibility which comes from doing that is very often useful later, and it's usually not much extra effort.
10:49 <Aruro> are there good haskell bindings to libusb and liblua?
10:50 <Cale> (since you still need to rig up getting the IORef where it's going anyway, it's not much different passing some function for accessing it)
10:50 nh2 joined
10:51 alsoLB joined
10:53 selthas joined
10:53 cpennington joined
10:53 <Cale> That gives you a convenient place to put in logging of changes to the state, possibly some kind of validation, or sometimes for instance, you'll discover that you really wanted that IORef to be a TVar or something, and it saves you from having to go all over your program making changes later.
10:55 juanpaucar joined
10:56 jer1 joined
10:58 justinfokes joined
10:59 eacameron joined
11:00 al-damiri joined
11:02 guampa joined
11:02 Snircle joined
11:02 Cooler joined
11:03 <* hackage> sqlcipher 1.0.1.2 - Haskell binding to sqlcipher https://hackage.haskell.org/package/sqlcipher-1.0.1.2 (figo)
11:04 merijn joined
11:04 juanpauc_ joined
11:05 selthas joined
11:06 piyush-kurur joined
11:08 justinfokes joined
11:08 zariuq joined
11:09 beerdrop joined
11:09 nh2 joined
11:09 __paul0 joined
11:11 Hunter1 joined
11:11 sgronblo joined
11:11 pie_ joined
11:11 ilyaigpetrov joined
11:11 akegalj joined
11:13 juanpaucar joined
11:14 <akegalj> hey all. I am trying to figure out how to use CA (Ceritficate authority) with warp-tls https://hackage.haskell.org/package/warp-tls-3.2.3/docs/Network-Wai-Handler-WarpTLS.html . So there is a simple way to use server-cert and server-key with tlsSettings method. tlsSettingsChain looks like something that I can provide CA as a second argument. Is this right?
11:14 jer1 joined
11:19 bjz_ joined
11:22 biglama joined
11:22 guampa joined
11:22 louispan joined
11:22 juanpauc_ joined
11:24 asm_ joined
11:26 justinfokes joined
11:27 cretiq joined
11:28 locallycompact joined
11:29 LAZAR joined
11:29 merijn joined
11:29 prkc joined
11:29 leat joined
11:29 locallycompact joined
11:30 cheater joined
11:30 <LAZAR> Any suggestions how to improve code style / performance on this short knapsack problem solver? http://lpaste.net/355569 Much appreciated!
11:30 tlaxkit joined
11:31 shangxiao joined
11:31 locallycompact joined
11:32 juanpaucar joined
11:32 malc_ joined
11:32 sdothum joined
11:33 locallycompact joined
11:33 fendoer joined
11:34 xcmw joined
11:35 halogenandtoast joined
11:35 ziyourenxiang joined
11:35 locallycompact joined
11:35 <* hackage> patat 0.5.2.0 - Terminal-based presentations using Pandoc https://hackage.haskell.org/package/patat-0.5.2.0 (JasperVanDerJeugt)
11:36 jer1 joined
11:36 phaji_ joined
11:36 selthas joined
11:37 crobbins joined
11:38 locallycompact joined
11:38 <opqdonut> LAZAR: could use pattern matching instead of n==0 in generateItems. otherwise looks good
11:38 henriksod joined
11:39 <lyxia> Also pattern match on pairs, especially when using random generators
11:40 Yuras joined
11:40 <LAZAR> opqdonut: Interestingly, someone suggested to me yesterday to use if...else if there are just two alternatives and a boolean predicate
11:40 insitu joined
11:40 <opqdonut> LAZAR: fillKnapsack could track the weight left, so decrease `limit` every time you add an item
11:40 7IZAAJZLL joined
11:40 7ITAA4DK1 joined
11:41 <opqdonut> LAZAR: yeah if it was a generic boolean predicate, but for equality you can pattern match
11:41 juanpaucar joined
11:41 <lyxia> LAZAR: IIRC the suggestion was to use if over case
11:41 <opqdonut> it's idiomatic
11:42 nickager joined
11:44 <LAZAR> And how would i pattern match a local variable? like value = randomR range generator
11:44 justinfokes joined
11:44 <lyxia> (value, gen') = randomR range generator
11:44 msko joined
11:45 <LAZAR> lyxia: ah cool so basically like in python
11:46 <lyxia> yeah
11:46 <lyxia> but better since you can do this with any algebraic data type
11:46 bigos joined
11:49 darlan joined
11:49 Yuras joined
11:50 anoLB joined
11:50 ptigwe joined
11:50 juanpaucar joined
11:51 jathan joined
11:55 Elhamer joined
11:55 merijn joined
11:56 insitu joined
11:56 jer1 joined
11:56 <wilornel> Is there any resource that explains all Haskell errors? A lot of times they do not make sense to me
11:57 nh21 joined
11:57 Elhamer_ joined
11:57 <wilornel> I mean, right now I think I veguely understand why there is an error ( I would not be able to explain all of the technicalities ), but the error does not make sen
11:57 <wilornel> se
11:59 fortruce joined
11:59 juanpauc_ joined
11:59 Boomerang joined
12:01 sankarshan1 joined
12:02 justinfokes joined
12:03 <merijn> wilornel: I'm not sure, tbh. You can always just ask here
12:04 <Cooler> can you not have a let block in a pattern guard's result?
12:04 <Cooler> | otherwise = let foo = bar 2 2
12:04 louispan joined
12:05 takle joined
12:05 <lyxia> what would be the meaning of that
12:05 <hpc> Cooler: let syntax is "let <definitions> in <expression>"
12:09 juanpaucar joined
12:11 sgronblo joined
12:11 danthemyth joined
12:11 TCZ joined
12:13 yellowj joined
12:14 tromp joined
12:14 ccomb joined
12:14 taktoa joined
12:15 sepp2k joined
12:15 sighingnow joined
12:16 Yuras joined
12:16 Mortomes|Train joined
12:17 magthe joined
12:17 jer1 joined
12:17 moongazer joined
12:18 <LAZAR> Which kind of indentation styl do you think is better? http://lpaste.net/355573 Aligning all possible results in one line or not?
12:18 juanpaucar joined
12:18 _deepfire joined
12:18 <LAZAR> *style
12:18 <ertes-w> wilornel: the most important thing is to actually read the error messages… GHC is good at explaining the error, and if you don't understand the error message, then it means that you need to learn some new concepts
12:18 mohsen_ joined
12:19 takle_ joined
12:19 eklavya joined
12:19 <ertes-w> LAZAR: i find the top one easier to read
12:19 Achylles joined
12:20 AlexRussia joined
12:20 <ertes-w> LAZAR: although in line 2 i would probably not use any padding
12:20 justinfokes joined
12:20 <ertes-w> in lines 4 and 5 i would align the "=", but write them right after the condition: … - getWeight sack = fillKnapsack …
12:21 cschneid_ joined
12:21 <* hackage> model 0.3 - Derive a model of a data type using Generics https://hackage.haskell.org/package/model-0.3 (PasqualinoAssini)
12:21 raviteja joined
12:23 <LAZAR> ertes-w: yeah thats true
12:23 nh2 joined
12:24 tsmish joined
12:25 merijn joined
12:27 juanpaucar joined
12:29 takle joined
12:29 juanpauc_ joined
12:30 justinfokes joined
12:30 systadmin joined
12:32 mmn80 joined
12:32 noumenon joined
12:33 ephemeral joined
12:33 fendor joined
12:33 prkc joined
12:33 takle joined
12:36 Elhamer__ joined
12:37 <angerman> if anyone has questions regarding this: https://medium.com/@zw3rk/a-haskell-cross-compiler-for-raspberry-pi-ddd9d41ced94, let me know. I'll be happy to answer :)
12:38 juanpaucar joined
12:38 Aruro joined
12:39 <Younder> angerman, Does it use a C compiler for cross compilation?
12:39 <* hackage> servant-auth-token 0.4.6.0 - Servant based API and server for token based authorisation https://hackage.haskell.org/package/servant-auth-token-0.4.6.0 (NCrashed)
12:40 crobbins joined
12:40 <angerman> Younder: if you mean if it goes through the C backend, then no. It uses GHC's LLVM backend.
12:40 anoLB joined
12:41 jer1 joined
12:41 <Younder> angerman, ahh. So no clasp or gcc. nice to know
12:41 <ertes-w> let's say, you want to convert A1, A2 and A3 to B, so you might start by writing functions f1 :: A1 -> B, f2 :: A2 -> B, f3 :: A3 -> B… the functions are just similar enough that you might think of merging them into an abstraction using a common A: f :: (a -> A) -> a -> B
12:41 <angerman> Younder: however the llvm backend does stg -> cmm -> llvm ir -> assembly -> object files. And clang is used as the assembler.
12:42 takle joined
12:42 <ertes-w> now you get A4 and A5, and also the functions f1, f2 and f3 are changing… in order to keep the abstraction you make f more powerful and thus more complicated… with every change f becomes more complicated, both in terms of interface and in terms of implementation
12:42 <angerman> Younder: or any other assembler that is found to turn assembly into object files.
12:42 twomix joined
12:42 <ertes-w> is there a name for this kind of problem?
12:42 <angerman> Younder: I'm not sure that this answers your question though?
12:43 <ertes-w> when seemingly similar functions are just different enough that abstraction is more expensive than ad-hoc
12:43 <lambdamu> I'm unhappy with the amount of manual work hsc, c2hs and greencard require. I wish there were a swig backend. How hard can it be to auto generate low level c bindings..
12:43 takle joined
12:43 <ertes-w> lambdamu: a few libraries do that… see 'gl' for example
12:44 <Younder> angerman, It serves my purposes for now. An ARM version of Haskell could be interesting. (Even if it has to be X-compiled.)
12:44 <LAZAR> What is the best way to deploy a haskell app for someone without GHC installed? I thought about Docker
12:44 <Younder> That is a ARM version of a haskell program.
12:44 <angerman> Younder: I think there will be arm binaries of the ghc release, which are native arm -> arm.
12:44 <Cale> Younder: If you have a sufficiently powerful ARM machine, perhaps it doesn't have to be cross compiled.
12:45 <lambdamu> ertes-w: do they use some homebrew solution and do they parse headers directly or some kind of spec?
12:45 <lambdamu> gonna take a look
12:45 wei2912 joined
12:45 <Younder> Cale, I have a Jetson TX1 which is fairly powerful
12:45 <angerman> Younder, Cale: yes the intention was to use a more powerful machine to compile to raspberry pi (a rather low power system).
12:45 <exio4> LAZAR: GHC compiles quite standalone apps by default
12:45 <ertes-w> LAZAR: i'm using nix+docker for that, but you can also just compile a static executable
12:45 <exio4> LAZAR: (unless you enabled -dynamic)
12:45 <ertes-w> lambdamu: i don't know, sorry… look at the source code
12:46 <LAZAR> exio4: It will compile elf bytecode on my machine which will not run on windows.....
12:46 <ertes-w> LAZAR: oh, if it's a different architecture/OS, you will need cross-compilation, or you need to use a native GHC
12:46 takle joined
12:47 <LAZAR> ok i guess Docker is the easiest solution
12:47 <angerman> Younder: yes, there are arm ghc binaries. I believe Phyx- is building and providng them. See https://www.haskell.org/ghc/download_ghc_8_0_2.html#linux_armv7
12:47 <ertes-w> LAZAR: docker will not solve the different-OS problem
12:47 <ertes-w> LAZAR: if it's a linux image, it will only run on linux
12:47 <angerman> Younder: I believe there will be aarch64 builds eventually as well.
12:47 Gloomy joined
12:47 <Younder> QUEMU allows you some play here as it simulates other CPU's
12:47 juanpaucar joined
12:47 <LAZAR> ertes-w: yeah but others can run my program inside a docker container
12:48 justinfokes joined
12:48 <ertes-w> LAZAR: also note that docker uses the notion of containers, with filesystems, etc… you couldn't just "install" a docker image as a regular program
12:48 hurkan left
12:48 Natch joined
12:49 Gurkenglas joined
12:49 <ertes-w> so it's mostly useful for long-running programs like daemons
12:49 <anoLB> i suppose you could target xen, and run on qemu...
12:49 <angerman> Younder: yes, you can use the user emulation mode on linux. A quemu free cross compiliation setup, can be easier I believe.
12:49 <ertes-w> with a network interface
12:49 <Younder> angerman, arm7 is pretty ancient. You want a modern 64bit ARM
12:49 anton____ joined
12:49 <angerman> Younder: which is why I said aarch64 build should be coming up soon, I believe.
12:49 <Cale> LAZAR: You might just want to get hold of a Windows machine, build the app there, and you'll end up with a Windows executable that way.
12:49 tromp joined
12:49 <anoLB> using HalVM ?
12:50 <ertes-w> LAZAR: you should find a way to produce native executables
12:50 meba joined
12:50 <exio4> native executables which would be quite standalone
12:51 <angerman> Younder: for raspberry pi though, you are essentially targetting armv6, if you target raspbian, as that supports rpi1, rpi2, rpi3, rpi0. And rpi1 and rpi0 are armv6 only.
12:51 alsoLB joined
12:51 <Cale> heh, or depending on what kind of program it is, you might just use ghcjs to compile it to javascript and then it'll just run in the browser :D
12:52 <exio4> Cale: that's like.. cheating!
12:52 takle_ joined
12:52 hicksy joined
12:53 <* angerman> doesn't know much about cross compiling *to* windows. :(
12:53 hicksy left
12:53 <angerman> ok.. I don't know much about cross compiling *from* windows either ...
12:54 <Younder> angerman, yea aarch64 works on my Jetson only
12:55 <angerman> huh? no arm emulation? I thought they all were able to do arm...
12:56 <Younder> the raspi's as you said run arm7
12:56 <Younder> Just did a quick uname -a
12:56 juanpaucar joined
12:57 psychicist__ joined
12:57 <* hackage> flat 0.3 - Principled and efficient bit-oriented binary serialization. https://hackage.haskell.org/package/flat-0.3 (PasqualinoAssini)
12:58 <angerman> Younder: yea, rpi2 is armv7. However raspbian is compiled for arm-linux-gnueabihf, which is armv6, so it support rpi1 and rpi0 (which are armv6) as well.
12:58 <angerman> Younder: see: https://en.wikipedia.org/wiki/Raspberry_Pi
12:59 k___ joined
12:59 jpll joined
13:00 Aruro joined
13:00 danza joined
13:01 bodisiw joined
13:01 hackebeilchen joined
13:02 jer1 joined
13:02 cdg joined
13:03 fizruk joined
13:04 stevenxl joined
13:04 takle joined
13:04 stevenxl joined
13:04 stevenxl joined
13:05 justinfokes joined
13:05 <stevenxl> Hi folks. New to Haskell. My program typechecks, but I get an exception when I am running my program in the repl. Is this just because of the repl?
13:05 <stevenxl> https://www.irccloud.com/pastebin/XbMAbObj/
13:05 dsh joined
13:05 takle joined
13:05 <stevenxl> Or did I use exitSuccess incorrectly
13:06 juanpaucar joined
13:06 mnxx joined
13:06 xtreak joined
13:08 eschnett joined
13:09 <Younder> exitSucess should be unnecessary and not set to the function Palindrome at least. I recommend a function for determining if it is a palindrome, one for the printout and a main for calling and exiting
13:09 sanitypassing joined
13:10 xtreak joined
13:11 halogenandtoast joined
13:11 <ertes-w> using 'case' instead of 'if' for Bool is actually kinda charming =)
13:12 xificurC joined
13:12 e2 joined
13:12 <Younder> compareStrings for strings
13:13 <Cooler> is there a way to insert a conditional breakpoint?
13:14 <* hackage> cabal-doctest 1.0.2 - A Setup.hs helper for doctests running https://hackage.haskell.org/package/cabal-doctest-1.0.2 (phadej)
13:14 _deepfire joined
13:14 <Cooler> foo a b = :break (a == 2)
13:15 justinfokes joined
13:15 juanpaucar joined
13:15 <Cooler> Cale, ?
13:16 <Cale> Cooler: I haven't really used ghci's debugging stuff much at all, but I don't recall there being a way
13:18 <Cale> Cooler: You could do something to branch on the value of a, and then set a breakpoint in the location where a is 2 or whatever.
13:18 TCZ joined
13:19 <Cale> I've never found breakpoints to be very useful -- they're quite a weird notion in the presence of lazy evaluation.
13:19 <Cooler> how do you debug in lazy evaluation?
13:19 aarvar joined
13:19 <Cooler> without breakpoints
13:19 <Cale> Mostly by evaluating expressions and figuring out what isn't evaluating to what you expect it to
13:20 juanpaucar joined
13:20 <ertes-w> make code modular enough that you can test individual modules on their own
13:20 <c_wraith> Debug.Trace is handy, but you need to remember what it isn't.
13:20 <ertes-w> since lazy code is also pure code, testing is usually very easy
13:21 <Cale> Debug.Trace is mostly handy for getting realistic arguments to functions in cases where those wouldn't necessarily be obvious
13:21 locallycompact joined
13:21 ChristopherBurg joined
13:21 locallycompact joined
13:21 <Younder> If you functions are typed they should be caught by the compiler
13:21 <Cale> You can write something like foo x y z | trace (show ("foo", x, y, z)) False = undefined
13:22 <Cale> i.e. add that guard to the top of the definition of the function foo
13:22 <Younder> no
13:22 jer1 joined
13:22 <c_wraith> though doing that breaks any code that depends on laziness to work. :)
13:22 <Cale> yes
13:22 <ertes-w> foo x y z = … where !_ = traceShow ("foo", x, y, z) ()
13:23 <Cale> hah, bang patterns
13:23 <Cale> I still don't really think bang patterns should be able to do that
13:23 <Cale> but okay :)
13:23 <ertes-w> why not?
13:23 <ertes-w> it's super-useful
13:24 <Cale> Because it makes the translation a bunch less straightforward.
13:24 etehtsea joined
13:24 xall joined
13:24 <Unode> Can someone explain the difference of having guard syntax | ... = ... versus | ... -> ... ? When does one use one or the other?
13:24 <Cale> and I dunno, turning let into case seems odd to me, though I guess ~ basically turns case into let, so whatever
13:24 juanpauc_ joined
13:24 <ertes-w> sure, but i'm willing to pay =)
13:24 <c_wraith> that also has weirdness issues with the scoping of where clauses when multiple equations and guards are involved
13:24 romank joined
13:24 <Younder> I think for a beginner it might be more confusing than useful.
13:24 <c_wraith> Unode: = is for declarations, -> is for case expressions
13:24 <lyxia> are bang patterns defined as sugar for seq? I wonder whether it's RebindSyntax-able ...
13:25 <lyxia> (this is not a good idea ofc)
13:25 <Younder> How about just sticking to the usual debugging procedures.
13:25 <ertes-w> lyxia: not sure, but i'm pretty sure it's more likely translated into 'case'
13:25 <Unode> c_wraith: so these are different kinds of guards?
13:25 <Cale> Unode: Inside case expressions, use ->
13:25 shangxiao joined
13:25 <c_wraith> Unode: they're identical in meaning, they're just different parts of the syntax
13:25 <Cale> Unode: In function and pattern bindings, use =
13:25 <ertes-w> oh, no…
13:26 <Unode> ok, thanks
13:26 <Cale> lyxia: Yeah, the translation involves seq
13:26 <ertes-w> whatever, i know what it does… not so worried about *how* it does it =)
13:26 <Cale> When bang patterns were first implemented, the translation was *super* simple
13:26 insitu joined
13:27 eschnett joined
13:27 SkyPatrol_ joined
13:27 <ertes-w> Cale: i rarely use bang patterns for function arguments… most of my uses are for 'let' and 'where'
13:27 <Cale> You'd just throw a seq in for each variable with a bang on the right hand side.
13:27 <ertes-w> for 'let' i could live without them, but the 'where' stuff is really awkward to write without bang patterns
13:28 <ertes-w> f x' | b = y1 | otherwise = y2 where !x = g x'
13:28 <Cale> But that meant that, e.g. let !x = ... in ... would mean let x = x `seq` ... in ...
13:28 <ertes-w> something like that is very convenient
13:29 eacameron joined
13:29 <ertes-w> f x' | x `seq` b = y1 | otherwise = y2 where x = g x' -- awkward
13:30 <Cale> I don't know why, but I've never actually come across an instance where I needed a bang in a where clause like that
13:30 <tobiasBora> Hello,
13:30 <tobiasBora> I'm using the pool package https://hackage.haskell.org/package/resource-pool-0.2.3.2/docs/Data-Pool.html
13:30 <ertes-w> Cale: i write functions like this a lot: f x = go where …
13:30 <ertes-w> Cale: where 'go' is a function
13:31 <ertes-w> Cale: telling GHC that a local value can be evaluated right away seems to help the strictness analyser a lot, so i get much more efficient code in return
13:32 wavemode joined
13:32 <tobiasBora> in order to create a pool of connections. In my postgresql options, the maximum number of connections is 100, so I'd like to create a 60 connections to pools. However I'm not sure to understand the difference between the two parameters in the pool settings
13:32 <tobiasBora> I tried this:
13:32 <tobiasBora> Pool.createPool (PGSQL.connectPostgreSQL connString) 60 600 60
13:32 <Cale> ertes-w: In a case like that though, you could just use seq
13:32 dhil joined
13:32 <tobiasBora> However it creates too many connections
13:32 <ertes-w> Cale: then if you use it like (map (f x)), it also initialises the local values before the fold even starts
13:33 <tobiasBora> What do they call stripes ?
13:33 <tobiasBora> What is the good way to set up a maximum number of simultaneous connections of 60 ?
13:33 juanpaucar joined
13:33 <Cale> tobiasBora: That's the second argument to createPool
13:33 <ertes-w> Cale: yes, but seq gets unwieldy if you have a few of those, and you also get a locality disconnect between the definition and the "evaluate immediately" intent
13:33 <Cale> er, third
13:33 <ertes-w> Cale: it's just much nicer with bang patterns
13:34 <Cale> (the first numerical argument)
13:34 <tobiasBora> hum I wrote you the wrong command, the good command is "Pool.createPool (PGSQL.connectPostgreSQL connString) (HDBC.disconnect) 60 600 60"
13:34 Wuzzy joined
13:34 <tobiasBora> Cale: and what should be the first numerical argument ?
13:34 <Cale> So that's going to have 60 stripes
13:35 Levex joined
13:35 eacameron joined
13:35 <Cale> It will leave unused connections open for 600 seconds
13:35 <Cale> and it'll keep at most 60 connections open per stripe
13:36 <tobiasBora> Cale: what is a stripe ?
13:36 <Cale> Independently managed sub-pools. Usually you just want 1
13:37 <Cale> We use createPool openPostgresql closePostgresql 1 5 20
13:37 <tobiasBora> Ok thank you. Here I've 60 * 60 connection maximum right ?
13:37 <Cale> yeah, that's rather extreme
13:37 <tobiasBora> I see thank you.
13:37 <mutsig_> Hi. I've got a question regarding heap profiling. After around 40 in my heap profile, I get a significant increase of "trace elements". After a few googles, I couldn't find what that refers to. What are "trace elements"?
13:37 <tobiasBora> Why 5 is better than 600 ?
13:37 <tobiasBora> usually I don't want to close connection right ?
13:38 xcmw joined
13:39 cretiq joined
13:39 <Cale> I haven't really thought too much about that, but if you're sharing a database server between many running instances of the application, it might be important to clean up more promptly
13:40 ystael joined
13:40 <Cale> mutsig_: Everything which isn't listed in the legend
13:41 oisdk joined
13:41 <mutsig_> Cale: Ok, thanks.
13:41 <Cale> mutsig_: the term comes from chemistry
13:42 <mutsig_> Cale: Is there any general thing to consider if trace elements is a large portion of the heap?
13:42 hybrid joined
13:42 oisdk joined
13:42 <Cale> There's a flag to hp2ps
13:42 <Cale> http://downloads.haskell.org/~ghc/7.4.1/docs/html/users_guide/hp2ps.html
13:42 <Cale> oops, that's old, but whatever
13:42 juanpaucar joined
13:42 <Cale> -t<float>
13:43 jer1 joined
13:43 <Cale> https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/profiling.html#cmdoption-hp2ps-t
13:43 <merijn> Poll: I have a library for channels that's currently using Control.Concurrent.BroadcastChan as namespace, but now that I want to introduce submodules to that it's becoming a rather cumbersome name for importing. Should I just switch to a top-level BroadcastChan module?
13:43 <Cooler> is foldr better than foldl?
13:44 <Cale> Cooler: For what task?
13:44 <Cooler> Cale, reducing an array
13:45 <Cale> Cooler: An *array*?
13:45 <Cooler> list
13:45 <Cale> Cooler: I mean, which functions are you supplying as arguments to the thing?
13:45 <Athas> Cooler: foldl' is best.
13:45 <Cale> Cooler: foldr and foldl are better than each other in different circumstances
13:45 <Athas> Use foldr if you want laziness, otherwise use foldl'. Never use plain (non-strict) foldl.
13:46 tjbp joined
13:46 <Cooler> Cale, well its a custom function
13:46 <Cale> (and usually when foldl is better, foldl' makes sure that you get the advantage, but GHC's optimisations are typically smart enough anyway)
13:46 <Cale> Cooler: *which* custom function
13:46 <Cale> Does it pattern match on both its arguments?
13:46 dm3 joined
13:46 <Cooler> oh
13:47 <Cooler> right now i am using foldr and pattern matching on the first
13:47 <Cale> > foldr (\x xs -> if even x then x:xs else xs) [] [1..] -- can't do this with foldl, for instance
13:47 <lambdabot> [2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,5...
13:47 <Cale> (i.e. implement filter)
13:48 mmachenry joined
13:48 <Cale> @src foldr
13:48 <lambdabot> foldr f z [] = z
13:48 <lambdabot> foldr f z (x:xs) = f x (foldr f z xs)
13:48 `^_^v joined
13:49 <Cale> As you can see there, foldr immediately gives control to f in the nonempty list case
13:49 <Cooler> Cale, its always a finite list
13:49 <Cale> only if f examines its second argument will the foldr continue
13:49 <Cale> So foldr can short-circuit
13:49 <Cale> @src foldl
13:49 <lambdabot> foldl f z [] = z
13:49 <lambdabot> foldl f z (x:xs) = foldl f (f z x) xs
13:50 <Cale> foldl by contrast greedily applies itself to new arguments until it reaches the end of the list
13:50 <blackdog> Cooler: kinda doesn't matter - if it's a finite but large list, you need to know how it's being produced or you could end up with memory leaks
13:50 zariuq joined
13:50 <Cale> Both of them work from left to right -- it's important to understand that a list can't be processed in any other order.
13:50 <Cooler> you can have memory leaks in haskell?
13:51 <Cale> Sure
13:51 <blackdog> it's not quite the same thing as a C memory leak, where you have stuff go missing permanently because you forgot t ofree it
13:51 davr0s joined
13:51 <mutsig_> Cooler: If you build up large thunks of unevaluated function calls, you get memory leak.
13:51 <blackdog> it's more like the working set is bigger than it needs to be
13:52 juanpaucar joined
13:52 <Cale> It's where you have stuff that's not garbage, but would be, if you were to do the evaluation that you'll eventually end up having to do anyway.
13:52 burtons joined
13:52 xanadu joined
13:53 <mutsig_> Cooler: that's what foldl might cause and foldl' might fix
13:53 nh2 joined
13:54 Khisanth joined
13:55 FreeBirdLjj joined
13:55 oisdk joined
13:55 AlexRussia joined
13:56 <Cale> The difference with foldl' is that it hints to GHC that the (f z x) there which you can see in the definition of foldl will need to be evaluated, so that it can choose to do that evaluation sooner.
13:56 <Cooler> Cale, well the second argument in function given to foldr is the accumulator right?
13:56 <Cale> Compiling with -O, GHC will generally get that right on its own, but sometimes you'd rather be sure about it.
13:56 <Cale> I wouldn't refer to it as an accumulator
13:57 <Cale> It's the result when applied to an empty list
13:57 <Cale> It doesn't accumulate anything in foldr's case
13:57 <Cale> @src foldr
13:57 <lambdabot> foldr f z [] = z
13:57 <lambdabot> foldr f z (x:xs) = f x (foldr f z xs)
13:57 <Cooler> well i am using it like an accumulator, its a Data.Map.Strict.Map that i am inserting stuff into
13:57 sternmull joined
13:57 <Cale> ^ we're passing the same z along
13:58 <Cale> Cooler: You almost certainly want foldl/foldl'
13:58 <Cale> Cooler: But probably even moreso, you'd rather use fromList and then union
13:59 <Cooler> well i am not just inserting that item
13:59 <Cooler> i am processing the item and inserting modifying the Map in the process
14:01 juanpaucar joined
14:01 <wilornel> I think the biggest confusion for me with the error messages is the wordings with "expected" and "actual"
14:02 Vally944 joined
14:02 <Cale> wilornel: Expected is what is expected to go in that position, actual is the type of the expression which is there.
14:02 <wilornel> expected means something on the right had to be like something on the left? How can I tell which token that I am looking at is the one that is expected to match something else?
14:02 plutoniix joined
14:02 Vally944 left
14:02 <wilornel> how can I know which position it's refering to?
14:03 <Cale> It tells you which expression had the wrong type
14:03 <Cooler> wilornel, it gives you the line and column number
14:03 <Cooler> also that
14:03 selthas joined
14:04 <wilornel> ah right, thanks!
14:04 <wilornel> thanks Cale and Cooler
14:05 mnxx left
14:05 <Cooler> so use foldl' ?
14:06 <Cooler> heres an example of foldr http://lpaste.net/355581
14:06 <Cale> Cooler: You shouldn't have to, there are suitable functions in Data.Map already
14:06 jerome_ joined
14:06 <Cale> for aggregating maps from lists of key/value pairs
14:07 jer1 joined
14:07 jerome_ left
14:07 sighingnow joined
14:07 <Cale> (fromList, fromListWith)
14:07 <wilornel> I think this makes sense as well: Remember: the type of 𝑎 is usually set by the le most instance of it and can’t change in the signature Eq a => a -> a -> Bool. Applying (==) to Integer will bind the 𝑎 type variable to Integer.
14:07 <wilornel> that's in the Haskell Programming from First Principles book
14:08 <Cooler> Cale, well in the paste, i am using the list as keys
14:08 <Cooler> or part of a key into the map
14:08 eacameron joined
14:09 angelos joined
14:09 Levex joined
14:09 romank joined
14:09 <merijn> So, no one has opinions on following the existing module hierarchy or not?
14:10 nh2 joined
14:10 juanpaucar joined
14:12 <Athas> merijn: the Haskell module namespace is a mess anyway. You can't make it worse!
14:12 <glguy> now you're polling about polls?
14:12 <Cale> merijn: I was vaguely thinking that I might consider naming the type BChan
14:12 <Athas> If you just have convenience modules that re-export everything, then it doesn't matter if that convenience module has a long name.
14:13 eklavya joined
14:13 takle joined
14:13 afarmer joined
14:14 <merijn> Cale: That doesn't really reduce much clutter from the import statements, tbh
14:14 <merijn> Cale: I already use BChan in the function name, but use a fully spelled type
14:14 <merijn> Cale: i.e. "writeBChan" over "writeBroadcastChan"
14:14 peterhil joined
14:14 <merijn> glguy: Yes! :p
14:15 <Cooler> union table $ fromList $ map (\f -> ((sn, f), entry)) follows
14:15 <Cooler> is that beter?
14:15 <Cooler> better*
14:15 <Cale> Cooler: that looks like what I was thinking
14:15 <Athas> The successor to Haskell better have a good module system.
14:15 <Cooler> is it better than this http://lpaste.net/355581
14:15 <Cooler> which uses foldr
14:15 <Cooler> or would foldl' be better
14:16 <merijn> Cale: I was more trying to figure out whether people would consider BroadcastChan "valuable" namespace or whether I should just grab it :p
14:16 <Cale> It's similar to using foldl' though there might be some advantage to the union that you can't get by folding
14:16 nglsr joined
14:16 thunderrd joined
14:16 <Cale> union will be linear time in the size of both Maps
14:16 juanpaucar joined
14:16 <Cale> while insert is O(log n) time per element, so it ends up being O(n log n) ish
14:17 halogenandtoast joined
14:17 <Cale> But fromList is O(n log n) anyway
14:17 oisdk joined
14:17 <Cale> You'd have to do more careful analysis than my current sleep schedule would allow me to do ;)
14:17 <wilornel> data (,) a b = (,) a b
14:17 <wilornel> instance (Eq a, Eq b) => Eq (a, b)
14:18 fizruk joined
14:18 <wilornel> What does that mean? The data type tuple would need to define how it treats equality if it wants to be an instance of Eq
14:18 <Younder> wilornel, what is that supposed to mean?
14:19 <wilornel> I'm trying to understand what the second line tells us
14:19 <Cooler> wilornel, its a constraint
14:19 <merijn> wilornel: Forget everything you know about inheritance and instances from OO
14:19 <Cooler> a and b have to have instances of Eq
14:19 <merijn> wilornel: Whether a type is an instance of a typeclass is completely separated and unrelated to it's definition
14:19 <wilornel> so if a is an instance of Eq and b is an instance of Eq, then we can say that (a,b) is an instance of Eq
14:19 <ph88^> how can i find code that uses this function? https://hackage.haskell.org/package/conduit-1.2.10/docs/Data-Conduit.html#v:tryC
14:20 takle joined
14:20 eschnett joined
14:20 <wilornel> so a type that is an instance of a typeclass does not need to implement the functions of the typeclass?
14:20 <merijn> ph88^: http://packdeps.haskellers.com/reverse
14:20 <Younder> would it not be clearer to use (a,b) than (,) a b
14:21 <wilornel> aaah wait! So in the syntax `instance A B`, we say that B is an instance of A, right?
14:21 <Cale> wilornel: It *really* should. If it doesn't, then unfortunately, what happens is that you get a warning and the methods get implemented with a runtime error.
14:21 <wilornel> And in `instance Constaint => A B` , we are saying that B is an instance of A, but only under the given constraint
14:21 <Cale> Yeah, the type B is an instance of the type class A.
14:21 <Cale> yeah
14:21 <wilornel> woot!
14:22 <wilornel> I just feel like the syntax does not communicate things clearly
14:22 <glguy> merijn: my opinion is that it's ok to blaze your own module trail
14:22 <wilornel> but this makes sense now!
14:22 <merijn> ugh...there's really nothing more readable than ghc-core? :(
14:22 <Younder> sigh, Haskell can be confusing
14:22 <Cale> Note that when deciding which instance applies to a given situation, the algorithm will *not* consider the constraints, only the structure of the type
14:22 <wilornel> but I didn't ge tmerijn's comment
14:22 <wilornel> principal type?
14:22 <Cale> Only after committing to a choice of instance will the constraints apply
14:22 <wilornel> It will check that the principal type fits under the constraints?
14:22 <merijn> wilornel: I was trying to say roughly the same thing. i.e. that instance can be declared separately from datatypes :)
14:22 uglyfigurine joined
14:23 <wilornel> merijn: cool!
14:23 <glguy> merijn: flags like -dsuppress-all and -dsuppress-uniques help
14:23 <Younder> Luckily it grows on you. In time you might even find it beautiful.
14:23 <wilornel> Younder: It does look very concise, which I really like!
14:23 <merijn> wilornel: So, if I define a new class I can make other, already existing types, instance too
14:23 <wilornel> ah, yes!
14:24 <ph88^> merijn, there are a lot of package which used conduit .. i already search all the yesod packages
14:24 <merijn> glguy: ah, that looks slightly less harrowing
14:24 <merijn> ph88^: You could try searching github for the function name too
14:24 <ph88^> merijn, i did that
14:24 <Cale> wilornel: The instance to use will be selected based on the actual type, not just the principal type of an expression -- if you manually specify a type, it will be using that, rather than what would have been inferred.
14:25 uglyfigu_ joined
14:25 <Younder> wilornel, Haskel has been (I think formally) declared a notation for math. So Haskell really is Math
14:25 <Cale> uhhh
14:25 <merijn> Younder: I would strongly disagree with that
14:25 <Younder> How concise is that!
14:26 <c_wraith> Younder: Haskell is a rather bad math. :)
14:26 <wilornel> what do you mean?
14:26 <Cale> Haskell is not a very good system for doing mathematics. As a logic, it's inconsistent.
14:26 jer1 joined
14:26 <c_wraith> Younder: good look proving things usefully in haskell.
14:26 <c_wraith> Younder: since undefined is a proof of everything.
14:26 <ph88^> merijn, i only found this http://www.yesodweb.com/blog/2014/01/conduit-transformer-exception i would like an example how to write a handler
14:26 <Cale> But there are definitely close parallels to be drawn.
14:26 <Cale> (the fact that we can say that it's an inconsistent logic is something!)
14:26 <merijn> glguy: Do you by any chance know how I can suppress derived typeclasses too?
14:26 <Cale> :t fix
14:27 <lambdabot> (a -> a) -> a
14:27 <Younder> c_wraith, I use it for proving things all the time in haskabelle
14:27 tefter joined
14:27 <Cale> As a logical proposition, that doesn't make much sense: "If a implies a, then a"
14:27 <c_wraith> Younder: that is a different language.
14:27 NeverDie joined
14:28 justanotheruser joined
14:28 rcschm joined
14:28 mizu_no_oto joined
14:28 <c_wraith> Younder: Isabelle can prove things. But when the code you write interfaces with other haskell code, the proofs are gone again.
14:28 <Younder> c_wraith, For type theory to work with logic you need braided types as defied in Jacobs 'categorical types and logic'
14:28 <ongy> they aren't gone, they may just not mean much
14:28 tromp joined
14:28 <Cooler> how does fix work? it takes a function and gives you a value?
14:28 <Cale> Cooler: It gives you the least-defined fixed point of the function
14:28 <c_wraith> > fix $ (0:) . scanl (+) 1 -- Cooler
14:28 <Cale> fix f = x where x = f x
14:29 <lambdabot> [0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,...
14:29 <Cale> heh, nice starting example
14:29 <Younder> The thing is to bind a an object and its behaviour to a type
14:29 {emptyset} joined
14:29 <Cale> Let's start with something simpler
14:29 <Cale> > fix (1:)
14:29 <c_wraith> Cooler: it's an abstraction of general recursion
14:29 <lambdabot> [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1...
14:29 <Younder> You are not listening to me
14:29 <c_wraith> Cooler: anything that can be written with recursion can be rewritten with a non-recursive form and fix
14:29 prkc joined
14:30 <Cale> Note that undefined is not a fixed point of the function (1:), since 1:undefined is not the same as undefined
14:30 <Cooler> recursion to iteration?
14:30 <Younder> These are alll exceptions vreated by a brai damaged set system
14:30 <wilornel> what is going on. I wish I understood more to see what's going on
14:30 revprez_atlanta joined
14:30 <Younder> This is how it is done:
14:30 <ongy> > fix show -- the favorite example of the person that showed me Haskell :)
14:30 <lambdabot> "\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\...
14:30 <c_wraith> wilornel: I recognize that feeling. I spent about a year feeling that way in this channel. But I eventually picked it all up. :)
14:30 <Cale> by the definition, we have:
14:30 <Cale> fix (1:) = x where x = 1:x
14:31 robertkennedy joined
14:31 <Younder> Yo generalize to have a class different from a set. So you avoid the russel paradox.
14:31 <c_wraith> well. most of it. I certainly don't know it *all*.
14:31 takle joined
14:31 <Cale> So x is a list whose head is 1, and whose tail is x itself again.
14:31 <wilornel> yeah, is it like learnings emacs? you never finish learning it all? what did you read btw?
14:31 <Younder> Thaen you create a categoyical network of classed. Then you braid the classes to bind variables to their objects
14:31 igniting joined
14:32 <c_wraith> wilornel: believe it or not, I'd say I've learned about half of what I know about Haskell from here. The other half from reading blog posts and papers linked to on the haskell subreddit
14:32 <Younder> Haskell is a lot more sound than you seem to think c_wraith
14:32 <Cale> wilornel: You eventually will learn all of the actual language, but there's always more libraries, and in Haskell, the libraries can be like languages of their own.
14:32 <Cooler> Cale, how does the bot print that
14:32 <ongy> I should keep an eye on the subreddit then... I know most from here and "just using haskell"
14:32 <Cale> print what?
14:32 <Cooler> does it take arbitrary?
14:33 oisdk joined
14:33 <Cooler> print 1:1:1:1:1:
14:33 <Cooler> etc
14:33 nwf joined
14:33 tlaxkit joined
14:33 <wilornel> checking out the subreddit as well
14:33 <Cale> Cooler: It applies show and takes the first 76 characters, and sticks "..." on the end
14:33 <c_wraith> ongy: as with all subreddits, you need mental filtering to make it useful. Even though it's way less required than most.
14:33 Elhamer_ joined
14:33 <Cooler> does fix f = f (f (f (f ( ...
14:33 <glguy> merijn: I don't know if you can
14:33 <Cale> Cooler: yes
14:34 <Cale> Cooler: another way we might try to define it is fix f = f (fix f)
14:34 <Cale> That would be less efficient in this case though
14:34 <c_wraith> edwardk's comments in the discussion of the Burritos For the Hungry Mathematician paper were amazing.
14:34 <ongy> c_wraith: For some reason I never got into the reddit thing. I only ever visit that domain if linked to it
14:34 <Cale> With fix f = x where x = f x, since the result is bound to a variable, once it's evaluated, it remains in an evaluated state
14:34 <c_wraith> ongy: reddit in general is a terrifying mess. But a few subreddits are ok.
14:35 <Cooler> > fix (1+)
14:35 <Younder> It all comes down to biggus dickus
14:35 <lambdabot> mueval-core: Time limit exceeded
14:35 nikolah joined
14:35 <Cale> So what ends up happening is that in memory, you end up with a *single* (:)-cell, with its tail pointed at itself
14:35 <merijn> glguy: Oh well, I'll improvise
14:35 <c_wraith> ongy: things like https://www.reddit.com/r/haskell/comments/3rh9tn/burritos_for_the_hungry_mathematician/cwp79zy/ make it worthwhile. :)
14:35 <Younder> Or as we like to refer to him in numbertheory Grothendiech
14:36 SuperTux88 joined
14:36 <wilornel> thanks everyone!! heading to bed. Have a good morning/day/lunch/evening/night/sleep !
14:36 <merijn> glguy: I can always optimise via random perturbation of the source ;)
14:36 <Cale> Cooler: 1 + undefined = undefined, so that's the fixed point you'll get
14:36 <c_wraith> Younder: I'm actually pretty comfortable relying on Haskell's type system to prevent dumb things, because any use of bottom values to circumvent proofs tends to also crash programs. What I'm not comfortable doing is calling that rigorous math.
14:37 <wilornel> actually last thing is, what's the difference between divMod and quotRem?
14:37 <Cale> > fix (\fac n -> if n == 0 then 1 else n * fac (n-1)) 10
14:37 <lambdabot> 3628800
14:37 <merijn> wilornel: The direction they round
14:37 <c_wraith> wilornel: their behavior on negative inputs
14:37 <Cale> wilornel: Sign convention
14:37 <Younder> wilornel, This is aan inspired discussion as I have ever seen here. Pleaso do come back!
14:37 <merijn> wilornel: One rounds towards 0, the other to negative infinity
14:37 <Cale> You almost always want divMod
14:37 <Cooler> Cale, which module has fix
14:37 <c_wraith> wilornel: quotRem corresponds to an x86 assembly instruction, so it should be faster if you *really* need it and know the inputs are positive. :)
14:37 oisdk joined
14:38 <Cale> But quotRem is a bit faster, because it's what CPUs implement, because it's *slightly* cheaper in terms of the number of transistors required.
14:38 <c_wraith> @index fix
14:38 <lambdabot> Data.Function, Control.Monad.Fix
14:38 <wilornel> Younder: Oh! Please keep the discussion going. Show them why haskell can be used for logic. I believe it can. I'll check back later!
14:38 sellout- joined
14:38 <c_wraith> Data.Function is such a sad module. It has... 3 things in it? Can those just be moved someplace more useful?
14:38 <Cooler> Cale, fix (1+) just goes into a infinite loop it doesn't give undefined
14:38 <wilornel> thanks tons Cale, c_wraith Younder, merijn
14:38 <Younder> c_wraith, Nor should you. But with the right tool it can be made rigorous.
14:39 muesli4 joined
14:39 juanpauc_ joined
14:39 <Cale> Cooler: Well, by "undefined" I just mean any form of nontermination.
14:39 tlaxkit joined
14:39 <Cooler> right
14:39 <Cale> Cooler: If you compile your program, you might actually get an exception
14:39 thimoteus joined
14:39 itihas joined
14:40 <c_wraith> Hmm. Yeah, it seems like fix (+1) should get a "<<loop>>" if it's run compiled. I think.
14:40 Elhamer__ joined
14:40 <Cale> (The way that expression evaluation is implemented is able to detect certain easy infinite loops, where in order to evaluate x, you must first evaluate x, and so you never make any progress)
14:40 <merijn> hmm, apparently the cost of pattern matching is roughly a handful of nanoseconds
14:40 mmachenry joined
14:41 Kreest_ joined
14:41 eazar001 joined
14:41 <Cale> Ah, I think the distinction might just be threaded vs. non-threaded runtime
14:42 TheFuzzball joined
14:42 <Cale> In the threaded runtime, you get stuck in a grey hole rather than a black one. :)
14:42 <c_wraith> Cale: even the threaded runtime can find loops, during GC
14:42 <merijn> So, suppose I have a function "foo" and a small (like one extra case) around "foo", should I tell GHC to inline foo to minimise the overhead?
14:42 tommd joined
14:42 <Cale> yeah, though if you don't get to do any allocation...
14:43 <c_wraith> the idle GC can still run
14:43 <c_wraith> Unless you turned it off...
14:44 revprez_atlanta joined
14:44 <c_wraith> Or unless there's some other thread that is neither idle nor allocating, I suppose. :)
14:44 <Cale> ah, yeah, it does find it with the threaded runtime here
14:44 <Cale> But not in ghci
14:44 <c_wraith> now add a thread that neither allocates nor is idle and try again. :)
14:45 <c_wraith> (blocking on a blackhole or greyhole counts as being idle)
14:45 phaji_ joined
14:46 <Cooler> i get an error saying show is applied to 3 arguments
14:46 <Cooler> main = do putStrLn $ show (fix (1+) :: Int)
14:46 <Cale> yeah, then it's dead
14:46 <Cale> Cooler: what's the next line?
14:46 AlexRussia joined
14:46 <Cooler> return ()
14:46 <Cale> Cooler: How many spaces before return?
14:46 <merijn> Any heuristics to determine whether inlining some function is useful?
14:46 <ski> indented too much, presumably ?
14:46 <Cooler> its aligned with putStrLn
14:47 <Cooler> oh wait i am using tabs not spaces
14:47 <ski> any tabs ?
14:47 <Cale> Cooler: Do you have tab characters in your source?
14:47 <Cale> ah
14:47 <Cale> there you go :)
14:47 <Cale> Most editors have an option you can turn on to always expand tabs
14:47 mgttlinger joined
14:47 <Cooler> yeah
14:47 jer1 joined
14:47 xificurC joined
14:47 <Cooler> Cale, compiling that its gone into a infinite loop
14:48 <Cooler> i mean running it after compiling
14:48 <ski> @src print
14:48 <lambdabot> print x = putStrLn (show x)
14:48 <Cale> Cooler: Interesting.
14:48 <Cale> Cooler: It should be using essentially no CPU, right?
14:49 <Cale> Cooler: Here I get foo: <<loop>> basically immediately.
14:49 <Cooler> Cale, actually no
14:49 <Cooler> test: <<loop>>
14:49 <Cooler> i get that
14:49 <Cale> right
14:50 <Cooler> something with running it from sublime
14:50 <Cooler> that goes into infinite loop
14:50 <Cale> Well, it's probably running ghci
14:50 <Cale> For whatever reason, ghci is not as good at detecting this loop.
14:51 <Cooler> so the compiler inserts a string in place of the code for the function?
14:51 <Cale> no
14:51 <Cale> This is detected at runtime
14:51 <Cale> It goes to evaluate fix (1+)
14:51 <ph88^> why is it if i move this code around it doesn't type check anymore? https://bpaste.net/show/408d9e4b7955
14:52 <Cale> and when it evaluates x = 1+x
14:52 <Cale> when it starts evaluating x, the pointer to the code for it is overwritten with a pointer which points to a bit of code which will throw an exception if entered
14:52 kmels joined
14:53 theelous3 joined
14:53 <Cale> and then (+) pattern matches on its arguments, causing x to get evaluated during its own evaluation, and you get the exception
14:54 <Cooler> why can't ghci do that
14:54 <Cale> I don't honestly know. There are some fiddly things going on... with the threaded runtime, it's a little more complicated
14:54 <mutsig_> If I have a newtype that derives MonadRandom, how can I set (and/or get) the seed? Is it possible?
14:55 hybrid joined
14:55 <Cale> In the threaded runtime, the "black hole" we replace that pointer with can't just throw an exception.
14:55 eklavya joined
14:55 <Cale> Two different threads might start to evaluate a variable at the same time
14:56 rold joined
14:56 <Cale> So, rather than a piece of code which throws an exception, the pointer is overwritten with a piece of code which waits for the thing to be evaluated (and which will throw an exception if this is the only thread which retains a reference to the variable)
14:56 <ski> ph88^ : try removing the binding for `snk' ?
14:57 <Cale> Perhaps ghci for whatever reason is retaining another reference to the thing in another thread.
14:57 <Cooler> livelock?
14:57 <Sornaensis> livelock is where threads are all doing work but none are making progress
14:57 <Cale> Well, it is a deadlock of sorts -- you'll notice that ghci is using 0% cpu
14:57 <lyxia> mutsig_: The MonadRandom type class does not have a notion of seed
14:58 <Cooler> right
14:58 sanae joined
14:58 urodna joined
14:58 Computist joined
14:58 <Cale> It just sits and waits for the thing to be evaluated, and it never is.
14:58 <ph88^> ski, what binding do you mean ?
14:58 <mutsig_> lyxia: Ok, thanks
14:58 mada joined
14:58 <ski> ph88^ : the one mentioned at the very end of the error message
14:58 <Cale> (iirc, it adds the thread to a queue of threads to be woken up after it gets evaluated)
14:58 ixxie joined
14:58 mattyw joined
14:59 <Cooler> btw hsdev is taking up 500+ Mb of ram
14:59 sanae joined
14:59 <c_wraith> Younder: I don't think we disagree on any facts - just whether to call what you're describing "Doing math in Haskell". :)
14:59 <Cooler> is that normal?
15:00 <Cooler> i installed it via cabal install for emacs
15:00 <merijn> So, if I provide both a non-exception throwing and throwing API, what's a good module name for the throwing version? .Exception? .Throw? Other suggestions?
15:00 <Cale> I don't use hsdev, but it doesn't surprise me... depending on what it's loaded.
15:00 <Cooler> taking around 588 Mb
15:00 <ski> ph88^ : since `snk' isn't used (any longer), it doesn't know which `m' satisfying `MonadIO' to use for `snk'. and since it's a pattern binding with no explicit type signature, DMR strikes
15:00 <ph88^> ski, eh ye that was it .. but i though where was PER pattern match , it's not ?
15:01 <ski> (not sure what you mean by "PER pattern match")
15:01 eazar001 joined
15:01 roldx joined
15:02 sanitypassing joined
15:02 <Unode> when using pattern matching, does the order of the clauses matter?
15:02 <Cooler> actually sublime haskell uses hsdev
15:02 <c_wraith> Unode: yes
15:02 <ski> Unode : yes, but only if you have overlapping defining equations
15:02 <Cale> Cooler: I use Sublime, but ended up just removing SublimeHaskell, since it flaked out too much on the large projects I work on for Obsidian.
15:02 slack1256 joined
15:02 <ph88^> ski, each line of handleInputOutput
15:03 <Unode> and does it stop on the first matching?
15:03 <* ski> still doesn't get it .. sorry
15:03 <c_wraith> Unode: they are (logically) tried top-down, left-to-right. (the latter matters when there are multiple pattern matches on the first line)
15:03 <c_wraith> err, on the same line
15:03 <ski> Unode : yes (if there's guards, a guard need to succeed of course)
15:03 crosleyt joined
15:03 <c_wraith> Unode: if GHC can prove it doesn't change the meaning, it might re-order things, but the resulting code will always have the same semantics as top-down, left-to-right
15:04 <tsahyt> I'm implementing an algorithm that is given as imperative pseudo code and using State is pretty much the way to go. now I'm tempted to pull in lens just for this one algorithm. how bad of an idea is that?
15:04 <Cale> Cooler: heh, a single ghcid for this project's frontend takes 1.7G of memory... I usually have one for the frontend, one for the backend, and then ghci for the frontend and backend as well...
15:04 <* ski> often prefers to have non-overlapping cases, so that the cases can be understood in isolation
15:04 <tsahyt> in terms of dependencies I mean. stack is currently busy compiling 9 extra transitive dependencies for the project
15:04 pie_ joined
15:04 <Cale> Cooler: It really does add up... I'm honestly not sure why it's quite *this* large.
15:05 <c_wraith> tsahyt: if you do that, you might as well use lens everywhere. :)
15:05 <Unode> ok then just to clarify things a bit more, if the first pattern is "func False False [s] = ..." and the function is first called with "func False False [...]" does this first clause always match first?
15:05 <tsahyt> hmm but mostly I don't want to use lens
15:05 <c_wraith> Unode: that last pattern is a tricky one. it only matches exactly single-element lists
15:05 <tsahyt> it's just that here I have a record containing a bunch of structures (a stack, a queue, etc) as my state type
15:05 <ph88^> ski, i meant this https://bpaste.net/show/bc7d151d1966
15:05 <tsahyt> and pushing onto the stack would be really nice with lens
15:05 er0shi joined
15:06 <tsahyt> using modify directly seems cumbersome in comparison
15:06 <tsahyt> it seems like this is exactly what lens is supposed to do
15:06 <Unode> there's 2 additional clauses, "func _ _ [] = []" and "func a b (s:ss)". The latter expands to a guard with 3 conditions.
15:06 <c_wraith> tsahyt: lens makes it trivial, yes. especially with things like the (%=) operator
15:06 <Unode> c_wraith: I see
15:06 <tsahyt> I guess I could live with a more minimal lens library for this use case
15:06 er0shi joined
15:06 <ph88^> ski, do you know how i can use exception handling on conduit ? i would like to write my own string to stderr in case the file can not be read or write https://hackage.haskell.org/package/conduit-1.2.10/docs/Data-Conduit.html#g:7
15:07 <Younder> c_wraith, Well I was educated a physicist before I became a mathematician. Now I work with machine learning as well. Perhaps my rigors of proff are not as solid as yours.
15:07 <ski> ph88^ : oh, you're asking whether `where' attaches to a single defining equation, i think. the answer to that is yes
15:07 <* ski> doesn't know `conduit'
15:07 <tsahyt> c_wraith: it just feels like bad form to pull in lens for just one algorithm
15:07 Gloomy joined
15:07 sanae joined
15:07 <c_wraith> tsahyt: I've pulled in a library for a single algorithm before. And if that library is vector-algorithms, it can take almost as long to compile as all the lens dependencies combined. >_>
15:07 jer1 joined
15:08 Luke joined
15:08 araujo joined
15:08 mjora7 joined
15:09 <tsahyt> how does that happen? last I checked, lens pulled in about 35 or so libraries when building it with stack on a clean install.
15:09 <c_wraith> Younder: I think we're not too far apart on that even. I think I'd just call what you're describing "Doing math in Isabelle that results in Haskell code".
15:09 araujo joined
15:09 <Younder> c_wraith, We need to have a discussion on this at a later date I feel. Loved your input. It gave me lot of food for thought.
15:09 <tsahyt> now tbf, most of them are installed already anyway for any serious project
15:09 sanae joined
15:09 <ski> ph88^ : i might not match on the `Maybe'-arguments there in the defining equations definiendums, but rather say `src = case minput of Nothing -> CB.sourceHandle stdin; Just input -> CB.sourceFile input' (or use `maybe' if you prefer). and similarly with `snk'
15:10 <c_wraith> tsahyt: vector-algorithms inlines to an extent ghc has had problems with historically - there were several versions of ghc that failed to compile it because they didn't think any real code would do effectively exponential inlining the way that package does.
15:10 LKoen joined
15:10 <ski> ph88^ : that factors out the code repetition
15:10 <tsahyt> exponential inlining sounds.. interesting
15:10 sampuka joined
15:11 <ph88^> ski, oh ye that's a good idea
15:11 <c_wraith> tsahyt: it uses CPP to create inlined expressions. In some cases, uses of that CPP are nested.
15:11 oisdk joined
15:11 <tsahyt> okay I suppose I can live with a very basic lens package here. all I really need is over. tying in with State is optional. what are my options now? Ideally I'd like it to be compatible with the full lens library
15:11 <c_wraith> lens-family and microlens come to mind
15:12 <c_wraith> I haven't used either, so I don't have a preference. :)
15:12 netheranthem joined
15:12 <tsahyt> microlens looks interesting since it's split up in a bunch of packages
15:12 cdg joined
15:13 <c_wraith> microlens should give you everything except batteries-included and prisms, iirc
15:13 osa1 joined
15:13 osa1 joined
15:13 gawen joined
15:13 <tsahyt> is there a way to list all transitive dependencies of a package?
15:14 <c_wraith> well, cabal install --dry-run
15:14 <c_wraith> add a -v if needed
15:14 sproingie joined
15:14 cschneid_ joined
15:15 <tsahyt> but that only lists the packages that aren't already installed
15:15 <c_wraith> I know it lists all dependencies if you add enough verbose flags :)
15:15 <sproingie> ever sit down at your computer and briefly forget completely how to use it?
15:15 <c_wraith> sproingie: about once a week
15:15 FreeBirdLjj joined
15:15 <sproingie> sign of getting old i guess ;p
15:16 <c_wraith> sproingie: sometimes I just stare at my login screen with no idea what I'm supposed to be doing.
15:16 <tsahyt> basic-lens would provide all the machinery I actually need
15:17 <tsahyt> but no TH wizardry
15:17 <tsahyt> and it's fully compatible with lens
15:17 takle joined
15:18 <tsahyt> I guess I'll just pull in lens and stop worrying. minimal dependency footprint is not exactly a common trait in haskell libraries to begin with
15:18 afldcr joined
15:18 <orion> tsahyt: What [29~
15:18 <orion> sproingie: How old are you?
15:18 <sproingie> haskell ain't exactly "batteries included", no
15:18 <sproingie> orion: 44
15:19 <tsahyt> sproingie: actually base contains a lot of stuff. but it can't keep up with the pace at which the ecosystem expands/develops
15:19 <shapr> sproingie: ooh, one year younger than me!
15:19 <tsahyt> I mean there's even a module for parser combinators in base
15:19 <c_wraith> tsahyt: lens's dependencies are mostly because of the profunctor package, and edwardk's refusal to rely on orphan instances. Which is, I think, a perfectly fine policy. But it means profunctor needs to depend on crazy amounts of things.
15:19 flatmap13 joined
15:19 <sproingie> it has a lot of low-level stuff, not a lot of practical libraries for, say, http or crypto or such
15:19 etehtsea joined
15:20 <Cale> tsahyt: Well, people have also been trying to get stuff *out* of base for a long time
15:20 <tsahyt> c_wraith: I thought the dependencies would be because lens itself for some reason takes the batteries included approach, providing lenses for most common data structures
15:20 <sproingie> but i guess lens or equivalent would be one of those lower-level things. i'm all for a reasonably minimal base too.
15:21 <tsahyt> I generally have no problem with big dependency trees. it's just that this leads to unreasonable binary sizes in some cases
15:21 <sproingie> base should provide a rich set of common type classes, really
15:21 <c_wraith> tsahyt: yes, but that's not near 35 dependencies by itself.
15:21 <athan> Can anyone here suggest a good method to debugging STM thread blocking errors?
15:21 <ph88^> anyone know how i can get my conduit exception handler to work ? https://bpaste.net/show/73ee15357694
15:21 <tsahyt> e.g. my pretty minimal gtk based haddock viewer/hoogle search compiles to ~55M of executable code
15:21 <tsahyt> with standard flags that is of course
15:22 <c_wraith> sproingie: Yeah, I think most people would agree Profunctor as a class probably should be in base, but no one wants to add it before a couple final design choices around supporting functions are worked out. Once it's in base, it's hard to revise them.
15:23 <sproingie> i dunno, profunctors have a pretty solid definition. the API might not be the best tho (wouldn't know, i have no idea what i'd use Profunctor for)
15:23 <Cooler> this is messed up
15:23 <c_wraith> sproingie: I think you just agreed with me. :)
15:23 <Cooler> hsdev is taking up 900+ Mb and i don't even have a .hs file open
15:23 <sproingie> oh *should*. yeah reading comprehension before my first cuppa
15:23 Gurkenglas joined
15:24 ctag joined
15:24 <Cooler> i might have to uninstall sublime haskell
15:24 <merijn> How do I get Haddock to render kind signatures on datatypes?
15:24 <Cooler> its over 1160 Mb now without a single haskell file open
15:24 <sproingie> a profunctor is a functor paired with its own opposite, right?
15:25 <c_wraith> sproingie: well. It's a functor paired with a contrafunctor
15:25 oisdk joined
15:25 <merijn> I have "newtype Foo (x :: Bar) a = ..." as a definition, but the Haddock documentation doesn't list the kind of the 'd' parameter of Foo
15:25 <c_wraith> sproingie: in some sense, it's a generalization of things that work sort of like functions.
15:25 <ski> "paired"
15:25 <c_wraith> sproingie: in that you can modify their "input" and "output"
15:25 <Unode> The full pattern I'm trying to understand: http://lpaste.net/355588 . c_wraith that first pattern is making me super confused. Would it really only match on the last element of the list?
15:26 xcmw joined
15:26 <c_wraith> Unode: that pattern is a special case for when both the Bools are False and the list has exactly one element
15:26 msko joined
15:26 <sproingie> c_wraith: so it has both fmap and contramap?
15:26 <c_wraith> Unode: if any of those three arguments are something else, it falls through to the other patterns, which cover all other cases.
15:27 <c_wraith> sproingie: on different type variables.
15:27 <c_wraith> sproingie: thought it calls them rmap and lmap :)
15:27 <c_wraith> *though
15:28 jmelesky joined
15:28 jespada joined
15:28 <tsahyt> is there a named synonym for %=?
15:28 <c_wraith> sproingie: rmap is the same as fmap for any type that's an instance of both Functor and Profunctor
15:28 <sproingie> all these different names for the same thing ... map fmap . >>>
15:28 jer1 joined
15:28 <sproingie> is it all about clearer error messages these days?
15:29 <ski> also about specificity of code, possibly
15:29 <Younder> yes, they are better
15:29 <c_wraith> sproingie: in this case, no. It's because you can't make rmap and fmap fit together.
15:29 <torstein> Network.listen takes an Int argument for the maximum number of queued connections. What does that mean, practically, e.g. for a chat server (https://wiki.haskell.org/Implement_a_chat_server)? That only two chat clients can be connected at the same time?
15:29 <c_wraith> sproingie: you can't make Functor a superclass of Profunctor because they have different kinds
15:30 <c_wraith> torstein: no, it's the length of the accept queue - how many connections can be in the accept phase.
15:30 <sproingie> makes sense for profunctor, sure
15:30 csaurus joined
15:30 jao joined
15:30 <sproingie> but my eyes really opened when i learned how map, fmap, function composition, and lift were all the same thing
15:31 <Unode> c_wraith: so if I get it correctly, if a line evaluates "isFirstInPair = False, isSecondInPair = False" and is not the last on the list, this line is not kept anywhere right? i.e. "func False False ["one","two"]" would not match the first rule.
15:31 Elhamer_ joined
15:31 <c_wraith> torstein: It's rare to need it more than about 5 or so. If it needs to be higher than that, you're under some serious load - or not accepting incoming connections rapidly.
15:31 <orion> Microlens doesn't include the (<>=) operator :(
15:31 <tolt> Does anyone know what "A simple interface for streaming eventlog data from live processes" is from the most recent ghc rc? I'm not able to find any docs on it
15:31 <phadej> orion: that's why they are microlens!
15:31 <torstein> okay thank you
15:32 <Younder> When I was beginning I really hated lift. It seemed like a con. I guess it still does
15:32 Pip joined
15:32 <c_wraith> Younder: you mean liftM?
15:32 <Younder> Like a card player cheeting at a card game
15:32 <Younder> c_wraith, yes
15:33 <sproingie> er yes liftM
15:33 <c_wraith> Unode: I'm not sure what you mean by "kept". But it's certainly true that it won't match the first rule.
15:33 <sproingie> :t lift
15:33 <lambdabot> (Monad m, MonadTrans t) => m a -> t m a
15:33 <phadej> c_wraith: you could require 'profunctorFunctor :: Dict (Functor (p a))` member though
15:33 <c_wraith> liftM is definitely historical baggage.
15:33 FreeBirdLjj joined
15:33 <phadej> c_wraith: but it's not nice to work with
15:33 <Cale> torstein: That number is the number of connections which can be waiting to be accepted. Since you usually accept connections by immediately forking a thread that will handle them and getting back to accept again, usually you won't have much of a backlog to work through.
15:33 slacker joined
15:33 takle joined
15:33 erisco joined
15:33 <sproingie> monad transformers have changed a lot since i last read A Gentle Intro
15:34 rkazak joined
15:34 <c_wraith> at least there's no liftA?
15:34 <c_wraith> Things didn't go *that* wrong. :)
15:34 entuland joined
15:35 <Cale> there... should be
15:35 <sproingie> :t liftA
15:35 <lambdabot> Applicative f => (a -> b) -> f a -> f b
15:35 <c_wraith> Oh, great. there is. *sigh*
15:35 <Cale> Why is that wrong?
15:35 <Cale> It implements fmap in terms of (<*>) and pure
15:35 <c_wraith> Applicative always depended on Functor! It doesn't need an extra operation.
15:35 <Cale> It's so that you can write
15:35 <Cale> fmap = liftA
15:35 <Younder> spoingie: you are selling yourself short. We all felt like this at first
15:36 <Cale> after having written your Applicative instance
15:36 <c_wraith> Then it should be named fmapDefault or something, like the equivalent in Traversable is
15:36 <Unode> c_wraith: as part of the guards in the third pattern, I understand that if isFirstInPair or isSecondInPair evaluates to True they are prepended to a list "(1 :: Int, concatLine s): ...". i.e. kept. In the case I mentioned s doesn't seem to be 'kept' anywhere.
15:36 dinamyc joined
15:36 RouxTheDay joined
15:36 <sproingie> it didn't always depend on Functor, did it? or was that just Monad with the barren set of supertypes?
15:36 <c_wraith> sproingie: it was just Monad
15:36 <Cale> Also, it would be weird to have liftA2, liftA3, etc. but not that
15:36 Pip_ joined
15:37 sirreal joined
15:37 <merijn> Does anyone know how I beat Haddock into displaying kind signatures on a datatype?
15:37 <sproingie> i never did get used to writing Applicative style, i dropped straight into monads
15:37 <erisco> really it should have been called liftA1 for consistency
15:37 oisdk joined
15:37 <erisco> sproingie, come back!
15:38 <Cale> sproingie: A good number of people learned to program with monads before Applicative existed.
15:38 <* sproingie> >>= return
15:38 <erisco> monads lead you to the dark side
15:38 Elhamer__ joined
15:38 RouxTheDay joined
15:39 <shapr> The dark side leads to dissatisfaction with Python :-/
15:39 <sproingie> yah i'm just re-learning what i forgot now, and everything's different. all the buzz is around Free Monads now :)
15:39 <c_wraith> Unode: oh, that's what you meant by kept. Then yeah, when those three things are true, it just calls through to a recursive call to func without producing any output
15:39 Itkovian joined
15:39 <Cale> There aren't really all that many Applicative instances which are not also Monad instances in practice.
15:39 <shapr> sproingie: I'm having some of that myself, applicatives and lens and so many cool toys!
15:39 <c_wraith> sproingie: actually, we're in the backlash phase around free monads. "they're too slow!" :)
15:39 <sproingie> slow is not a problem for me, i don't care if my haskell runs as slow as bash frankly
15:40 <phadej> Cale: there are, e.g.`optparse-aapplicative`
15:40 <Cale> I don't understand the recent wave of buzz about free monads
15:40 jerbome joined
15:40 <sproingie> (well i will if i ever get around to that roguelike)
15:40 <Cale> Where did that come from?
15:40 <phadej> Cale: "Applicative which isn't a Monad"
15:40 <Cale> phadej: I know there are a handful of examples
15:41 <sproingie> my issue with lens and such is the punctuation-heavy operators
15:41 <phadej> and e.g. Const :)
15:41 <sproingie> which now that it's a stable set of operators isn't such a big deal
15:42 <Cale> I think it's totally okay if you see foo <*> bar and read it as do f <- foo; v <- bar; return (f v) in your head, for the most part.
15:42 <erisco> yeah but what a shame
15:42 <c_wraith> sproingie: there are patterns to the operators. Learn the patterns and you reduce it to only like 6 cases, instead of 100. :)
15:42 <shapr> I just read it as "foo <*> bar"
15:42 <c_wraith> 6 is still a lot!
15:42 zero_byte joined
15:43 <Cale> I like most of what lens does, but I find most of those operators to be frivolous and silly
15:43 <Cale> I much prefer the ordinary function names for lens' stuff
15:44 <c_wraith> They introduce so many parenthesis, though..
15:44 <sproingie> i wish haskell just required whitespace between identifiers so it were possible to mix alpha and punctuation in operators
15:44 <Cale> c_wraith: you can still use (.) and ($) as usual to avoid most of the parens
15:45 jerbome joined
15:45 <Cale> Being able to use kebab-case would be nice.
15:45 Oxit_ joined
15:46 <c_wraith> think of all the lens tutorials that would break if you had to put a space on both sides of .
15:46 <Rembane> sproingie: Write a preprocessor. :D
15:46 krazedkat joined
15:46 <Cooler> are record updates not compositional? i thought they were https://youtu.be/cefnmjtAolY?t=187
15:46 <Cale> c_wraith: I enforce that rule anyway. I wish the lens tutorials would too.
15:46 <Cooler> you can just compose a bunch of getter functions right?
15:46 <c_wraith> Cale: I agree, actually
15:46 <Cale> Not putting spaces around (.) looks awful
15:46 <c_wraith> Cooler: yes, but you can't compose updates
15:46 <Cooler> what
15:47 <slack1256> I like lens with view/over/set/preview over the operators too
15:47 shangxiao joined
15:47 <Rembane> Cooler: That's one of the warts with that syntax and why people use lenses.
15:47 jathan joined
15:47 <c_wraith> Cooler: you can compose record accessors when you are using them as functions to get a value.
15:47 <c_wraith> Cooler: you can't compose them when you are using them to update a value.
15:47 <shapr> New #haskell band named ContraFunk?
15:47 raichoo joined
15:48 <Cale> shapr: Felonious Thunk
15:48 <sproingie> ProFunky
15:48 <shapr> oooh
15:48 jerbome left
15:48 <shapr> Clearly this needs a lambdabot plugin.
15:48 <shapr> Best #haskell band names
15:49 <slack1256> "the simons" would work
15:49 <sproingie> as for python ... yeah, when i go back to python, i end up wanting to implement most of Prelude in it
15:49 JagaJaga joined
15:49 <shapr> yeah, me too
15:49 <shapr> I end up rewriting scan and others about once every six months.
15:49 <shapr> and coworkers often say "what the heck is that?"
15:49 <sproingie> there's operator overloading magic that makes it not even that unpleasant
15:49 <orion> "Data families are the indexed form of data and newtype definitions." -- What does 'indexed' mean?
15:49 <sproingie> if baffling to cow orkers, yes
15:49 trism joined
15:49 <c_wraith> I keep wanting to introduce traverse_ and traverse in Ruby projects at work. My coworkers would be fine with those, right?
15:50 <shapr> suuure
15:50 <Cale> shapr: when they ask, link them to this http://cale.hn.org/share/Folds.svg
15:50 <Cale> shapr: ;)
15:50 <c_wraith> orion: it means that the implementation is selected by a type variable
15:50 fresheyeball joined
15:50 <orion> I see.
15:50 <sproingie> i've seen several C++ Monad implementations that overload >> for bind (has better precedence and associativity than >>=)
15:50 <c_wraith> orion: that type variable (or those variables) is (are) called the index
15:51 <ski> (type parameter)
15:51 Itkovian joined
15:51 <Cale> sproingie: How many have you seen implement the abstraction correctly?
15:52 argent0 joined
15:52 <sproingie> Cale: i did see one with a test suite that verified monad laws for some of the examples
15:52 augur joined
15:52 jer1 joined
15:52 <merijn> hvr: Can I kick off a matrix build for a package candidate somehow?
15:52 <Cale> I've seen a lot more incorrect implementations of Monad in other languages for which one couldn't write a generically usable sequence function than I have seen correct ones.
15:52 <Cale> If you can't write code which works in an arbitrary monad, you have failed.
15:53 <sproingie> once concepts land in mainstream c++, they're looking to add the standard types like Monoid etc to the stdlib
15:53 <Cooler> T1{get0::Int} ; T2{get1::T1} ; T3{get2::T2} ; T4 {get3::T3} ; get_foo = get3 . get2 . get1 . get0 ; get_bar = get2 . get1 . get0 ; get_bar record
15:53 <c_wraith> Cale: there's *some* value in recognizing that there's a common pattern that you're using. But it's pretty small in comparison to the value of being able to abstract.
15:53 <sproingie> Functor is gonna confuse folks tho, given STL bastardized the term already
15:53 <Cooler> actually how do you update deep inside records?
15:54 <c_wraith> sproingie: I'm sure they'll just call it Mappable or something
15:54 <Cooler> do you have to unwrap everything and wrap it up again/
15:54 <Cooler> unwrap all the levels down
15:54 <lyxia> basically yes
15:54 <c_wraith> Cooler: r1{f1 = r2 {f2 = ..}}
15:54 <Cale> Cooler: yeah, without lens, or defining your own mapping functions
15:55 <shapr> Cale: my employer blocks that domain :-(
15:55 <Cooler> that seems horrible
15:55 <c_wraith> Cooler: now you know why there are at least 20 libraries on hackage for improving the situation :)
15:55 <Cale> shapr: ah, it's just my desktop machine
15:56 <Rembane> Cale: I love the curly ones, like scanl1.
15:56 <Cale> http://i.imgur.com/3BIzhfH.png
15:56 <Cale> shapr: ^^
15:57 <shapr> Cale: ah nice!
15:57 xall joined
15:58 <EvanR> Cooler: simple lenses make that really nice, and make other things really nice in the process
15:58 dm3 joined
15:58 <EvanR> but because records sort of suck, you have to make them all yourself or generate them with TH
15:58 <Rembane> Is there a lenses for dummies tutorial somewhere?
15:58 <* hackage> websockets-simple 0.0.6.1 - Simpler interface to the websockets api https://hackage.haskell.org/package/websockets-simple-0.0.6.1 (athanclark)
15:58 <sproingie> lens has a pretty good tutorial
15:59 sssilver joined
15:59 <EvanR> and then theres lens
16:00 <fresheyeball> Anyone around who knows about the gloss package?
16:00 crobbins joined
16:00 <Rembane> fresheyeball: It's nice, is it acting up?
16:00 <fresheyeball> Rembane: scaling an image looks unaliased
16:00 <fresheyeball> err
16:00 lieven joined
16:00 quchen joined
16:01 <sproingie> was thinking of using gloss for the roguelike but the font rendering looks awful
16:01 <Rembane> fresheyeball: Do you have a minimal example to show us? Codewise and imagewise.
16:01 <fresheyeball> un-anti-aliased
16:01 <sproingie> aliased :)
16:01 <fresheyeball> sproingie: right I have hte same problem
16:01 <Rembane> Everything is Nyquist's fault!
16:01 <fresheyeball> the*
16:01 xcmw joined
16:02 <sproingie> fresheyeball: i'm likely going with SDL instead
16:02 <c_wraith> sproingie: if it's terminal-only, everyone gets to choose their own font! :P
16:02 <fresheyeball> sproingie: what raw SDL?
16:03 <sproingie> SDL2. very nice complete bindings.
16:03 insitu joined
16:03 <EvanR> sproingie: "font" is being pretty generous here
16:03 <* hackage> haskell-tools-demo 0.7.0.2 - A web-based demo for Haskell-tools Refactor. https://hackage.haskell.org/package/haskell-tools-demo-0.7.0.2 (lazac)
16:03 <EvanR> its just simple lines forming vaguely correct letter shapes
16:03 pera joined
16:03 <fresheyeball> sproingie: it looks excessively low level
16:04 <sproingie> fresheyeball: yeah my first challenge would be to slap a decent API on top of it
16:04 <fresheyeball> sproingie: go for it, I picked gloss to avoid re-inventing wheels
16:04 <EvanR> fresheyeball: are you asking for references on game engines or something?
16:04 <bodisiw> sproingie, do you have a suggestion for basic SDL2 'hello world'? with stack maybe?
16:04 <sproingie> probably something imperative like tcod/bearlibterm/rotjs then try to make it more functional, steal ideas from lambdahack or soemthing
16:05 <EvanR> gloss is for simple graphics fast
16:05 <EvanR> its fast, but perhaps too simple for a real application
16:05 <fresheyeball> EvanR: you have a better direction that doesn't involve writing my own bindings, or working with OpenGL in a low level way?
16:06 <EvanR> there are a billion game engines, people like writing those more than actual games
16:06 <sproingie> bodisiw: grab the source for SDL2, should build effortlessly, and there's lots of example code including hello world
16:06 <fresheyeball> EvanR: Any good ones? I don't want to write and engine, I want to write a game.
16:06 <bodisiw> okay, i'll try again... i have not had good luck, or possibly i am dumb :-)
16:07 <fresheyeball> For what I've seen its mostly incomplete, immature code, of people reinventing wheels with no direction.
16:07 <EvanR> well yeah
16:07 <sproingie> i don't really *want* to write YA game engine either, but existing options are few. there's a lot in lambdahack, but it's huge.
16:07 <EvanR> huge?
16:08 <sproingie> as in has tons of various features and backends
16:08 Elhamer joined
16:08 <sproingie> i'd rather reinvent wheels when i have to learn how they roll anyway
16:09 <sproingie> bodisiw: could be platform-related if it doesn't build cleanly. i know it does well on linux and macos
16:09 alfredo_ joined
16:09 juanpaucar joined
16:10 descender joined
16:10 <bodisiw> i'm on macos here, but possibly messed up environment with too much installs
16:10 <sproingie> also have to have SDL2 installed of course. i used homebrew.
16:10 <bodisiw> yeah, i got it through homebrew
16:10 <bodisiw> works great from python
16:11 jer1 joined
16:11 <EvanR> sproingie: and so the perpetuation of engines continues
16:11 <sproingie> oh sdl2_ttf might not build cleanly, i had to set INCLUDE_PATH and LIBRARY_PATH before building. mostly because i didn't know how to fix the cabal file myself.
16:12 juanpaucar joined
16:12 <EvanR> the work is 90% game engine and 90% actual game
16:12 <bodisiw> aha, iirc i was struggling with sdl2_image and sdl2_ttf
16:12 Sonolin joined
16:12 <fresheyeball> grr I just want to write game
16:12 <sproingie> yeah sdl2 knows to look in /usr/local, sdl2_ttf for some reason does not
16:12 <fresheyeball> and so I need to write an engine first
16:12 <bodisiw> use puzzlescript and make your game
16:13 <bodisiw> then you can build the engine you want for it
16:13 <fresheyeball> and now I need to write a graphics library first?
16:13 <sproingie> actually you should write a game then extract an engine from that
16:13 <EvanR> fresheyeball: what did you think of helm
16:13 anodium joined
16:13 asm_ joined
16:13 <erisco> to make a game you have to give it 180%
16:14 <sproingie> erisco: and get paid for 100%. certainly seems to be EA's work ethic.
16:14 <fresheyeball> EvanR: Helm looks nice
16:14 <fresheyeball> but it doesn't get many updates
16:14 <erisco> @remember sproingie i'd rather reinvent wheels when i have to learn how they roll anyway
16:14 <lambdabot> It is forever etched in my memory.
16:15 <EvanR> it has to be not big, be getting "updates", be feature packed,...
16:15 <EvanR> ok
16:15 oisdk joined
16:15 nullifidian joined
16:16 biglama joined
16:16 <EvanR> the best libraries dont get updates, because theyre done
16:17 <EvanR> i will now go back to my game, which doesnt have an engine
16:17 <* EvanR> cackles maniacally
16:17 planck_ joined
16:17 <sproingie> "done" to me means someone wrote a game in it beyond flappy bird
16:17 <erisco> it is a pushcart ;)
16:17 <EvanR> well thats not going to be a thing any time soon in haskell
16:18 Sonolin joined
16:18 planck_ joined
16:18 <erisco> all framework and no engine
16:18 Sonolin joined
16:19 <sproingie> all hat no cattle
16:19 <EvanR> a DSL which lets you do the basic things a game needs but doesnt provide anything recognizable as an engine might be more haskell like
16:19 ludat joined
16:19 <erisco> I suspect that's not a percussion joke
16:19 <sproingie> yeah a DSL is kinda what i'm going for
16:20 <EvanR> and so far FRP is not that
16:21 mmachenry joined
16:21 <erisco> well, if you simplify the description of FRP as "computing with time" then it doesn't make much sense to expect that much specialisation from it
16:21 sssilver joined
16:21 <erisco> it'd be like expecting functions and ADTs to be your engine
16:21 <EvanR> i mean the lack of engine
16:22 afarmer joined
16:22 <bodisiw> `stack run` gives me a 'Executable named lazyfoo-lesson-01 not found on path: ...'
16:22 <bodisiw> (in this SDL2 repo)
16:22 im0nde joined
16:22 <sproingie> never cared too much for the emphasis on "time" in FRP. it's really just an ordering, time is one means of imposing it
16:22 <sproingie> but event sourcing doesn't care much about "time"
16:23 <EvanR> smooth animations are really about time
16:23 fortruce joined
16:23 <EvanR> not time tick events
16:23 anodium joined
16:23 <sproingie> sure, but FRP has gone well beyond animation now
16:23 <EvanR> and we still dont have what im talking about
16:23 <EvanR> so it seems to have missed the mark
16:24 sanitypassing joined
16:24 <sproingie> that's the world of programming for ya
16:24 anodium joined
16:24 <erisco> it can be real time, but it has been known you can use other sources
16:24 <EvanR> beyond would mean, you actually can still do the simple stuff
16:24 Sonolin joined
16:25 davean joined
16:25 <EvanR> not, decided on a totally different thing to do
16:25 oisdk joined
16:26 Sonolin joined
16:26 <EvanR> zeno's paradox proved that time is not an event
16:27 <sproingie> it also proved zeno didn't know math. or knew enough to baffle the masses with a silly trick.
16:27 Sonolin joined
16:27 <sproingie> i've been off doing web apps, so when i think FRP, i think rxjs/redux. those were game changers for web apps.
16:27 tommd joined
16:27 <EvanR> oh god
16:28 <LKoen> yes, convergent series are silly
16:28 <sproingie> ok redux hardly counts, that largely just gives you persistence
16:28 <sproingie> but rxjs is quite nice
16:28 pie_ joined
16:28 <LKoen> my indian friend calls them "convergent sillies"
16:28 <erisco> EvanR, I don't see how that is a proof that "time is not an event"
16:28 <erisco> do you mean that time is not discrete? because I don't see that either
16:28 <EvanR> its like the set of all sets isnt a set
16:28 ziocroc joined
16:29 <sproingie> it isn't? i thought it was the set of sets not containing themselves
16:29 <EvanR> its not
16:29 tromp joined
16:29 <EvanR> neither is that one
16:29 <sproingie> the former's a category, the latter is just illogical, right?
16:30 <EvanR> a set of all sets is illogical too
16:30 fizruk joined
16:30 flatmap13 joined
16:31 <bodisiw> this conversation reminds me of the 'i see what you mean' peter alvaro's talk at strange loop
16:31 <EvanR> but hey this is haskell, and we are programming in an inconsistent logic
16:32 <EvanR> so sail on
16:32 Oxit_ joined
16:32 mmhat joined
16:32 <sproingie> eh fast and loose reasoning ...
16:32 juanpaucar joined
16:32 <sproingie> pay no attention to the bottom behind the curtain
16:32 fotonzade joined
16:33 WhereIsMySpoon joined
16:34 <WhereIsMySpoon> Hey, is there a more generic way to enumerate the conditions for this function: https://gist.github.com/anonymous/5d547790984af97fb8932ad43fa87c36 like if I wanted to do myThirdLast…etc, how do I say “anything less than this number of elements in the list is wrong”
16:34 flatmap13 joined
16:35 <erisco> how do you show Haskell is inconsistent?
16:35 Scip joined
16:35 <monochrom> By re-defining "inconsistent".
16:35 <c_wraith> :t undefined -- erisco
16:35 <lambdabot> a
16:36 <torstein> Anyone familiar with intero on Emacs? When I select intero as flycheck-checker I don't get HLint warnings (but i do if i select haskell-hlint)
16:36 <EvanR> construct a value of a type that has no values
16:36 abhiroop joined
16:36 cloudhead joined
16:36 <monochrom> Like, if a program aborts or non-terminates, then you call it inconsistent.
16:36 jer1 joined
16:36 <lyxia> WhereIsMySpoon: reverse then drop (thisNumber - 1)
16:36 <erisco> right, I suppose so
16:37 <EvanR> you could put a Data.Set inside itself ;)
16:37 <monochrom> As opposed to noticing that it still satisfies the safety property and so you should be calling it consistent.
16:37 {emptyset} joined
16:37 <WhereIsMySpoon> lyxia: sorry, what?
16:37 <WhereIsMySpoon> im very nooby atm, so sorry
16:37 <erisco> well it is weird that bottom is a member of all types yet should we use it to prove a type we've demonstrated inconsistency
16:37 stphrolland joined
16:38 <EvanR> the inconsistent comes from using curry howard isomorphism to recast parts of haskell as logical connectives
16:38 anton___ joined
16:38 <monochrom> Therefore don't prove a type at all.
16:38 AlexRussia joined
16:38 <lyxia> WhereIsMySpoon: If you want to access the n-th element starting from the end of a list, you reverse it, then you access the n-th element from the beginning of the reversed list.
16:38 <EvanR> which you apparently shouldnt be doing
16:38 <c_wraith> erisco, taken advantage of inconsistency, in that case. inconsistent logics have advantages.
16:38 aarvar left
16:39 <EvanR> erisco: example practical issue... the law (fst x, snd x) = x doesnt work in the presence of bottom, in haskell. (from the fast and loose reasoning paper)
16:39 <WhereIsMySpoon> lyxia: oh, duh
16:39 <EvanR> its illogical!
16:40 <sproingie> i always treat lists as either streams or sets, i never find myself having to access the nth element
16:40 <monochrom> Curry-Howard is really nice for total languages.
16:40 <erisco> I don't know what the correspondence is precisely for Haskell
16:40 <WhereIsMySpoon> sproingie: im doing exercises :)
16:40 <erisco> seems awkward
16:40 oisdk joined
16:41 <sproingie> WhereIsMySpoon: ah. i guess it's good to know how to do in case one runs across it
16:41 <lyxia> WhereIsMySpoon: in the bit of code you pasted, if you don't care about the error message too much you can drop the second case
16:41 phyrex1an joined
16:41 <stphrolland> Hi. I have a question regarding FFI. I have read on stackoverflow that it should be used in last resort for performance critical code. Sometimes ago I made a draft of the stuff I plan to do (myriads of musical oscilators) in python, and that part was clearly a bottleneck, which completely disappeared when I wrote it in c++. I'm going to do something much more evolved wrapper in Haskell, that shoudl call that c++ core.
16:41 <WhereIsMySpoon> sproingie: well im just trying to learn how to solve issues by writing haskell atm
16:41 <stphrolland> Do you really advise against FFI ?
16:41 fortruce joined
16:41 <lyxia> WhereIsMySpoon: and then if you want to access the third-to-last element, you can change the [x,y] case to [x,_,_]
16:42 oisdk joined
16:42 <sproingie> stphrolland: it's not so much that it's advised against, it's just that it's massively tricky and of course it's unsafe
16:42 <sproingie> stphrolland: but for something like realtime synthesis, you might have to reach for the FFI, yes
16:42 <EvanR> FFI can be a performance bottleneck
16:43 <EvanR> if you need to make a lot of calls
16:43 <sproingie> yeah the boundaries of FFI are notoriously slow. in most languages, really.
16:43 <stphrolland> there's a mutex or something like that when a call to the FFI is done ?
16:43 <sproingie> i don't believe so
16:43 <EvanR> theres a lot of stuff going on, especially if the foreign code may call *back* sometime
16:44 RouxTheDay joined
16:44 <EvanR> you can configure the ffi boundary to tweak it though
16:44 <stphrolland> what's the reason more or less that several FFI calls might be troublesome ?
16:44 <erisco> you want to batch when doing FFI calls
16:44 <sproingie> it's not like python with the GIL. tho python tends to call into C precisely so that code *can* release the GIL
16:45 <erisco> first you have a lack of inlining and optimisation
16:45 <erisco> second you have the overhead of marshalling
16:45 <sproingie> if you just want to twiddle with oscillators, i believe there's supercollider bindings for haskell
16:45 etehtsea joined
16:45 <sproingie> SC's protocol is kinda bleh, but it does do the job
16:45 <stphrolland> Even if I use bytestring to comunicate between the two, there is marshalling ?
16:46 t7 joined
16:46 <erisco> concurrency, parallelism, garbage collection... these are just more pains
16:46 <EvanR> stphrolland: ByteString data is pinned, so you can pass a pointer to that data directly
16:46 IndigoTiger joined
16:47 <EvanR> but a pointer
16:47 int0x27h joined
16:47 <EvanR> is boxed, and you have to unbox it when you poke it
16:47 <EvanR> but there is more going on during an FFI call
16:47 <WhereIsMySpoon> lyxia: im sorry, im lost. How in the function do I reference the list and reverse it?
16:48 <WhereIsMySpoon> or anyone else lol
16:48 <EvanR> stphrolland: a possibly aging blurb about this in the wiki https://wiki.haskell.org/Performance/FFI
16:48 <sproingie> you can pack C structs into a bytestring, so you don't have to bang raw bits into them
16:49 <sproingie> can't recall what the package that does that is called
16:49 <fresheyeball> Ok so Helm is totally unmaintained
16:49 <EvanR> hmm.
16:50 rkazak joined
16:51 jathan joined
16:51 colo joined
16:52 fortruce joined
16:53 <lyxia> WhereIsMySpoon: http://lpaste.net/355594
16:53 <stphrolland> sproingie: I think the module for marshalling structs you were talking about is import Foreign.Storable . It's documentation looks like that.
16:53 <sproingie> i looked around for haskell game engines, there's not much maintained. for roguelikes, lambdahack was about it.
16:54 <sproingie> stphrolland: i could swear i saw something different, but my memory is pretty bad
16:54 <stphrolland> i will search for others, maybe there are some better packages
16:54 <colo> has someone had troubles compiling after the recent windows 10 update?
16:55 <cocreature> colo: there are new ghc binaries available that fix the issues
16:55 <cocreature> it’s a known issue
16:55 maarhart joined
16:56 mmachenry joined
16:56 <colo> thanks
16:56 jer1 joined
16:57 <sproingie> bah. stack is not very robust about stale lockfiles
16:57 Quurz joined
16:57 <sproingie> created part of a project and failed to create stack.yaml. bad stack.
16:57 tiny_test joined
16:57 jgt joined
16:58 Wuzzy2 joined
16:58 fortruce joined
16:58 <jgt> hey folks, anyone know how to get all records in a table with persistent?
16:58 <bodisiw> sproingie, i had to `stack build --flag sdl2:examples`, but now i can run them!
16:59 rbocquet joined
17:00 <sproingie> bodisiw: quick way to run them is 'stack run example-foo-99' or whatever. grep for '^exe' in the .cabal file
17:01 <sproingie> pretty sure that'll even force them to build
17:01 <jgt> oh, I think I got it. This seems to work: `users <- runDB $ selectList ([] :: [Filter User]) []`
17:02 SpinTensor joined
17:02 uglyfigurine joined
17:02 eklavya joined
17:03 <bodisiw> sproingie, well that didn't work for me for some reason, although now it does... at first `stack run` tried to run them without building them
17:04 zachk joined
17:04 Swizec joined
17:04 <sproingie> tch. yeah, stack is still pretty rough.
17:05 <bodisiw> next i'll have to figure out how to make a new project and use this library as a dependency... would i still want to use the git repo, or do i want to pull in from hoogle/stackage/whatever
17:05 <sproingie> i wish adding deps were as easy as npm or carton
17:05 <zachk> how easy is adding deps in npm or carton?
17:06 <bodisiw> npm is pretty easy
17:06 <bodisiw> except when some guy unpublishes his packages
17:06 <sproingie> npm add leftpad
17:07 acertain joined
17:07 burtons joined
17:07 <sproingie> i guess carton is about the same as cabal that way, you edit cpanfile
17:08 <jgt> fwiw, I've been pretty happy with Stack
17:08 <sproingie> oh i love stack, it's just still a little wobbly in places
17:08 <jgt> do we have issues filed for the wobbly bits?
17:08 [[[[[ExTRa]]]]] joined
17:08 <sproingie> probably
17:09 <jgt> (I know I'm coming across as adversarial here, and I don't mean to be)
17:09 uglyfigu_ joined
17:09 <jgt> I should probably dig into Stack's issues list when I get some time
17:09 <bodisiw> jgt, tbh i'm too new to have much expectations of Stack
17:10 <bodisiw> other than people saying 'it just works' (which has not _quite_ born out in my limited experience)
17:10 <sproingie> naw, you don't come across as too argumentative. i'm just a born whiner :-/
17:10 meoblast001 joined
17:10 <jgt> bodisiw: it certainly 'just works' more than cabal did, in my experience
17:11 <sproingie> better than cabal-sandbox for sure
17:11 bvad joined
17:11 nickager joined
17:11 <sproingie> though it solves it in almost the same way, clone the world
17:12 <bodisiw> i guess i also see nix a lot and don't really understand that either
17:12 <sproingie> i'd love to try out nix but it's just hell on macos
17:12 <bodisiw> being new to cabal/stack/nix all at once is a little overwhelming
17:12 pylbrecht joined
17:12 <shapr> After the pile of recent articles on lobste.rs, I think I'll try nix soon.
17:12 <sproingie> you end up with weird versions of core libs that may or may not build at any given time
17:13 yellowj joined
17:13 tg joined
17:14 <quchen> shapr: You don’t have to try it, you can just do it! I use Nix (the package manager) happily without problems
17:15 <quchen> NixOS on the other hand doesn’t save you much work, and compensates well for it by having to write your own derivations.
17:15 <quchen> It’s usable in production though, don’t get me wrong, but it’s not a good solution to everything.
17:16 <sproingie> i just have no use case for nixos, really. when i want that level of isolation, i'd rather use docker.
17:16 <sproingie> nix would be a great build solution for docker images, sure. but multiple userlands on one box makes no sense for deployment. at least for me.
17:17 jer1 joined
17:17 connrs joined
17:18 <quchen> Docker doesn’t isolate much. In particular the security aspect is just not there.
17:18 pie__ joined
17:19 mstruebing joined
17:19 <orion> You know what's really neat? Compiling a Haskell application to a bootable ISO.
17:19 <sproingie> i'm told it's better (docker started out shockingly bad)
17:19 <orion> And then converting that to an EC2 AMI.
17:22 Luke joined
17:23 <sproingie> honestly i'll take full-blown VMs wherever that's cheap enough, way less to fuss over
17:23 exbio joined
17:23 gillesmajor joined
17:24 gillesmajor left
17:24 <sproingie> but any decently complex app has to have some orchestration anyway, so no big whoop to have some config daemon handing out ports too
17:24 sleffy joined
17:24 umren joined
17:25 <* orion> just had an idea
17:25 bvad joined
17:25 <orion> You mentioned orchestration. Are you familiar with Consul?
17:28 <sproingie> i've heard of it, never used it. i ended up writing my own coordinator with no kidding, a cgi script.
17:28 <sproingie> haven't done devops in years either :)
17:29 <sproingie> perl cgi script using sqlite to hand out configs and take status heartbeats. worked like a dream.
17:29 tromp joined
17:30 Bassetts joined
17:31 <orion> Imagine that there was a Haskell implementation of Consul which you could plug it directly in to your application. If you were using HaLVM, you could package the entire thing up as an AMI, take advantage of auto-scaling groups, and get automatic orchestration.
17:31 juanpaucar joined
17:32 cobreadmonster joined
17:32 UberLambda joined
17:33 UberLambda left
17:33 robotroll joined
17:33 <orion> All with *no operating system*.
17:33 <* shapr> sproings
17:34 <shapr> orion: Maybe the Reduceron will one day be useful there
17:34 drcode joined
17:34 burtons joined
17:35 <sproingie> i've had little need for bare metal apps thus far. maybe if i start targeting RPi or something
17:35 <orion> shapr: That would be neat.
17:36 <orion> sproingie: Haskell on the RPi is awful. :(
17:36 <sproingie> i'm told it's generally awful on any ARM
17:36 <sproingie> tho iOS devices seem to have enough brute power to overcome
17:36 <shapr> A friend of mine is learning Haskell on his rpi, he says it works fine
17:37 <orion> How much demand is there for RPi/ARM Haskell development outside of toy projects?
17:37 <orion> I'm not aware of any businesses that rely on it.
17:37 <bodisiw> dang, i was hoping to run some haskell on rpi
17:37 <bodisiw> what's bad about it?
17:37 <shapr> At one of the local hackerspaces, I've met fifty kids who use an rpi for their home computer.
17:37 <sproingie> haskell itself is pretty niche in corporate environments. a strong niche now, but still
17:38 jer1 joined
17:39 <orion> bodisiw: I actually do use Haskell on a RPi to control access to a fraternity.
17:40 <orion> Each frat member gets a NFC tag that they use to get access to the building.
17:40 <orion> The application reads the tags, checks to see that they've paid their dues, and controls the GPIO pins to toggle the door latch.
17:41 <bodisiw> haha i like that
17:41 <bodisiw> nice way to ensure dues are paid :-)
17:41 <bodisiw> so what about that experience leads you to call it awful?
17:42 <orion> Indeed! Regarding development, I was unable to compile all the library dependencies without triggering the OOM killer.
17:42 FreeBirdLjj joined
17:42 <erisco> so what's the cool way to generate random numbers? some state monad thingie? passing around a RandomGen obviously sucks
17:42 <sproingie> compiling stuff on a pi is masochism
17:42 <orion> And I wasn't prepared to destroy a flash drive by adding multiple GB of swap space.
17:42 <bodisiw> orion, i would imagine cross-compiling is the way to go...
17:43 <sproingie> isn't it the *only* way to go with ghc on arm?
17:43 <orion> bodisiw: Not possible. The libraries I depend on require TemplateHaskell.
17:43 drcode joined
17:43 <Sonolin> sproingie I believe there's ARM binaries now
17:43 <Sonolin> have yet to check 'em out though
17:43 <orion> TH is disabled on cross-compiled versions of GHC.
17:43 <sproingie> oh nifty. other issue i seem to remember is it had to use a very slow GC on ARM
17:44 <bodisiw> ah, what's the reason for that?
17:44 <erisco> I am guessing this is cool https://hackage.haskell.org/package/MonadRandom-0.5.1
17:44 <sproingie> probably some tricky asm in the GC or something
17:44 <orion> bodisiw: Because TH actually executes code during the compilation process. If GHC is spitting out ARM instructions, they won't run on x86_64.
17:45 Scorchin joined
17:45 <bodisiw> orion, oh okay weird
17:45 <sproingie> orion: llvm would seem to be the answer here
17:45 <MarcelineVQ> orion: there's pretty active dev in that direction atm
17:45 <orion> MarcelineVQ: Cool.
17:45 <MarcelineVQ> angerman has some blog posts about the subject, iirc
17:46 jcp___ joined
17:46 afcondon_ joined
17:46 <MarcelineVQ> ghcjs and external process ghci both take advantage of ferrying out compilation to get around that sort of limitation
17:46 fingerzam joined
17:46 replay joined
17:46 AlexRussia joined
17:46 <sproingie> oh neat didn't know ghcjs even did TH
17:46 prefork joined
17:46 <orion> bodisiw: I did find a solution though: The Linux kernel has a feature called binfmt, which allows you to specify an interpreter for binaries that match a certain fingerprint. The QEMU project has a package called, "qemu-user-static" which is one such set of interpreters.
17:46 raynold joined
17:47 <sproingie> reading up it looks like it kinda cheats
17:47 <orion> Including one for ARM.
17:47 oisdk joined
17:47 takle joined
17:47 Swizec_ joined
17:47 <bodisiw> sounds like tooling is just not there yet, but maybe it's a matter of time
17:48 <sproingie> ghcjs is exciting but holy hell is project setup a pain
17:48 <bodisiw> i have not used TH at all
17:48 <sproingie> you might have in a library and not known
17:49 <orion> With binfmt support enabled, I was able to create a docker image of Raspian and compile/run Haskell code on my very powerful machine.
17:49 <bodisiw> sounds complicated... but i don't want to use python anymore
17:49 <orion> Then I just sftp the resultant binary right on to the RPi.
17:49 <sproingie> TH is really really cool but when TH code breaks the error messages are baffling
17:50 <orion> bodisiw: The whole process is neatly packaged up: https://github.com/centromere/ghc-arm
17:50 pie__ joined
17:51 <bodisiw> thanks, hopefully i will get to the point where it's useful for me :-)
17:51 <orion> Ping me if you have any questions.
17:51 <bodisiw> right now i barely got SDL2 working, so i've got plenty of learning ahead
17:51 <orion> Cool.
17:52 afarmer joined
17:52 <orion> sproingie: What is most exciting about GHCJS?
17:52 <bodisiw> (i assume i can use its framebuffer support to not run X on rpi)
17:53 <shapr> This was posted yesterday: https://medium.com/@zw3rk/a-haskell-cross-compiler-for-raspberry-pi-ddd9d41ced94
17:53 <sproingie> orion: having access to the browser platform
17:53 cretiq joined
17:53 connrs joined
17:54 <orion> In a perfect world browsers would have Haskell interpreters built in, and everything would run in a restricted Monad.
17:54 nh2 joined
17:55 <sproingie> wait for webasm i guess
17:55 <orion> ha
17:55 <orion> Actually, is it possible to have typed assembly?
17:55 <sproingie> sure, there's several implementations
17:56 <orion> That's actually really awesome: You could compile your Haskell code to a typed assembly and deliver that to the browser instead of the actual source code.
17:57 <sproingie> me, i don't care if the runtime is implemented with a bunch of hamsters on adderall
17:57 chaosmasttter joined
17:57 moet joined
17:58 im0nde joined
17:58 castlelore joined
17:58 castlelore joined
17:58 CoderPuppy joined
17:58 jer1 joined
17:59 <sproingie> webasm i imagine just does something like pnacl for isolation. works well enough.
18:00 <EvanR> on the subject of game engines, do people get anything out of "completed" game engines in other languages ever? pygame?
18:00 <EvanR> if so youd want to see what those libs provide and wonder if it makes sense for haskell
18:01 <EvanR> because theres millions in other languages that are write only and no one would realistically want to use
18:01 <Aruro> java --help ----> unrecognized option help, and people dream about haskell in browsers :D
18:01 themagician joined
18:01 <sproingie> pygame's had many many things written with it. but pygame's age is showing, and there's better stuff out there
18:01 <EvanR> better stuff... that people use?
18:02 <sproingie> Aruro: java's always used single dashes for options
18:02 <erisco> windowing, mouse, keyboard, joystick, audio, rendering, physics, game state
18:02 <Sonolin> pygame was only really used for toys/pet projects though
18:02 <erisco> networking
18:02 eschnett joined
18:02 <EvanR> erisco: ... that sounds like mostly something like SDL which isnt a game engine
18:02 <Sonolin> performance was terrible (not to mention the API)..
18:02 <sproingie> game state can bite me, most engines have a horribly primitive idea of states
18:02 <Aruro> sproingie: how hard is it for billion dollar monster to inlcude a couple of lines of code for 2 dashes :)
18:02 <erisco> EvanR, SDL checks a lot of boxes nonetheless
18:03 <EvanR> Sonolin: terrible api is not the focus of the question, but whether people use it
18:03 <sproingie> for me, input handling is the main reason for an engine, since it's so fiddly
18:03 <EvanR> erisco: not really what i was getting at though
18:03 <Sonolin> EvanR you mean like using a C/other language framework in Haskell?
18:03 <sproingie> Aruro: when java was new, it wasn't really a settled convention like it is now
18:03 <Sonolin> I'd think it would be useful for sure
18:03 <Aruro> btw gnu tools can do both
18:03 <EvanR> no
18:04 <sproingie> -foo in most gnu tools is equivalent to -f -o -o
18:04 shangxiao joined
18:04 <erisco> entity component frameworks
18:04 <erisco> i.e. "game objects"
18:04 <sproingie> entity systems can likewise bite me
18:05 <EvanR> "where are the game engines" answered: everywhere. "where are the engines in haskell" answered: nowhere. "where are the game engines that i would use": ???. "how to make an engine in haskell that i would use" f(???)
18:05 <* hackage> persistent-mysql 2.6.0.2 - Backend for the persistent library using MySQL database server. https://hackage.haskell.org/package/persistent-mysql-2.6.0.2 (MichaelSnoyman)
18:05 mizu_no_oto joined
18:05 <sproingie> the use case in c++ was for specific memory layouts. in other languages, it's about composition, which you're going to use anyway ... right?
18:05 <erisco> I just want some libraries to take away all the nonsense for me... like making a window and rendering fonts
18:06 <erisco> after that I'll handle the rest
18:06 <MarcelineVQ> what kind of fonts?
18:06 <EvanR> sproingie: many people dong use c++ or drop into something else for "scripting"
18:06 <sproingie> so as far as entity systems go, having to use goofy surrogate keys for entities is not a win for me
18:06 <EvanR> erisco: right so we have all that now, so isnt that interesting
18:06 <erisco> font rendering is a whole barrel of worms... I don't want to have to think about it :P
18:06 <EvanR> pango bindings, cairo bindings
18:07 <EvanR> hafbuzz
18:07 <sproingie> erisco: SDL is pretty much right up your alley then
18:07 <EvanR> harfbuzz
18:07 <erisco> you know the image libraries that let you throw in anything and get out anything? like that
18:07 <EvanR> not that all games need browser-like text
18:07 <sproingie> i think SDL is still using freetype and not harfbuzz, but for most purposes it really doesn't matter
18:07 oisdk joined
18:07 <EvanR> ex. http://i.imgur.com/FMOYXVJ.png
18:08 <erisco> you have to be careful with sprite fonts... very restrictive
18:08 <EvanR> sproingie: two different things... one is rendering glyphs and the other is for complex layouts
18:08 <Tuplanolla> Is FreeGLUT the still only framework that provides stroke fonts out of the box?
18:08 <sproingie> juicypixels aims at being that "throw in anything" library afaik
18:08 <EvanR> erisco: if you look at an arcade game or a "megatouch" game or a casino video game... not too much non-sprite text
18:09 <EvanR> elaborate text in games is really specific to MMOs
18:09 <erisco> they're technically easy to do but also an aesthetic style
18:09 <sproingie> eh everyone wants a nice font in their menus
18:09 <EvanR> or space adventure
18:09 cpup joined
18:09 <erisco> no, it is pervasive in all genres
18:09 <EvanR> no, i dont think so
18:10 <EvanR> big name computer games, and only some
18:10 <erisco> well, browse Steam sometime and let me know what you see
18:10 <MarcelineVQ> by sprite text do you mean the low-res look or do you mean bitmap fonts?
18:10 <EvanR> that is really a specific kind of game
18:10 Cassiopaya joined
18:10 <EvanR> MarcelineVQ: ill get you an example
18:11 <erisco> anyways they only satisfy a special case
18:11 <sproingie> bitmap fonts i'd guess, which can be as smooth as you like
18:11 fizruk joined
18:11 <MarcelineVQ> EvanR: sorry I meant to be asking erisco
18:11 <sproingie> but lots of fun trying to kern those
18:11 andyo joined
18:11 <erisco> yes, bitmap fonts
18:11 robotroll joined
18:11 <EvanR> MarcelineVQ: http://a2.mzstatic.com/us/r30/Purple1/v4/f0/f9/6a/f0f96a73-172a-c4b7-fcee-1e6f748cb227/screen520x924.jpeg
18:11 insitu joined
18:11 laplacian joined
18:11 <erisco> "sprite font" in that it is rendered like you do sprites, i.e. you compile a "sprite sheet" and draw subsections of it for each sprite
18:12 <sproingie> kerning is actually easy, it's all the other hinting that's basically impossible with bitmaps
18:12 <MarcelineVQ> ah, what's restrictive about bitmap fonts? there's techniques like distance field rendering to keep them useable in most cases
18:12 <EvanR> right
18:12 <erisco> limited in that it is fixed in size
18:12 <sproingie> such hinting becomes important when you scale things to different sizes
18:12 <EvanR> MarcelineVQ: were both talking about fancy graphical lettering, not a font renderer for solid text
18:12 <sproingie> some languages become completely unreadable when you scale them down without hints
18:13 <erisco> eh, then we're just talking about it as an encoding rather than a presentation
18:13 fortruce joined
18:13 <EvanR> so this is a no on my question
18:14 Kreest__ joined
18:14 <* hackage> servant-auth-token-rocksdb 0.4.1.2 - RocksDB backend for servant-auth-token server https://hackage.haskell.org/package/servant-auth-token-rocksdb-0.4.1.2 (NCrashed)
18:14 <EvanR> something that integrates everything SDL would do plus a physics engine, in a sort of browser-like programmed environment?
18:14 <EvanR> taking care of shaders and time and everything?
18:15 bs joined
18:15 <sproingie> if you want a browser-like environment, it's hard to beat a browser
18:15 <erisco> EvanR, I think that is missing the point somewhat... but alright
18:15 <EvanR> sproingie: except for one thing... audio synth
18:15 <sproingie> oh no, that's there now too
18:15 <EvanR> erisco: which point?
18:15 <EvanR> sproingie: what you got
18:15 <erisco> the example you posted
18:16 <EvanR> that wasnt a point... nevermind
18:16 <erisco> that may be done with sprites, sure, but then we're really just talking about pre-computing
18:16 <sproingie> html5 audio does a lot beyond just <audio> tags
18:16 <EvanR> sproingie: i checked... it doesnt do what im talking about
18:17 <erisco> where did all the effects and initial rendering come from? some graphics program that has sophisticated font rendering
18:17 <sproingie> should be able to do synthesis
18:17 <EvanR> you cant get a callback, a sample stream
18:17 <erisco> the fact we can pre-compute it doesn't change the equation
18:17 <EvanR> you can only make oscillators
18:17 <EvanR> and they only do sinewaves
18:17 zcourts joined
18:17 <EvanR> you cant do general DSP
18:18 fortruce joined
18:18 uglyfigurine joined
18:18 `Guest00000 joined
18:18 <sproingie> well it's all sine waves in the end
18:18 <sproingie> there's higher level APIs around though
18:18 <EvanR> its a missing fragment of the browser platform
18:18 <orion> "It's sine waves all the way down..."
18:18 <erisco> what do you think the turnaround time is on their text renders? probably not great
18:19 jer1 joined
18:19 <sproingie> https://www.w3.org/TR/webaudio/#idl-def-PeriodicWave
18:19 <EvanR> i didnt mean for my question to become a huge discussion of text rendering techniques
18:19 <EvanR> or DSP
18:20 <sproingie> EvanR: it's always more interesting a little deeper down the rabbit hole :)
18:20 james999 joined
18:20 uglyfigu_ joined
18:21 oish joined
18:21 <EvanR> sproingie: yes, you cant do general synthesis. they made a particular kind of one dsp thing you can use and called it done. im sure theyll "standardize" a few more primitives later
18:22 <ClaudiusMaximus> EvanR: there is a ScriptProcessor node in web audio it seems, that lets you use arbitrary js callback to fill an output buffer periodically
18:22 infandum joined
18:22 mac10688 joined
18:22 <tsahyt> how can I use lens to check whether a IntMap [Foo] contains the empty list at a given position?
18:22 <sproingie> EvanR: i think the idea was to provide the primitives and let library authors fill in the rest
18:22 <sproingie> EvanR: i mean do you really want another DOM?
18:22 <EvanR> something like what ClaudiusMaximus is what i was looking for
18:22 <infandum> Can I have a generic render for diagrams? Like, depending on the user input ".svg" or ".html", for instance, it would automatically render that file?
18:22 <EvanR> sproingie: i am not suggesting this browser idea, i was randomly poking at my original question
18:22 dni joined
18:23 <Gurkenglas> tsahyt, "views (at k) null"
18:23 <tsahyt> ah
18:23 <tsahyt> hmm but I have this intmap as part of a Bar record and carry it around in a state monad
18:23 Kreest_ joined
18:24 <tsahyt> I suppose there's a nice way to do this rather than accessing the state first and then checking
18:24 <Gurkenglas> tsahyt, "uses (mapfield . at k) null".
18:24 <cocreature> Gurkenglas: isn’t that a type error? at gives you a lens to a Maybe iirc?
18:24 <tsahyt> Gurkenglas: thanks!
18:24 <byorgey> infandum: yes, that is possible. You have to define your diagrams with a polymorphic type (http://projects.haskell.org/diagrams/doc/manual.html#polymorphic-diagrams-and-partialtypesignatures is helpful here)
18:24 <tsahyt> this is the first time I'm using lens for anything, I'm still rather disoriented
18:24 <Gurkenglas> You're right. "uses (mapfield . at k . _Just) null" if no entry is supposed to return False
18:24 <EvanR> ClaudiusMaximus: looks like they want to create "audio workers" ... nice
18:25 <shapr> tsahyt: have you read Gabriel's lens tutorial?
18:25 oberstein joined
18:25 <tsahyt> shapr: not yet
18:25 <byorgey> infandum: unfortunately there isn't anything to do this automatically so off the top of my head I am not sure how easy it is to keep all the nice options like -w and -h and so on, because you have to write main yourself so it can decide which backend to call
18:25 <Gurkenglas> tsahyt, if the map is supposed to contain a list of values for each key and [] is supposed to be equivalent to no values, use "mapfield . at k . non []" as your accessor and you don't need to worry about whether a key is in there
18:25 baldrick joined
18:27 prkc joined
18:27 <tsahyt> it actually should always be in there
18:27 <infandum> byorgey: I am doing a render to a file, so there is no command line.
18:27 <tsahyt> the Nothing case would indicate an unrecoverable error here
18:28 mivael_ joined
18:28 <Gurkenglas> tsahyt, you're trying to remove an element from the list and remove the [] from the map if the element was the last one for that key?
18:28 <infandum> byorgey: Would I be using renderDia with this type as input or each renderHtml5 and renderSVG?
18:28 <byorgey> infandum: ah, ok, that's easier then
18:28 <glguy> If the elements of your list aren't instances of Eq, you can use: non' _Empty :: Iso' (Maybe [a]) [a]
18:29 <byorgey> infandum: I think you probably want to use renderHtml5 and renderSVG
18:29 <tsahyt> Gurkenglas: no it's not removed at the end, I just need to know when it hits empty
18:29 <tsahyt> it might fill up again
18:30 <james999> i'm downloading haskell 8.0.2a from the website, but the O'Reilly book I have says it uses version 2012.4.0.0. Can someone clarify the difference?
18:30 <infandum> byorgey: OK. Thank you!
18:30 <glguy> 2012.4.0.0 is a version of the Haskell Platform. 8.0.2a is a version of GHC
18:30 <glguy> GHC is the compiler, and the compiler is a component of the Haskell Platform
18:30 leat joined
18:31 <glguy> james999: https://www.haskell.org/platform/contents.html
18:32 <sproingie> iirc some stuff in RWH doesn't work in 8.02 without minor adjustments
18:32 Itkovian joined
18:32 <sproingie> or maybe that's just LYAH
18:32 <james999> I'm looking at an installer window right now that says "Haskell Platform 8.0.2-a 32 bit"...
18:33 <glguy> james999: At some point there Haskell Platform versioning switch to use the GHC version number. YOu can see that by following the link I sent you
18:34 <james999> glguy: I see it now thanks. Will the sample code be fine or will it break?
18:34 robotroll joined
18:34 <glguy> james999: Some will work, some will break
18:34 <james999> ok.
18:34 <sproingie> most will work, what breaks is usually due to imports you no longer need
18:34 <sproingie> or imports that were moved around
18:34 meoblast001 joined
18:36 <james999> yeah. that's the problem with using books or tutorials that aren't current I suppose.
18:36 juanpaucar joined
18:37 Itkovian joined
18:37 connrs joined
18:38 dddddd joined
18:38 jaziz joined
18:39 BlueRavenGT joined
18:39 jer1 joined
18:40 SkyPatrol joined
18:40 zcourts_ joined
18:40 alqatari joined
18:40 <infandum> byorgey: Having some trouble: it seems that even with that polymorphic type I still need to have "b" explicitely be one backend, so I can't have a function "renderType :: FileType -> QDiagram b V2 Double Any -> IO"
18:41 nickager joined
18:41 <byorgey> infandum: I would expect you at least need a Backend constraint, renderType :: Backend b => FileType -> QDiagram ... -> IO ()
18:41 Destol joined
18:42 <infandum> byorgey: So that documentation had "f :: _ => stuff"
18:42 <byorgey> hmm, no, maybe not
18:42 <infandum> So I have "renderType :: _ => stuff"
18:42 <infandum> Forgot that part, sorry
18:42 <byorgey> infandum: you don't need that for renderType. You need it for your diagrams.
18:42 <infandum> oh
18:43 <infandum> haha well I have that as well
18:43 <infandum> the diagram is of type QDiagram b V2 Double Any
18:43 <infandum> That part compiles
18:43 <byorgey> ok, at this point you will have to show me some actual code and error messages =)
18:44 <infandum> byorgey: https://pastebin.com/9rGnDx9p
18:45 <infandum> byorgey: • Couldn't match type ‘b’ with ‘Diagrams.Backend.PGF.Render.PGF’
18:45 <infandum> ‘b’ is a rigid type variable bound by
18:45 <infandum> the inferred type of
18:45 <infandum> renderType :: String -> D.QDiagram b D.V2 Double D.Any -> IO ()
18:45 <infandum>
18:45 <infandum>
18:46 <EvanR> erisco fresheyeball seems like the free-game package comes with support for graphics and fonts
18:46 <glguy> byorgey: Do you need any help getting "active" fixed to build against the current version of lens?
18:46 <byorgey> infandum: please show me ALL your code, and paste the full error message in the pastebin as well
18:46 pie__ joined
18:47 ccomb1 joined
18:47 <infandum> byorgey: Well there's a bit too much for that...
18:47 meoblast001 joined
18:48 <byorgey> glguy: I might. I haven't looked much at it yet since the semester was wrapping up.
18:48 <byorgey> infandum: well, can you make a small but complete example that demonstrates the problem?
18:48 <byorgey> infandum: I can't really debug code in my head without being able to actually try compiling and running it myself.
18:49 stef204 joined
18:49 <infandum> byorgey: I can try
18:49 <byorgey> infandum: I suspect the problem may have something to do with renderType being defined in a 'let'
18:49 im0nde_ joined
18:49 <byorgey> but I am not sure
18:49 anemecek joined
18:50 connrs joined
18:50 <byorgey> infandum: oh! no, I am being dumb. Currently, the type of renderType says that the *caller* of renderType gets to choose the backend.
18:50 cyborg-one joined
18:50 <byorgey> but the implementation is trying to choose some specific backends.
18:51 stef204 joined
18:51 <byorgey> you would have to do something like String -> (forall b. QDiagram b V2 Double Any) -> IO () but that will not work either, because none of the diagrams you define will have that type --- they will have more constraints
18:52 vbCrLf joined
18:52 <infandum> byorgey: I figured I might have to do repetitive calls to the diagram with (:: PGF) and the like
18:52 <infandum> :(
18:53 <infandum> Let's see if that works
18:53 <byorgey> yes, that might be what you have to do. I don't think it
18:53 <byorgey> ...don't think it's possible to make a generic function like renderType
18:53 <glguy> byorgey: Oh, looks like someone already fixed "active" for you, it just needs a release https://github.com/diagrams/active/commit/8cdf72f4f4160a7216614bb46bf8099e2d1b094d
18:53 <infandum> byorgey: OK, thank you for your help!
18:53 <byorgey> infandum: sure!
18:54 CoderPuppy joined
18:54 <byorgey> glguy: oh, great! I hadn't noticed that. cchalmers is our resident lens expert
18:55 <vbCrLf> Hey! I write a program in Python, which calls Haskell (compiled to a DLL and using FFI exports) in order to do some computations. How can I abort an Haskell function on demand?
18:55 <byorgey> glguy: it doesn't need a major version bump, does it?
18:55 <vbCrLf> Some computations take time and I want to be able to abort them using Python if needed
18:55 <glguy> byorgey: nope, very little bump at all
18:55 <glguy> It will only work in *more* cases than before now
18:56 aewens joined
18:56 <glguy> byorgey: Maybe take note while you're thinking about it that diagrams-lib needs an updated bound on intervals (0.8 came out), digrams-lib builds against this new version, but I don't know how to test that it behaves correctly http://hackage.haskell.org/package/intervals-0.8/changelog
18:56 <byorgey> ok. Making an upload now.
18:56 eschnett joined
18:56 <glguy> Thanks!
18:56 <Gurkenglas> vbCrLf, you could kill the thread doing it
18:56 <byorgey> glguy: yes, I saw the intervals update. I glanced at it just long enough to know that I didn't know if it still works correctly.
18:57 dni joined
18:58 <* hackage> active 0.2.0.13 - Abstractions for animation https://hackage.haskell.org/package/active-0.2.0.13 (BrentYorgey)
18:59 rom1504 joined
18:59 <infandum> byorgey: That did it!
18:59 <byorgey> infandum: great!
18:59 <infandum> Just a bunch of code repetition though
18:59 jaj joined
19:00 <byorgey> infandum: right, sadly I don't know of a good way to avoid that. Other diagrams developers have definitely spent time thinking about this problem before, but I don't know that anyone's ever come up with anything reasonable.
19:00 jer1 joined
19:01 <infandum> byorgey: The only worrying part is that they render differently :/
19:02 <infandum> The text was centered in the pdf but in the svg it's to the top left for some reason
19:02 <byorgey> infandum: I was just going to ask if it involved text.
19:02 <infandum> haha
19:02 <infandum> are there known issues?
19:03 <byorgey> since text is just passed off to each backend's native text support it is very hard to get text to look consistent across backends
19:03 <vbCrLf> Gurkenglas: Killing threads doesn't corrupt the state or something like that?
19:03 <byorgey> unless you use something like SVGFonts to convert text into paths and then stroke that
19:03 dm3 joined
19:03 <Tuplanolla> Haskell threads come with exception handlers, vbCrLf.
19:03 <sproingie> bleh. how in sam hell do i get sdl2 to use a hardware renderer? i added opengl as a dependency, not sure what else i need
19:03 <vbCrLf> Okay, thanks! I'll try
19:04 <byorgey> infandum: with that said, there could also be bugs; reports are most welcome
19:04 <infandum> byorgey: I'll see if I can find some solution for that.
19:05 <infandum> byorgey: Is there a recommended way to handle size? I used to have it fixed like mkHeight 60 but that turned out to be a bust -- absolute makes everything too small -- is there some kind of automatic way of having a size (like em hight or something)?
19:05 <lep-delete> @src (.)
19:05 <lambdabot> (f . g) x = f (g x)
19:06 zcourts joined
19:06 pie_ joined
19:06 <sproingie> oh FFS sdl2-ttf used to work for me, now it won't even link. i give up.
19:06 zcourts__ joined
19:07 <* shapr> hugs sproingie
19:07 <sproingie> i just want to program without constantly doing battle with the underlying system
19:07 <shapr> it gets easier?
19:08 <Tuplanolla> It doesn't get easier.
19:08 <sproingie> it got way easier when i switched to browser programming, yes. maybe i'll give ghcjs another go.
19:09 <Tuplanolla> The more programming skill you gain, the faster you can solve relevant problems, so that more time is left for fighting build systems.
19:09 zcourts joined
19:09 <srhb> Tuplanolla: :-P
19:11 <byorgey> infandum: size is complicated. It depends on what you are trying to achieve. Try reading http://projects.haskell.org/diagrams/doc/manual.html#measurement-units to start.
19:11 <byorgey> infandum: what exactly do you mean by "handle size"?
19:13 jrp6 joined
19:13 bennofs joined
19:16 <sproingie> bloody f***ing hell. it's looking for a symbol TTF_GetError ... which is apparently now a macro
19:16 <Tuplanolla> You have to admit that's a bit funny.
19:16 <sproingie> so looks like sdl2_ttf is broken
19:17 <infandum> byorgey: I'm not sure. When I open an html, for instance, the font size is up to the browser. I would prefer it that way. I don't know what the user would want and I want them to change the size of the result on the fly. However, if it's too tiny then it's nearly invisible even with 2000% zoom in the browser (which is what absolute does, as I have the base unit as 1).
19:18 ziocroc joined
19:18 crave joined
19:18 <geekosaur> welcome to the world of programming. we talk about bitrot for a reason >.>
19:21 jer1 joined
19:21 <infandum> byorgey: Like: I want 10 pt font size. What is that in diagrams' language for everything?
19:21 pie_ joined
19:22 Derbycat joined
19:22 afarmer joined
19:22 <EvanR> monads would be so scary if they werent called that. or maybe they would be! F# computation expression tutorials...
19:22 <EvanR> wouldnt*
19:22 chaosmasttter joined
19:22 <EvanR> "computation expressions have the reputation of being confusing..."
19:23 <EvanR> facepalm
19:23 <seequ_> It's like they tried to disguise monads as well as they possibly could
19:23 <geekosaur> isn't there already a "cute fuzzy things" monad tutorial somewhere?
19:24 <geekosaur> or s/fuzzy/fluffy/
19:24 <EvanR> in this video SPJ said "i think they called them 'Workflows'... which in retrospect is probably a good idea"
19:24 <byorgey> infandum: sorry, I have to go. There are answers but they are a bit complicated. Why don't you send a message to the diagrams mailing list and then others can chime in with suggestions as well.
19:24 <EvanR> but then... they didnt
19:24 <EvanR> its computation expressions
19:25 <sproingie> EvanR: workflows are just one of the things monads express though. that'd be a good description of do-notation though
19:25 <infandum> byorgey: That's fine, I know it's a bit complex
19:25 romank joined
19:25 <sproingie> the problem with trying to call monads something else is that it usually describes a subset of monads
19:26 <infandum> thank you
19:26 <EvanR> sproingie: whats funny is, Monad in programming *is* a subset of monads ;)
19:26 <sproingie> looks like s/TTF_GetError/SDL_GetError/ worked fine. made a pull req but i don't get a good feeling about how maintained sdl2-ttf is
19:27 <sproingie> EvanR: anyway i don't think monads scare away people so much now that flatMap is appearing in other languages
19:27 <sproingie> they're just FlatMappables
19:27 ikke joined
19:27 <EvanR> i actually like FlatMappable
19:27 `^_^v joined
19:27 <sproingie> monad transformer stacks on the other hand get pretty daunting
19:28 <Tuplanolla> That's a bit verbose. Why not `Flattable` or `Pancake` instead?
19:28 <EvanR> at one point Flattenable ... pertaining to the join operation
19:28 <geekosaur> "Squishy"
19:28 <EvanR> should work in languages where most libraries are words much longer than that
19:28 <sproingie> MonoidInTheCategoryOfEndofunctors
19:29 <EvanR> Squishable
19:29 <sproingie> Squishy
19:29 armyriad joined
19:29 coot____ joined
19:29 <EvanR> Squishy may come off as sounding patronizing
19:29 <sproingie> thus we keep Monad
19:30 xall joined
19:30 <Logio> monads are still quite okay compared to the legions of co-objects
19:30 <EvanR> SPJ "at least 'Monad' has the effect of filtering only people who really want to learn haskell"
19:31 <EvanR> (filter keeps things that predicate returns True)
19:31 <Akii> I like the term "Squishy Thingy"
19:31 <Akii> has a nice sound to it
19:31 <kuribas`> wait, flatMap is Monad?
19:31 <EvanR> yes
19:31 <Akii> and mapReduce is fold, right?
19:31 <sproingie> using the join . fmap intuition, yes
19:32 <sproingie> sometimes bind works better to explain a monad, sometimes join
19:32 <EvanR> > join [[1,2,3],[4,5,6],[7,8,9]] -- ;)
19:32 <taktoa> well, a monad is `flatten` (join) + `pure`
19:32 <lambdabot> [1,2,3,4,5,6,7,8,9]
19:32 <sproingie> i find Maybe is easier to explain with bind, and join . fmap for List
19:33 <Akii> :t bind
19:33 <lambdabot> error:
19:33 <lambdabot> • Variable not in scope: bind
19:33 <lambdabot> • Perhaps you meant one of these:
19:33 <taktoa> yeah FlatMappable is not a complete description of Monad
19:33 <EvanR> i tried to make a list of monads just now, i got 19
19:33 <Tuplanolla> I wouldn't really mind `Pancake` or `Burrito` either.
19:33 crave_ joined
19:33 <sproingie> bind in haskell is spelled >>=
19:33 <Akii> what's bind?
19:33 <Akii> ah
19:33 <Akii> right
19:33 <aewens> My main issue with teaching monads with Maybe is that the gap it puts you in between somewhat understand what monads are and how you'd go about using them for anything non-trivial.
19:33 <Akii> lol
19:33 <eschnett> :t (>>=)
19:33 <lambdabot> Monad m => m a -> (a -> m b) -> m b
19:33 <taktoa> you could maybe call it PointedFlatMappable
19:33 <Tuplanolla> Beamer already gets away with animals and plants for modules.
19:34 <EvanR> aewens: from concrete examples to the abstract
19:34 <sproingie> aewens: Maybe is a good trivial example that actually does something useful
19:34 <kuribas`> :t \f -> join . fmap f
19:34 <lambdabot> Monad m => (a1 -> m a) -> m a1 -> m a
19:34 <sproingie> List is a good step after that. everyone knows map and ++ after all
19:34 moet joined
19:34 <EvanR> most people dont (know they can) use non deterministic computation
19:34 jgt joined
19:35 <aewens> Yeah, but most guides I found on monads explained Maybe and then left it at that.
19:35 juanpaucar joined
19:35 pgiarrusso joined
19:35 <EvanR> you need to explain these 19 example i compiled!
19:35 <sproingie> "nondeterministic" scares people though, they get images of amb and such in their head
19:35 <EvanR> whats wrong with amb!
19:35 <sproingie> (ok only lispers get amb into their head)
19:36 hybrid joined
19:36 <eschnett> :t amb
19:36 <lambdabot> error: Variable not in scope: amb
19:36 Levex joined
19:36 dm3 joined
19:36 <sproingie> http://www.randomhacks.net/2005/10/11/amb-operator/
19:37 <EvanR> amb [x] = x, amb (x:xs) = race x (amb xs)
19:37 <sproingie> poor explanation of amb in that article actually, but the examples are adequate
19:37 <sproingie> Icon had that sort of thing built in, damn fun little language
19:38 bkboggy joined
19:39 vinny_wang1212 joined
19:40 <vinny_wang1212> join #java
19:40 <sproingie> i had a lot of fun using Quantum::Superpositions in perl to generate rule combos. hell that code might still be in use
19:40 <sproingie> took a stab at doing it in haskell but back then i didn't know how to tame the massive space leak i caused :p
19:41 <EvanR> QIO quantum computation monad
19:41 darjeeli1 joined
19:41 jer1 joined
19:42 baldrick joined
19:42 tromp joined
19:43 man_arab joined
19:44 <taktoa> EvanR: sproingie: if you're interested in QM and know a little bit of category theory (e.g.: what a monoid category is), check out https://arxiv.org/abs/0908.1787
19:44 <taktoa> *monoidal
19:45 <sproingie> taktoa: QM seriously hurts my brane. Q::S in perl was a goofy name for plain old nondeterministic programming
19:45 <taktoa> ah
19:45 <sproingie> perl6 has it built in with "junctions"
19:46 <EvanR> taktoa: sweet
19:46 <EvanR> i will forward this to the reading group
19:46 <sproingie> and haskell just plain has it built in because it has sensible "primitives" like fmap
19:47 <sproingie> design patterns for free, more or less
19:48 bigos joined
19:49 <EvanR> is there a current idiomatic "exit" monad going around?
19:49 <EvanR> or is EitherT, ExceptT used for this
19:49 sleffy joined
19:50 deech joined
19:50 rafaelcgs10 joined
19:51 nwf joined
19:51 <deech> Hi all, I'm trying out the GHC release candidate on one of my projects and it's complaining about base version bounds in dependencies (set to upper bound of 4.9.*). Is there a way to get Stack to ignore them?
19:52 <sproingie> EvanR: MonadFail perhaps? maybe more modern alternatives exist.
19:52 <man_arab>  From which country are ye?
19:52 Luke joined
19:53 <EvanR> whoa
19:54 <EvanR> no PM
19:54 <EvanR> USA
19:54 <sproingie> deech: quick and dirty way would be to use a nightly resolver
19:54 <sproingie> or is that just a nightly stackage?
19:55 <EvanR> sproingie: MonadFail requires a String and isnt really a monad of its own
19:55 <sproingie> it subclasses Monad afaik. but not very satisfying, no
19:56 <EvanR> heh, Identity as an exit monad
19:56 <sproingie> sure. exit with success.
19:56 <EvanR> > (fail "hmm" :: Identity Int)
19:56 <lambdabot> Identity *Exception: hmm
19:56 <EvanR> no
19:57 <sproingie> ugh
19:57 <man_arab> Hi
19:58 flatmap13 joined
19:58 <deech> sproingie: I'm using 'resolver: nightly-2017-05-16' and I still get, for example, 'base-4.10.0.0 must match >=4 && <4.10 (latest applicable is 4.9.1.0)'
19:58 flatmap13 joined
19:58 <sproingie> guess nightly resolvers aren't enough
19:58 man_arab left
19:58 shayan_ joined
19:59 <kadoban> Nightly resolvers tend to use nearly the most recent released GHC, I don't remember them ever using RCs
19:59 <kadoban> I think there's something about using RCs with stack/stackage on fp complete's blog a while back, but I don't recall exactly.
20:00 oish joined
20:01 zv joined
20:02 jer1 joined
20:02 wmendoza joined
20:03 <rafaelcgs10> is here a good place to ask something about formal proof systems? more specifically
20:03 TheFuzzball joined
20:04 baldrick joined
20:04 <rafaelcgs10> ...more specifically the formal system given in Wadler's paper: How to make adhoc polymorphism less ad hoc
20:05 pie_ joined
20:07 <deech> sproingie: Got something working by doing 'resolver: ghc-8.2.0.20170507'.
20:07 xcmw joined
20:07 maarhart joined
20:09 <sproingie> ooh cool
20:09 Jesin joined
20:11 Itkovian joined
20:12 bvad joined
20:12 abroz joined
20:12 MichaelBurge joined
20:13 conal joined
20:13 cdg joined
20:16 locallycompact joined
20:18 locallycompact joined
20:18 tristanp joined
20:18 rom1504 joined
20:19 justan0theruser joined
20:19 <deech> Has anyone tried the release candidate with a non-trivial Setup.hs? I'm getting errors like 'Could not find module ‘Distribution.Simple.PreProcess’' and it's clearly there 'https://github.com/haskell/cabal/blob/2.0/Cabal/Distribution/Simple/PreProcess.hs'.
20:20 <glguy> deech: Yes, I've been building things with nontrivial Setup.hs and 8.2.1-rc1/2
20:21 Luke joined
20:22 <cocreature> deech: llvm-hs’s Setup.hs is fairly complex and I was able to get it working after adapting to the API breakage in cabal 2.0
20:22 jer1 joined
20:23 <cocreature> deech: do you use setup-depends?
20:23 <unknownln> Is there any reason to prefer either (>) and (<) or (>>) and (<<) when dealing with a monad besides aesthetic appeal of one vs the other?
20:24 <WarmCookie> I don't know how you'd use (>) or (<); they aren't monadic.
20:24 <glguy> I'd prefer (>>) to (<<) because (<<) isn't defined
20:24 <deech> cocreature: Oh yeah. I just updated that to Cabal >= 2.0.0 and now I'm getting API breakage errors. Thanks!
20:24 <unknownln> sorry, meant `*>` and `<*`
20:25 <glguy> *> and <* do two different things, they aren't interchangable
20:25 <unknownln> I must mean something else
20:25 <unknownln> hmm
20:25 rkazak joined
20:25 <mnoonan> (<*) doesn't have to be flip (*>)?
20:25 <unknownln> ^ wondering this myself now
20:26 <WarmCookie> I think your question is if it's reasonable to use Applicative style/syntax/operations on monadic values when you don't need the full power of monads?
20:26 <glguy> mnoonan: No, it's very unlikely not to be that
20:26 <glguy> mnoonan: No, it's very unlikely not to be that
20:26 <glguy> damn it
20:26 <glguy> mnoonan: No, it's very unlikely to be that
20:26 <unknownln> WarmCookie: yes that
20:26 <mnoonan> I get it, I get it :)
20:27 <unknownln> is there a reason to prefer the applicative operators to the monadic operators, for those operators which are equivalent
20:27 <glguy> no
20:27 <taktoa> well they have weaker constraints
20:27 <glguy> If you're using a type that supports both, then the weaker constraints won't matter
20:28 <mnoonan> glguy: oh, right; the sequence of actions is the same in both cases
20:28 <taktoa> code using the applicative operator will be more polymorphic
20:28 <glguy> Unless it's being used at a specific type already
20:28 <taktoa> yes
20:28 <glguy> It's possible that for a specific type that there could be a performance difference between the different choices, but there's no general guideline
20:28 kamyar joined
20:29 <unknownln> in this case I'd be using it in some parsing code, so definitely a specific type is in play
20:29 <deech> Wow, this Cabal API breakage was way easier to fix than 7.10 -> 8.0.
20:29 <WarmCookie> It's common for parsing libraries to encourage an applicative-style usage.
20:29 safe joined
20:30 <taktoa> I tend to use applicative operators whenever reasonable. I never use `return`, always `pure`. I usually forget to use `*>` instead of `>>` though.
20:30 Cooler joined
20:31 <kamyar> Hello guys
20:31 <kamyar> Please help me about using groundhog
20:31 <taktoa> I think it's because *> is a bit uglier and doesn't convey the semantics quite as well as >>
20:31 jathan joined
20:31 insitu joined
20:32 <unknownln> yeah, I prefer the look of >>. I had thought << existed as well, but I've been using the applicative operators so I hadn't tried it
20:33 <hvr> it just gets mildly confusing as >> and << are used often as bitshift operators in other popular languages... :)
20:33 <taktoa> oh yeah lol
20:33 coot____ joined
20:33 <WarmCookie> unknownln: You need >>= over <*> when the grammar of the second parser depends on the result of the first parser. Usually the grammar is designed such that the parsers are relatively easy to implement without having contextual changes in the grammar.
20:33 <taktoa> I'm so far down the haskell rabbit hole I forgot about that lol
20:33 <taktoa> I think every context-free grammar can be written using an applicative parser?
20:34 <kamyar> http://lpaste.net/355605
20:34 <WarmCookie> Yes, or at least it's what I'm trying to explain.
20:34 <kamyar> Please help me fix this code
20:35 <unknownln> that makes sense. If a library supports both, are there any performance gains in making sure a grammar is context-free?
20:35 juanpaucar joined
20:35 <unknownln> performance isn't a concern for me right now, but I'm curious
20:36 <glguy> kamyar: flip withConn :: (MonadBaseControl IO m, MonadIO m) => conn -> (conn -> m a) -> m a
20:36 <taktoa> unknownln: I think you could write an applicative parsing library that is asymptotically faster than a monadic one
20:37 uglyfigurine joined
20:37 anodium joined
20:37 <kamyar> glguy: What should I do?
20:37 <WarmCookie> unknownln: Performance is neglectable for the case that's being made. What's more worrying is that when using the monadic approach, you cannot infer information about the parser without fully running it.
20:37 <glguy> kamyar: You'll need to make sure you're applying 'flip withConn pool' to something with type 'conn -> m a'
20:37 <glguy> kamyar: instead of what you're applying it to now
20:37 <WarmCookie> unknownln: There's a paper on static analysis that explains precisely that. I wonder if I can find it.
20:38 <kamyar> glguy: I haeve migrated from persistent to groundhog
20:38 <glguy> ok
20:38 juanpauc_ joined
20:38 <kamyar> glguy: I used a pool and I want to make a select query on it
20:39 <unknownln> If you find it, let me know. That's sounds pretty interesting
20:39 tttttttttttttttt joined
20:40 <kamyar> glguy: Can you help me?
20:40 <glguy> kamyar: I can't help you learn how to use groundhog. I can help you to understand why what you're doing with withConn is a type error
20:41 <unknownln> kamyar
20:41 <glguy> unknownln: I have an example of a type that only provides an Applicative interface so that the resulting values can be inspected if you're interested
20:41 <kamyar> glguy: Sould I use runDbConn instead? please see the signatures
20:41 <unknownln> change `u <- select ...` to `let u = select ...`
20:41 <glguy> kamyar: I don't know, I haven't used that library.
20:41 pie_ joined
20:41 <unknownln> and see what happens
20:41 sproingie joined
20:41 sproingie joined
20:42 <cocreature> kamyar: as glguy explained, flip withConn pool expects a function "conn -> m a" but you are not providing such a function. you are starting a do block immediately
20:42 <unknownln> but I'm not sure that's actually the issue
20:42 <unknownln> oh shoot yeah
20:42 <unknownln> I was just looking at the error there, ignore me
20:42 <glguy> Just looking at the API I don't think you probably need to use withConn at all
20:42 <glguy> You should probably read the docs for groundhog to see how it's intended to be used
20:43 <kamyar> glguy: I did but I wanna use a pool not a conn
20:43 <unknownln> glguy yeah, that'd be neat to look at (the applicative)
20:43 <tttttttttttttttt> send nudes lmao
20:43 rbocquet joined
20:43 was kicked by glguy: kynxbai
20:44 rafaz joined
20:44 <rafaz> hey where can i find support for sd disc recover?
20:44 <glguy> unknownln: See the example at the bottom of this page, it defines a parser for a config file and then is able to inspect the shape of the parser to make documentation for it http://hackage.haskell.org/package/config-schema
20:44 <glguy> rafaz: Oops, you're in the wrong channel. No this isn't the right place to find the right channel
20:45 <rafaz> can u help me out glguy and guide me :D
20:46 uglyfigurine joined
20:46 <koala_man> has anyone ever gotten afl-fuzz to work with Haskell programs?
20:47 <sproingie> rafaz: the guy with the @ told you this was the wrong channel
20:47 <kamyar> glguy: There is no sample of groundhog using its pool!
20:47 <sproingie> not sure why i bother, good faith gets me nowhere on irc
20:47 <unknownln> thanks
20:48 mrd1 joined
20:48 wmendoza joined
20:49 rafaz left
20:49 <sproingie> oooo
20:49 bjz joined
20:50 <sternmull> why does "putStrLn <$> getLine" in ghci does not print the entered value? It asks me for the input, so it must be because putStrLn is actually evaluated... but then where is its output?
20:51 juanpaucar joined
20:51 <glguy> :t putStrLn <$> getLine
20:51 <lambdabot> IO (IO ())
20:51 Jjjjjjjjjjjjjjjj joined
20:51 <taktoa> sternmull: putStrLn =<< getLine
20:51 <taktoa> is what you want
20:51 <* hackage> concurrent-output 1.9.1 - Ungarble output from several threads or commands https://hackage.haskell.org/package/concurrent-output-1.9.1 (JoeyHess)
20:52 <cocreature> kamyar: I think you want to use withResource instead of withConn
20:52 crobbins joined
20:52 TheFuzzball joined
20:52 <sproingie> <$> is just `fmap`
20:53 Cooler joined
20:54 <glguy> sternmull: with 'result <- putStrLn <$> getLine' the result is an action that each time if executed would print the line that getLine read from the console
20:54 xcmw joined
20:54 <sternmull> thank you glguy and taktoa. I think i understand it now. The getLine was evaluated to produce an IO action that would print its value, and i never executed that action.
20:54 <kamyar> cocreature: ok let me see, What about runDbConn?
20:54 <kamyar> cocreature: It gets pool
20:54 <orion> Is reversing a list expensive?
20:55 <Tuplanolla> Yes, orion.
20:55 <glguy> It's as expensive as doing anything with the whole list
20:55 <orion> But it's not as expensive as, say, adding elements to the end of a list as opposed to the head.
20:55 TheFuzzball joined
20:57 wmendoza joined
20:58 rafaz joined
20:58 <rafaz> need help to recover data from Sd card can anyone guide me to a good support channel?
21:00 <Tuplanolla> Self-sufficiency, rafaz: http://irc.netsplit.de/channels/?net=freenode
21:00 Itkovian joined
21:00 buttbutter joined
21:02 burtons_ joined
21:04 alx741 joined
21:05 mizu_no_oto joined
21:05 jgt joined
21:05 JagaJaga joined
21:05 pie_ joined
21:06 <* hackage> graphmod 1.4 - Present the module dependencies of a program as a "dot" graph. https://hackage.haskell.org/package/graphmod-1.4 (IavorDiatchki)
21:06 wmendoza joined
21:06 kamyar joined
21:07 pie_ joined
21:11 fotonzade joined
21:11 sleffy joined
21:12 danthemy_ joined
21:13 Moyst joined
21:16 JeanCarloMachado joined
21:16 JeanCarl1Machado joined
21:19 romank joined
21:22 TheHoff joined
21:22 romank joined
21:23 <TheHoff> Hey guys, i need some help with quickCheck and Arbitrary Char's
21:23 taksuyu joined
21:23 allenj12 joined
21:24 TheFuzzball joined
21:28 <kadoban> TheHoff: What kind of help?
21:28 augur joined
21:29 <TheHoff> kadoban: i want to verify that two functions always return the same, the input parameters are 2 finite strings, i defined a prop_function which compares the output of both function, with the corresponding parameters
21:30 <TheHoff> i think my problem is now to create arbitrary strings, i added Char to an instance of Arbitrary with "arbitrary = chooose('a','z')
21:30 juanpaucar joined
21:30 <TheHoff> but if i call quickcheck, it seems to run forever
21:31 <TheHoff> i guess the strings are too long (the 2 functions simply look for the second string in the frist string and return the indices of it)
21:31 bennofs joined
21:31 mmachenry joined
21:31 jao joined
21:31 <kadoban> Can you lpaste what you did? I think Char and String are already instances of Arbitrary, by the way.
21:33 cpup joined
21:34 juanpauc_ joined
21:34 Luke joined
21:34 <TheHoff> i have sent you an pm kadoban
21:34 <kadoban> I don't do private help, sorry.
21:34 flatmap13 joined
21:35 <Xe> I will for $50 an hour
21:35 <TheHoff> kadoban: i just sent the paste in pm
21:35 <* hackage> hquantlib 0.0.4.0 - HQuantLib is a port of essencial parts of QuantLib to Haskell https://hackage.haskell.org/package/hquantlib-0.0.4.0 (PavelRyzhov)
21:36 imalison joined
21:38 TheFuzzball joined
21:39 sssilver joined
21:39 <imalison> Can someone help me understand why I had to make this change https://github.com/IvanMalison/taffybar/commit/2542b6ebc6337634736c413670792711639ac1f3 in order to make my write file call occur consistently?
21:39 <imalison> I suspect that it has something to do with lazyIO
21:40 shangxiao joined
21:40 {emptyset} joined
21:41 dfeuer joined
21:42 uglyfigurine joined
21:42 flatmap13 joined
21:42 Discovery joined
21:43 <kadoban> imalison: What's the type of toggleStateFile ?
21:44 <imalison> IO FilePath
21:45 <imalison> kadoban: I'm assuming that the reason is basically because the value that is produced by the call of writeFile on the value coming from toggleStateFile is never used?
21:45 <kadoban> imalison: Ah, then <$> seems wrong. Wait ... how did that actually compile? Maybe I'm misunderstanding (??)
21:45 <imalison> yeah ?? is
21:45 <imalison> fab ?? a = fmap ($ a) fab
21:45 <imalison> it should definitely compile
21:46 TheFuzzball joined
21:46 <imalison> why would <$> be wrong?
21:46 <kadoban> Wouldn't :t (writeFile <$> toggleStateFile) be IO (IO (FilePath)) ?
21:46 <Cale> imalison: Because you're constructing an action as the result of this thing which is just being discarded
21:46 <imalison> oh i need a join
21:46 <kadoban> Or no, not quite that *ponders*
21:47 <Cale> indeed... but you're already in a do-block
21:47 <Cale> So maybe just run the toggleStateFile on a separate line
21:47 <imalison> yeah thats what i did
21:47 <Cale> right
21:47 <imalison> but why did it compile
21:47 mattp_ joined
21:47 <Cale> Because it's okay if it's an IO (IO ())
21:48 <imalison> yeah but its applied to another argument
21:48 <imalison> ah well yeah the intermediate type s
21:48 <kadoban> Oh, it's :: IO (String -> IO ()) and then ?? show result makes sense, but then you end up with IO (IO ())
21:48 <imalison> right yea
21:48 CoderPuppy joined
21:48 <imalison> yeah i think a join would have worked
21:48 <Cale> yeah, it would have
21:48 <kadoban> It would, but the way you changed it to is more idiomatic I'd say.
21:49 <imalison> ha well now i feel dumb
21:49 <Cale> Equivalently, capture the result of the action with <- and then run that
21:49 <imalison> kadoban: why is that
21:50 <kadoban> Not sure I have a good answer to that. It's just what I would expect and find easiest to understand.
21:50 <glguy> naming things and using do-notation is preferable to a mix of operators. It makes for easier code to understand
21:50 sleffy joined
21:50 <glguy> This code was confusing enough that while it compiled you didn't understand what it meant with the operator version
21:51 mr_sm1th joined
21:51 ixian joined
21:52 <imalison> glguy: yeah thats a fair point, although I think the intent is pretty clear
21:52 MichaelBurge joined
21:52 <glguy> I don't think that was the case here, the diff you showed was an improvement
21:52 <Cale> imalison: Well, the *intent* was clear, but what the code actually did wasn't as clear ;)
21:52 hiratara joined
21:53 <imalison> glguy: so when, do you think, is it appropriate to use things like '<$>' or ??
21:53 <imalison> which is sort of like the applicative style
21:54 <Cale> I think it can be just fine to use <$> and the other operators of that sort, but it's hard to explain exactly where it's profitable.
21:54 <glguy> Using ?? is cute but probably generally a way to write confusing code. <$> is fine on its own, but here combined with ?? lead to confusion
21:54 <Cale> Certainly if you were just going to join the result, you should be using =<< or something instead.
21:54 <imalison> glguy: yeah but the problem was more with <$> than ?? in this case
21:55 juanpaucar joined
21:55 <kadoban> Yeah, I'd say (=<<) is pretty much always going to be preferable to using (<$>) and then join
21:55 <glguy> No, if it was just <$> it would have been more obvious what you'd done wrong
21:56 <kadoban> (or the equivalent do notation is of course fine too)
21:57 <* hackage> hlint 2.0.7 - Source code suggestions https://hackage.haskell.org/package/hlint-2.0.7 (NeilMitchell)
21:58 ertes joined
21:59 <Cale> The other thing is that ?? is pretty uncommon, so at least I wasn't familiar with how it would associate in the presence of <$> at first
21:59 <imalison> kadoban: yeah so something like that `flip writeFile (show result) =<< toggleStateFile`
21:59 Cooler joined
21:59 <imalison> Cale: yeah i had defined ?? myself
22:00 <Cale> If it was writeFile <$> toggleStateFile <*> pure (show result)
22:00 <Cale> then that would still be wrong, but it would be more idiomatically wrong ;)
22:00 <kadoban> Cale: Haha
22:00 <kadoban> imalison: Yeah, I think so. The flip is unfortunate, but that's how I would have done it I think.
22:00 <orion> > 4 > ((-1) :: Word8)
22:00 <lambdabot> False
22:00 <imalison> kadoban: thats why I feel like one might prefer the <$> version
22:01 <kadoban> (or using do notation)
22:01 <imalison> it makes it feel more like the applicative style
22:01 <imalison> kadoban: hahah yeah. It seems like do notation is the consensus
22:01 <Cale> Well, the trouble with this thing is that there's no way to write the effect you want here with just Applicative
22:01 <kadoban> But it's outside of the realm of Applicative, Applicative isn't powerful enough.
22:01 <imalison> but I really don't feel like it adds to the clarity
22:01 <Cale> The effect you want to have on the world depends in some way on the result of one of the actions
22:01 <Cale> So it's impossible to write with Applicative
22:02 <imalison> Cale: yeah i get that
22:02 halogenandtoast joined
22:03 <hexagoxel> is the markdown flavor supported by hackage documented somewhere?
22:03 <hexagoxel> (README.md etc.)
22:07 alx741 joined
22:07 burtons joined
22:09 planck_ joined
22:09 yrid joined
22:09 alx741 joined
22:11 juanpaucar joined
22:12 <* hexagoxel> goes to #haskell-infrastructure
22:12 atk joined
22:13 cpup joined
22:14 alx741 joined
22:14 sssilver joined
22:14 mekeor joined
22:15 rblaze1 joined
22:16 e14_ joined
22:17 louispan joined
22:17 dm3 joined
22:18 yrid joined
22:18 Mibaz joined
22:18 <* hackage> butcher 1.1.0.0 - Chops a command or program invocation into digestable pieces. https://hackage.haskell.org/package/butcher-1.1.0.0 (lspitzner)
22:19 zcourts_ joined
22:19 JeanCarloMachado joined
22:19 <hexagoxel> three days, three packages released, yay! (at least by UTC)
22:20 JeanCarl1Machado joined
22:23 <* hackage> tensorflow 0.1.0.2 - TensorFlow bindings. https://hackage.haskell.org/package/tensorflow-0.1.0.2 (JudahJacobson)
22:24 fotonzade joined
22:27 <Mibaz> Do arrows lie somewhere on the "functor / applicative / monad" spectrum?
22:27 <Mibaz> Everything I've found online has been vague or out of my league or conflicting.
22:28 joebob joined
22:28 <glguy> Mibaz: no, "arrows" are their own thing with a different kind
22:29 <Mibaz> glguy: Ok thanks!
22:29 CoderPuppy joined
22:31 <sproingie> the little category theory i've picked up hasn't helped me grok what Arrow is about
22:31 hiratara joined
22:31 e14 joined
22:31 <geekosaur> Arrow is a thing that had Control.Applicative and Control.Category caged inside it and trying deperately to get out
22:32 <Mibaz> sproingie: I thought I was starting to get a hang of these typeclasses and then arrows showed up ;)
22:32 <sproingie> Control.Category is silly easy, Arrow is some weird business with tuples
22:32 <geekosaur> that was the cage >.>
22:32 <geekosaur> otoh Cotegory ended up with the tuples somehow
22:32 <geekosaur> *Category
22:33 <sproingie> eh, the Category class just defines id and .
22:33 <sproingie> seems pretty simple. arrow seems to be computation over pairs, which i suppose represent the ends of the arrow ... ?
22:34 darjeeli1 joined
22:35 zachk joined
22:35 Sgeo joined
22:35 zachk joined
22:35 kamyar joined
22:35 <kamyar> Hello
22:35 <sproingie> o/
22:35 <kamyar> Please someone tells me what the ~ sign do in constraints?
22:35 <phadej> it's type equality
22:36 <phadej> a bit like ==
22:36 <sproingie> type equality. a ~ b means a is the same type as b
22:36 <phadej> but for type
22:36 <phadej> but for types
22:36 <kamyar> select :: (PersistEntity v, EntityConstr v c, HasSelectOptions opts conn (RestrictionHolder v c), PersistBackend m, Conn m ~ conn) => opts -> m [v]
22:36 <kamyar> See this
22:36 <sproingie> not sure why they didn't just make type equality ==
22:37 petrus joined
22:37 <phadej> sproingie: because there's type family == which returns lifted Bool
22:37 <sproingie> ah
22:38 planck joined
22:38 <sproingie> boy that's a hell of a constraint
22:38 <phadej> that's not the real reason; but related to the real one (you should read about different equalities)
22:38 <sproingie> (on that select func)
22:38 flatmap13 joined
22:38 <kamyar> sproingie: Yea! And I am getting confused now!
22:38 Reshi joined
22:38 <phadej> `Conn` is at type-family, and `Conn m ~ conn` says that `Conn m` should be `conn`
22:39 <sproingie> the types in persistent are ... hairy :)
22:39 <phadej> i.e. it could been written HasSelectOptions opts (Conn m) (RestrictionHolder v c)..
22:39 <kamyar> sproingie: It is not persistent! It is groundhog!
22:40 <phadej> but not sure why maintainer went that way (consistency with more complicated variants?)
22:40 <sproingie> ah. ok, looking at persistent, the types look pretty simple
22:40 <kamyar> sproingie: I was using persistent but for many reasons decided to migrate to groundhog but I am confused now!
22:41 <kamyar> sproingie: groundhog supports relations and database foreign keys
22:41 <sproingie> ooh nifty
22:41 <kamyar> sproingie: But with too less docs and samples
22:42 <sproingie> ah the famously complete documentation the haskell ecosystem is known for ;p
22:42 <kamyar> Hey guys can someone help em using groundhog-postgresql pool object in select function?
22:43 <kamyar> All the samples use a single connection not the pool
22:43 <sproingie> presumably you get a connection from the pool
22:43 <kamyar> sproingie: Yea but there are functions getting pool for example runDbConn
22:44 <kamyar> sproingie: And, suppose u have a conn, does this select func get one? WTH
22:44 <planck> hello, i am new to irc and i have a question
22:44 noumenon joined
22:44 <planck> i am trying to join a channel however it says i need gto be identified by services
22:44 <planck> but i am already identified?
22:45 <sproingie> ok so it's runDbConn that can handle a single conn or a pool. looks like you should be able to just use a pool interchangeably with a connection
22:45 <sproingie> i'm guessing that's what ExtractConnection is about
22:45 <kamyar> sproingie: But how?
22:45 <sproingie> if my guess is right, just use it like a connection
22:46 <sproingie> very scala-esque idiom, "extract" naming and all
22:47 lambda_foo joined
22:47 <Mibaz> planck: https://superuser.com/questions/106965/how-do-i-identify-with-services-on-irc might be a good starting place. Depends on your client
22:48 <planck> thank you!
22:48 <sproingie> planck: you'll want to start with /msg nickserv help
22:48 <sproingie> nickserv is what registers you
22:48 <planck> and what will be the best irc client
22:48 <phadej> there are instance ExtractConnection Postgresql Postgresql where and
22:48 <phadej> instance ExtractConnection (Pool Postgresql) Postgresql
22:48 cpup joined
22:48 <planck> i am using xchat on ubuntu but i dont really like it]
22:48 <sproingie> the best client is the one you prefer. anything maintained within the last 5 years will do
22:48 <planck> which one do you guys reccomend?
22:49 <Mibaz> planck: can confirm xchat is horrible
22:49 <sproingie> me, i rather like xchat. i use irssi right now
22:49 <sproingie> irssi being a terminal app though, it's for old-skool types
22:49 <Tuplanolla> Pidgin works for me.
22:50 mjora7 joined
22:50 <sproingie> xchat's API is unbelievably idiotic though
22:51 <sproingie> but then so is pretty much the design of IRC
22:51 jgt joined
22:52 <Mibaz> sproingie: Once made an IRC client with Python. The protocol is pretty idiotic, as far as I could tell.
22:52 <planck> kiwi looks nice]
22:52 <planck> pidgin aswell
22:52 <planck> thank you for the recomendations
22:53 <planck> which one was the terminal based?
22:53 <sproingie> i wrote an IRC implementation in MOO. and yeah, the protocol started off awful and has only become worse
22:53 <sproingie> planck: irssi
22:53 <zachk> irssi and weechat
22:53 <mjora7> I live Textual (only MacOS), Irssi (terminal based) and thelounge (node, browser based).
22:53 rinon left
22:56 reptar_ joined
22:56 <sproingie> i wonder if irc's server protocol has any kind of multipath routing or if it's still all a tree topology
22:56 <Mibaz> sproingie: haha In the last 2 minutes I haven't been able to find out what M00 even is. You're adventurous.
22:56 <PlasmaStar> RFC still being followed bud. 8-)
22:57 <sproingie> Mibaz: lambda.moo.mud.org
22:57 <sproingie> wrote it for E_MOO in my larval stage of hacking
22:58 <zachk> mibaz moo, likea mud , old style multiuser text games
22:58 thebardian joined
22:59 <sproingie> i'd hope on *IRC* i wouldn't have to give background on what a MUD is. but i guess IRC has been more successful.
22:59 <jrm> If you worship in the church of Emacs, there is ERC and Circe.
22:59 <Rembane> sproingie: It isn't the 90s anymore. :D
23:00 <sproingie> Rembane: yet irc goes on. so do MUDs i guess, but they're tiny islands with shrinking populations.
23:00 <Rembane> sproingie: It does indeed.
23:00 <Mibaz> sproingie: Rembane: I get my hipster points just knowing what IRC is. Any more and I'd need to buy a beanie.
23:00 <sproingie> HellMOO is still a pretty fun MUD, long as you aren't easily offended
23:00 <Rembane> sproingie: Fun fact: I never started playing MMORPGs because they were too slow to play compared to MUDs.
23:01 <Rembane> Mibaz: Buy a beanie and get it over with, you will thank me later. :)
23:01 pgiarrusso joined
23:01 abroz joined
23:01 <sproingie> i got into WoW for a year, decided the game felt too much like work
23:02 thimoteus joined
23:03 jmcarthur joined
23:03 <Mibaz> Rembane: Maybe I can afford a nice beanie after all this Haskell finally pays off and I become impressively wealthy
23:04 <Mibaz> I mean people who know Haskell are all wealthy, right? ... ?
23:04 <sproingie> the Simons probably do pretty well, sure
23:04 <Rembane> Mibaz: Oh yes, at least one.
23:06 CoderPuppy joined
23:06 <Mibaz> I definitely am missing the Simons reference.
23:06 <hpc> actually all haskellers come from old money
23:06 <hpc> learning the language is like nerd polo
23:07 <EvanR> sproingie: and MUDs lost popularity like... 10 years before freenode
23:07 markasoftware joined
23:07 jaziz joined
23:07 <EvanR> was born
23:07 <Mibaz> hpc: XD it all makes sense
23:07 <sproingie> Mibaz: two of the guys behind GHC are named Simon, and there's a third Simon also active in the haskell community
23:07 twanvl joined
23:07 <sproingie> not sure if there were any simons in the committee. i'd guess SPJ was there?
23:08 sssilver joined
23:09 <Mibaz> sproingie: aah, they rake in the grant money, then, I suppose
23:09 cpennington joined
23:09 <sproingie> eh, SPJ (Simon Peyton-Jones) works for microsoft and Simon Marlow for facebook
23:10 <Mibaz> sproingie: Oh got it.
23:10 <EvanR> sproingie: definitely https://www.youtube.com/watch?v=re96UgMk6GQ
23:10 hybrid joined
23:10 <EvanR> "SPJ Escape from the ivory tower"
23:10 stef204 joined
23:10 systemfault joined
23:10 SkyPatrol joined
23:11 <sproingie> been meaning to watch that. i've seen some of SPJ's talks before, he's pretty good
23:11 <EvanR> sproingie: also this history of haskell and other lazy functional languages in the 80s http://haskell.cs.yale.edu/wp-content/uploads/2011/02/history.pdf
23:12 <EvanR> i just watched it, was hilarious
23:12 sgronblo joined
23:12 aez joined
23:12 <sproingie> he's kind of the larry wall of haskell
23:12 <sproingie> (wall is way weirder tho)
23:14 qki joined
23:14 <aez> @help
23:14 <lambdabot> help <command>. Ask for help for <command>. Try 'list' for all commands
23:14 <aez> list
23:14 <aez> @help list
23:14 <lambdabot> list [module|command]. Show commands for [module] or the module providing [command].
23:16 jer1 joined
23:16 tuborgman joined
23:17 Achylles joined
23:17 filterfish joined
23:18 Levex joined
23:20 cpup joined
23:21 aez joined
23:22 anuxivm joined
23:22 dylanj_ joined
23:23 sigmundv__ joined
23:24 drewbert joined
23:25 <* hackage> loc 0.1.2.1 - Types representing line and column positions and ranges in text files. https://hackage.haskell.org/package/loc-0.1.2.1 (chris_martin)
23:28 <* hackage> loc-test 0.1.2.1 - Test-related utilities related to the /loc/ package. https://hackage.haskell.org/package/loc-test-0.1.2.1 (chris_martin)
23:31 <kamyar> Fellows
23:31 nilof joined
23:31 <kamyar> Can someone give me a clue how to set tablename in groundg=hog mapping YAML?
23:32 <kamyar> Found out! Thnx!
23:33 cschneid_ joined
23:36 theDon_ joined
23:37 stef204 joined
23:37 Jesin joined
23:37 jer1 joined
23:38 markus1209 joined
23:38 markus1219 joined
23:41 lavalike joined
23:42 twomix joined
23:43 sleffy joined
23:44 ludat joined
23:46 dsfox joined
23:46 NeverDie_ joined
23:46 Rotaerk joined
23:46 lavalike_ joined
23:47 <sproingie> > fix error
23:47 <lambdabot> "*Exception: *Exception: *Exception: *Exception: *Exception: *Exception: *Ex...
23:47 <sproingie> ... got there in the video :)
23:48 Levex joined
23:49 tefter joined
23:49 NeverDie joined
23:51 stef204 joined
23:53 YongJoon joined
23:54 _deepfire joined
23:54 juanpaucar joined
23:55 cloudhead joined
23:55 nakal joined
23:55 sgronblo joined
23:56 alveric2 joined
23:57 vaibhavsagar joined
23:57 MarioBranco joined
23:57 lavalike joined
23:58 jer1 joined
23:58 infinity0_ joined