<     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:01 infinity0 joined
00:02 burtons joined
00:02 acidjnk22 joined
00:03 m1dnight_ joined
00:03 m1dnight1 joined
00:03 Elsi joined
00:04 infinity0 joined
00:04 jordan3522 joined
00:05 <jordan3522> hi guys, how can i call two different functions in main?
00:05 <jordan3522> because when i write the second function call in a new line i get an error
00:05 ddere joined
00:06 infinity0 joined
00:06 nomicflux joined
00:07 <koala_man> jordan3522: main = f1 >> f2 you can also use do notation
00:07 wroathe joined
00:08 <thang1> do notation is, ah, a bit more understandable for beginners I think
00:08 butterthebuddha joined
00:08 <koala_man> harder to type in multiple lines on irc
00:08 <benzrf> thang1: sure, because it hides what's really going on >:[
00:08 <koala_man> main = do
00:08 <koala_man> f1
00:08 <koala_man> f2
00:09 <thang1> benzrf: sure, but I'm a fan of steering people away from the idea that you need to understand category theory to write "hello" ++ "world" :p
00:09 <Sornaensis> koala_man: please use lpaste for multi line stuff
00:09 infinity0 joined
00:10 tom7942 joined
00:11 yellowj joined
00:11 <jordan3522> koala_man ty it worked!
00:12 <koala_man> yay
00:12 Jesin joined
00:13 Fylwind joined
00:14 anuxivm left
00:14 earldouglas joined
00:16 louispan joined
00:17 nomicflux joined
00:18 doomas1 joined
00:21 connrs joined
00:22 LordBrain joined
00:25 wroathe joined
00:25 codesoup joined
00:27 systadmin joined
00:28 mmachenry joined
00:28 andyhuzhill joined
00:28 uglyfigurine joined
00:30 abhiroop joined
00:35 khumba joined
00:37 Shatnerz joined
00:40 acarrico joined
00:41 tromp joined
00:41 slack1256 joined
00:43 debouncer joined
00:43 newhoggy joined
00:43 butterthebuddha joined
00:44 Ptival joined
00:44 <Ptival> has anyone had an issue with haskell-mode where the "Collecting type info" feature makes all warnings appear twice?
00:45 wroathe joined
00:45 Atrumx joined
00:46 plutoniix joined
00:47 newhoggy_ joined
00:48 BlueRavenGT joined
00:49 JoshS joined
00:51 dlight joined
00:51 lockdown joined
00:52 <lockdown> why are there two haskell websites?
00:53 <benzrf> ?
00:55 darjeeling_ joined
00:55 <lockdown> haskell-lang.org haskell.org
00:56 Stanley00 joined
00:57 takle joined
00:57 <Rembane> lockdown: Haskell-lang is a hm... fork of haskell.org because errr... politics.
00:57 <saylu> In Hspec, does anyone know how to evaluate a _list_ of expectations? Instead of having lines within an "it" block that say "func x `shouldBe` 10", I've zipped two lists together with "zipWith shouldBe [f x, f y] [10, 11]" to end up with a list of expectations.
00:57 <saylu> But now I don't quite know how to evaulate it!
00:57 coltfred joined
00:58 umib0zu joined
01:00 ridho joined
01:00 <saylu> Type error is "Couldn't match type `Arg [Expectation]. Expected type: SpecM (). Actual type: SpecWith (Arg [Expectation])`
01:00 {emptyset} joined
01:00 <benzrf> Rembane: wait, whuh?
01:01 <benzrf> i never heard of this O:
01:02 <c_wraith> benzrf, it had to do with whether stack got top billing or not.
01:02 robatosan joined
01:02 <Rembane> benzrf: I might've extrapolated a bit, but well, the politics part is 100% correct.
01:04 <lyxia> saylu: sequence (zipWith shouldBe ... ...)
01:05 plot joined
01:05 <saylu> lyxia: that's it!
01:05 <saylu> geekosaur in #haskell-beginners also helped me find zipWithM_, which is basically sequence_ . zipWith
01:05 vaibhavsagar_ joined
01:05 systadmin joined
01:05 <saylu> The amount of times I've forgotten about `sequence` ... ugh
01:07 ridho joined
01:08 thunderrd_ joined
01:09 jchia_3 joined
01:09 niteria joined
01:10 doomlord joined
01:10 wroathe joined
01:10 MrWoohoo joined
01:11 abhiroop joined
01:12 carlomagno joined
01:14 takle joined
01:17 niteria joined
01:22 uglyfigurine joined
01:22 aarvar joined
01:23 roconnor joined
01:23 takle joined
01:25 Supersonic112_ joined
01:27 eschnett joined
01:29 tobiasBora joined
01:30 louispan joined
01:31 takle joined
01:33 path[l] joined
01:33 reverse_light joined
01:33 levelone joined
01:35 benl23 joined
01:36 castlelore joined
01:36 castlelore joined
01:36 Goplat joined
01:39 castlelore joined
01:40 xfix joined
01:41 wroathe joined
01:42 Welkin joined
01:43 castlelore joined
01:43 uiop__ joined
01:46 takle joined
01:47 Trendrrrr joined
01:47 biglambda joined
01:51 systadmin joined
01:52 carlomagno joined
01:53 khumba joined
01:54 istvan joined
01:54 abhiroop joined
01:56 meba joined
01:56 butterthebuddha joined
01:57 asthasr joined
01:59 systadmin joined
02:00 hucksy joined
02:01 wroathe joined
02:06 takle joined
02:07 abhiroop joined
02:07 jao joined
02:08 <vaibhavsagar_> saylu: zipWith_ also works
02:09 <iqubic> I have no idea how one is supposed to make glirc work properly
02:10 <tsani> iqubic: how is it not working for you?
02:10 <iqubic> tsani: I can't connect to any servers.
02:10 <iqubic> I just don't know the right commands to enter
02:12 <tsani> iqubic: you configure all your servers in ~/.config/glirc/config and then use `/connect <name>`
02:13 <iqubic> I'm going to try that.
02:13 <iqubic> What is tsl?
02:13 <tsani> iqubic: TLS? The proper name for SSL.
02:13 uglyfigurine joined
02:13 <iqubic> And how do I get the certs?
02:13 takle joined
02:14 <tsani> iqubic: you don't need them. They come bundled with the OS.
02:14 <iqubic> https://github.com/glguy/irc-core/wiki/Configuration-File
02:14 <iqubic> See the example section there.
02:14 urodna joined
02:14 <tsani> yeah I'm looking there :)
02:14 <tsani> Those are client certs.
02:14 <tsani> Which are unnecessary for regular connections.
02:15 <iqubic> So do I want tls or not?
02:16 watabou joined
02:16 Spondyl joined
02:16 <tsani> iqubic: it's preferable to use TLS whenever you can, for security.
02:17 <iqubic> So I just set TLS to yes, and that's that?
02:17 gugah joined
02:18 <LordBrain> no
02:18 <LordBrain> conect to port 6697
02:18 <LordBrain> instead of the usual
02:18 e14 joined
02:18 <LordBrain> i think the usual is 6667 right? but for tls, note that last six becomes a nine
02:19 <suzu> just want to announce
02:20 <suzu> Snap is quite nice
02:20 <suzu> really feels like im writing haskell
02:20 <suzu> unlike yesod
02:20 <suzu> where im writing yesod i feel
02:21 wroathe joined
02:22 <LordBrain> ok, your preference has been filed
02:22 crobbins_ joined
02:22 andyhuzhill joined
02:22 kritzcreek joined
02:25 uuplusu joined
02:26 louispan joined
02:26 Argue joined
02:29 <suzu> great thanks
02:29 <suzu> ;D
02:30 birdgg joined
02:30 splanch joined
02:32 takle joined
02:32 wroathe joined
02:32 robatosan joined
02:32 nomicflux joined
02:35 Anonymous0250 joined
02:37 xcmw joined
02:39 smillmorel joined
02:40 exferenceBot joined
02:42 <iqubic> What is Snap?
02:42 <iqubic> And why does Yesod feel like a completely different language?
02:42 abhiroop joined
02:43 debouncer joined
02:43 <iqubic> LordBrain: According to the glirc wiki, all I have to do is tell my config that I want to use TSL and glirc takes care of that for me.
02:44 darjeeling_ joined
02:44 hexagoxel joined
02:44 <LordBrain> ok
02:45 <LordBrain> i dont use glirc, i'm just talking in general
02:45 louispan joined
02:45 <iqubic> https://github.com/glguy/irc-core/wiki/Configuration-File
02:45 <iqubic> see the example section there.
02:45 <LordBrain> yesod uses conduit a lot i suspect, that might make it feel different, but i havent actually worked with it much
02:45 <byorgey> iqubic: Snap is a kind of ginger liqueur. https://www.mouth.com/products/snap#variant=558447733
02:46 <EvanR> its only tuesday ppl
02:46 <sm> yesod provides several EDSLs to reduce boilerplate
02:46 alx741 joined
02:46 <iqubic> What is an EDSL?
02:46 <iqubic> E Domain Specific Langauge?
02:46 <sm> embedded domain specific language
02:46 <iqubic> Ah.
02:46 <byorgey> iqubic: an External Difibrillation Service Language
02:47 <LordBrain> lol byorgey
02:47 <iqubic> byorgey: LOL
02:47 <LordBrain> iqubic, you're kind of new to haskell arent you?
02:48 Xanather joined
02:52 beanbagu1 joined
02:53 <Zemyla> If p is a Category and a Profunctor, then forall f. lmap f id === rmap f id, right?
02:55 AX3L joined
02:57 splanch joined
02:57 <iqubic> LordBrain: Yeah. Been haskelling for only about 6 months now.
02:58 systemfault joined
02:59 systemfault joined
02:59 abhiroop joined
02:59 samp joined
02:59 <iqubic> glguy: Why can't I connect to freenode with glirc? error Host not resolved: getAddrInfo: does not exist (Name or service not known)
03:00 <iqubic> I try issuing "/connect freenode" and get that error.
03:00 <koala_man> use irc.freenode.net probably?
03:01 <koala_man> freenode is indeed an invalid hostname
03:01 <EvanR> nah
03:01 <iqubic> koala_man: That worked for me.
03:01 <EvanR> freenode isnt the right thing, but you could put it in your hosts file
03:02 cschneid_ joined
03:03 blym joined
03:05 Guest94757 joined
03:06 iqubic joined
03:06 <iqubic> So I can enter freenode from glirc, but I can't get to the #haskell server.
03:06 biglambda joined
03:06 mac10688 joined
03:06 bengt_ joined
03:07 <glguy> I know it's written in Haskell, but #haskell isn't a glirc support channel :-/
03:08 systadmin joined
03:09 <iqubic> glgu, it's your irc client. Can't you help me with it?
03:09 Jesin joined
03:09 otto_s joined
03:09 sssilver joined
03:09 systemfault joined
03:10 <iqubic> glguy: I just want to chat while using glirc
03:10 <glguy> I'm killing bad guys in Nier: Automata (fun game!). All the commands and configuration are on the wiki.
03:10 isd joined
03:10 <glguy> and also in client with /help
03:11 <dmwit_> Zemyla: I don't think so. It doesn't even seem like it type checks for all `f`.
03:11 <Zemyla> :t \f -> lmap f C.id
03:11 <lambdabot> (Category p, Profunctor p) => (a -> c) -> p a c
03:12 <Zemyla> :t \f -> rmap f C.id
03:12 <lambdabot> (Category p, Profunctor p) => (b -> c) -> p b c
03:13 <dmwit> Ah, I see. I was incorrectly choosing `id` to have the same type on the two sides of the equation.
03:13 wroathe joined
03:13 takle joined
03:13 sssilver joined
03:15 <dmwit> Zemyla: I suspect that you will not be able to prove that just from the class laws.
03:15 <dmwit> Possibly if you add parametricity you can get it.
03:18 sssilver joined
03:18 splanch joined
03:18 cranej joined
03:21 takle joined
03:22 iqubic joined
03:23 wroathe joined
03:24 {emptyset} joined
03:24 sword865 joined
03:26 iqubic joined
03:26 <iqubic> Hello Folks
03:26 pengfei joined
03:26 <iqubic> Can anyone see this?
03:26 <fosterite> yes
03:26 <lyxia> I can't.
03:26 <iqubic> I want to check if my glirc connection is working as it should.
03:27 <fosterite> congrats, you have rtfm
03:27 <iqubic> glguy: Thanks for pointing out my rather dumb mistake.
03:27 <suzu> [iqubic] is using a secure connection
03:27 <suzu> gj
03:28 <iqubic> See, it took a while, because once I got glirc to connect to freenode, I then forgot to do "/join #haskell"
03:28 <iqubic> I just type "/connect #haskell" and expected that to work.
03:28 <iqubic> Which it didn't
03:28 <suzu> lol
03:29 splanch joined
03:29 <iqubic> Yeah, I feel stupid
03:30 <suzu> it's all good
03:30 <iqubic> suzu: How did you know that I was using a secure connection?
03:30 <suzu> common feeling for haskell devs tbh
03:30 <suzu> i did /whois iqubic
03:30 abhiroop joined
03:31 <iqubic> How do I close a msg buffer in glirc?
03:31 michbad joined
03:31 <iqubic> Is that possible?
03:31 <suzu> maybe /close
03:31 <suzu> ?
03:31 <suzu> just a guess. i don't use glirc
03:31 ljhms joined
03:32 <suzu> stack has been "installing" ghc 8.0.2 for like 5m now
03:32 <suzu> grr
03:32 flatmap13 joined
03:33 <suzu> notify-send is a great tool btw, for those on linux
03:33 wroathe joined
03:33 <qmm> is there an answer to this? https://github.com/elm-lang/projects/blob/master/notes/on-sharing-types.md
03:33 <suzu> do-really-long-command; notify-send "cmd complete"
03:33 <suzu> easy desktop notification for when your long thing is done
03:34 sssilver_ joined
03:34 takle joined
03:34 louispan joined
03:35 Argue_ joined
03:35 <LordBrain> qmm, well have you looked at cloud haskell?
03:36 ljhms joined
03:38 <LordBrain> not sure if it is applicable or not, but i recall they had some solutions for serializing code... if your client serializes the code for the type, instead of merely the type, then maybe that addresses the issue?
03:40 JeanCarloMachado joined
03:43 felixsch_ joined
03:43 augur joined
03:45 jmcarthur joined
03:53 robatosan joined
03:53 wroathe joined
03:54 drybjed1 joined
03:55 tomboy64 joined
03:57 meba joined
03:58 isd joined
04:04 takle joined
04:08 leat joined
04:10 <iqubic> How do I view scrollback in glirc?
04:10 <Axman6> page up
04:10 <Axman6> may need shift page up on some systems
04:11 <iqubic> I don't have a page up key on my keyboard.
04:11 <suzu> are you on a mac?
04:11 <suzu> if so, fn-up will page up
04:11 <Axman6> you will have some way to send a page up though
04:11 <suzu> or fn-shift-up
04:12 <iqubic> fn-up works. fn-shift-up doesn't
04:12 takle joined
04:12 infinity0 joined
04:12 <iqubic> Here's fn-shift-up:
04:12 <iqubic> [5;2~
04:12 <suzu> lol
04:12 <suzu> ok
04:12 <suzu> well, good. use fn-up then
04:12 <iqubic> I wll
04:13 louispan joined
04:13 <iqubic> s/wll/will
04:14 wroathe joined
04:15 fowlslegs joined
04:15 abhiroop joined
04:18 ljhms joined
04:19 Costar joined
04:21 splanch joined
04:23 takle joined
04:23 chlong joined
04:25 augur joined
04:26 iqubic joined
04:27 eklavya joined
04:27 <iqubic> Hello?
04:27 <iqubic> Is this channel just dead right now?
04:27 <pacak> iqubic: No.
04:29 xcmw joined
04:29 augur joined
04:30 iqubic joined
04:31 takle joined
04:31 robotroll joined
04:31 <iqubic> So, I just realized that the common tail-recursive factorial function is a bit like a stateful computation
04:32 jluttine joined
04:32 <iqubic> Well, it's like a computation that has been repeated over and over and over.
04:32 robatosan joined
04:33 augur joined
04:34 panovia joined
04:34 wroathe joined
04:36 burtons joined
04:37 splanch_ joined
04:37 ner0x652 joined
04:38 kritzcreek joined
04:40 mty joined
04:40 uiop__ joined
04:41 augur joined
04:41 splanch joined
04:41 brynedwardz joined
04:42 <Squarism> iqubic, yes - its alot more active at other hours.
04:42 piyush-kurur left
04:43 piyush-kurur joined
04:43 splanch joined
04:44 chacon joined
04:45 wroathe joined
04:45 revprez joined
04:45 iqubic joined
04:45 jer1 joined
04:45 <iqubic> So what is the time zone of this place?
04:46 Koterpillar joined
04:47 chacon left
04:48 <pacak> iqubic: Depends on a person.
04:48 <pacak> For me it's midday-ish.
04:48 <Squarism> its global - but say its active from like 12:00 -> 04:00 CET
04:48 aarvar joined
04:50 ollieh[m] joined
04:50 butterthebuddha joined
04:51 revprez joined
04:51 revprez_ joined
04:51 <mty> is there an idiomatic way to write a fn: Monad m => State s a -> StateT s m a
04:52 PennyNeko joined
04:53 swalladge joined
04:54 <iqubic> Funny, I'm also working on a state thing.
04:54 <iqubic> mty: Isn't that just lift?
04:54 <iqubic> :t lift
04:54 <lambdabot> (Monad m, MonadTrans t) => m a -> t m a
04:55 sadasdfjk joined
04:55 wroathe joined
04:55 <mty> doesnt compile, mtl has State as an alias of StateT s Identity a
04:55 takle joined
04:55 <iqubic> Oh.
04:56 <iqubic> You want a way to make it so that Identity can be any monad?
04:56 <mty> any would be nice, at this moment I only need it to be a Maybe
04:57 <iqubic> There should be a way to do that
04:58 uglyfigurine joined
04:58 Yuras joined
04:59 <iqubic> Not getting anything useful from hoogle
05:00 splanch joined
05:00 <mty> problem i think is t m1 a -> t m2 a isn't possible for all m1 & m2
05:00 <mty> but t Identity a -> t m a should be possible for all m
05:01 <ollieh[m]> Anyone used the Haskell Tensorflow bindings? It uses Stack, and I've managed to get it to build and run the tests, following the instructions, but I can't figure out how to add it to my existing project that uses Stack. They have an example project that you build with a docker container, but it looks like it has no stack.yml. Any ideas how that might work? The bindings are here: https://github.com/tensorflow/haskell and
05:01 <ollieh[m]> the example project is https://github.com/tensorflow/haskell/tree/master/tensorflow-mnist
05:02 splanch joined
05:02 path[l] joined
05:03 tromp joined
05:03 bigos_ joined
05:04 codesoup joined
05:04 fizruk joined
05:05 wroathe joined
05:05 forgottenone joined
05:06 jer1 joined
05:06 plot joined
05:09 Swizec joined
05:09 louispan joined
05:09 dec0n joined
05:11 {emptyset} joined
05:12 <mty> iqubic: answer was: mapStateT $ return . runIdentity
05:14 xtreak joined
05:14 Big_G joined
05:16 <jle`> mty: 'hoist generailize' is one common way to do this
05:16 insitu joined
05:16 <jle`> mty: but the best way to approach this is to not ever use State s a in the first place
05:17 <jle`> 'hoist generalize' works for other monad transformers too, in general
05:17 blym_ joined
05:17 <jle`> but again, the right way to fix this is to never use State s a
05:17 <iqubic> What's hoist generalize?
05:18 <iqubic> jle`: Can you explain that to me?
05:18 <jle`> http://hackage.haskell.org/package/mmorph-1.0.9/docs/Control-Monad-Morph.html
05:18 <jle`> mty: instead of using State s a, you can use Monad m => StateT s m a
05:18 <jle`> which is identical to State s a
05:18 alicemaz joined
05:18 <jle`> get, put, modify, etc. are already polymorphic over Monad m
05:19 hpc joined
05:19 <iqubic> jle`: It's not though. State s a = StateT s Identity a
05:19 <jle`> it's isomorphic
05:19 <iqubic> Sure it is.
05:19 mohsen_ joined
05:19 <jle`> by 'identical', i mean that it has all of the same functionality
05:19 <jle`> and the same API
05:20 <iqubic> Can you write the isomorphism to show me? I'm not sure how the two are the same?
05:20 <jle`> except Monad m => StateT s m a is more useful
05:20 <jle`> and it doesn't require an explicit hoist
05:20 <iqubic> What is a hoist?
05:20 <jle`> see the link i sent earlier
05:20 robatosan joined
05:21 beanbagu1 joined
05:21 <jle`> i suppose they are not isomorphic, but `State s a` is a subtype of `Monad m => StateT s m a`
05:21 <jle`> so everything you would want to do with `State s a`, you can do with Monad m => StateT s m a instead
05:22 <jle`> so there's no reason to prefer State s a over Monad m => StateT s m a
05:22 <mty> jle`: thanks, seems so obvious now that you point it out
05:22 Coldblackice joined
05:22 <jle`> the type synonym really only exists for pedagogical purposes i think
05:22 <iqubic> So StateT is just strictly better?
05:23 <jle`> oh, the type synonym exists to make the types for runState/evalState/execState a little nicer
05:24 <iqubic> Yeah, that makes sense.
05:24 abhiroop joined
05:24 <iqubic> Does runStateT exist? How bout execStateT
05:24 <jle`> i know one way to find out
05:24 <jle`> check out the documentation for StateT :)
05:25 <jle`> http://hackage.haskell.org/package/transformers-
05:25 wroathe joined
05:27 soniku joined
05:27 <iqubic> Alright. That looks like it works
05:27 <iqubic> It makes complete sense.
05:28 splanch joined
05:29 Guest14972 joined
05:29 hybrid joined
05:30 osa1 joined
05:30 osa1 joined
05:30 burtons joined
05:31 Koterpillar joined
05:31 mkoenig joined
05:33 lambda-11235 joined
05:34 flatmap13 joined
05:35 Koterpillar joined
05:36 abhiroop joined
05:37 andyhuzhill joined
05:39 debouncer joined
05:39 Axman6 joined
05:40 andrei` joined
05:41 <andrei> Is it possible to turn an IO setter and getter into a lens?
05:42 path[l] joined
05:43 <cocreature> andrei: what is an IO setter?
05:44 <andrei> cocreature: I have an opaque strucutre with setXY :: X -> Y -> IO X and getXY :: X -> IO Y
05:44 pungi-man joined
05:44 Costar joined
05:44 biglambda joined
05:44 jer1 joined
05:45 <glguy> No, that won't form a Lens
05:45 <cocreature> andrei: you can’t make a lens out of that. a lens would give you “set” without IO in the type signature and you can’t escape IO
05:46 wroathe joined
05:46 takuan joined
05:47 <andrei> That's sad. There's no way to deal with mutable data with lens aside from zooms?
05:47 <glguy> It's not "sad", it just isn't what a lens is
05:47 vlatkoB joined
05:48 <andrei> glguy: It is. It means that lenses only work for pure structures and they break down whenever things get too complicated.
05:49 Yuras joined
05:50 jhrcek joined
05:50 kamyar joined
05:51 Sampuka joined
05:51 insitu joined
05:51 <kamyar> Hello guys!
05:51 <kamyar> PLease help me with this error: http://lpaste.net/355141
05:53 mzf joined
05:54 yellowj joined
05:54 paolino joined
05:56 aloiscochard joined
05:56 Itkovian joined
05:56 sellout- joined
05:57 <dmj`> kamyar: what is the type of extractBearerAuth
05:57 <kamyar> dmj`: extractBearerAuth :: ByteString -> ByteString -> Maybe ByteString
05:58 <dmj`> kamyar: is that from wai-extra? I’m seeing "extractBearerAuth :: ByteString -> Maybe ByteString” on the haddocks
05:58 <kamyar> dmj`: I have modified it for my special case
05:59 <kamyar> dmj`: I wrote another module
06:00 <cocreature> change line 7 to liftIO $ do
06:00 <dmj`> ^ that
06:01 <dmj`> kamyar: also, you’re establishing a new connection to redis on every request
06:01 jbgi joined
06:02 <kamyar> cocreature: Fixed! Thnx!
06:02 hurkan joined
06:02 <kamyar> dmj`: Fixed! Yes I will change it later
06:02 <kamyar> dmj`: I will write a redis connection pool at the end
06:03 sellout-1 joined
06:03 {emptyset} joined
06:04 xinming joined
06:04 cfricke joined
06:04 hurkan left
06:04 LHoT10820 joined
06:04 debouncer joined
06:04 <kamyar> dmj`: Any suggesstion?
06:04 tromp joined
06:05 danvet joined
06:05 JoelMcCracken joined
06:05 <dmj`> kamyar: suggestions on how to write a pool?
06:05 <kamyar> dmj`: Yes! And another question: I guess I can omit 'case' in my code. Can u help?
06:05 Koterpillar joined
06:05 <dmj`> @package resource-pool
06:05 <lambdabot> http://hackage.haskell.org/package/resource-pool
06:05 plutoniix joined
06:06 <dmj`> is good, specifically the `createPool` function
06:06 <dmj`> kamyar: I would get rid of the partial functions, you have some hard pattern matches
06:06 plutoniix joined
06:06 <dmj`> Right c <- ….
06:07 <dmj`> let Just x = ….
06:08 splanch_ joined
06:08 <kamyar> dmj`: Yes! At first I just wanted to omit case, since the output of function is maybe so it is possible to omit case
06:08 fakenerd joined
06:08 <kamyar> dmj`: I guess Nothing -> return Nothing does not smell good!
06:09 blym_ joined
06:09 <cocreature> you could use MaybeT
06:10 bgamari joined
06:10 sellout- joined
06:11 wroathe joined
06:11 takle joined
06:15 edsko joined
06:16 plot joined
06:17 xinming joined
06:19 zeroed joined
06:19 mohsen_ joined
06:19 takle joined
06:19 quchen joined
06:19 xtreak joined
06:21 xtreak joined
06:22 uglyfigurine joined
06:22 Kim1 joined
06:24 butterthebuddha joined
06:26 Denthir joined
06:27 uglyfigu_ joined
06:28 nicknovi1 joined
06:28 augur joined
06:28 <wz1000> Whenever I try to use ghc-mod I get an error: GHC.PackageDb.readPackageDb: inappropriate type (not enough bytes)
06:29 <geekosaur> your ghc-mod is for a different version of ghc, and the binary/cached package db format changed
06:31 Mortomes|Work joined
06:31 wroathe joined
06:32 <glguy> Tonight's new project: A TOML parser using alex/happy with minimal dependencies https://github.com/glguy/toml-parser/blob/master/src/TOML.hs
06:33 xtreak joined
06:33 <glguy> (Yes, I know that it's missing "comments". That's tomorrows task)
06:33 debouncer joined
06:33 <cocreature> at some point I should probably learn alex/happy
06:36 Yuras joined
06:36 noumenon joined
06:37 jer1 joined
06:37 takle joined
06:39 TommyC joined
06:39 <glguy> if you need examples I have parser of various sizes to look over
06:39 <glguy> the bigger example is for Lua
06:39 BartAdv joined
06:41 yoneda joined
06:41 <quchen> wz1000: Are you using Cabal or Stack?
06:42 wroathe joined
06:43 <cocreature> glguy: can you get somewhat decent error messages using alex/happy? ghc itself is pretty bad when it comes to parse errors
06:44 <* paolino> jumps around for uncovering type family in constraints
06:44 MP2E joined
06:45 Itkovian joined
06:45 alfredo joined
06:45 takle joined
06:46 Argue_ joined
06:46 uglyfigurine joined
06:46 Koterpillar joined
06:46 <glguy> cocreature: You can add error productions to the grammer to help with that
06:46 oish joined
06:47 <glguy> cocreature: I have some of those in the Lua parser to help find, for example, unclosed {
06:47 <cocreature> glguy: thanks, I’ll take a look at that
06:49 razi1 joined
06:50 guiben joined
06:51 xificurC joined
06:51 ketil_ joined
06:51 wroathe joined
06:54 zargoertzel joined
06:55 jer1 joined
06:55 nickolay joined
06:55 uglyfigurine joined
06:55 coot joined
06:55 <wz1000> quchen: Stack
06:56 eklavya joined
06:56 louispan joined
06:57 <quchen> wz1000: Then run »stack build ghc-mod« to get the matching one
06:57 <quchen> (For your project)
06:59 takle joined
06:59 zeroed joined
07:00 xtreak joined
07:00 wroathe joined
07:02 dunx joined
07:03 <wz1000> Thanks, I got it to work
07:06 uiop joined
07:06 Argue__ joined
07:07 srh joined
07:08 Lokathor joined
07:10 s4msung joined
07:11 mattyw joined
07:12 <paolino> hi, is it possible to gereralize ModT and ModTP in one other type (http://lpaste.net/355142) ?
07:13 uglyfigurine joined
07:13 vlatkoB_ joined
07:14 xtreak joined
07:14 albertid joined
07:15 takle joined
07:16 jer1 joined
07:18 insitu joined
07:19 flatmap13 joined
07:20 <wz1000> Why hasn't the ghc package for arch been updated? It was flagged outdated in January.
07:20 <cocreature> wz1000: I’ve been wondering that myself
07:20 <cocreature> I guess someone should email the maintainer
07:20 <cocreature> they probably just forgot
07:21 baldrick1 joined
07:21 ccomb joined
07:22 fakenerd joined
07:22 uglyfigurine joined
07:23 <pacak> wz1000: Probably nobody cares enough about haskell in arch.
07:23 <cocreature> pacak: well then they shouldn’t add a package to the repos :)
07:23 ventonegro joined
07:24 takle joined
07:24 Axman6 joined
07:27 SenpaiSilver joined
07:27 Gurkenglas joined
07:27 soniku joined
07:30 Spatial joined
07:30 insitu joined
07:30 Levex joined
07:32 Maxou joined
07:32 <Spatial> lpaste.net/355143 returns ones and zeros. Can't I return Vector Int ?
07:33 <cocreature> Spatial: what’s the type of step?
07:34 <pacak> Spatial: Why IO?
07:34 Maxou joined
07:34 <cocreature> ah it’s from hmatrix
07:34 MoALTz joined
07:34 <cocreature> Spatial: just implement your own step function
07:35 connrs joined
07:36 <Spatial> Annotated lpaste
07:36 <Spatial> Using hmatrix
07:36 filterfish joined
07:37 Levex joined
07:37 filterfish joined
07:37 <cocreature> "cmap (\x -> if x > 0 then 1 else 0)" will do what you want I think
07:37 <cocreature> and pacak is right. remove IO
07:37 <Spatial> Need not be IO
07:38 cschneid_ joined
07:38 conal joined
07:38 takle joined
07:39 jer1 joined
07:41 ertes joined
07:41 castlelore joined
07:41 castlelore joined
07:43 plot joined
07:44 rightfold left
07:44 uglyfigurine joined
07:45 splanch joined
07:46 thc202 joined
07:46 xtreak joined
07:49 splanch__ joined
07:50 blym_ joined
07:51 tomphp joined
07:51 fizruk joined
07:52 CurryWurst joined
07:52 Levex joined
07:53 CurryWurst joined
07:53 osa1_ joined
07:54 alfredo joined
07:54 D4Y joined
07:55 fowlslegs joined
07:56 fakenerd joined
07:56 mstruebing joined
07:56 drpantoss joined
07:57 robatosan joined
07:58 <paolino> is it correct that when promoted data "P a = P a | N" I need typintype to use "P ()" as a type ?
07:58 meba joined
07:58 uglyfigurine joined
07:59 <paolino> data "P a = Q a | N" I need typintype to use "Q ()" as a type ? -- better
07:59 jer1 joined
07:59 <jle`> you should only need DataKinds
07:59 <jle`> and PolyKinds
07:59 <jle`> maybe
07:59 <jle`> but, i know one way to find out :)
08:01 dquarks_ joined
08:01 <paolino> well actually a use "Q a" as a type in a typefamily, don't know if it is relevant
08:01 tomphp joined
08:02 <tfc[m]> hey there, anyone using the JHC compiler?
08:02 <tfc[m]> i would like to experiment with it because it seems to be easy to link it in lowlevel-context
08:03 dbushenko joined
08:03 <jle`> paolino: what does GHC tell you you need?
08:03 <paolino> it also compiles only with that
08:04 <paolino> tfc[m], what is a lowlevel-context ?
08:04 <tfc[m]> well the interesting thing about jhc was that i read that it doesnt use garbage collection like ghc runtimes do etc.
08:04 tromp joined
08:04 <glguy> cocreature: I updated the aforementioned toml parser to have error productions for unclosed [ and { so you get the error pointing to that character instead of the "unexpected EOF" error
08:04 <tfc[m]> so it's easier to get it into an OS kernel
08:05 <tfc[m]> kernel
08:05 uuplusu_ joined
08:05 oish joined
08:05 <glguy> https://github.com/glguy/toml-parser/blob/master/src/Parser.y#L97-L98 if you're interested
08:06 <cocreature> glguy: great, thanks!
08:07 <paolino> jle' https://github.com/paolino/book-a-visit/blob/master/Status.hs#L95
08:07 fizbin joined
08:08 uglyfigurine joined
08:08 <paolino> jle' and L31 for Presence def
08:08 path[l] joined
08:08 <jle`> did you have a question?
08:08 <paolino> if I take off typeintype ghc says I cannot use Present constructor as a type there at 91
08:09 <jle`> line 91 seems empty to me
08:09 <cocreature> paolino: does it work if you use 'Present?
08:09 tomphp joined
08:09 <paolino> sorry 95
08:10 <cocreature> maybe it requires TypeInType because Presence is polykinded?
08:10 <paolino> cocreature, no, same error
08:10 <paolino> cocreature, no idea
08:11 <paolino> I thought typeintype was something unrelated
08:11 <jle`> it might be something to do with kinds, yeah
08:11 <jle`> if you ever use a kind as a type, you need TypeInType
08:11 <paolino> do I ?
08:11 jutaro joined
08:11 tomphp joined
08:11 <jle`> hard to tell without explicit kind signatures
08:13 pie_ joined
08:13 <jle`> try giving UnPresent a kind signature
08:14 <jle`> UnPresent (b :: Presence Role) (a :: ????)
08:14 butterthebuddha joined
08:14 <jle`> :: Constraint
08:15 Elhamer joined
08:15 <paolino> a :: *
08:15 dm3 joined
08:15 beanbagu1 joined
08:17 bjz joined
08:17 <paolino> aside that, why data Presence (a :: kr) = Present a | Absent doesn't compile and need a GADT ?
08:17 butterthebuddha joined
08:18 LiaoTao joined
08:18 <paolino> an ADT has all parameters of kind * ?
08:18 tomphp joined
08:18 Levex joined
08:18 oisdk joined
08:20 zeroed joined
08:20 jer1 joined
08:21 sjpet joined
08:22 mbuf joined
08:22 ADG joined
08:22 <ADG> wtf is:
08:22 <ADG> > :t (foldl (.)) <$> (*2) $ (+3)
08:22 <lambdabot> <hint>:1:1: error: parse error on input ‘:’
08:22 tomphp joined
08:23 <paolino> :t foldl (.)
08:23 <lambdabot> Foldable t => (a -> c) -> t (a -> a) -> a -> c
08:23 <cocreature> paolino: "Present a" creates a constructor that takes a value of type "a" but your kind might not have values
08:23 <osa1_> :t :t foldl (.) id [(*2), (+3)]
08:23 Argue_ joined
08:23 <lambdabot> error: parse error on input ‘:’
08:23 <ADG> >:t (foldl (.)) <$> (*2) $ (+3)
08:23 squareburdener joined
08:23 osa1 joined
08:23 <ADG> >:t (foldl (.)) <$> (*2) $ (+3)
08:23 <ADG> >:t (foldl (.)) <$> (*2) <*> (+3)
08:23 <osa1> :t foldl (.) id [(*2), (+3)]
08:23 <lambdabot> Num c => c -> c
08:24 <jchia> Parser question (e.g. Megaparsec): Let's say I already have a parser p that I want to use to define parser q. p consumes exactly 10 characters and q consumes 8. The result of q is the same as the result of p on the input appended with "00". How can I define q in terms of p?
08:24 <paolino> cocreature, that's about the typeintype ?
08:24 <ADG> >:t ((foldl (.)) <$> (*2) $ (+3)) $ (+7)
08:25 systadmin joined
08:25 <cocreature> paolino: no about why normal ADTs don’t take non * arguments. e.g. if you set kr = Symbol that ADT can’t be used in a non-promoted way
08:25 <cocreature> now I don’t think there is some fundamental reason why we couldn’t remove this restriction from ADTs but it’s there for now
08:26 uglyfigurine joined
08:26 tomphp joined
08:27 <paolino> ok, thanks. This new haskell type tools are great
08:27 lep-delete joined
08:28 robatosan joined
08:29 <paolino> I mean haskell is revolutionary in the upgrades. No other language jumps like this I guess
08:29 takle joined
08:30 tomphp joined
08:34 pantoss_ joined
08:34 nh2 joined
08:34 drpantoss joined
08:35 takle joined
08:35 unK_ joined
08:35 <mivael> > 3 & (&) 13 (/) -- funny
08:35 <lambdabot> 4.333333333333333
08:35 richi235 joined
08:35 Denthir joined
08:36 tomphp joined
08:36 <Axman6> what is this nonsense, forth?
08:36 <Axman6> :P
08:37 <Axman6> jchia: that looks like you should have that dependency the other way around
08:39 Elhamer_ joined
08:39 noumenon joined
08:40 drpantoss joined
08:40 <Axman6> if it's possible to inject values into the state of the parser, I guess you could push "00" on the front of the inut, but that's a gross hack at best
08:40 jer1 joined
08:40 Elhamer__ joined
08:42 drpantoss joined
08:43 cyborg-one joined
08:43 tomphp joined
08:43 kamyar joined
08:43 <kamyar> Hello friends
08:44 <kamyar> I have a question:
08:44 <kamyar> Suppose I have function of type: String -> String -> Maybe String
08:44 <kamyar> called func1
08:44 <kamyar> and I have a value of type Maybe String
08:44 <kamyar> called x
08:44 <kamyar> I wanna call the function with the value without using case
08:45 <kamyar> func1 x "test"
08:45 <bartavelle> x >>= flip fun1 "foo"
08:45 <kamyar> but this raises error cuz x is not string but Maybe String
08:45 <kamyar> bartavelle: Thnx! Lets try!
08:45 cloudhead joined
08:46 <cocreature> or alternatively "do x' <- x; func1 x "test""
08:46 <cocreature> eh "do x' <- x; func1 x' "test""
08:46 acidjnk22 joined
08:46 <bartavelle> yes, do notation is much clearer than '>>= flip'
08:47 <kamyar> cocreature: Thnx!
08:48 robatosan joined
08:50 yepo joined
08:50 guiben joined
08:53 uglyfigurine joined
08:54 raichoo joined
08:55 blym_ joined
08:55 yellowj joined
08:56 debouncer joined
08:57 robatosan joined
09:01 jer1 joined
09:02 uglyfigurine joined
09:03 zero_byte joined
09:04 dm3 joined
09:05 Yuras joined
09:06 Argue joined
09:06 oish joined
09:07 jaspervdj joined
09:07 niko joined
09:07 ub joined
09:08 mmn80 joined
09:09 tomphp joined
09:10 <mivael> kamyar, or this one: (fromJust $ func1 <$> x <*> pure "another string")
09:10 twanvl joined
09:11 uglyfigurine joined
09:17 tomphp joined
09:18 Sigyn joined
09:19 <mivael> kamyar, no, my version does not work if x is Nothing
09:19 <kamyar> mivael: Thanx anyway I fixed
09:20 avn joined
09:20 <mivael> kamyar, what is your fixed version looks like? (just curious)
09:21 Maxou joined
09:21 chipp joined
09:22 jer1 joined
09:22 plot joined
09:22 fizruk joined
09:23 bno2 joined
09:23 featherlessbiped joined
09:23 ycheng joined
09:23 davenpcm__ joined
09:24 AntiSpamMeta joined
09:24 Maxou joined
09:25 mauke_ joined
09:25 joe9_ joined
09:25 TommyC joined
09:26 CuriousErnestBro joined
09:27 Ciquattro joined
09:27 lambdabot joined
09:27 lambdabot joined
09:29 soniku joined
09:31 <kamyar> mivael: I revered the case version since it was more clear!
09:31 <mivael> :)
09:32 cyborg-one joined
09:33 Ciquattro joined
09:33 tomphp joined
09:33 insitu joined
09:34 romank joined
09:34 uglyfigurine joined
09:34 jutaro joined
09:36 fakenerd joined
09:38 blym_ joined
09:39 xtreak joined
09:39 jutaro1 joined
09:42 saep joined
09:42 LnL joined
09:42 jer1 joined
09:43 dm3 joined
09:43 locallycompact joined
09:44 balor joined
09:45 pie_ joined
09:48 splanch joined
09:51 Argue joined
09:53 blym_ joined
09:58 _sg joined
09:59 meba joined
09:59 fakenerd joined
10:00 filterfish joined
10:00 Raddamu joined
10:01 gmcabrita joined
10:01 fakenerd joined
10:01 uglyfigurine joined
10:02 effectfu1 joined
10:03 jer1 joined
10:03 guiben joined
10:04 rightfold joined
10:04 <mivael> kamyar, maybe (const Nothing) func1 :: Maybe [Char] -> [Char] -> Maybe [Char]
10:04 <mivael> kamyar, maybe (const Nothing) func1 x "another string"
10:05 tomphp joined
10:05 <mivael> another unclear alternative ;)
10:06 fizruk joined
10:06 yepo_ joined
10:07 salva joined
10:07 Billifischmaul joined
10:08 JagaJaga joined
10:11 flatmap13 joined
10:11 Gurkenglas joined
10:12 blym_ joined
10:14 <dysfun> "i know, i'll just read how aeson implements FromJSON to see how to use generics" -> "there's more than one screenful of imports"
10:15 sw1nn joined
10:16 Argue joined
10:17 flatmap13 joined
10:17 bjz_ joined
10:17 jabesed joined
10:19 Wizek joined
10:19 <jabesed> I have caball installed singletons, but "import Data.Singletons" doesn't appear to do the trick
10:19 tomphp joined
10:19 <jabesed> am I forgetting some step?
10:19 zeroed joined
10:20 mfukar joined
10:20 Wizek_ joined
10:21 splanch joined
10:22 mrkgnaow joined
10:23 guest_ joined
10:24 <brynedwardz> jabesed: What error are you getting? Is this in a file or ghci? Did you do `ghci` or `cabal repl`?
10:24 jer1 joined
10:24 mrkgnao joined
10:24 mzf joined
10:24 <jabesed> brynedwardz: in ghci, "Could not find module ‘Data.Singletons’"
10:24 <brynedwardz> Try using `cabal repl` instead
10:24 <jabesed> brynedwardz: didn't know about cabal repl
10:25 tomphp joined
10:25 <jabesed> brynedwardz: that worked, thanks
10:25 <brynedwardz> np
10:25 <jabesed> brynedwardz: how new is this? haven't been following haskell as closely as I used to
10:27 <brynedwardz> jabesed: Not sure. I use stack instead of cabal as a build tool, but they're similar enough
10:27 Silox| joined
10:27 <jabesed> brynedwardz: I see, thanks
10:28 tomphp joined
10:28 <brynedwardz> jabesed: cabal also has cabal sandboxes now, I think they're the recommended way to build projects
10:28 <dysfun> or stack
10:29 <guest_> Could someone explane this statement? "The difference between applicatives and monads is that with applicatives, you can see what those components are before you run the program."
10:29 <dysfun> guest_: applicatives are only able to fail in isolation, not because of a previous result
10:30 <guest_> dysfun: what do you mean fail?
10:30 <dysfun> for example, Maybe is an applicative. failing for that would be Nothing
10:31 <guest_> dysfun: what is failing for list?
10:33 Maxou joined
10:34 <dysfun> failure is only one potential use case (useful for maybe and either, for example). for lists, the closest thing is the empty list
10:34 <dysfun> the core part is the isolation. whereas in a monad, we can perform different logic based upon previous values, with an applicative we can't
10:34 blym_ joined
10:35 <dysfun> one of the more interesting properties of that is that we can see whether it's safe to run some things in parallel
10:35 inr joined
10:36 hust921 joined
10:36 tomphp joined
10:37 <guest_> dysfun: how can we see if it's safe?
10:37 <dysfun> if it only uses the operators from applicative, it is not dependent on previous results, and is thus safe
10:38 <rightfold> In f <$> a <*> b <*> c; a, b and c cannot see each other's results, but with a >>= b >>= c they can.
10:39 <dysfun> monads naturally encode the moral equivalent of a let statement - the ability to see values in future computations
10:40 <guest_> rightfold: so parts of applicative expression is independent and monadic is dependent?
10:41 <rightfold> As in data dependency, yes
10:41 <dysfun> yes. the range of behaviour you can encode in monadic behaviour is strictly a superset
10:41 <rightfold> And because of lack of data dependency, you can parallelise without further coordination
10:42 <guest_> dysfun: But I don't undestand what this part means "you can see what those components are before you run the program."
10:43 Maxou joined
10:43 <dysfun> what precedes those words?
10:43 <guest_> dysfun: http://elvishjerricco.github.io/2017/03/10/profunctors-arrows-and-static-analysis.html
10:44 <rightfold> Functions are opaque. You cannot inspect what f does in x >>= f. But the return value of <*> may not be opaque, so x <*> y may be inspectavle
10:44 <mivael> kamyar, another (cleaner) version: func1 <$> x <*> Just "another_string"
10:44 jer1 joined
10:44 <mivael> (seems like a job for Applicative)
10:45 aib joined
10:45 <rightfold> >>= takes a function, and functions are black boxes. <*> does not take or return functions
10:45 <dysfun> oh, i think it's just bad wording
10:45 <dysfun> the paragraph after that reads better
10:45 tomphp joined
10:46 aib|2 joined
10:46 <dysfun> they're talking from the point of view of batching instead of parallelising, but they're equivalent
10:46 <Ieuan> Hi, when I try to load this code https://pastebin.com/GCJt1zYk in ghci, it complains "proc4.hs:48:19: Not in scope: type variable ‘statement’"
10:47 <dysfun> if something is monadic, you have to issue the first query to know what to issue in the second
10:47 <Ieuan> Not sure what I've done wrong - I'm initialising statement on line 51
10:47 <rightfold> Ieuan: try Prog [Stm]
10:47 <dysfun> you're using statement as if it was a type
10:48 <rightfold> statement is a value, not a type
10:48 <dysfun> on line 48
10:48 <rightfold> The type of statements is STM
10:48 <guest_> rightfold: (+) <$> Just 1 <*> Just 2 how theses Justs can be inspectavle?
10:48 <rightfold> Stm*
10:48 <Ieuan> rightfold, oh derp, you're right, thanks
10:48 <Ieuan> And eurgh, that's given me a massive array of new errors to try and hunt down :')
10:50 <guest_> dysfun: Yes, but getUsername is just a function, how <*> can batch them in one query?
10:50 systadmin joined
10:50 aib joined
10:50 <dysfun> well, you choose how to implement <*> based on the types
10:51 <rightfold> But getUsername userId1 is not a function
10:51 <rightfold> It's a description of how to get stuff
10:51 <rightfold> These descriptions can be used to guide batching
10:52 Elhamer joined
10:52 shesek joined
10:52 Maxou joined
10:52 <guest_> rightfold: So, it isn't Int -> IO String? But some sort of Int -> Query?
10:52 <rightfold> Yeah
10:53 <rightfold> IO is like function, a black box
10:53 <rightfold> There's nothing you can do to figure out what it looks like, other than to observe its output/effects
10:53 <mniip> conflating IO and functions isn't a good idea
10:54 <jchia> Lens question: How can I simply express a Lens that will get (1, 3) out of (1, 2, 3, 4)? This doesn't typecheck: view ((,) <$> _1 <*> _3) (1,2,3,4)
10:54 Yuras joined
10:54 <guest_> I think I get it now, thanks.
10:54 dm3 joined
10:56 <cocreature> jchia: the reason why that’s not so easy is that the product of a lens is not a lens because the lenses could overlap
10:56 debouncer joined
10:56 DocWinter joined
10:56 oish joined
10:56 splanch joined
10:56 <jchia> cocreature: What does it mean by 'overlap'?
10:57 <mniip> jchia, what would the result of setting _1 <*> _1 be
10:57 <cocreature> jchia: there are two solutions: 1. write the lens yourself or 2. use "lens (\s -> view _1 s &&& view _2 s) (\s (x,y) -> set _1 x (set _2 y s))
10:58 splanch_ joined
10:58 <phadej> http://stackoverflow.com/questions/36521208/how-to-make-the-product-of-two-lenses
10:58 <cocreature> eh the first part should be \s -> (view _1 s, view _2 s)
10:58 <cocreature> I couldn’t decide between &&& and a lambda :)
10:58 <jchia> Thanks. That's quite long. I think pattern matching is more readable.
10:59 tomphp joined
10:59 <jchia> The \s ->(view _1 s, view _2 s) is reasonably readable, too
10:59 fotonzade joined
10:59 mmachenry joined
10:59 Philonous_ joined
10:59 <dibblego> > (1, 2, 3, 4) ^.. (_1 <> _3) -- there is this, but it is a list
10:59 <lambdabot> [1,3]
10:59 cheater joined
11:00 <cocreature> you can wrap that up in a “unsafeProduct” combinator and use it for all products where you know it’s disjoint
11:00 <cocreature> dibblego: and it’s not a lens ;)
11:00 <dibblego> what's not?
11:00 Philonous joined
11:00 <cocreature> _1 <> _3
11:00 <jchia> Well, (,) <$> view _1 <*> view _3 seems like a good compromise
11:01 osa1 joined
11:01 osa1 joined
11:01 <dibblego> I don't think it pretends to be right?
11:01 oisdk joined
11:01 <cocreature> right but jchia said they wanted a lens
11:02 <dibblego> ok
11:02 aib joined
11:02 Snircle joined
11:03 aib joined
11:03 <mivael> kamyar, s/cleaner/cleaner but wrong/
11:03 <pacak> > (\(a, _, b, _) -> (a, b)) (1,2,3,4)
11:03 <lambdabot> (1,3)
11:03 <pacak> magic!
11:04 <mivael> kamyar, func1 <$> x <*> Just "another_s" & fromMaybe Nothing
11:05 iulian joined
11:05 jer1 joined
11:05 soniku joined
11:06 splanch joined
11:09 oisdk joined
11:09 iulian_ joined
11:11 splanch joined
11:11 bjz joined
11:12 ziocroc joined
11:13 sdothum joined
11:14 fizbin joined
11:14 jer1 joined
11:16 cur8or joined
11:17 rockfordal joined
11:17 asthasr joined
11:17 rcat joined
11:18 Maxou joined
11:21 ortmage joined
11:22 Fendor joined
11:23 dm3 joined
11:23 Argue_ joined
11:24 plot joined
11:24 <NickHu> How can I do url unshortening with http-conduit's HTTP.Simple module?
11:25 cfricke joined
11:27 <cocreature> NickHu: unshortening?
11:28 alfredo_ joined
11:28 <Maxdamantus> Presumably he means reading the `Location` header.
11:28 xinming joined
11:29 <NickHu> It dumps me at the end of the chain though, where I get a 200 and no Location header is present
11:31 simukis joined
11:31 mmachenry joined
11:32 PennyNeko joined
11:32 <cocreature> NickHu: you can manually use “getRedirectedRequest” but it’s not in the .Simple module
11:33 cyborg-one joined
11:34 <NickHu> Yeah, figured it out with responseOpenHistory - thanks!
11:36 Xanather joined
11:37 freusque joined
11:40 dm3 joined
11:40 blym_ joined
11:42 sirreal joined
11:42 netheranthem joined
11:42 fakenerd_ joined
11:43 dm3 joined
11:44 oleo joined
11:44 robatosan joined
11:44 JeanCarloMachado joined
11:45 <jchia> Is there any way at all to use a top-level fixed-value variable in pattern matching? E.g. if I have a top-level "foo = 3 :: Int", can I use it to in a match pattern?
11:46 <cocreature> jchia: you can’t but what you can do is make a pattern synonym called Foo and match on that
11:46 obihann joined
11:46 fizbin joined
11:46 <cocreature> “pattern Foo = 3”
11:46 mivael joined
11:47 systadmin joined
11:47 <jchia> cocreature: Thanks.
11:48 cloudhead joined
11:48 hvr joined
11:51 snoreven joined
11:52 nh2 joined
11:53 <Athas> Does Accelerate require LLVM 4.0?
11:53 <geekosaur> jchia, you can also use a guard or a view pattern
11:54 Denthir joined
11:54 uuplusu joined
11:54 james1111 joined
11:55 asmyers joined
11:55 <snoreven> hey, quick question: can i make the order in an Ord instance dependent on the parameter position. like "compare x y = LT" but "compare y x = EQ"? sounds like a bad idea but i didn't read anything about it in the docs and i'm not 100% sure so i thought i'd ask...
11:55 albertid_ joined
11:56 <geekosaur> that's just alpha renaming (the x in the second one has nothing to do with the x in the first, likewise for the y)
11:56 Elhamer joined
11:56 <snoreven> i know they are supposed to represent the same value
11:56 <quchen> snoreven: Ordering should be an equivalence relation, so that x=x, x=y means y=x, and if x=y and y=z then x=z.
11:56 <snoreven> i thought that was understandable ;)
11:56 <quchen> The rest is up to you.
11:56 nomicflux joined
11:57 <quchen> Oh, I said ordering when I meant equality.
11:59 <geekosaur> Athas, it looks like yes. accelerate-llvm depends on llvm-hs which appears to require llvm-4.0. I will further note that that backend works with the LLVM IR, which means hard version dependencies because LLVM IR does not guarantee either backward or forward compatibility (and this bites ghc's own llvm backend as well...)
11:59 <quchen> snoreven: But the problem remains: when (x=y) then (y=x). In your question, you wanted (compare x y) to be something else than (compare y x), despite (compare x y) being EQ.
12:00 meba joined
12:01 <Athas> geekosaur: too bad - LLVM 4.0 is too recent for any of my systems.
12:01 Prutheus joined
12:01 <snoreven> @quchen: hmm, thx.. yeah looks like its a bad idea. i wanted to be able to compare bounds of open and closed intervals via Ord. but i can only do that when i know what's a left and what's a right bound
12:01 <lambdabot> Unknown command, try @list
12:01 <Athas> Maybe I should try out that Docker thing one of these days.
12:01 cfricke joined
12:02 Levex joined
12:03 <snoreven> i made an error in reasoning anyway.. nevermind
12:03 slomo joined
12:05 mmn80 joined
12:06 ahihi joined
12:07 watersoul joined
12:09 <cocreature> Athas: which system are you own? llvm 4.0 is new but if you’re fine with building it yourself then it works even on older systems in most cases
12:09 <cocreature> and for some systems there are backports
12:11 ogrady_ joined
12:11 jer1 joined
12:11 ahihi joined
12:12 jrm joined
12:12 Guest22807 left
12:13 sepp2k joined
12:14 butterthebuddha joined
12:15 Klapaucius_ joined
12:15 Elhamer_ joined
12:16 Guest123434 joined
12:18 fakenerd joined
12:19 Elderon joined
12:23 kyle1320 joined
12:24 avn joined
12:24 avn_nb joined
12:26 rcschm joined
12:27 balor joined
12:28 fizruk joined
12:30 tromp joined
12:32 jship joined
12:33 systadmin joined
12:33 cschneid_ joined
12:36 fluffystub joined
12:36 <Athas> cocreature: sure, but it's more effort than I'm prepared to invest.
12:38 Maxou joined
12:38 jer1 joined
12:38 oish_ joined
12:38 mpsag joined
12:40 fosterite joined
12:40 crobbins_ joined
12:42 Maxou joined
12:43 kmels joined
12:43 coltfred joined
12:44 ziocroc2 joined
12:44 <cocreature> fair enough
12:45 ilyanok joined
12:46 Nycatelos joined
12:47 <ilyanok> Hi, is it normal that the time reported in the my_prog.prof file is 100 times smaller than the actual time measured with the 'time' command? I'm using 'stack build --profile' to build my project.
12:49 dm3 joined
12:49 crobbins joined
12:49 pungi-man joined
12:50 reuben36` joined
12:50 gawen joined
12:50 Wingsorc joined
12:52 ExpHP joined
12:54 <Cale> ilyanok: I'm not sure I'd call it "normal", but it indicates that your program isn't spending a lot of time evaluating expressions.
12:54 <Cale> For example, if your program was usually blocked on I/O, you would expect to see something like that.
12:55 <ilyanok> Cale: what about FFI? Does it count during profiling?
12:55 <Cale> Pretty sure it doesn't count.
12:56 Noldorin joined
12:56 jer1 joined
12:57 cpennington joined
12:57 dm3 joined
12:58 <ilyanok> thanks for the info. So, what's the right way to profile IO/FFI?
12:58 bruschkov joined
12:59 chipp joined
12:59 roconnor joined
12:59 nh21 joined
12:59 chipp joined
13:01 guiben joined
13:03 Argue__ joined
13:04 tomphp joined
13:05 rockfordal joined
13:05 lc_ joined
13:06 tomphp joined
13:08 silvers- joined
13:08 iAmerikan joined
13:08 tomphp joined
13:09 beanbagu1 joined
13:10 soLucien joined
13:11 theelous3 joined
13:11 balor joined
13:12 tomphp joined
13:12 Fendor joined
13:13 eliasr joined
13:14 guiben joined
13:14 splanch joined
13:15 tomphp joined
13:16 jathan joined
13:16 cdg joined
13:16 tomphp joined
13:18 jer1 joined
13:18 bennofs joined
13:21 <dysfun> how does liquid haskell work? is it a preprocessor?
13:21 nh2 joined
13:21 <Ieuan> What are the most common things that might cause megaparsec to hang when you run the parse function?
13:23 <ilyanok> Ieuan: left recursion?
13:23 umib0zu joined
13:23 <Ieuan> ilyanok, yeah, I think so
13:23 lukesp joined
13:24 chipp joined
13:24 tomphp joined
13:24 jmiven joined
13:26 dfeuer joined
13:26 fizbin joined
13:27 ystael joined
13:27 danthemyth joined
13:28 ogrady joined
13:29 jabesed joined
13:29 locallycompact joined
13:31 <jabesed> I'm thinking of using 'dependent' typing for an AST, still have some reading to do to get up to date with the current status quo
13:31 soniku joined
13:31 <jabesed> however my biggest concern right now is with regards losing "access" to useful class abstractions
13:32 lukesp joined
13:33 jangsutsr joined
13:36 revprez_ joined
13:37 romanix joined
13:37 burtons joined
13:38 jer1 joined
13:40 smillmorel joined
13:40 `^_^v joined
13:40 <DrMentats> is there anything that takes a function a -> b and a monad m [a] and produces m [b]? fmap . map works, but it feels a little weird
13:41 systadmin joined
13:41 <piyush-kurur> DrMentats: fmap (map f) ?
13:41 butterthebuddha joined
13:42 <piyush-kurur> DrMentats: okey I did not see your message fully
13:42 <jchia_3> DrMentats: A monad is a functor. Why is that weird?
13:42 <* byorgey> also fails to see what is weird about this.
13:42 <* piyush-kurur> too
13:43 ziyourenxiang joined
13:43 <DrMentats> no, I get it, but that's basically fmap . fmap, so I was thinking there must be something like that in the standard library already
13:43 <lyxia> fmap fmap fmap
13:43 <byorgey> DrMentats: the standard library doesn't often have names for things that can be simply assembled out of a few existing parts.
13:43 <piyush-kurur> DrMentats: think of it as composition of the associated functors
13:43 asthasr joined
13:44 <piyush-kurur> Endo functors in this case
13:44 <phadej> DrMentats: there isn't, there is http://hackage.haskell.org/package/composition-extra if you want to use <$$> :)
13:44 umib0zu left
13:44 phaji joined
13:44 <phadej> and i have seen people defining fmap2 fmap3 etc
13:44 jerme joined
13:44 meba joined
13:45 <DrMentats> all right, all right, you convinced me
13:45 <Unode> For the hspec users in the room. Are hooks always executed regardless of success or failure of tests?
13:46 Noldorin joined
13:46 <piyush-kurur> DrMentats: if you are unhappy with the lack of docs of fmap . fmap , you can think of adding a where clause and give a more meaningful name
13:46 <byorgey> @type \f -> getCompose . fmap f . Compose
13:46 <lambdabot> forall k (g :: * -> k) (f :: k -> *) a a1. Functor (Compose f g) => (a1 -> a) -> f (g a1) -> f (g a)
13:46 Kreest__ joined
13:47 istvan joined
13:47 <DrMentats> piyush-kurur: I just don't wanna do things that people will look at and say "why didn't he just use that other thing instead?" lol
13:47 <DrMentats> but if the natural thing to do is to compose the fmaps, then I shall compose
13:48 <byorgey> @type ala Compose . fmap
13:48 <piyush-kurur> DrMentats: I do not think so. If type aliases, function definitions make the code more readable, I am all for it
13:48 <lambdabot> forall k2 k3 k1 k5 (a' :: k2) (g' :: k2 -> k3) (f' :: k3 -> *) (a'1 :: k1) (g'1 :: k1 -> k5) (f'1 :: k5 -> *). (Compose f'1 g'1 a'1 -> Compose f' g' a') -> f'1 (g'1 a'1) -> f' (g' a')
13:48 <byorgey> DrMentats: ^^^ in that case this is what you should avoid =)
13:48 mmachenry joined
13:48 <DrMentats> lol got it
13:48 Argue_ joined
13:49 plutoniix joined
13:49 <piyush-kurur> DrMentats: also most of the time it is zero cost as compiler will optimise it out and you do not have do write actual comment
13:49 <byorgey> > (ala Compose . fmap) (+1) (Just [2,3,4])
13:49 <lambdabot> error:
13:49 <lambdabot> • Ambiguous type variable ‘a'0’ arising from a use of ‘show_M20834362309...
13:49 <lambdabot> prevents the constraint ‘(Show a'0)’ from being solved.
13:49 saep joined
13:50 plutoniix joined
13:50 mizu_no_oto_work joined
13:51 <piyush-kurur> byorgey: how are you?
13:51 tomphp joined
13:51 <byorgey> hi piyush-kurur, I'm good, how are you?
13:52 <piyush-kurur> byorgey: I am fine
13:52 <piyush-kurur> the semester got over here so things are less hectic
13:52 eschnett joined
13:55 mithrandeer joined
13:56 ludat joined
13:57 plutoniix joined
13:58 chipp joined
13:58 fkurkowski joined
13:59 debouncer joined
13:59 flatmap13 joined
14:00 jer1 joined
14:00 MDA2 joined
14:00 plutoniix joined
14:01 ub joined
14:01 beanbagu1 joined
14:02 plutoniix joined
14:04 mmo joined
14:04 Prutheus joined
14:04 <mmo> Does anybody know of a way to write GUI-tests for GTK applications (written with haskell-gi) in haskell?
14:05 plutoniix joined
14:07 plutoniix joined
14:08 pie_ joined
14:08 <Unode> mmo: there's probably something that wraps the native gtk testing framework https://developer.gnome.org/gtk3/stable/gtk3-Testing.html
14:08 <Unode> but I don't actually know.
14:10 atle joined
14:10 oish_ joined
14:13 <NickHu> Is there a general rule of thumb for when I'd want MaybeT IO a over IO (Maybe a)
14:13 plutoniix joined
14:14 vaibhavsagar joined
14:14 <quchen> NickHu: Whatever makes your code more readable. IO (Maybe a) is usually easier to work with. If you have larger transformer stacks (»Maybe plus State plus IO plus Either plus
14:14 <quchen>
14:14 <quchen> then MaybeT begins to become more useful.
14:15 <quchen> If you use MaybeT in a too shallow stack you get implicit error handling at the cost of having to liftIO all the time.
14:15 <quchen> The runtime cost of both is pretty much identical (if not actually identical), since MaybeT is just a newtype.
14:15 <NickHu> So I shouldn't feel compelled to turn every IO (Maybe a) into a MaybeT IO a then
14:16 tomphp joined
14:16 <ezyang> too bad :(
14:17 dsh joined
14:17 plutoniix joined
14:17 hybrid joined
14:18 <kadoban> NickHu: Definitely not
14:19 beuke joined
14:20 <NickHu> Also, which package should I be getting my monad lifts from?
14:20 jer1 joined
14:20 plutoniix joined
14:20 <NickHu> Say, if I'm using vanilla monad transfomers, Control.Monad.Trans.Maybe
14:20 <NickHu> Control.Monad.Trans.Class?
14:21 pie_ joined
14:21 uuplusu_ joined
14:21 <Unode> NickHu: Control.Monad works for me
14:21 sampuka joined
14:22 mmo left
14:22 jeltsch joined
14:22 lukesp joined
14:22 <quchen> transformers has the transformers, mtl has the convenience classes for working with them.
14:22 plutoniix joined
14:22 <quchen> You should not feel compelled to abstract over transformer stacks of size one, no. :-)
14:23 <quchen> I don’t think that’s ever been useful to me.
14:23 jabesed joined
14:23 <quchen> 2 is questionable, when you’ve got 3 stacks begin to shine.
14:23 uuplusu_ joined
14:23 rkazak joined
14:23 <shapr> begin to shine?
14:23 <NickHu> Unode: Control.Monad doesn't have transformer lifts
14:23 <quchen> shapr: »remove a lot of pain«
14:24 <shapr> oh, I see "when you have a stack of three, transformer stacks start to be really useful.
14:24 <quchen> Yes.
14:24 pie_ joined
14:25 <shapr> quchen: that missing comma lost me
14:25 uuplusu joined
14:25 <quchen> :set -XImplicitComma
14:26 <dolio> shapr: No, it was a command.
14:26 <dolio> When you've got 3 stacks, begin to shine.
14:26 revtintin joined
14:26 noumenon joined
14:26 <shapr> dolio: that's how I read it at first
14:26 uuplusu__ joined
14:27 ssmall joined
14:29 uuplusu_ joined
14:29 plutoniix joined
14:30 <* shapr> shines
14:31 stphrolland joined
14:31 earldouglas joined
14:31 eazar001 joined
14:32 soniku joined
14:34 squareburdener joined
14:35 <stphrolland> Hi, in a simple program, the main task is to launch a repeated action, I use Control.Concurrent.Timer, with its useful repeatedTimer function. However the main thread does block, so my repeatedTimer function is never called, not even once. How do I block the main thread so as the timer simply gets called endlessly ?
14:36 systadmin joined
14:36 oish__ joined
14:37 alqatari joined
14:38 uuplusu joined
14:40 <lyxia> stphrolland: can you show your code
14:41 forgottenone joined
14:41 jer1 joined
14:41 <stphrolland> I think I found, forkIo should be sufficient. let me try first.
14:41 mmn80 joined
14:42 Maxou joined
14:42 <stphrolland> from the package Control.Concurrent.Tread , it is mean to block
14:43 plutoniix joined
14:43 <lyxia> what is meant to block
14:44 <quchen> cocreature: Breaking change pushed (namely: annotations)
14:44 <quchen> cocreature: That’s the end of breakages I think. :-)
14:44 oleo joined
14:45 sykora joined
14:46 mizu_no_oto_work joined
14:46 Maxou joined
14:49 <NickHu> is there a builtin to curry a 6-tuple (yes, really)?
14:49 ChristopherBurg joined
14:50 <dysfun> is there any way to get type equality back when you've gone existential?
14:50 plot joined
14:51 <nshepperd_> dysfun: carry along a Typeable constraint and compare types at runtime
14:52 <dysfun> yeah, i thought so
14:53 coltfred joined
14:53 al-damiri joined
14:54 <stphrolland> @lyxia: here's the code http://lpaste.net/355155 , I would like the time to execute, but the main thread seems to almost immidately terminate
14:54 <lambdabot> Unknown command, try @list
14:54 zariuq joined
14:54 <stphrolland> lyxia: here's the code http://lpaste.net/355155 , I would like the time to execute, but the main thread seems to almost immidately terminate
14:54 <stphrolland> time = timer
14:54 <Cale> NickHu: What do you mean by "curry a 6-tuple"?
14:55 <Cale> NickHu: Are you just looking for the constructor (,,,,,)?
14:55 <lyxia> stphrolland: main has to explicitly wait for its children
14:56 <stphrolland> lyxia, but I don't know how to do that
14:56 <lyxia> stphrolland: the simplest is with an MVar
14:56 Wuzzy joined
14:56 mada joined
14:56 <lyxia> stphrolland: http://hackage.haskell.org/package/base- see "Terminating the program" at the bottom
14:57 <stphrolland> lyxia: thanks
14:58 oish_ joined
14:59 <NickHu> Cale: I meant the opposite actually, didn't express it well
14:59 <Cale> Pattern matching?
15:00 <c_wraith> :t uncurry (,)
15:00 <lambdabot> (a, b) -> (a, b)
15:00 <c_wraith> fancy id
15:00 ubsan_ joined
15:02 uglyfigurine joined
15:03 bcq joined
15:04 jer1 joined
15:05 debouncer joined
15:05 <bcq> i've seen talk of porting Elm to X, specifically Erlang, and people have even tried it. is Elm on Erlang an oxymoron? don't you need IO and all of the monads Haskell gives you?
15:05 jaspervdj joined
15:06 dmwit_ joined
15:07 cschneid_ joined
15:08 StoneToad joined
15:09 eklavya joined
15:10 cynick joined
15:10 nilof joined
15:10 <shapr> Cale: want to write an article for TMR?
15:11 <lyxia> shapr: do you have suggestions for topics
15:11 <shapr> lyxia: something Haskell related, that you want to write about?
15:12 stelleg_web joined
15:12 <shapr> lyxia: I'm writing about clash-lang, someone else is doing d3js visualization from Haskell
15:13 flatmap13 joined
15:13 <shapr> lyxia: what would you like to write about?
15:13 <lyxia> that's my question :)
15:14 <shapr> lyxia: look at the last few projects where you've written code, pick one you want to describe?
15:14 ssmall left
15:14 Itkovian joined
15:15 <lyxia> Yeah. I'll think about it.
15:16 bennofs joined
15:16 <shapr> lyxia: do you have projects up on github?
15:16 chlong joined
15:18 ilyanok joined
15:18 tzh joined
15:18 flatmap13 joined
15:19 <lyxia> Yes indeed.
15:20 <fosterite> bcq: you could compile to the erlang VM (BEAM)
15:21 HarveyPwca joined
15:22 miklcct joined
15:23 Silox| joined
15:24 jer1 joined
15:24 <stelleg_web> does anyone know how to access opaque c constants in haskell?
15:25 <byorgey> shapr: are you reviving TMR?
15:25 <stelleg_web> if I have a header that has something like "extern const myStructType defaultValue;", it would be great to be able to access that
15:25 <stelleg_web> preferrably using c2hs
15:27 lockdown left
15:28 StoneToad joined
15:28 raichoo joined
15:29 <mnoonan> stelleg_web: this doesn't directly answer your question, but have you tried inline-c?
15:29 bruschkov joined
15:30 DocWinter joined
15:30 <stelleg_web> mnoonan: briefly, but it seemed a little painful to work with non-standard C types
15:31 <mnoonan> stelleg_web: I've been using it to wrap a C++ API, and so far (for my admittedly simple cases), I've been able to get pretty far just by adding things to the typemap in the Context.
15:32 guiben joined
15:32 <stelleg_web> mnoonan: oh cool, can you point to any resources that show how to do that?
15:32 vaibhavsagar joined
15:33 HoierM joined
15:34 koneida joined
15:34 oisdk joined
15:35 <mnoonan> stelleg_web: I just went from the docs here: https://hackage.haskell.org/package/inline-c- to the source for baseCtx. Then just below it is the default C type table. You can add other Haskell types as long as you have a Storable instance.
15:35 <mnoonan> I don't think you can get much control over how things are marshalled beyond the Storable instance, but that might be enough for you
15:35 sfcg joined
15:36 Sgeo joined
15:36 lambdaman joined
15:36 insitu joined
15:36 <koneida> Hello everyone. If I'm programming a game with a grid in an imperative context, and I want to, say, check the neighbors of every element, the idiom is to use a nested for loop and look at neighbors by futzing with indices. What is the equivalent haskell idiom?
15:37 guiben joined
15:37 marr joined
15:37 lambdaman joined
15:38 <stelleg_web> mnoonan: thanks. I remember now I was intimidated by having to use template haskell, but maybe I should finally just take the plunge
15:38 <mnoonan> stelleg_web: for what it's worth, I'm very un-TH-savvy and am managing to muddle through ok :)
15:39 thunderrd joined
15:43 Gurkenglas joined
15:44 <stelleg_web> mnoonan: I guarantee I'm even more un-TH-savvy :). thanks for the help
15:44 NyanPasu joined
15:45 jer1 joined
15:45 <Cale> koneida: Well, probably you produce a list of the things you want to look at.
15:47 cross joined
15:47 urodna joined
15:47 jmelesky joined
15:47 oish_ joined
15:48 jao joined
15:49 <koneida> Cale: Yes, of course, but are there library functions that help with this? For instance, I don't see anything like a map that operates on a list and takes a ((row,col) -> a -> b).
15:49 <Cale> Well, lists aren't meant to be accessed randomly
15:50 <Cale> Think of a list as basically being a loop waiting to happen.
15:50 <Cale> If you're going to be accessing it randomly, you probably want to use a Map or Array or something for your grid.
15:51 <MitchellSalad> what's are people's preferred SQL solution these days?
15:51 dquarks_ joined
15:51 <koneida> Cale: Right, I guess that's what I'm asking -- for random access, I should use Array?
15:51 Aruro joined
15:52 dan_f joined
15:52 <dysfun> MitchellSalad: esqueleto is pretty neat
15:52 <MitchellSalad> koneida: depends, might you be consing onto this thing? that's O(n) for an array
15:52 malakin joined
15:52 <koneida> MitchellSalad: In the case I'm working on now, it's a fixed size.
15:53 <MitchellSalad> ah, then yeah, Array or Vector
15:53 <Cale> See https://hackage.haskell.org/package/grid for useful geometric operations
15:53 tlaxkit joined
15:53 <Cale> (Though for a square grid, maybe that's a bit of a waste)
15:54 robertkennedy joined
15:55 <koneida> Yeah, square grid. I was also thinking I could convert from a simple [[a]] to a graph. That way each node would know its neighbors. I was just curious if there was a more idiomatic approach.
15:56 jathan joined
15:57 locallycompact joined
15:57 <Cale> koneida: Once you have some type Grid a for a grid whose cells are labelled with values of type a, you might want to write a function Grid a -> Grid (Set a) which produces the same grid structurally, but where each cell is labelled with the values of the neighbours of that cell in the original grid
15:58 jutaro joined
15:59 locallycompact joined
16:00 sleffy joined
16:00 `^_^v joined
16:00 pungi-man joined
16:02 SpinTensor joined
16:02 davila joined
16:02 fotonzade joined
16:04 splanch joined
16:04 acertain joined
16:05 cyborg-one joined
16:05 <Aruro> does somebody use Array?
16:05 <Aruro> array is like magnetic tape, relict
16:05 lambdaman joined
16:05 jer1 joined
16:07 <Cale> I'd still use it sometimes.
16:08 istvan joined
16:08 <istvan> I have an embarrasingly dumb question: how do I resolve Could not find module ‘Data.Tree.Zipper’ ? I can't seem to find a package missing in cabal
16:09 vengefulpickle joined
16:09 <istvan> I can import Data.Tree just fine
16:09 <jle`> istvan: that depends; where does Data.Tree.Zipper exist?
16:09 <jle`> what package is it in?
16:09 <jle`> or, does it even exist at all?
16:09 <Cale> There appears to be a package called rosezipper that has a module with that name
16:10 <Cale> Data.Tree is from containers, but containers doesn't have a Data.Tree.Zipper
16:10 <istvan> ah, I'll give that a shot
16:10 <jle`> istvan: do you know how to look up documentation for a package?
16:10 fizbin joined
16:10 <istvan> Is that a cannonical zipper implementation or should i write my own like most examples seem to?
16:10 fizbin joined
16:10 <istvan> jle`, I am looking at https://hackage.haskell.org/package/rosezipper-0.2/docs/Data-Tree-Zipper.html -- it is now obvious its in rosezipper
16:11 descender joined
16:11 {emptyset} joined
16:12 <Cale> I almost never have a use for a tree type which isn't at least somewhat specialised to the application at hand. So usually I'd also be writing a zipper for the specific sort of tree that I was working with by hand as well.
16:12 fizbin joined
16:13 meandi_2 joined
16:13 <Cale> But if you're using Data.Tree, then this is an appropriate zipper for that.
16:13 kyle1320 joined
16:15 Sonolin joined
16:15 kyren joined
16:17 <istvan> I'm not entirely sure yet that zipper is what I actually need, perhaps I can get advice on a better approach. I have an AST (not a Data.Tree, but rather something of my own design) where each node is an operation: multiply, add, or load (a constant). I have a CPU with an add pipe and a multiply pipe, and I want to schedule each operation. I need to ensure no node is scheduled until all of its children have completed, and I can't
16:17 <istvan> schedule more than one multiply or add per cycle. Any suggestions how I might approach it?
16:18 deank joined
16:18 <Cale> I'd probably just use a Map Integer Instruction
16:19 <Cale> (as the type of schedules)
16:19 <tobiasBora> Hello,
16:19 <tobiasBora> I'm using System.IO.hGetLine
16:20 <istvan> Cale, not sure I follow
16:20 <tobiasBora> when the input is a linux file no problem
16:20 <tobiasBora> but when the input is a DOS formated file (ending with \r\n), then I get the \r in my line
16:20 <tobiasBora> how could I get rid of this \r properly, ie not using a dirty regex ?
16:21 splanch joined
16:21 <istvan> Cale, to be clear, I am not trying to evaluate the instructions, I am trying to build the schedule not evaluate it. The trick is the entire left subtree might be multiplies and the entire right tree might be adds and I would like to interleave them, not evaluate one subtree then another
16:21 <Cale> tobiasBora: By setting the encoding on the Handle correctly
16:22 <Cale> istvan: Actually, you probably don't even want a tree, but a proper graph type for that bit.
16:22 v0id_NULL joined
16:22 <Cale> e.g. you might have let x = 5 + 5 in x * x
16:23 <Cale> istvan: and you don't want to have to evaluate x twice then.
16:23 dm3 joined
16:24 Apocalisp joined
16:24 alqatari joined
16:24 <tobiasBora> Cale: I found hSetNewLineMode handle universalNewlineMode, is it that ?
16:24 eklavya joined
16:24 <Cale> tobiasBora: ahh, yes
16:25 umib0zu joined
16:25 <tobiasBora> ok thank you!
16:25 FreeBirdLjj joined
16:25 <NickHu> Is there a function that goes from a string like "/some string/" to "some string"?
16:25 <Cale> tobiasBora: Well, possibly you also want to set outputNL appropriately.
16:25 <NickHu> That isn't something like drop first and drop last
16:26 jer1 joined
16:26 <Cale> NickHu: Can you explain what you want the function to do?
16:26 doomlord joined
16:26 <Cale> Remove all slashes?
16:26 <tobiasBora> Cale: I think default outputNL is ok
16:27 <jle`> > const "some string" "/some string/"
16:27 <lambdabot> "some string"
16:27 <NickHu> Cale: Yeah, pretty much
16:28 <NickHu> I suppose I could filter it
16:28 <istvan> Cale, for my first Haskell project I'm not doing a full optimizing compiler, just a bare-minimum calculator for a VLIW CPU. I'm not worried about CSE at this point
16:28 <jle`> > filter (/= '/') "/some string/"
16:28 <lambdabot> "some string"
16:28 <NickHu> Actually, what I want is that the function checks it's of the form "/a/" first
16:28 <NickHu> Basically what I'd use a regex for in another language
16:28 <jle`> what do you mean by 'of the form "/a/"'
16:28 <jle`> that it has two slashes?
16:28 <jle`> it is three characters long?
16:29 <NickHu> It's a string delimited by slashes
16:29 <mnoonan> istvan: Can do you it greedily? like, compute a topological order on your expresison dag, then emit the first available instruction for the correct pipe, or go to the "wrong" pipe if you have no other choice?
16:29 oberstein joined
16:30 trism joined
16:30 <jle`> NickHu: can you check if the first and last characters are '/' ?
16:31 aarvar joined
16:31 <NickHu> I kinda wanted to do it without two conditionals, just like a regex substitution or something
16:31 tomboy64 joined
16:31 <jle`> do you think a regex substitution would be more readable than checking the first and last characters?
16:32 <EvanR> head s == c || last s == c
16:32 <istvan> mnoonan, The most simple scheduler is greedy but I suspect a dynamic programming approach will have a substantial improvement since a doing a single add may "unlock" several multiplies whereas greedy may result in several adds in a row with no multiplies available to schedule
16:32 soniku joined
16:32 <EvanR> obviously correct code > not obviously incorrect code
16:32 <Cale> @let import qualified Text.ParserCombinators.ReadP as P
16:32 <lambdabot> Defined.
16:32 <Cale> > P.readP_to_S (do P.char '/'; xs <- many (P.satisfy (/= '/')); P.char '/'; return xs) "/hello/"
16:33 <lambdabot> [("hello","")]
16:33 <jle`> that might fail if there's a slash in the middle of the string
16:33 <MitchellSalad> doesn't properly escape, 0/10
16:33 <NickHu> jle`: Honestly yes
16:34 <EvanR> theres something to be said for code that is like 4 characters long vs 4 lines long
16:34 <Cale> Well, it's supposed to be delimited by slashes, so it's not supposed to have a slash in the middle
16:34 <jle`> NickHu: there's a reason regexp is called a write-only language
16:34 <EvanR> after training, you can appreciate the brevity
16:35 <EvanR> but a lot of regex is like, 4 lines long though
16:35 <MitchellSalad> NickHu: You could use pattern synonyms for this - 'case foo of IsRegex bar -> ...; NotRegex -> ...'
16:35 DrMentats left
16:35 BlueRavenGT joined
16:35 <Cale> MitchellSalad: huh?
16:35 <jle`> @let slashFirstLast s = head s == '/' && last s == '/'
16:35 <lambdabot> Defined.
16:35 <jle`> > slashFirstLast "/hello/"
16:35 ilyanok left
16:35 <lambdabot> True
16:35 <EvanR> > slashFirstLast ""
16:35 <lambdabot> *Exception: Prelude.head: empty list
16:35 <Cale> > slashFirstLast "/"
16:35 <EvanR> hehe
16:35 <lambdabot> True
16:36 <MitchellSalad> Cale: huh? to your huh? :P
16:36 hackebeilchen joined
16:36 alqatari joined
16:36 <ollieh[m]> Anyone used the Haskell Tensorflow bindings? It uses Stack, and I've managed to get it to build and run the tests, following the instructions, but I can't figure out how to add it to my existing project that uses Stack. They have an example project that you build with a docker container, but it looks like it has no stack.yml. Any ideas how that might work? The bindings are here: https://github.com/tensorflow/haskell and
16:36 <jle`> @undefine
16:36 <lambdabot> Undefined.
16:36 <ollieh[m]> the example project is https://github.com/tensorflow/haskell/tree/master/tensorflow-mnist
16:37 cemg joined
16:37 <jle`> @let slashFirstLast s = and [length s > 1, head s == '/', last s == '/']
16:37 <lambdabot> Defined.
16:37 sellout- joined
16:37 DarkSkyes joined
16:37 <cdornan> the regex package will do what you want, btw
16:37 DarkSkyes left
16:38 <cemg> hello guys, this is my first haskell app, what do you think ? how can i improve the code quality or any suggestions ? https://github.com/dyrnade/smallDockerImagesTool
16:38 <cemg> it uses nix behind the scenes
16:40 <Cale> MitchellSalad: I don't understand how that gets us any closer to computing whatever function we're after. I mean... yes, you could, having written an appropriate function for this, define a pattern synonym to make it look pretty.
16:40 <MitchellSalad> yea, that's all I was saying :P
16:40 CorkExaminer joined
16:41 ertes joined
16:41 <shapr> byorgey: yes! I am reviving TMR! Want to update typeclassopedia?
16:41 gcross joined
16:42 <stelleg_web> mnoonan: so it seems like you have to add a typespecifier for every pointer type for inline-c? so for every C type T, you need a context entry for T and T*?
16:42 <NickHu> How do you guys typically do error handling in MonadIO? I'm looking for a way to just basically catch and ignore errors from https://hackage.haskell.org/package/http-conduit-
16:43 <MitchellSalad> NickHu: for ignoring errors, I'd use safe-exceptions (so you don't accidentally ignore async exceptions like ThreadKilled)
16:43 <jle`> if you're working in generic MonadIO, you can use the functions from lifted-base instead of the typical ones from base
16:43 hexfive joined
16:43 skeet70 joined
16:43 <jle`> lifted-base provided catch/handle/etc. but generalized to work on more than just IO
16:44 <stelleg_web> mnoonan: oh, nevermind
16:44 <NickHu> I've never done any error handling in Haskell - is there a quick guide somewhere
16:45 <jle`> oh, if you can work with specifically IO, it's even easier
16:45 hackebeilchen joined
16:45 <NickHu> can I just wrap my IO in a try and not care about it when it fails?
16:45 <MitchellSalad> yeah, your quick guide is jle`
16:45 <jle`> the documentation for Control.Exception in base is pretty clear
16:45 splanch joined
16:45 <jle`> but i liked this chapter http://chimera.labs.oreilly.com/books/1230000000929/ch08.html#sec_exceptions
16:45 eklavya_ joined
16:45 <jle`> it's a nice summary of how exceptions work
16:46 <jle`> and yeah safe-exceptions is a nice way to prevent accidental bad practices from handling errors
16:47 jer1 joined
16:47 <jle`> https://github.com/fpco/safe-exceptions#readme
16:47 <Unode> in the hspec package what exactly is the difference between before and before_ (with the underscore).
16:47 dreamseeker joined
16:47 qqwy joined
16:47 <qqwy> Greetings, everyone
16:48 <MitchellSalad> Unode: 'before' provides its result to the 'SpecWith a', 'before_' just calls the given IO action
16:48 <qqwy> I am trying to wrap my head around the ST monad and how to use it
16:48 <qqwy> :t runST
16:48 <lambdabot> (forall s. ST s a) -> a
16:48 <qqwy> I don't really understand this type. What is `s` here?
16:48 <jle`> the 's' there is a phantom type
16:48 castlelore joined
16:48 castlelore joined
16:49 <jle`> it's a type system trick to prevent STRefs from leaking out of runST
16:49 pie_ joined
16:49 <jle`> you can sort of think of it like a hack meh
16:49 <Unode> MitchellSalad: so one is lazy and the other isn't? I don't really understand the implications in this scenario.
16:49 <MarcelineVQ> ollieh[m]: the default stack.yaml template shows a few ways to get other projects working with yours, in this case I suspect you're wanting subdirs but I'm not sure based only on what you've said there. e.g.:
16:49 <lpaste> MarcelineVQ pasted “ollieh[m]” at http://lpaste.net/5015372047572795392
16:50 <jle`> qqwy: basically, most of your ST actions will be of the form `ST s a`, where s is a phantom polymorphic type
16:50 <qqwy> Can I understand 'phantom type' as 'an unboud type variable that is not actually manually bound but is a trick for the typechecker'?
16:50 <jle`> you should be able to ignore it for the most part
16:50 <jle`> yes, you do not have any values of type 's'
16:50 codesoup joined
16:50 <qqwy> Is the `s` just there to ensure that the calls to runST is not memoized?
16:50 <qqwy> are*
16:50 <MitchellSalad> Unode: hmm, not laziness... before trying to answer, are you familiar with 'SpecWith'?
16:51 <jle`> it's to ensure that no STRefs can be "taken out of" ST
16:51 <jle`> STRefs are the mutable memory cells you can use in ST
16:51 rockfordal joined
16:51 <jle`> `(forall s. ST s a) -> a` effectively says that whatever type variable 's' is isn't allowed to "leave" the `ST s a`
16:51 <Unode> MitchellSalad: not really, have been trying to use hspec for a couple of hours but the docs aren't extensive. I'm also still new to haskell.
16:51 <MarcelineVQ> cemg: interesting, what all does it do? as in what part of your workflow does it stand in for?
16:52 <jle`> the result you get from runST has to not involve the 's' type variable
16:52 drostie joined
16:52 <MitchellSalad> Unode: no problem, are you trying to write a specific test, or are you just trying to understand the docs before diving in?
16:52 <jle`> qqwy: every STRef you create in ST also has this same phantom parameter
16:52 <MitchellSalad> :t newSTRef
16:52 <lambdabot> a -> ST s (STRef s a)
16:53 urodna joined
16:53 <qqwy> So can these 'mutable memory cells' then be considered 'variables' in the imperative sense? (as in 'a box' at which at a single time is a value and at another time suddenly something else might be stored?)
16:53 <qqwy> Ah
16:53 <jle`> yup
16:53 <qqwy> And there the `s` magically appears
16:53 <Unode> MitchellSalad: I'm trying to write a test that runs an IO operation (split a file into multiple) and I'm trying to use `before` or `around` to do this in a temporary directory. Currently looking at `withsystemTempDirectory`.
16:53 dreamseeker_ joined
16:53 <Cale> You can think of the 's' as the type of the heap in which your STRefs all live.
16:53 <ollieh[m]> MarcelineVQ: ah thanks, I will try that out
16:54 <jle`> yeah, so if you tried to runST (newSTRef 10), that'd be runST :: (forall s. ST s (STRef s Int)) -> STRef s Int, which is not allowed by the type system
16:54 <qqwy> How does newSTRef actually fill in the `s` here? Or is the fact that this is not necessary part of the magic that makes it work?
16:54 <Zemyla> I kind of wish ST had MVars and forkST.
16:54 <jle`> the important thing for the type system is that the 's' it has is the asme as the 's' of the ST it lives in
16:54 <Cale> If you want, you can think of runST as actually supplying the s type
16:54 <Cale> :t runST
16:54 <lambdabot> (forall s. ST s a) -> a
16:54 <Zemyla> Doing parallel calculations is referentially pure, yes?
16:55 <drostie> Can I just say that the "zippers = derivatives" thing is awesome? I mean it takes a sec to say "`data List x = Nil + Cons x (List x)` is like L(x) = 1 + x L(x), which we can solve implicitly as L(x) = 1/(1 - x) = 1 + x + x^2 + x^3 + ...; its derivative is L'(x) = x L'(x) + L(x) which we recognize as L(x)/(1 - x) = L(x) L(x), so the zipper for [x] is ([x], [x])" ... but it's such a fun argument.
16:55 <Cale> You're not allowed to pick s there, runST will pick it for you.
16:55 <MarcelineVQ> ollieh[m]: I'm not sure if my example there is functional but when you have a stack.yaml at the top level of a project and cabal files in subdirectories you'll be wanting to use subdirs in some manner so it's a start :>
16:55 <* MitchellSalad> wants to try explaining ST but feels there are too many cooks in the kitchen
16:55 <jle`> Zemyla: concurrency is nondeterministic tho
16:55 <drostie> er, Nil | Cons x (List x)...
16:55 <jle`> drostie: yes you can say it
16:55 <jle`> it is awesome
16:55 umib0zu left
16:56 <jle`> qqwy: but yeah, the documentation of STRef shows you how you can use it
16:56 <jle`> http://hackage.haskell.org/package/base-
16:56 <MarcelineVQ> ollieh[m]: more info scattered about here https://docs.haskellstack.org/en/stable/yaml_configuration/#project-specific-config
16:56 <cemg> MarcelineVQ, it just creates small docker image for you by help of nix. we needed small images at work so this came my mind to give it go and i wanted to learn Haskell
16:56 <Unode> MitchellSalad: the docs also mention 'bracket' on at least 2 examples but I don't get where this function is coming from.
16:56 <Cale> qqwy: But of course, in the actual implementation, no such type s is actually picked, it just goes ahead and really allocates memory and reads/writes it.
16:56 <jle`> STRefs are kind of like pointers to mutable boxes you can change the contents of over the type of your ST algorithm
16:56 <Cale> (and forgets about s)
16:56 t7 joined
16:57 jship joined
16:57 kyren joined
16:57 unK_ joined
16:57 <MarcelineVQ> cemg: pretty cool. I've not used docker but I have seen some nix confix files and they're a little imposing so a tool to do that for you seems like a good idea
16:57 <jle`> in practice you can ignore the s, except in situations where you do things that aren't allowed (like return an STRef out of an ST)
16:57 <Unode> MitchellSalad: by "the docs" I was referring to hspec: http://hspec.github.io/writing-specs.html#using-hooks (the withStubbedApi)
16:58 <ReinH> drostie: it's nice, isn't it
16:58 <qqwy> Ah, I see. The `s` is just there to ensure we don't shoot ourselves in the foot
16:58 <qqwy> Nice :-)
16:58 osa1 joined
16:58 osa1 joined
16:58 <MitchellSalad> Unode: ah, if you have a "resource" like a temp file, you'd want to use the 'around' family of functions
16:58 <ReinH> drostie: I have that feeling about all of Conor's work.
16:58 <cemg> MarcelineVQ, thank you
16:58 fizruk joined
16:58 <jle`> i use this trick in a lot of my libraries now
16:58 <qqwy> I don't really understand why it works, but it's amazing
16:58 <cemg> I am glad to hear that
16:58 <ReinH> jle`: the ST trick?
16:58 <Cale> qqwy: Yeah, in particular, it guarantees that you'll never use an STRef from one instance of runST that was created by another.
16:58 <jle`> yeah, you don't have to understand exactly how it works to just use ST day to day
16:58 <jle`> ReinH: the phantom s trick
16:58 <MitchellSalad> Unode: for example, 'around (withSystemTempDirectory "blah")' would have type 'SpecWith FilePath -> Spec'
16:58 <ReinH> jle`: yeah, what do you find yourself using it for?
16:59 <Cale> qqwy: Because you'll have no way to show that s is the same type in each case.
16:59 jbgi joined
16:59 <MitchellSalad> Unode: so, you'd simply pass a spec that is parameterized by 'FilePath' (for example, a function from FilePath)
16:59 plutoniix joined
16:59 <ReinH> Cale: btw I've been learning Agda and Idris. It's a trip.
16:59 <Cale> qqwy: It actually *is* possible to smuggle STRefs out in the result of a runST, but it's not possible to actually use them.
16:59 <MitchellSalad> jle`: care to share any libraries that you've used this trick in?
16:59 <Cale> ReinH: nice!
17:00 <qqwy> Ah, *now* it clicks! Because newSTRef and friends are only ever called in the context of runST, the `s` is filled in by the type checker (without ever regarding what is actually in there).
17:00 <qqwy> That was what I was missing :D
17:00 <jle`> ReinH, MitchellSalad: it's useful for libraries that have monads you can "allocate variables" of some type in
17:00 plutoniix joined
17:00 <ReinH> Cale: I get sad when my computer isn't smart enough to prove that n + S m = S (n + m) but other than that it's been fun.
17:00 <Cale> ReinH: Well, it requires induction
17:00 <jle`> like in my 'uncertain' library, there's a monad where you can sample random variables and perform operations on them, and it keeps track of correlations and covariances between different sampled points
17:00 <jle`> these variables are implemented internally as just keys to a Map state
17:00 <ReinH> Cale: yes, I want my computer to do that for me.
17:01 c-rog joined
17:01 <* qqwy> 's mind ≡ blown
17:01 <ollieh[m]> MarcelineVQ: I think I got it working, I added a package like '../tensorflow-haskell/tensorflow' below the '.' and it seems to be building :)
17:01 <jle`> like type RandomVar = Int
17:01 <ReinH> right
17:01 <jle`> so i don't ever want a user to "run" the monad and get an actual *variable*/reference out of it
17:01 <jle`> since the reference itself is meaningless
17:01 Swizec joined
17:01 <MarcelineVQ> neat, you'll want extra-dep: true with that or stack could be quite confused
17:01 <jle`> it's just an Int. and they might use it in another invocation of Run
17:02 <ollieh[m]> Ok ill put that in
17:02 <jle`> also in my 'backprop' library, users have a monad where they can bind variables and functions on thos variables and the library performs backpropagation on the result to find the gradient
17:02 <MarcelineVQ> it doesn't always happen but 9/10 times an issue with building involving custom pacakges is the lack of extra-dep :>
17:02 <MarcelineVQ> imo it should be default
17:02 <Unode> MitchellSalad: I'm not sure I understand... can you provide that same example with around and around_ ? Perhaps if you know of some code that uses this pattern I can just understand that.
17:02 <jle`> and so again it doesn't make any sense for the variables/references themselves to leak out of the backprop monad
17:03 <ReinH> jle`: ooh, btw +/- is a nice constructor name
17:03 oisdk joined
17:03 <MitchellSalad> Unode: yeah, one second, making coffee
17:03 <jle`> thank you, it's pretty cheeky admittedly :)
17:03 <Unode> MitchellSalad: thanks :D
17:03 <ReinH> jle`: I've been reading a lot of agda, it is not nearly cheeky enough.
17:03 plutoniix joined
17:03 <ReinH> jle`: oh this is a nice use of ad
17:04 <drostie> @ReinH: ahaha I googled Conor McBride to see what else he has written besides the zippers = derivatives paper.
17:04 <lambdabot> Unknown command, try @list
17:04 <drostie> oh, whoops.
17:04 <drostie> Forgot this is IRC.
17:04 <ReinH> heh
17:04 <ReinH> drostie: lots of very good stuff
17:05 <ReinH> His new ornaments stuff is nice too
17:05 <drostie> right, interspersed with articles about forgiving murderers. XD
17:05 <ReinH> wait what
17:05 <ollieh[m]> How do you think I might be able to google for other public projects that depend on tensorflow? I doubt I'm the first person to use it but I haven't found any
17:05 <jle`> ReinH: i was surprised at how simple the Corr monad was with AD
17:05 robatosan joined
17:05 sssilver joined
17:05 kyren_ joined
17:05 <ReinH> ollieh[m]: iirc there's a reverse dependency lookup somewhere
17:05 <jle`> it wasn't exactly pre-planned but i'll take it :)
17:05 lambdaman joined
17:06 <ReinH> jle`: Ed's practice of choosing the most general possible solution to everything pays off in interesting ways sometimes
17:06 <drostie> apparently he shares a name with a guy in the US who shot his girlfriend. (I said "murderer" but apparently she survived?)
17:06 <ReinH> oh, ok
17:06 <ReinH> I was about to say
17:06 <EvanR> is this like a reiserfs
17:06 plutoniix joined
17:06 <ReinH> haha noooo
17:07 jer1 joined
17:07 <MarcelineVQ> ollieh[m]: that's a good question, if the project is on hackage (though I think it's not) you can do as ReinH is suggesting at http://packdeps.haskellers.com/reverse , possibly github has a way as well
17:08 <MarcelineVQ> 'the project' being tensorflow in this case
17:09 <qqwy> ReinH: That sounds wonderful
17:09 plutoniix joined
17:09 flatmap13 joined
17:09 <ReinH> qqwy: which?
17:09 <qqwy> Too often do I see people who do not realize how they could make a slightly more general version of their algorithm, which would save them work in the long run
17:09 <ReinH> oh yeah
17:09 <ReinH> Ed's the kind of guy who implements a linear algebra library using Naperian Functors
17:10 mrmenagerie joined
17:10 <qqwy> wow
17:10 <drostie> oh it's one of those really strange cases. She survived the shooting on life support but after 4 days with no improvement her parents took her off life support, then he was convicted of murdering her. wtf. anyway.
17:10 <* qqwy> in some distant future, wants to become that kind of guy too
17:10 <ReinH> @hackage linear
17:10 <lambdabot> http://hackage.haskell.org/package/linear
17:10 <MarcelineVQ> ollieh[m]: https://github.com/search?q="tensorflow-haskell"&type=Code is possibly a start
17:10 <ReinH> is based on http://www.cs.ox.ac.uk/people/jeremy.gibbons/publications/aplicative.pdf
17:11 niteria joined
17:11 <qqwy> Unfortunately have to go
17:11 <qqwy> talk to you later this evening
17:11 <qqwy> Thank you!
17:11 <ReinH> o/
17:12 Elhamer joined
17:12 <EvanR> forwarded the paper to new orleans haskell group
17:12 <EvanR> (which contains at least one person obsessed with APL)
17:13 Costar joined
17:13 plutoniix joined
17:13 cdg joined
17:13 DrMentats joined
17:13 <ReinH> EvanR: :)
17:14 <ollieh[m]> aha I found a couple like this: https://github.com/search?l=Haskell&q=tensorflow
17:15 <ReinH> ollieh[m]: it's unfortunate that package dependency is out of band to github, otherwise they'd have a huge amount of info about language ecosystems
17:15 <ReinH> I sometimes wonder if package management could be implemented via git submodules and how terrible that would be
17:16 <ReinH> that's basically how ad hoc package management in agda works, I guess
17:16 sampuka joined
17:16 plutoniix joined
17:16 connrs joined
17:16 Cassiopaya joined
17:16 <ollieh[m]> I mean, they've got all the data, they could pick a few languages and write something that could work it out for them
17:17 <ollieh[m]> that would be pretty neat
17:17 mda1 joined
17:17 teqwve joined
17:17 <ReinH> yeah
17:18 <ReinH> node might be the best choice tbh
17:18 fosterite joined
17:18 <Cale> ReinH: git submodules :(
17:19 <ReinH> Cale: yes, I know.
17:20 <ReinH> I think it would be possible to implement a coherent system on top of them
17:20 <Cale> Actually my main problem with them is simply that the UI around them is annoying for no good reason
17:20 <ReinH> like we implement a coherent functional programming system on top of CPUs and memory.
17:20 <ReinH> yes, this is git in a nutshell
17:20 <Cale> e.g. to start with, why the heck aren't they automatically initialised and updated by default?
17:20 <ReinH> the underlying module is good but they've done an excellent job obscuring this through a terrible UI
17:21 <ReinH> s/module/model
17:21 <Cale> s/good/kinda okay/
17:21 <ReinH> Yeah, also removing them, moving them, updating them, etc, is unnecessarily complicated
17:21 <ReinH> Cale: Oh that's right you like darcs don't you
17:21 <fosterite> ollieh[m]: I think snoyman has a reverse dependency website for stackage somewhere
17:21 <Cale> yeah
17:22 <ReinH> fair enough
17:22 <cocreature> http://packdeps.haskellers.com/ has reverse deps for all of hackage iirc
17:22 <Cale> I mean, I never actually loved anything as far as version control goes, but going from darcs to git felt like a huge step backwards.
17:23 bennofs1 joined
17:23 <cocreature> and I think that feature is also implemented in hackage itself by now. but it’s not yet deployed
17:25 plutoniix joined
17:25 typedrat joined
17:25 romank joined
17:27 plutoniix joined
17:28 jer1 joined
17:28 <ReinH> Cale: I wrote a vector zipper, it's like an exercise in learning how to add all over again.
17:29 sellout- joined
17:29 <Cale> ReinH: haha
17:30 <EvanR> vector zipper... ?
17:30 <ReinH> a list zipper but for length-indexed lists, a.k.a. vectors
17:30 <ReinH> it's a bad name but it's the one we have
17:30 <EvanR> oh Vect
17:30 plutoniix joined
17:30 <ReinH> yeah, Vect
17:30 <cocreature> oh I thought a zipper of Vector
17:30 <MitchellSalad> Unode: still there?
17:30 <Unode> yup
17:30 <ReinH> Vect is short for vector ;)
17:31 <EvanR> roger roger whats your vector victor
17:31 <fosterite> Cale: have you heard of pijul? like darcs but faster
17:32 path[l] joined
17:32 dreamseeker joined
17:33 LordBrain joined
17:33 <MitchellSalad> okay, let's see... you are trying to use "withSystemTempFile" in a test"
17:33 <MitchellSalad> ?
17:34 <LordBrain> one thing with that is watch out for systemd
17:34 <LordBrain> depending on its configurations... it makes your temporary files invisible inside of /tmp
17:34 <Unode> MitchellSalad: Ĩ'll probably wrap that on another function that does a few more things but the general idea is create a directory, put some files there, run the test, check the result and get rid of the folder (on success or failure)
17:35 <LordBrain> its a "feature"
17:37 iAmerikan joined
17:37 Yuras joined
17:38 gienah_ joined
17:39 replay joined
17:40 <MitchellSalad> Unode: here, does this help? http://lpaste.net/355158
17:41 <MitchellSalad> i had to re-jigger withSystemTempFile to make it work with 'around', and then put annoying explicit type signatures on things because some parts of hspec use type families that interact badly with inference
17:41 <MitchellSalad> but for a real test, the compiler could figure out more of the types
17:42 plutoniix joined
17:42 <Unode> MitchellSalad: could you also create another paste using around_ ? This is a great help.
17:43 fowlslegs joined
17:44 <Unode> the inside of the 'it' is quite confusing indeed. But I think I get the general idea.
17:45 hiccup joined
17:45 MDA2 joined
17:45 <hiccup> trying to set up sublime-haskell. have to install hsdev. trying to use stack global context. had to add haddock/hdocs to extra-deps. but still have dependency problems for hformat, simple-log, and text-region. do i have to download hsdev src and manually modify their .cabal?
17:46 plutoniix joined
17:46 edsko_ joined
17:46 Costar joined
17:46 baweaver left
17:48 cdg_ joined
17:48 <Guest50004> can anyone help me with my stack problem above? http://lpaste.net/4235251105803534336
17:48 jer1 joined
17:48 nek0 joined
17:49 pfoetchen joined
17:50 <Unode> Guest50004: seems like a resolver problem. Unless I'm reading it wrong. The applicable versions actually match.
17:51 <Guest50004> Unode: my read is that those matching versions are what it's looking up in hackage, but (i don't understand stack yet) afaict, stack's "approved" versions are way behind (the versions it's saying "must match")
17:52 fizbin joined
17:52 kamyar joined
17:53 debouncer joined
17:53 cyborg-one joined
17:54 dcoutts_ joined
17:54 <Unode> Guest50004: you might want to open an issue on stack @ github. Doesn't seem to be a problem on your end.
17:54 plutoniix joined
17:54 <ReinH> Unode: the actual versions being used are part of the package name, e.g., hformat- means stack is using version
17:54 pwnz0r joined
17:54 <ReinH> It does seem to be a problem.
17:54 kyle1320 joined
17:54 <Unode> ReinH: so where does the "must match" version come from_
17:55 <Unode> ?
17:55 <Myrl-saki> @pl \f -> (f =<<) .
17:55 <lambdabot> (line 1, column 16):
17:55 <lambdabot> unexpected end of input
17:55 <lambdabot> expecting white space or simple term
17:55 <ReinH> The version in stackage is (see https://www.stackage.org/lts-8.13/package/hformat-
17:55 <Myrl-saki> @pl (\f -> ((f =<<) .))
17:55 <lambdabot> (.) . (=<<)
17:55 <Unode> ReinH: I see
17:55 <geekosaur> Unode, Guest50004: the resolver
17:55 <ReinH> but the solver has determined that it must matchh ==0.2.*, which it does not
17:55 <ReinH> I think you can just include a matching version as an extra-dep
17:55 ner0x652 joined
17:56 <ReinH> you might also try the nightly, which has bumped it up to 3.0, but updating every package might cause more problems that it solves
17:56 felixsch__ joined
17:56 <ReinH> *than
17:56 plutoniix joined
17:57 <Unode> ReinH: I think Guest50004 is right in that the hsdev.cabal lists == 0.2.*.
17:57 <ReinH> :t (.) . (=<<)
17:57 <lambdabot> Monad m => (a1 -> m b) -> (a -> m a1) -> a -> m b
17:57 <ReinH> Unode: yes, that is why it must match that
17:57 <Myrl-saki> @pl (\f g x -> f =<< g x)
17:57 <lambdabot> (.) . (=<<)
17:57 <ReinH> but it does not match that, because it is only
17:57 <Myrl-saki> Eh
17:58 <ReinH> :t (>=>)
17:58 <lambdabot> Monad m => (a -> m b) -> (b -> m c) -> a -> m c
17:58 <Myrl-saki> `f =<< g x` == `(f <=< g) x`, right?
17:58 <ReinH> one or the other
17:58 <Myrl-saki> Just to make sure I'm not going cray. Lol.
17:58 carlo joined
17:59 <ReinH> Unode: I'm saying the issue stack is reporting is real, not a bug in stack
17:59 <Guest50004> ReinH: thanks i'll try :) it suggested that for libraries stack doesn't list... aren't there dangers in asking it to use higher than approved versions?
17:59 <Myrl-saki> Is there a `:: (a -> Bool) -> a -> Maybe a`?
17:59 <Unode> ReinH: so this particular lts-8.9 has an invalid hsdev version? (lts-8.8 seems to suffer the same)
17:59 <Myrl-saki> (or `:: (a -> Bool) -> Maybe a -> Maybe a`)
17:59 <Myrl-saki> :t filter
17:59 <lambdabot> (a -> Bool) -> [a] -> [a]
17:59 <ReinH> Guest50004: yes, there are always dangers in upgrading packages. But the danger in not upgrading is that it doesn't work.
17:59 <lyxia> :t mfilter
17:59 <lambdabot> MonadPlus m => (a -> Bool) -> m a -> m a
17:59 <Myrl-saki> lyxia: Thanks.
17:59 meoblast001 joined
18:00 <ReinH> Guest50004: anyway, hdev is claiming to work with that version, and to not work with 0.1.*
18:00 <ReinH> er, hsdev
18:00 coot joined
18:00 dfeuer joined
18:00 Hexagenic joined
18:01 istvan joined
18:01 <Unode> ReinH: right I think I get it. Things were bundled on an lts that aren't actually compatible. So I guess it still needs to be reported.
18:01 <ReinH> > mfilter even . pure $ 1
18:01 <lambdabot> error:
18:01 <lambdabot> • Ambiguous type variables ‘m0’, ‘a0’ arising from a use of ‘show_M53873...
18:01 <lambdabot> prevents the constraint ‘(Show (m0 a0))’ from being solved.
18:01 JuanMiguel joined
18:01 <ReinH> > mfilter even . pure $ 1 :: Maybe Int
18:01 <lambdabot> Nothing
18:02 <Unode> (I thought the purpose of lts-** was to avoid these kinds of package version incompatibilities)
18:02 tumdedum joined
18:02 tumdedum joined
18:02 <ReinH> Unode: *that* would be a stackage bug, yes
18:02 flatmap13 joined
18:02 <ReinH> but hsdev is not in stackage
18:02 <ReinH> so it is not guaranteed to work
18:03 <ReinH> they have automated testing for that too iinm
18:03 <Unode> oh..
18:03 <Myrl-saki> :t fold
18:03 plutoniix joined
18:03 <lambdabot> (Monoid m, Foldable t) => t m -> m
18:04 <Guest50004> ReinH: seems to be working, thanks! is there a better way to do this than stack's global context? seems wrong that i have a bunch of global extra-deps for a specific need...
18:05 <ReinH> Guest50004: in the stack config for the project itself
18:05 dm3 joined
18:05 <MitchellSalad> Unode: oops, just saw this... one moment
18:05 <Guest50004> ReinH: but this is for installing sublime-haskell globally -- should i do that for each project?
18:05 bigos_ joined
18:05 <Myrl-saki> :t foldM
18:05 <lambdabot> (Monad m, Foldable t) => (b -> a -> m b) -> b -> t a -> m b
18:06 <Unode> MitchellSalad: no worries, and thanks again.
18:06 <Unode> Guest50004: maybe create a project that is used by your sublime setup_
18:06 <Unode> if you want to avoid going global with that.
18:06 <ReinH> Guest50004: well, you can create a root stack config that has the rest as subdirectories
18:07 <Unode> I'm not a sublime user though so I don't know if that is possible.
18:07 smillmorel joined
18:07 <ReinH> so foo/stack.yml and foo/bar/stack.yml and foo/baz/stack.yml
18:07 <ReinH> and foo/stack.yml builds them all
18:08 <ReinH> er, stack.yaml
18:08 <ReinH> Guest50004: the other option would just be to build it using cabal
18:08 bvad joined
18:08 <MitchellSalad> Unode: I updated the paste and put an example using 'around_' at the bottom http://lpaste.net/355158
18:08 plutoniix joined
18:09 <Myrl-saki> @pl (\a m -> a >>= (\a -> fmap (++ a) m))
18:09 <lambdabot> liftM2 (flip (++))
18:09 <Myrl-saki> Oh cool.
18:09 <Unode> MitchellSalad: thanks a lot!
18:10 lambdaman joined
18:10 <Unode> MitchellSalad: hold on, the last test uses both around and around_ is that correct?
18:10 <Guest50004> ReinH: hrm ok i'll think about it. tried cabal but i have no global ghc :) is there a way to use stack's? i've been operating under the oversimplication that "stack is the new cabal,"
18:10 uglyfigurine joined
18:10 <Myrl-saki> @pl foldr (liftM2 (++)) (Just [])
18:10 <lambdabot> foldr (liftM2 (++)) (Just [])
18:11 <Myrl-saki> :(
18:11 <ReinH> heh, well, I'd probably go for the parent stack.yaml then
18:11 <ReinH> Myrl-saki: whatcha doin?
18:11 <ReinH> That expression doesn't have any points in it
18:11 <Guest50004> ReinH: i was worried a global ghc would mess up stack...
18:11 <MitchellSalad> Unode: yep, you can combine them
18:11 <ReinH> Guest50004: you can tell stack to ignore it, iinm
18:11 richi235 joined
18:12 <Myrl-saki> ReinH: ProjectEuler, one-liner.
18:12 <ReinH> I'm not saying that's the best plan, but presumably the author has checked that they build with cabal
18:12 <ReinH> Myrl-saki: which problem?
18:12 <Unode> MitchellSalad: ok then I still don't quite get what around_ does differently.
18:12 <Myrl-saki> https://projecteuler.net/problem=47
18:12 <glguy> Guest50004: It's fine to have GHC installed separately, stack doesn't mind
18:12 plutoniix joined
18:12 jer1 joined
18:13 nick123 joined
18:13 <ReinH> Myrl-saki: and what subproblem are you working on?
18:13 soLucien joined
18:13 <MitchellSalad> Unode: It doesn't provide any argument to the inner spec (like a temp file), it just lets you run anything you want before and/or after each test
18:14 <Unode> oh.. so around accepts arguments from the test while around_ simply calls the function?
18:14 <Myrl-saki> ReinH: Right now, I'm trying to check distinctness using `groupBy` and `sort`.
18:14 <Myrl-saki> :t groupBy `on` fst
18:14 <lambdabot> error:
18:14 <lambdabot> • Couldn't match type ‘[a]’ with ‘a -> a -> Bool’
18:14 <lambdabot> Expected type: [a] -> [a] -> [[a]]
18:14 <Unode> MitchellSalad: let me play some more with these examples to see if I get it.
18:14 <Myrl-saki> I really forgot how lol
18:14 dfeuer joined
18:15 <Myrl-saki> :t groupBy ((==) `on` fst)
18:15 <lambdabot> Eq a => [(a, b)] -> [[(a, b)]]
18:15 <Myrl-saki> Ah.
18:15 plutoniix joined
18:16 ralu joined
18:18 asmyers joined
18:18 Maxou joined
18:18 ADG joined
18:19 lambdaman joined
18:19 bodisiw joined
18:19 uuplusu_ joined
18:19 <ADG> how to get stack working, man I am trying since hours and stack setup gets stuck on Updating package index or I get HTTPexception
18:20 jathan joined
18:20 <geekosaur> are you behind a proxy?
18:21 <glguy> The initial download is something like 240M, are you on a slower connection?
18:21 <ADG> is it true 240M ?
18:21 <ADG> can I atleast get a progress bar?
18:23 phyrex1an joined
18:23 uuplusu joined
18:23 <byorgey> shapr: I already have been updating Typeclassopedia, it is on the wiki now =)
18:24 <ADG> probably I'll leave it overnight
18:24 <Myrl-saki> fold $ extend (First . mfilter (all ((== 1) . length) . groupBy ((==) `on` fst) . sort) . foldr (liftM2 (++)) (Just []) . fmap (mfilter ((== 4) . length) . Just . factorise) . NE.take 4) $ 1000 NE.:| [1001..9999]
18:24 <Myrl-saki> And it solves nothing.
18:24 <Myrl-saki> That's what I get for trying to be smart. lol
18:24 <byorgey> shapr: I'm not particularly interested in putting an updated version in TMR. But perhaps I could be convinced to contribute something else.
18:24 felixsch_ joined
18:26 <srhb> Athas: Not sure if you do Quora, but heads up: https://www.quora.com/unanswered/How-does-Futhark-compare-to-Accelerate
18:28 dm3 joined
18:28 Swizec joined
18:29 eklavya joined
18:29 <Athas> srhb: nifty, thanks.
18:29 ragepandemic joined
18:30 lambdaman joined
18:31 bennofs joined
18:31 fizruk joined
18:31 <Myrl-saki> @pl (\x -> x <$ f x)
18:31 <lambdabot> ap (<$) f
18:32 jer1 joined
18:32 istvan joined
18:32 peterbecich joined
18:32 NeverDie joined
18:33 <Myrl-saki> @pl (\x -> x <$ (f . g $ x))
18:33 <lambdabot> ap (<$) (f . g)
18:34 soniku joined
18:34 augur joined
18:34 <geekosaur> the pointfree plugin still doesn't know about Applicatives, sadly
18:35 <Sornaensis> @free (>>=)
18:35 <lambdabot> Try `free <ident>` or `free <ident> :: <type>`
18:35 dm3_ joined
18:36 ubsan_ joined
18:37 Lokathor_ joined
18:38 fotonzade joined
18:38 <Myrl-saki> solve = fromJust . getFirst . fold . extend (fmap (product . map fst . take 4) . First . foldr (liftM2 (++)) (Just []) . fmap (mfilter ((== 4) . length) . Just . factorise) . NE.take 4)
18:39 <Myrl-saki> (PE 47)
18:39 <Myrl-saki> I feel so disgusted writing that. :D
18:39 <Myrl-saki> @pl fromJust . getFirst . fold . extend (fmap (product . map fst . take 4) . First . foldr (liftM2 (++)) (Just []) . fmap (mfilter ((== 4) . length) . Just . factorise) . NE.take 4)
18:39 <lambdabot> fromJust . getFirst . fold . extend (fmap (product . map fst . take 4) . First . foldr (liftM2 (++)) (Just []) . fmap (mfilter ((4 ==) . length) . Just . factorise) . NE.take 4)
18:39 mbw joined
18:39 {emptyset} joined
18:40 <* geekosaur> sees no points to remove from that
18:40 <mbw> How can I query lambdabot for a free theorem, preferrably in a private session?
18:40 <jle`> you can use @free in a private session
18:40 <jle`> using /q @free
18:40 <geekosaur> er
18:40 <jle`> er
18:40 <jle`> /q lambdabot [stuff]
18:40 <Myrl-saki> I'm... pretty sure I could have used `filter` there.
18:40 <geekosaur> /q lambdabot @free
18:41 <geekosaur> and I think for operator identifiers you have to cheat and say something like @free bind :: Monad m => m a -> (a -> m b) -> m b
18:41 augur_ joined
18:41 tec_ joined
18:42 <mbw> Can it give you more than one theorem? I need the good stuff for zipWith.
18:42 <Myrl-saki> Oh no. That was actually pretty correct. Lol.
18:43 alfredo joined
18:43 eklavya_ joined
18:44 <Myrl-saki> (For some definitions of correct.)
18:45 <dolio> It only gives you one theorem per type.
18:46 <Cale> Specifically, it gives you *the* free theorem for that type
18:46 coltfred joined
18:47 lambdaman joined
18:47 robertkennedy joined
18:47 <mbw> So there's only one per type (or rather, any other would follow from it)?
18:47 buttbutter joined
18:48 <fosterite> yes, the free theorem is usually rather general
18:48 robotroll joined
18:49 uelen joined
18:50 vengefulpickle joined
18:50 <mbw> Ok thanks.
18:50 <Cale> There are other theorems you might want to prove regarding any given function
18:50 <Cale> but they're not free
18:52 unyu joined
18:52 <mbw> I don't think this will be of any practical use to me anytime soon. I don't have the theoretical background to grok the paper, and I don't even understand the output.
18:52 <Cale> What did you want to know?
18:53 jer1 joined
18:53 lambdaman joined
18:53 splanch joined
18:53 <dolio> Cale: There are other theorems that could be free, I think. It makes some arbitrary decisions.
18:53 epsilonhalbe joined
18:54 <Cale> Oh, interesting
18:54 <dolio> Like assuming every capital letter is a covariant functor.
18:55 <dolio> Like, there is the more general parametricity theorem in terms of relations that is 'free'.
18:56 <dolio> And is not always implied by the more specialized on that @free gives you.
18:56 felixsch__ joined
18:56 peterbecich joined
18:57 <mbw> I was wondering if there are useful laws that can be stated for zipWith, zipWith3 etc. There should of course be the ones that follow from the Applicative instance from ZipList. What I'd like to know in the long run is if it can be applied in the context of multidimensional arrays, where you zipWith array slices.
18:57 peterbec` joined
18:57 <jle`> ah yes those aren't free theorems
18:57 jdt joined
18:57 <jle`> mbw: free theorems would be just the theorems that follow directly from the *types* of zipWith, zipWith3, etc.
18:57 <jle`> they don't consider the actual implementation
18:58 <jle`> :t zipWith
18:58 <lambdabot> (a -> b -> c) -> [a] -> [b] -> [c]
18:58 insitu joined
18:58 <jle`> @free (a -> b -> c) -> [a] -> [b] -> [c]
18:58 <lambdabot> Try `free <ident>` or `free <ident> :: <type>`
18:58 <mbw> I'm just looking for some useful laws, be they free or not.
18:58 <jle`> @free zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
18:58 <lambdabot> (forall x. h . k x = p (f x) . g) => $map h . zipWith k xs = zipWith p ($map f xs) . $map g
18:59 <jle`> yeah, those aren't free theorems...they're just theorems :)
18:59 bodisiw joined
18:59 <mbw> It was a last resort to come up with something. I'll have to write quickCheck properties or work things out on paper.
19:00 <shapr> hedgehog properties?
19:00 eklavya joined
19:01 <mbw> Well I thought fast & loose reasoning was morally correct...
19:02 connrs joined
19:02 <geekosaur> only with respect to nontermination
19:02 smillmorel joined
19:02 asmyers joined
19:05 <NickHu> Is there a better/more concise way to write http://lpaste.net/3914041342233149440 ?
19:06 lambdaman joined
19:08 <jle`> NickHu: it's weird seeing guard in IO
19:08 <jle`> wouldn't you rather just throw an error?
19:08 spacecadetbrown joined
19:08 ikke joined
19:08 Achylles joined
19:08 <jle`> also, why isJust + fromJust? why not just pattern match?
19:08 <jle`> is there any reason you're returning everything in MaybeT?
19:09 <jle`> you just add it on at the end so it's really no different than returning IO (Maybe FacebookReacts)
19:09 <cocreature> it looks like NickHu might expect guard to return Nothing
19:09 <cocreature> then MaybeT makes a bit more sense
19:10 <jle`> yes that is a suspicion i had as well; just hoping these questions would figure that out
19:10 <NickHu> Yeah, I saw it here https://en.wikibooks.org/wiki/Haskell/Monad_transformers
19:10 mmachenry joined
19:10 <jle`> are you trying to use MaybeT to do short-circuting IO ?
19:10 <NickHu> I'm under the impression that if the guard sees a Nothing the whole function gives up and returns Nothing
19:10 <NickHu> Which is exactly what I want to happen
19:10 james111 joined
19:10 <jle`> that's the case for Maybe
19:10 <jle`> but you aren't in Maybe, there
19:11 <NickHu> Yes, I am
19:11 <jle`> you're in IO
19:11 <jle`> it's also the case for MaybeT
19:11 <jle`> but you're in IO there
19:11 <jle`> ...does this typecheck at the moment?
19:11 <NickHu> Yeah, it compiles
19:11 darjeeling_ joined
19:11 <james111> Please could someone help me reverse a list then take the first element out then pass other items back for recursion
19:12 <Myrl-saki> > MaybeT _
19:12 <lambdabot> error:
19:12 <lambdabot> • Data constructor not in scope: MaybeT :: t0 -> t
19:12 <lambdabot> • Perhaps you meant variable ‘maybe’ (imported from Data.Maybe)error:
19:12 <Myrl-saki> Okay..
19:12 <jle`> this surprises me
19:12 <cocreature> leaving that aside, line 7-18 seem a bit weird. why are you applying a lambda to pid instead of just using pid directly?
19:12 xcmw joined
19:12 <Myrl-saki> NickHu: Look at the definition of MaybeT.
19:12 <cocreature> jle`: what do you expect to cause problems?
19:12 <jle`> M.lookup returns Maybe
19:12 <SolitaryCypher> reverse . drop 1?
19:12 <jle`> it doesn't return IO
19:12 <cocreature> oh right
19:12 <Myrl-saki> jle`: lmao. Me too.
19:12 <SolitaryCypher> james111: reverse . drop 1?
19:12 <jle`> i'd expect line 4 to be a type error
19:13 <jle`> what is the type of getResponseBody ?
19:13 <Myrl-saki> NickHu: Are you sure you saved?
19:13 <Tuplanolla> If you find yourself reversing a list, your design most likely went wrong at some earlier point, james111.
19:13 <NickHu> cocreature: You're right, I missed that while refactoring
19:13 jer1 joined
19:14 <jle`> NickHu: what your'e doing in this current file is defining an IO (without the help of MaybeT) and then wrapping it all in MaybeT at the end
19:14 <jle`> so you don't ever actually work with any MaybeT actions
19:14 a3Dman joined
19:14 bigos_ joined
19:14 blz joined
19:14 <NickHu> Response a -> a
19:14 robkennedy joined
19:15 <jle`> what about parseRequest?
19:15 <cocreature> to make this very explicit "MaybeT x >> MaybeT y" is not the same as "MaybeT (x >> y)"
19:15 <cocreature> and you’re doing the latter
19:15 <NickHu> Myrl-saki: What do you mean?
19:15 <cocreature> while it seems you expect the former
19:15 <Myrl-saki> runMaybeT . maybeT $ x == x
19:15 <jle`> NickHu: the file you gave us shouldn't compile
19:15 <Myrl-saki> Err. MaybeT*
19:16 <jle`> since M.lookup returns Maybe, and it's being <-'d in an IO do block
19:16 felixsch_ joined
19:16 <james111> SolitaryCypher: I am new to chaining functions together. I used reverse . drop 1 xs and I get error of drop applied to too few arguments
19:16 <Myrl-saki> (And even then, you need to use `lift`)
19:16 <james111> Tuplanolla: its just for a beginner project. I will keep that in mind for the future thank you
19:17 <Myrl-saki> Er wait. No.
19:18 <lpaste> jle` annotated “No title” with “No title (annotation)” at http://lpaste.net/3914041342233149440#a3474836882737594368
19:18 terrorjack joined
19:18 <jle`> NickHu: i gave two potential rewrites; one using MaybeT to show how MaybeT is supposed to work, and one without it to show that it doesn't relaly make sense to use MaybeT here
19:19 <jle`> MaybeT is really only useful when you do multiple chained short-circuiting stuff
19:19 <Myrl-saki> `pid <- MaybeT.return $ M.lookup path m`
19:19 <Myrl-saki> let pid = ?
19:19 <ExpHP> How can I scrub a cabal file for unnecessary dependencies? Cabal-1.24 is too bleeding edge for 'packunused'
19:19 felixsch__ joined
19:19 <jle`> Myrl-saki: M.lookup returns Maybe, so <- lets you take advantage of short-circuiting MaybeT
19:20 <jle`> in an ideal usage of MaybeT, there would be multiple such binds
19:20 <Myrl-saki> That's not my point.
19:20 <Myrl-saki> Wait for a while.
19:20 <cocreature> ExpHP: I haven’t tried it myself so take it with a grain of salt but I recently stumbled upon neil’s https://github.com/ndmitchell/weeder#readme
19:20 <cocreature> which seems like it’s supposed to do that
19:21 <Myrl-saki> Prelude Control.Monad.Trans.Maybe> runMaybeT $ return Nothing >> return 1
19:21 <Myrl-saki> Just 1
19:22 <Myrl-saki> jle`:
19:22 felixsch_ joined
19:22 <jle`> not sure what you're trying to show? sorry :|
19:23 <Myrl-saki> jle`: The `return` is wrong.
19:23 <Myrl-saki> jle`: I think you meant to use `lift`
19:23 <jle`> what you wrote isn't the same as what i wrote
19:23 ertes joined
19:23 <jle`> lift would be for IO actions
19:23 <jle`> @let import Control.Monad.Trans.Maybe
19:23 <lambdabot> Defined.
19:23 <Myrl-saki> Prelude Control.Monad.Trans.Maybe Control.Monad.Trans.Class> runMaybeT $ lift Nothing >> return 1
19:23 <jle`> > runMaybeT (MaybeT.return) Nothing >> return 1
19:23 <Myrl-saki> Nothing
19:23 <lambdabot> error:
19:23 <lambdabot> Not in scope: ‘MaybeT.return’
19:23 <lambdabot> No module named ‘MaybeT’ is imported.
19:24 <jle`> > runMaybeT $ (MaybeT . return) Nothing >> return 1
19:24 <lambdabot> error:
19:24 <lambdabot> • Ambiguous type variables ‘m0’, ‘a0’ arising from a use of ‘show_M19759...
19:24 <lambdabot> prevents the constraint ‘(Show (m0 (Maybe a0)))’ from being solved.
19:24 <* NickHu> sent a long message: NickHu_2017-05-03_19:24:03.txt - https://matrix.org/_matrix/media/v1/download/matrix.org/ETkznocSbhOPMVgwBHpDsRKl
19:24 <NickHu> whoops, didn't mean to paste that
19:24 <jle`> > runMaybeT $ (MaybeT . return) Nothing >> return 1 :: Identity (Maybe Int)
19:24 <lambdabot> Identity Nothing
19:25 <* NickHu> sent a long message: NickHu_2017-05-03_19:25:06.txt - https://matrix.org/_matrix/media/v1/download/matrix.org/cHKtpyZqQemvGQHjqTFZjuXE
19:25 <ExpHP> cocreature: yep, it's perfect!
19:25 <Myrl-saki> You wrote `MaybeT.return`, that's what I was confused about. Sorry.
19:25 <jle`> lift :: IO a -> MaybeT IO a
19:25 <jle`> ah yeah, i meant `MaybeT . return`
19:25 beanbagu1 joined
19:25 <jle`> NickHu: what code gave this error?
19:26 <NickHu> jle`: Yeah, I did that
19:26 asmyers joined
19:26 <ExpHP> hm, surprisingly I only have 2 dependencies out of ~50 that are unused, despite lots of frequent turnover in my codebase
19:26 <jle`> what code gave the error you just sent?
19:26 <ExpHP> I bet 75% of them are only used once
19:26 <NickHu> ahh, looks like it didn't need return/pure
19:26 <lpaste> jle` revised “No title (annotation)”: “No title (annotation)” at http://lpaste.net/3474836882737594368
19:27 <tsahyt> is psqueues still the fastest priority queue implementation?
19:28 <jle`> NickHu: anyways, yeah, MaybeT is not really very useful here because you don't do multiple short-circuiting IO Maybe chains
19:28 _sg joined
19:28 <NickHu> That did, jle`, but if you take out the . pure it's fine
19:28 <NickHu> (On line 4)
19:28 <jle`> if you only have one IO Maybe, easiest thing is to just use forM
19:28 <NickHu> How do you mean?
19:28 <jle`> what am i looking at? what line 4?
19:28 leat joined
19:29 <NickHu> http://lpaste.net/3474836882737594368 line 4
19:29 <jle`> MaybeT is only worthwhile if you sequence multiple chained short-circuiting operations
19:30 <jle`> otherwise you might as well just use forM like what I wrote
19:31 <jle`> huh that's weird. what's the type of M.lookup ?
19:31 fizruk joined
19:31 <jle`> is it not the standard M.lookup from containers?
19:31 <ReinH> You can always wrap a particular IO (Maybe a) with MaybeT at use sites.
19:31 <ReinH> Which is nicer than unwrapping MaybeT IO a imo
19:32 jerme joined
19:32 <jle`> yeah, it makes more sense to just return IO (Maybe a); MaybeT is a convenient newtype wrapper for chaining several short-circuiting IO (Maybe a)'s in a do block and other similar things
19:32 splanch joined
19:32 <jle`> also i see that M.lookup returns IO for some reason, which is why the original thing compiled
19:32 <ReinH> It mostly depends on context. If you mostly "live" in MaybeT IO, do that, and vice versa.
19:33 <* geekosaur> wonders if this is the ghc 6.6 lookup >.>
19:33 <NickHu> jle`: It's from Control.Concurrent.Map, sorry, should've said
19:33 <ReinH> One other advantage of IO (Maybw a) is that you can export it and users won't incur a transformers dependency to use it.
19:34 jer1 joined
19:34 felixsch__ joined
19:34 <lpaste> jle` annotated “No title” with “No title (annotation) (annotation)” at http://lpaste.net/3914041342233149440#a7956381835863261184
19:34 <jle`> NickHu: if that's the case, then the second annotation is how i would probably write it
19:37 AaronFriel joined
19:37 <ReinH> I would extract the parseRequest to be a function that expects a pid.
19:37 electrostat joined
19:37 <ReinH> Some useful way to use it should present itself.
19:41 iAmerikan joined
19:41 GreySunshine joined
19:41 beerdrop joined
19:42 yellowj joined
19:43 richi235 joined
19:45 a3Dman joined
19:50 yrdz joined
19:50 Costar joined
19:53 zeroed joined
19:55 jer1 joined
19:58 <nitrix> Is it possible to disable the GC entirely or reduce the frequency of the passes?
19:59 cdg joined
20:03 biglambda joined
20:04 <AaronFriel> nitrix: I don't believe so. You can reduce the frequency by increasing the size of the allocation area with the -A RTS flag.
20:04 <AaronFriel> nitrix: An experimental feature in the next GHC, compact regions, will allow much stronger controls on what garbage collection occurs and its cost.
20:06 <ExpHP> so haskell can have dynamic bindings https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#implicit-parameters
20:06 <ExpHP> the question is... dare I use them?
20:06 <AaronFriel> @ExpHP most people do not use them in favor of explicit bindings or the Reader monad, or more complicated monad stacks.
20:06 <lambdabot> Unknown command, try @list
20:06 <tdammers> I think they're mildly evil
20:07 <tdammers> explicit bindings are more explicit (ergo better), at the expense of being slightly more explicit (ergo more work to type and read)
20:08 a3Dman joined
20:08 <tdammers> it's a neat feature, but I doubt I'll ever use it
20:08 <ExpHP> yeah, Reader is what I figured, but I feel having to wrap types like that tends to cause tight coupling
20:09 <ExpHP> er, I don't mean wrapping /types/, but... rather, the way it affects function signatures
20:09 <AaronFriel> Apologies to the Hackage people for the uhm... upload spam, as the 4th time is the charm, I just published this simple little package: https://hackage.haskell.org/package/graphted, which I call graph-indexed monads/functors/etc.. Why graph-indexed? Because the parameter of the indexed tracks the operations performed on it (e.g.: Apply, Bind, Fmap, etc.) and
20:09 <AaronFriel> allows a GADT that uses such a monad to pattern match on the operations.
20:10 <AaronFriel> Example use here: https://github.com/AaronFriel/eff-experiments/blob/temp-wip/src/Control/Monad/Graph/Eff.hs
20:11 <AaronFriel> That's prior to me cleaning up and pulling out "graphted" as a dependency, and renaming things to be cohesive.
20:11 beanbagu1 joined
20:12 glguy joined
20:13 splanch joined
20:14 <AaronFriel> By nicely defining those operations, it works well (and type checks well) with the language extensions NoImplicitPrelude, RebindableSyntax, ApplicativeDo, as in this code sample: http://lpaste.net/355161
20:15 emmanuel_erc joined
20:15 <james111> How can I condense these two functions into one? http://lpaste.net/355162
20:16 felixsch_ joined
20:16 alicemaz joined
20:18 <jle`> AaronFriel: so this is like a generalized version of indexed functors/applicatives/monads ?
20:18 lambdaman joined
20:18 jer1 joined
20:18 <AaronFriel> jle`: I think so? Similar to rmonad, but I think simpler and moving in a different direction. I use type families where they used constraints.
20:19 shainer left
20:19 <jle`> i'm referring to https://hackage.haskell.org/package/indexed-0.1.3
20:19 <fosterite> AaronFriel: is this supposed to let me specify what control paths are legal in a more modular way?
20:19 jathan joined
20:20 <jle`> AaronFriel: basically instead of f i j a, you have f g a; you can get the original by having g being (i, j)
20:20 <jle`> and it lets you custom-define your type functions Bind/Fmap/etc. instead of fixing them like indexed does
20:20 <AaronFriel> fosterite: Yes, you could write the family such that no instance of "Bind (Apply ..) .." is permitted, which would restrict any implementation to never using sequentially dependent application after parallelizable application.
20:20 flatmap13 joined
20:21 <jle`> so you could implement the indexed package with what you have
20:21 plutoniix joined
20:21 splanch joined
20:22 plutoniix joined
20:24 twanvl joined
20:24 <AaronFriel> I did that, here wrapping IxMonad (https://github.com/AaronFriel/eff-experiments/blob/temp-wip/src/Control/Monad/Graph/Class/Indexed.hs) and here with a categorical approach (https://github.com/AaronFriel/eff-experiments/blob/temp-wip/src/Control/Monad/Graph/Class.hs#L147-L185)
20:25 plutoniix joined
20:25 danzimm joined
20:25 <AaronFriel> One thing that's not satisfying is with the former, (wrapping IxMonad) there's no good way to get type inference for "return", to restrict it to the domain "WrappedIx m (i, i) a"
20:26 Immune joined
20:27 <AaronFriel> I think I would need kind classes to be able to specify a "UnitElementKind" of the parameter (in this case, the kind (k, k), and UnitElementKind would be k) and a type function UnitElementKind p -> p
20:29 <AaronFriel> e.g.: For indexed monads, "ireturn :: a -> m i i a". I would want to define "greturn :: forall (i :: UnitElementKind p) a. a -> m i a" instead of "greturn :: forall a. a -> m (Unit m) a".
20:30 iAmerikan joined
20:30 jao joined
20:30 <AaronFriel> ^ oops, this is what I would want: "greturn :: forall (i :: UnitElementKind p) a. a -> m (Unit m i) a", which would take an arbitrary type of kind "UnitElementKind p" and turn it into a "p".
20:32 mr_sm1th joined
20:34 Prutheus joined
20:35 hvr joined
20:35 hvr joined
20:36 soniku joined
20:36 plutoniix joined
20:37 rblaze1 joined
20:37 Matt_P1 joined
20:38 jer1 joined
20:39 Gurkenglas joined
20:39 JuanMiguel joined
20:40 bennofs1 joined
20:42 hvr joined
20:42 hvr joined
20:42 acarrico joined
20:43 Itkovian joined
20:43 avn joined
20:44 spacecadetbrown joined
20:44 <tdammers> ExpHP: dynamic vars don't reduce the coupling, really; it just looks like it
20:44 eyedempotent joined
20:44 <tdammers> ExpHP: but the dependency between the code that uses the variable and the code that sets it is still there
20:45 <tdammers> ExpHP: it's just that the dependency is invisible on the in-between layers in the call graph
20:46 bigos_ joined
20:47 mbazs joined
20:47 splanch joined
20:48 `^_^v joined
20:49 pera joined
20:50 doomlord joined
20:50 plutoniix joined
20:52 hackebeilchen joined
20:53 plutoniix joined
20:54 yellowj joined
20:55 fotonzade joined
20:55 Destol joined
20:57 drostie joined
20:57 peterbecich joined
20:58 <thang1> sup
20:58 sfcg joined
20:59 jer1 joined
20:59 <lpaste> asd pasted “Hello” at http://lpaste.net/4190387629776175104
21:00 <* thang1> congratulates asd
21:00 anuxivm joined
21:02 tomphp joined
21:02 cur8or joined
21:03 bjz joined
21:04 cloudhead joined
21:07 augur joined
21:07 debouncer joined
21:10 dannyxn joined
21:10 <dannyxn> hello
21:11 <dannyxn> what is haskell used for?
21:11 <pharaun> everything?
21:12 <dannyxn> you meant it is possible to bulid web apps with haskell?
21:12 alicemaz joined
21:12 <Tuplanolla> It'd be easier to ask what it's not used for, dannyxn.
21:12 <dannyxn> so what haskell isn't used for?
21:13 kritzcreek joined
21:13 <Tuplanolla> That'd be embedded systems and hpc.
21:13 <pharaun> certain sectors such as some subset of embedded system (but there's embedded system code-generators in haskell) :) and anything that might be sensitive to GC
21:13 <rblaze> dannyxn probably not used for first person shooters
21:13 <pharaun> but even games often are implemented in languages with GC so its not impossible
21:13 Maxou joined
21:13 <EvanR> :t fmap (+1) (0,0)
21:13 <lambdabot> (Num t, Num b) => (t, b)
21:14 <pharaun> (see minecraft and java, kerbal space program and C#, and unity based games)
21:14 <EvanR> whats up with those choices of letters?
21:14 <pharaun> dannyxn: there's wai/yesod/snap/happstack (for web dev)
21:14 <EvanR> pharaun: i wish ksp/unity didnt freeze up my mac
21:14 <EvanR> gc or not
21:14 <pharaun> EvanR: me too
21:15 <dannyxn> is it possible to compare haskell and python?
21:15 <pharaun> how so?
21:15 <pharaun> in what regard?
21:15 <pharaun> there's many ways you can compare it
21:15 justin2 joined
21:16 Aruro joined
21:16 <EvanR> > compare "Haskell" "Python"
21:16 <lambdabot> LT
21:16 <pharaun> ha
21:16 zeroed joined
21:16 zeroed joined
21:16 <EvanR> stands for leeter
21:16 frankpf joined
21:17 <Aruro> > compare "Haskell" "Lisp"
21:17 <lambdabot> LT
21:17 <dannyxn> I'd like to hear that in real time converstation
21:17 <tdammers> dannyxn: yes, of course... it's just that they are very different languages, so I don't know how interesting the comparison is going to be
21:17 <dannyxn> and discuss about it
21:17 Wizek_ joined
21:17 plutoniix joined
21:17 <Aruro> lets all think about beatiful 50k lines of C code which went into "Haskell" runtime
21:17 <pharaun> did this person leave?
21:17 <Sonolin> > compare "Haskell" "VimL"
21:18 path[l] joined
21:18 <Sonolin> > compare "Haskell" "VimL"
21:18 <lambdabot> LT
21:18 <Sonolin> ehhh idk about that
21:18 <EvanR> stackless python vs tagless gmachine
21:19 <Aruro> > compare "C" "C++"
21:19 <lambdabot> LT
21:19 jer1 joined
21:19 <tdammers> > let C = 'C' in compare C (succ C)
21:19 <lambdabot> error: Not in scope: data constructor ‘C’
21:19 <tdammers> ah ofc
21:19 <tdammers> > let c = 'C' in compare c (succ c)
21:20 <lambdabot> LT
21:20 <Aruro> > succ "C++"
21:20 <lambdabot> error:
21:20 <lambdabot> • No instance for (Enum [Char]) arising from a use of ‘succ’
21:20 <lambdabot> • In the expression: succ "C++"
21:21 <EvanR> > succ 'c'
21:21 <lambdabot> 'd'
21:21 <Aruro> yeah, its char
21:21 <EvanR> i guess we finally answered that question
21:21 a3Dman joined
21:21 <EvanR> (the value of C++)
21:21 <Aruro> > compare "Haskell" "Cobol"
21:21 <lambdabot> GT
21:21 <tdammers> I think it's mildly disappointing that we can't have stuff like forall a. compare a (succ a)
21:22 <orion> > succ 'Z'
21:22 <lambdabot> '['
21:22 <EvanR> :k a b (c b)
21:22 <lambdabot> error: Not in scope: type variable ‘a’
21:22 <lambdabot> error: Not in scope: type variable ‘b’
21:22 <lambdabot> error: Not in scope: type variable ‘c’
21:24 <Aruro> why if u type one character in ghci command Ctr-D does not function anymore
21:25 <Aruro> seems like feature to prevent suddent exit?
21:25 <dyreshark> Aruro: see the answer here: http://stackoverflow.com/questions/20340561/why-isnt-ctrl-d-signaling-eof-with-this-program
21:25 <pharaun> Aruro: ipython same
21:26 <pharaun> i just tested it with ipython as well and it has the same behavur
21:26 <Aruro> to be fair bash has same :)
21:26 <EvanR> must be a terminal thing
21:26 xintron joined
21:26 xintron joined
21:28 <Aruro> why is bash still around? its so outdated ? were there attempts to design better stuff?
21:28 plutoniix joined
21:28 <EvanR> there are other shells, and reimplementations of bash
21:28 <Aruro> like rethink whole philosophy with stdin out and err
21:28 flatmap13 joined
21:28 <EvanR> oh yeah totally
21:28 <EvanR> nothing fundamental about ByteString
21:29 lambdamu joined
21:29 <EvanR> but were stuck
21:29 <Aruro> like parsing output of another programm seems supid when bash could just pass it in smth like stdcomm
21:29 <yushyin> Aruro: like powershell?
21:29 splanch joined
21:29 <ph88_> when i yield Double in my Conduit is a a Conduit Double or a Conduit [Double] ?
21:30 <Aruro> same with parsing command line, also stupid, has to be done by bash ?
21:30 <Aruro> millions of libs just to do this redundant task
21:30 <Sonolin> you know there's a #linux right?
21:31 <Aruro> Sonolin: has nothing to dowith haskell? i dont think so :)
21:31 <Aruro> majority of haskell libs do something what bash or good shell had to be doing
21:32 <Sonolin> I don't think bash is related to Haskell much at all
21:32 drostie joined
21:33 <Aruro> Sonolin: im saying that haskell lib ecosystem is been build around old building, which is linux shell
21:33 <Aruro> im sure haskellers would have created much better shell
21:34 <dyreshark> they have
21:34 <dyreshark> it's called ghci ;)
21:34 <Aruro> :)
21:34 <Tuplanolla> Lisp machines had a repl as a shell...
21:35 forgottenone joined
21:35 <EvanR> i cant stand "lisp repl as a shell"
21:35 <ReinH> So has Microsoft, actually.
21:35 <thang1> why not?
21:35 pandeiro joined
21:35 <EvanR> its not very ergonomic
21:36 <EvanR> you have to start every line with (, so why do you have to actually type it?
21:36 <EvanR> shouldnt it just be assumed
21:36 <ReinH> PowerShell has structured data pipelines.
21:36 <Aruro> ReinH: really?
21:36 <ReinH> Yeah.
21:36 <thang1> Fair. I really don't tend to like full blown turing complete languages in shells
21:36 <EvanR> powershell lets you pass C# objects through the pipe
21:36 <Aruro> ReinH: interesting
21:36 <thang1> BASH and other traditional shells are fine because they don't feel turing complete due to being /designed/ as shells
21:36 <Aruro> are there haskell libs tuned for powershell?
21:37 <ReinH> You can define your own typed structures. https://technet.microsoft.com/en-us/library/ff730946.aspx
21:37 <EvanR> does haskell even interact with .NET in any way
21:37 <Aruro> ah, so linux users can get calm right?
21:37 sleffy joined
21:37 <thang1> The only thing I know of currently for shell stuff in haskell is Turtle
21:38 <Aruro> there is also shelly
21:38 <thang1> oh yeah, that too
21:38 <lambdamu> Does anyone else think the prominence of the lambda calculus is somewhat odd, given how strongly it resembles implication when implication as a logical operation is rather decidedly sumbsumed by disjunction in combination with negation in logic?
21:38 <ReinH> Honestly, the Linux shell and the entire file descriptor system is an archaic PITA, as anyone who has looked at pipes or conduit for process management can probably tell you.
21:38 noumenon joined
21:39 <ReinH> The things you have to do to make stdout and stderr behave like nice conduits is o_O
21:39 <EvanR> lambdamu: implication is not disjunction+negation in intuitionistic logic
21:39 <EvanR> even in classical, thats really annoying
21:39 <EvanR> also lambda calculus is illogical
21:39 <Aruro> ReinH: are there any new systems on horizon? System 9 (or Project 9) ?
21:40 <ReinH> idk
21:40 jer1 joined
21:40 <thang1> lol not in any meaningful way
21:40 <thang1> Windows, Linux, OSX, etc., won.
21:40 <Aruro> i forgot there was some system Poject 9 or Platform 9
21:40 <thang1> Now there are new sub-units of stuff that's coming out... Rust is looking to replace C, oilshell is an interesting new take on shell languages
21:40 <Aruro> from good old folks
21:41 <EvanR> Plan 9
21:41 <ph88_> can anyone give me a hint what i could do to get these parsing and conduit functions right? https://bpaste.net/show/4d799bce2cd8
21:41 <thang1> and so on
21:41 <Aruro> EvanR: yeah that
21:41 a3Dman joined
21:41 <thang1> To put it thisa way, if any new OS comes out and even makes a dent in the market at this point, it's only going to happen because it completely obliterates the current market. That will only happen if somehow there's a completely new paradigm of computing/technology that's yet to be uncovered
21:41 <ReinH> Here's a fun discussion of the issues for pipes specifically https://groups.google.com/forum/m/#!msg/haskell-pipes/JFfyquj5HAg/Lxz7p50JOh4J
21:42 <thang1> (and by uncovered I mean "quite rapidly, before existing solutions can evolve")
21:42 nick123 joined
21:42 <Tuplanolla> People forget these things are even possible: http://www.loper-os.org/?p=284
21:43 darjeeling_ joined
21:43 <lambdamu> EvanR: but doesn't linear logic reconcile the symmetry of the idea implication = disjunction + negation with the fact that it isn't quite accurate in constructive logic?
21:43 splanch joined
21:43 <EvanR> im still pretty neophyte with linear logic
21:43 <alicemaz> there's a truism that a lot of these sorts of markets that benefit greatly from network effects (desktop OS, phone OS, social network, etc) have room for 2.5 players
21:44 rperry joined
21:44 <alicemaz> often seems to be the case
21:44 augur joined
21:44 <monochrom> And politics. :)
21:45 xxalien8dxx joined
21:45 <alicemaz> heh
21:45 <Aruro> was linux a player?
21:45 fosterite joined
21:46 <monochrom> Yes.
21:46 <monochrom> Or no, if you mean "iPod was a player, Creative Jukebox was a player, linux was not".
21:46 <alicemaz> for pc I'd call it the 0.5. it seems to be ubiquitous for us but we are very much in the minority. for servers ofc it is the leader
21:47 <alicemaz> but yknow "next year in linux on the desktop"
21:47 <monochrom> It is also wise to not take the number 2.5 too literally.
21:50 <EvanR> (+ x * y) looks funny but seems to work
21:50 <EvanR> and (* x + y) doesnt
21:51 <EvanR> also is (+1) or (1+) better
21:51 <EvanR> (+x) or (x+)
21:52 koneida joined
21:52 hiratara joined
21:53 richi235 joined
21:53 mjora7 joined
21:53 zcourts joined
21:54 <DrMentats> I think ghc-mod might have a memory leak. usage goes up to a whopping 2.2 GB on my machine, then if I kill it in the process monitor, it goes back down to just under 65 MB while performing no worse than before (as far as I can see). I'm using it through Atom's haskell-ghc-mod package.
21:54 romank joined
21:55 plutoniix joined
21:55 <MarcelineVQ> EvanR: if there's a better it's more likely to be x+ since that would become a partially applied (+) rather than perchance a lambda, idk for sure though, depends how it's desugared, what core you get, and ultimately whether a CAF matters to you
21:56 <MarcelineVQ> there's more here about that, though I find it a little confusing https://wiki.haskell.org/Constant_applicative_form
21:56 preyalone joined
21:56 <EvanR> its a CAF ?
21:57 <MarcelineVQ> depends how it desugars so maybe
21:59 lambdaman joined
22:00 jer1 joined
22:02 ubsan_ joined
22:02 sellout- joined
22:02 <EvanR> MarcelineVQ: that discussion is making my head spin
22:03 richi235 joined
22:04 <monochrom> It is best to just read core.
22:04 ertes joined
22:05 Deide joined
22:05 <monochrom> I think that CAF's only significance is "GC has to honour it as one of the roots, and cannot deallocate it because it isn't even on the heap"
22:05 <monochrom> (although, its child or grandchild or whatever may be.)
22:06 <monochrom> So, a global binding.
22:06 iAmerikan joined
22:07 <Tuplanolla> Is there a prettier formulation of hyperspherical coordinates than the one mathematicians usually use?
22:07 <Tuplanolla> Implementing it feels wrong on some level.
22:07 sw1nn joined
22:07 <Aruro> DrMentats: ghc-mod had been known to be slow, so far nothing changes, like years.
22:08 <Aruro> Tuplanolla: sperical coordinates in n dimensions?
22:08 <Aruro> h*
22:08 <Tuplanolla> Yes, Aruro.
22:08 jeltsch joined
22:09 <Aruro> just spherical then, if im not mistaken. there is hypercube though
22:09 <Aruro> i personally think "whatever" if meaning is correct
22:09 <Tuplanolla> I don't follow.
22:10 <Aruro> there is term hypercube hypersphere
22:10 <Aruro> but this suffix seems not to apply to coordinate systems names
22:10 <Aruro> prefix*
22:10 <Tuplanolla> Okay, sure. My question still stands.
22:11 mekeor joined
22:11 ExpHP joined
22:11 <MarcelineVQ> what's the current notation? n-tuple for n-dimentions?
22:12 <MarcelineVQ> I suppose I could ask google, nvm me :>
22:12 jer1 joined
22:12 <monochrom> Oh! Maybe you can do this. The gist is just to run "sin^2 + cos^2 = 1" on steroid, right?
22:12 stevebash joined
22:12 <Tuplanolla> The azimuthal angle is not consistently against the highest dimensional axis in the conventional formulation, MarcelineVQ.
22:13 <monochrom> So when you have "a^2 + b^2 + c^2 + d^2 = 1", there are two ways to cut up the RHS to fit "sin^2 + cos^2 = 1"
22:13 augur joined
22:13 takle joined
22:13 <monochrom> One way is a^2 = sin^2 theta , b^2+c^2+d^2 = cos^2 theta and then introduce another angle to further cut up b,c,d.
22:13 dpren joined
22:14 <Tuplanolla> The polar angle is also shoved to the end of the components instead of the beginning, so taking the infinite-dimensional limit would be symmetry-breaking.
22:14 <ExpHP> what are we trying to do here? generate normalized vectors?
22:14 <monochrom> But maybe you want to do a middle cut: a^2 + b^2 = sin^2 theta, c^2 + d^2 = cos theta.
22:14 <stevebash> Hi, I'm having difficulty with Text.Parsec, I'd like to parse a value {1,2,3} and return the whole value including brackets
22:14 rperry joined
22:14 Levex joined
22:14 <stevebash> I've got this pVal :: Parser Text
22:14 <stevebash> pVal = toS <$> (string "{" <*> (many (noneOf "{}")) <*> string "}")
22:14 <stevebash> yiii
22:14 <stevebash> pVal :: Parser Text
22:15 <stevebash> pVal = toS <$> (string "{" <*> (many (noneOf "{}")) <*> string "}")
22:15 <stevebash> y
22:15 takle joined
22:16 <stevebash> Doesn't compile, how to make it return the "{}" with the <*> operator?
22:16 <stevebash> pPgArray :: Parser Text
22:16 <stevebash> pPgArray = toS <$> (string "{" *> (many (noneOf "{}")) <* string "}")
22:17 <stevebash> If I do that it does compile but doesn't include the "{}"
22:17 richi235 joined
22:17 <ExpHP> stevebash I think you're close. The thing on the left of <*> needs to be a parser of functions (e.g. Parser (String -> String -> String))
22:18 sellout- joined
22:18 <monochrom> stevebash: I want you to study the following example, it is not parsec but it's still Applicative, using Maybe.
22:18 <lambdamu> mconcat <$> sequenceA [string "{", many (noneOf "{}"), string "}"]
22:18 <ExpHP> e.g. I think this would give you all but the "}": (++) <$> string "{" <*> (many (noneOf "{}"))
22:18 <lambdamu> wouldn't something like that work?
22:19 <monochrom> > (((\a b c -> a*b + c) <$> Just 2) <*> Just 3) <*> Just 4
22:19 <lambdabot> Just 10
22:19 <monochrom> You see how I parenthesize it?
22:19 fotonzade joined
22:19 taktoa joined
22:19 uglyfigurine joined
22:20 <stevebash> Thanks a lot ExpHP I'll see if I can make it work with your examples
22:20 iAmerikan joined
22:21 <ExpHP> stevebash in fact I think it can be made much less magical looking with some do notation
22:21 hamishmack joined
22:21 <ExpHP> do {a <- parser1; b <- parser2; c <- parser3; pure (a ++ b ++ c); }
22:22 mmn80 joined
22:22 Proteus1 joined
22:22 <stevebash> I've not tried that yet, thanks a lot, that would be more readable
22:23 sdemos_ joined
22:23 fingerzam_ joined
22:23 preyalone_ joined
22:23 debouncer joined
22:24 al-damiri_ joined
22:24 jan-sipr joined
22:25 dbohdan_ joined
22:25 caasih_ joined
22:25 malthe_ joined
22:25 comboy_ joined
22:25 tekacs joined
22:26 integral joined
22:26 integral joined
22:26 petercom1and joined
22:26 jstolare1 joined
22:26 razwelle1 joined
22:26 mathu_ joined
22:26 srenatus[m]1 joined
22:26 kaeluka_ joined
22:26 Lex[m]1 joined
22:26 iffsid[m]1 joined
22:26 jrkp_ joined
22:26 Boreeas_ joined
22:26 jrslepak_ joined
22:26 xnyhps_ joined
22:26 scinawa1 joined
22:26 platz_ joined
22:27 Ornedan joined
22:27 supki joined
22:27 unsymbol_ joined
22:27 Monoide_ joined
22:27 Rembane joined
22:27 pasukon_ joined
22:27 barrucadu joined
22:27 barrucadu joined
22:27 nikolah joined
22:27 NextHendrix joined
22:27 alphawaffle joined
22:27 qz joined
22:27 Wuzzy2 joined
22:27 atk joined
22:27 Levex joined
22:27 comboy_ joined
22:27 cmn_ joined
22:28 codehero joined
22:28 troydm1 joined
22:28 <stevebash> The do notation worked as you said, thanks again ExpHP
22:28 julmae joined
22:28 FederalRick[m] joined
22:28 scav joined
22:28 xcmw joined
22:28 cartwright joined
22:29 JeanCarloMachado joined
22:29 FederalRick[m] joined
22:29 majoh joined
22:29 Sonderblade joined
22:29 raid joined
22:30 lambdabot joined
22:30 lambdabot joined
22:30 mathu joined
22:30 <Tuplanolla> I mustn't be the only one to feel that the common definition of spherical coordinates is gross and unsatisfying.
22:30 Reisen joined
22:30 levex_ joined
22:31 scopedTV joined
22:31 hanDerPeder joined
22:31 kmc joined
22:31 kmc left
22:31 <monochrom> Have you tried what I said?
22:31 cool_penguins joined
22:31 cool_penguins left
22:31 zomg joined
22:31 hiratara joined
22:31 ahf joined
22:32 jlouis joined
22:32 Twey joined
22:32 tsahyt joined
22:32 <Tuplanolla> I didn't get what you said, but I'll have to look into it, monochrom.
22:32 `micro joined
22:32 e joined
22:32 zcourts joined
22:33 Saizan joined
22:33 <Tuplanolla> I see how it could lead somewhere, however.
22:33 lambdaman joined
22:33 statusfailed joined
22:33 <ExpHP> it's like the common definition of slope. Who knows why we aren't all working in the projective plane...
22:33 LeaChim joined
22:33 qlkzy joined
22:34 JeanCarloMachado joined
22:34 alien8d joined
22:34 <ExpHP> no wait, I got it
22:34 <ExpHP> it's like ieee-754
22:35 <ExpHP> where everybody has agreed upon using a standard which fails to satisfy even the property that x == x
22:35 <monochrom> We are working in the projective plane when talking about slope. We say "slope is infinity" all the time.
22:36 zero_byte joined
22:36 <ExpHP> monochrom yet if I ask matplotlib to plot a vertical line, I get a divide by zero error :V
22:36 <Tuplanolla> You can call it ISO 31-11 if you're feeling sassy.
22:36 frankpf joined
22:36 Snircle joined
22:37 <monochrom> Ah yeah then matplotlib is not doing homogeneous coordinates when it ought to.
22:37 soniku joined
22:38 <monochrom> I guess its author had only thought of plotting functions, "you have to pass the vertical line test".
22:38 reem joined
22:38 <monochrom> Except it passes that test and fails the other vertical line test :)
22:38 <thang1> lol
22:38 <ExpHP> my feeling is that a whole lotta software does it wrong; most important software that does any kind of heavy lifting
22:39 <ExpHP> because for some reason, the beautiful side of mathematics just never makes it into this stuff
22:39 jer1 joined
22:39 <thang1> Beautiful perfection meets ugly, greasy hardware never works well
22:40 <monochrom> The beautiful side of mathematics doesn't make it into the programming curriculum.
22:40 jmcarthur joined
22:40 <Tuplanolla> Often it doesn't make it into mathematical publications either.
22:40 <monochrom> Even if it did, it wouldn't make it into the students' heads.
22:40 <ExpHP> tbh I still don't get why euclidean division isn't the standard behavior of integer division/modulus in even a single language--not one (that I know of)
22:40 <Tuplanolla> Need more Greek letters to secure funding.
22:40 MP2E joined
22:41 <Myrl-saki> lol
22:41 Levex joined
22:41 <ExpHP> python and haskell at have floored division, which is slower, more complicated to describe imo and has fewer nice properties
22:42 carlomagno joined
22:42 <monochrom> What does euclidean division do again? Remainder is betwen -4 and 4 (when dividing by 10)?
22:42 <ExpHP> whereas euclidean division is just: 0 <= a mod b < abs b.
22:42 nick123 joined
22:42 <ExpHP> always-positive modulus
22:42 biglambda joined
22:42 <monochrom> I see.
22:43 <monochrom> > (5 `mod` (negate 3), 5 `rem` (negate 3))
22:43 <lambdabot> (-1,2)
22:43 <monochrom> One more test
22:43 <ExpHP> I often people say how they sometimes find the behavior of floored division useful for floats, but I've never had the fortune of actually running into one of those cases
22:43 <monochrom> > negate 5 `rem` 3
22:43 <lambdabot> -2
22:43 <ExpHP> or maybe I'm just not thinking outside fo the box
22:43 <monochrom> Ah, darn.
22:45 <benzrf> haskell 2010 typeclasses could theoretically be implemented purely by monomorphizing, right? with no dictionary passing
22:45 <monochrom> Didn't Knuth write something in favour of euclidean division?
22:45 <benzrf> (no specific reason im asking - i was just thinking about why dictionaries are necessary and realized that as far as i can tell, they /technically/ aren't)
22:45 whaletechno joined
22:46 <Tuplanolla> Are you saying that you could specialize to all known types the way C++ does templates, benzrf?
22:46 <ExpHP> monochrom: no idea
22:46 <benzrf> i don't know how C++ does templates :>
22:46 <monochrom> benzrf: If I assume whole-program compilation and no polymorphic recursion, I think yes.
22:46 <benzrf> monochrom: polymorphic recursion?
22:46 <benzrf> ooh hold on
22:46 <ExpHP> monochrom: The first time I actually saw the phrase used was in this article: https://www.microsoft.com/en-us/research/publication/division-and-modulus-for-computer-scientists/
22:46 <taktoa> C++ does templates by macro expansion
22:46 <thang1> C++ templates are basically black magic
22:47 <taktoa> no they're actually pretty simple.
22:47 <benzrf> i don't even really know what templates are
22:47 <ExpHP> though at that point I was already aware of the utility of always positive moduli, and had to implement it in a couple of projects
22:47 <taktoa> benzrf: C++ always monomorphizes templated functions
22:47 <benzrf> c++ is one of the few langauges ive never tried to learn
22:47 leat joined
22:48 <monochrom> ExpHP: I think that's the article I saw too.
22:48 <nh2> benzrf: it is interesting to learn, it has some real ugliness but also some really good things
22:48 <ExpHP> C++ templates are like macro expansion in the AST
22:48 <ExpHP> safer but still duck-typed
22:48 <taktoa> nh2: lol got really confused seeing your name in two different channels at once
22:49 augur joined
22:49 <benzrf> ExpHP: "macro expansion in the AST" is redundant isnt it? isnt that how about half of macro systems work
22:49 <ExpHP> hehe
22:49 <benzrf> lisp macros and rust macros certainly both work in the ast, and so do haskell macros
22:49 <ExpHP> not C :D
22:49 <* monochrom> spreads rumour: Stroustrup says "anyone who want to do type-level numbers in Haskell should consider C++ instead" :)
22:49 ljc joined
22:50 <benzrf> ah yes, C's macros occur in the ASL
22:50 <benzrf> :]
22:50 <taktoa> C++ _can_ do polymorphic recursion btw, you just can't instantiate a function at an infinite set of types
22:50 <taktoa> so the polymorphic recursion you can do is really boring
22:50 conal joined
22:51 alanz joined
22:51 <taktoa> (disclaimer: that statement is based on my understanding of how C++ template expansion works and could totally be inconsistent with the actual implementations)
22:52 _main_ joined
22:52 <ExpHP> benzrf: To be entirely honest I do actually more or less equate c++ templates with rust macros in terms of power
22:52 beerdrop joined
22:52 <ExpHP> maybe that's because I write too much rust :V
22:52 <benzrf> so they really are just macros?
22:52 <taktoa> yes
22:52 <benzrf> ah ok
22:52 <benzrf> ive decided to finally maybe try learning rust for real
22:53 __main__ joined
22:53 <ExpHP> rust is my baby
22:53 <* ExpHP> snuggles rust protectively
22:53 Levex joined
22:54 <ExpHP> except for the part where I abandoned it for my two latest projects to write them in haskell
22:54 <benzrf> im thinking maybe i will rewrite in rust this toy renderer i previously did in C
22:54 <benzrf> heh
22:54 <glguy> Alright, my screen filled up with messages about Rust and C++, so it's time to move back to the /topic
22:54 robatosan joined
22:54 iAmerikan joined
22:55 __main__ joined
22:55 <Rembane> If you like to continue the off topic conversation, go to #haskell-offtopic and rock your socks off!
22:55 <benzrf> glguy: why do you hate fu-oh wait i almost called C++ "fun"
22:55 <benzrf> Rembane: why not #haskell-blah
22:56 <Rembane> benzrf: Because #haskell-offtopic is mentioned in the /topic of this channel and #haskell-blah isn't.
22:57 <benzrf> lame
22:57 jer1 joined
22:57 <Rembane> benzrf: Indeed, poke geekosaur!
22:58 <ExpHP> #haskell-offtopic isn't in /list so it must not exist. (QED)
22:59 <Tuplanolla> That place is too offtopic though.
22:59 <taktoa> there's no such thing as "too offtopic" :P
22:59 <MarcelineVQ> it's whatever you want it to be
23:00 <Rembane> Does it become ontopic if it is too off topic?
23:00 <benzrf> h o r s e s h o e t h e o r y
23:01 uuplusu_ joined
23:01 <ExpHP> I wonder, is this topic ontopic? what mysteries!
23:01 <taktoa> homotopic
23:03 splanch joined
23:04 featherlessbiped joined
23:04 kadoban-unreg joined
23:04 <thang1> I really wanna learn Rust, actually
23:04 <geekosaur> wut?
23:05 <thang1> But I'm more focused on learning Haskell now atm. I'm semi-proficient in C-family languages
23:05 <thang1> Also I scrolled up 2 pages and forgot I was contributing to a conversation that probably happened 30 minutes ago lol
23:05 Destol joined
23:05 hamishmack joined
23:05 <ExpHP> "gee, the lag is really bad today"
23:06 <thang1> that damn ping
23:06 butterthebuddha joined
23:06 <* thang1> says as he has a ping time of 5ms to google.com from blazing fucking fast university wifi
23:06 soniku joined
23:07 romank joined
23:08 <benzrf> tfw freezing fucking slow college wifi
23:08 <* thang1> pets benzrf's head in sympathy
23:08 unyu joined
23:09 <thang1> Hmm... currently 10 -> 2.5 MB/s download speeds
23:10 <thang1> The guys doing the wifi network here are actually really smart. They don't cap your internet speed for small downloads so you can install stuff like OS updates or download small videos or whatever super fucking fast
23:10 lgs joined
23:10 <thang1> But they're gonna throttle your 100TB porn downloads down to a reasonable 2.5MB or so
23:11 doomlord joined
23:11 jship joined
23:12 alveric2 joined
23:13 mr_sm1th joined
23:14 hc_ joined
23:14 cschneid_ joined
23:15 Xion_ joined
23:15 aarvar joined
23:16 eschnett joined
23:17 JeanCarloMachado joined
23:18 conal joined
23:18 lambda-11235 joined
23:19 jer1 joined
23:19 smillmorel joined
23:19 bytesighs joined
23:24 moth joined
23:25 splanch joined
23:25 butterthebuddha joined
23:25 moth joined
23:26 ZelteHonor joined
23:26 flatmap13 joined
23:26 JeanCarloMachado joined
23:28 DrMentats left
23:28 nilof joined
23:29 nakal joined
23:30 ludat joined
23:31 blz joined
23:32 erisco joined
23:32 darlan joined
23:34 markasoftware joined
23:34 <erisco> any thoughts on a generalisation of newtype Tree a = Tree [(a, Tree a)] ?
23:34 conal joined
23:34 <mniip> that's a weird tree
23:35 <erisco> say we use bifunctors instead, so newtype X f a = X (f a (X f a))
23:35 <mniip> are you sure that's exactly the structure you want
23:35 <erisco> not sure if that is anything interesting
23:35 <erisco> yup
23:35 <erisco> labeled edges
23:35 <mniip> ok
23:35 <mniip> it's a fixpoint
23:36 <erisco> I already have the program written but I am feeling something more general here
23:36 <mniip> Mu (WriterT a [])
23:36 <mniip> no wait
23:36 <mniip> wrong order
23:37 <mniip> no yes, that's the right order
23:37 doomlord joined
23:38 codesoup joined
23:39 Xion_ left
23:39 hybrid joined
23:39 jer1 joined
23:41 <NickHu> Do I want LoggerT (MaybeT IO a) or MaybeT (LoggerT IO a)?
23:41 Gurkenglas_ joined
23:41 <NickHu> Or maybe (MonadIO m, MonadLogger m, MonadMaybe m) => m a
23:42 <erisco> mniip, isn't that a kind error? WriterT is missing an argument
23:42 <glguy> NickHu: That's up to you, depends if you want the log if the MaybeT layer ends in failure
23:42 <glguy> NickHu: also the first two were kind errors
23:42 <mniip> erisco, so?
23:42 <glguy> erisco: It's supposed to be missing that last argument so that it has kind * -> *
23:43 <erisco> then I have the wrong definition of Mu
23:43 <mniip> "missing an argument" it isn't a type family
23:43 <mniip> newtype Mu f = In { out :: f (Mu f) }
23:43 <erisco> yup the one I got was different, heh
23:43 <erisco> so it is just another name for Fix, then
23:45 markus1189 joined
23:46 markus1199 joined
23:46 <erisco> that's another possibility but I am not sure what implications we have then
23:46 cschneid_ joined
23:47 <ZelteHonor> If I have question about parser combinator, can someone answer me?
23:47 <pacak> Foldable instance for (,) at haskell cafe, round 2, fight....
23:47 forgottenone joined
23:47 <NickHu> glguy: Just to check my intuition, the first one is the one which can log MaybeT failure right?
23:48 <glguy> NickHu: No
23:49 <erisco> O
23:50 Achylles joined
23:50 <NickHu> oh right yes, more inwards is towards the bottom of the stack
23:50 <geekosaur> ZelteHonor, probably best just to ask it
23:50 <erisco> I'd be tempted to say X m f = X (m (f (X m f))) but then it is essentially Fix
23:50 theDon_ joined
23:51 <erisco> it had been a bit frustrating... there are these subtly different tree-like types and it feels like there should be a way to have all of them
23:51 pera joined
23:52 Costar joined
23:52 <ZelteHonor> I am using a parser combinator library in another language (FParsec in F#). It is inspired by parsec and I feel that I might have better luck here. I am trying to convert à Lex/Yacc based parser of the lambda-calculus. The problem is, the parser use left-recursive grammar. The library does not support that. Is there anything I can do?
23:52 <benzrf> ZelteHonor: you could just use earley or something ;P
23:52 <erisco> mniip, is there anything interesting about such a fixed point? i.e. assuming a monad?
23:52 kadoban joined
23:53 tromp joined
23:53 <erisco> ZelteHonor, yes, you factor out the left recursion
23:53 <Costar> Hi all
23:53 rkazak joined
23:54 robatosan joined
23:54 <benzrf> hi Costar
23:54 <erisco> ZelteHonor, for example S ::= Sa | b we first find all the prefixes S can start with
23:55 <erisco> ZelteHonor, which is clearly b, in this case. then we find all the things that can follow, which is a repetition of a's
23:55 <ZelteHonor> Would it help showing the Yacc grammar?
23:55 <Costar> hi benzrf
23:56 <ZelteHonor> http://lpaste.net/355169
23:56 <erisco> ZelteHonor, so we get S ::= bT; T ::= aT | ε
23:57 bigos_ joined
23:57 sellout- joined
23:57 jathan joined
23:57 <erisco> I don't know Yacc grammars, but if you follow the method I described (admittedly vaguely) then you can figure it out
23:58 kadoban-unreg left
23:59 infinity0 joined
23:59 <erisco> oops I goofed, it should be T ::= aT | a
23:59 <erisco> that's an off-by-one error for grammars I suppose :P
23:59 <monochrom> "S ::= Sa | b" can be rewritten as "S ::= (a*)b". You can then use "many a >> b".
23:59 jer1 joined
23:59 <glguy> you mean b(a*)?
23:59 <erisco> you have it backwards monochrom