Home liberachat/#haskell: Logs Calendar

Logs on 2021-10-14 (liberachat/#haskell)

00:00:06 × hyiltiz quits (~quassel@31.220.5.250) (Ping timeout: 245 seconds)
00:00:58 × hippoid quits (~idris@184.105.6.88) (Quit: leaving)
00:01:14 idris joins (~idris@184.105.6.88)
00:04:40 × Stotteren quits (~Stotteren@pool-108-20-79-41.bstnma.fios.verizon.net) (Remote host closed the connection)
00:06:33 hyiltiz joins (~quassel@31.220.5.250)
00:06:39 <idris> can someone give me a hint for the Node case for defining a functor on a tree? https://paste.tomsmeding.com/W7jWvHNw
00:06:55 <idris> a question from typeclassopedia
00:08:00 zaquest joins (~notzaques@5.128.210.178)
00:09:30 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
00:09:30 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
00:09:30 wroathe joins (~wroathe@user/wroathe)
00:09:34 <ski> you'll need to use `Node' in the result, of course
00:09:45 × tdaeayusr^ quits (~tdaeayusr@70.166.66.234) (Ping timeout: 265 seconds)
00:10:09 <ski> (also, you're missing a pair of brackets, in the pattern)
00:10:28 × emf quits (~emf@2620:10d:c090:400::5:c416) (Quit: emf)
00:10:50 <ski> fixing that, you're only handling non-empty lists .. .. maybe it would be better to not match on the structure of the list here ?
00:12:19 <idris> ski: im going to ponder on that
00:12:46 <ski> (there are multiple ways to go about it .. some might be nicer than others)
00:13:29 MQ-17J joins (~MQ-17J@2607:fb90:1d89:67a9:1cd1:a18:a57f:e102)
00:17:32 × MQ-17J quits (~MQ-17J@2607:fb90:1d89:67a9:1cd1:a18:a57f:e102) (Read error: Connection reset by peer)
00:17:50 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
00:18:10 <idris> is there a way to destructure the a Node to get at the `a` in ITree in the pattern itself?
00:18:48 <ski> that's what you're doing in your paste (modulo the bracketting mistake)
00:19:24 × Neuromancer quits (~Neuromanc@user/neuromancer) (Ping timeout: 265 seconds)
00:19:25 <ski> however .. "is there a way to destructure a list to get at the element(s) of the list ?"
00:20:30 <idris> the (x:xs) syntax, and then recursion?
00:20:43 <ski> (perhaps even : "is there a way to do the same thing to all elements of a list ?")
00:21:26 × Tuplanolla quits (~Tuplanoll@91-159-69-50.elisa-laajakaista.fi) (Quit: Leaving.)
00:21:26 <ski> that's one way. (my last questions hints at another way to think about it)
00:21:48 <idris> yeah, I had some thought like that - 'fmap f Node xs = Node (map f xs)'
00:22:23 × Psybur quits (~Psybur@mobile-166-170-32-197.mycingular.net) (Remote host closed the connection)
00:22:37 <idris> but is not correct, but I think that's closer to your hints
00:22:42 <ski> yea .. except `xs' is not a list of `a's, but a list of `ITree a's .. so you can't pass `f' to `map' expecting it to call it on every element of `xs', since that doesn't work
00:23:00 <ski> instead, you have to .. *mumble* *mumble*
00:23:41 <idris> hmm. seems like another fmap
00:24:23 <ski> (`f' is a function converting `a's to `b's, remember. it doesn't accept a whole `ITree a' as input .. what would be comfortable with working on an `ITree a' ?)
00:25:19 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
00:25:32 <idris> ummm, fmap?
00:25:40 <ski> maybe ?
00:25:46 <idris> haha
00:25:49 <ski> (perhaps you can explain ?)
00:25:49 × chexum_ quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
00:26:06 chexum joins (~quassel@gateway/tor-sasl/chexum)
00:27:06 <idris> "what would be comfortable working on an ITree a"... where this pattern is working on a [ITree a]
00:27:25 <idris> maybe a case pattern on the right side is what I need
00:28:03 <ski> well, you could try that as well
00:28:23 <koz> Is it possible to construct a tasty option that is just a flag? I.e., instead of '--my-option=foo' it's just '--my-option'?
00:28:42 <idris> ski: you're cluing me that there's a better way
00:30:13 <ski> it's good to have multiple approaches in ones arsenal of problem attack, and to become better accquainted with their relative strengths, trade-offs, preconditions, effects
00:30:52 <idris> ok, you've given some great hints. Time to try a bunch of stuff. Thanks
00:31:12 <idris> ski++
00:31:17 <ski> sometimes, banging one's head on a thing, for a while, exploring several avenues, is a better worth of one's while, than being served the (or rather, one particular) answer
00:31:23 ski twitches
00:31:31 <idris> agreed
00:31:49 <ski> (of course, if you're stuck, or if you want a proper explanation, feel free to ask for that)
00:31:54 <idris> thank you for NOT giving me the exact answer
00:34:06 emf joins (~emf@2620:10d:c090:400::5:c416)
00:34:23 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
00:39:34 brainfreeze joins (~brainfree@2a03:1b20:4:f011::20d)
00:39:37 <jollygood2> @hoogle [a] -> [(a, Int)]
00:39:38 <lambdabot> Test.LeanCheck.Stats counts :: Eq a => [a] -> [(a, Int)]
00:39:38 <lambdabot> Test.Speculate.Utils counts :: Eq a => [a] -> [(a, Int)]
00:39:38 <lambdabot> ELynx.Tools sortListWithIndices :: Ord a => [a] -> [(a, Int)]
00:39:47 <jollygood2> is there something like that in base?
00:39:55 <jollygood2> or similar
00:40:08 <awpr> `zip [0..]`
00:40:25 × alx741 quits (~alx741@186.178.108.69) (Ping timeout: 252 seconds)
00:40:32 <awpr> or with `flip` to make the order match
00:41:17 <ski> possibly that's not the intended semantics ?
00:41:21 <jollygood2> sorry, I wasn't clear, I want to get the count of identical elements
00:41:25 ski nods
00:42:10 <awpr> ah, okay. can cobble something together with `Data.IntMap.fromListWith`, but it won't be as convenient as a pre-made function
00:42:25 <awpr> `Data.Map.fromListWith`
00:42:46 <geekosaur> nothing premade but I think you can construct one with length, group, and sort
00:42:52 <xsperry> > (map (head &&& length) . group . sort) ["foo", "bar", "foo"]
00:42:54 <lambdabot> [("bar",1),("foo",2)]
00:45:22 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds)
00:45:45 <ski> i guess one could also search for "bag" or "multiset"/"multi-set"
00:48:14 lavaman joins (~lavaman@98.38.249.169)
00:49:14 <Axman6> I always called that ahistogram
00:50:18 <Axman6> % data Booly a where Truey :: Booly 'True; Falsey :: Booly 'False
00:50:18 <yahb> Axman6:
00:50:25 <Axman6> % :T Truey
00:50:25 <yahb> Axman6: unknown command ':T'; use :? for help.
00:50:28 <Axman6> % :t Truey
00:50:28 <yahb> Axman6: Booly 'True
00:52:28 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 252 seconds)
00:53:02 alx741 joins (~alx741@181.196.69.128)
00:54:17 <ski> hm, well, "histogram" entered my mind, but afaik, the word is used when you have some given partition of the possible data points, not necessarily the identity equivalence relation / the finest partition, so ..
00:57:03 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
00:57:03 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
00:57:03 wroathe joins (~wroathe@user/wroathe)
00:57:22 haskellchap joins (~haskellch@84-115-222-182.cable.dynamic.surfer.at)
00:59:47 <haskellchap> Hello everyone. Can anyone tell me how come this https://pastebin.com/raw/bJkmarBp program does not work when compiled with -XStrict .
01:00:05 <haskellchap> I get the error "How?" executed, even though branch is not True
01:00:42 <haskellchap> Without -XStrict the program works fine.
01:01:19 × hyiltiz quits (~quassel@31.220.5.250) (Ping timeout: 252 seconds)
01:01:36 × funsafe quits (~funsafe@2601:1c1:4200:e53:2875:5507:42e4:4e14) (Read error: Connection reset by peer)
01:01:39 <awpr> that's kind of the definition of `-XStrict`. it makes the data constructor `P` strict, which means the error gets forced as part of constructing the `P`
01:01:52 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds)
01:01:57 <ski> try `ff = M.state (\_ -> error "How ?")'
01:02:34 <haskellchap> The code runs up to the branch and then throws error
01:03:55 <ski> hm, what if you add say `() <- ()' before the `let' ?
01:04:16 <ski> er, make that `() <- return ()', of course
01:05:45 × brettgilio quits (~brettgili@x-node.gq) (Quit: Leaving...)
01:05:48 <haskellchap> I mean, your M.state suggestion works. The code no longer throws and putting f below g will throw it.
01:05:49 <ski> hm, sorry, i should be more specific. before the second `let' (after the second `do'). (i forgot that there was a first `let')
01:06:14 <haskellchap> the M.state works even if let P{f,g} is there. If f is not called there is no throw.
01:06:21 <monochrom> What awpr said. You just need to understand: without Strict, but with "data P = P { f :: !(SM ()), g :: !(SM ())}", that is enough strictness to cause the bottom.
01:06:21 funsafe joins (~funsafe@2601:1c1:4200:e53:2875:5507:42e4:4e14)
01:06:39 × nitrix quits (~nitrix@user/nitrix) (Quit: Genius is one percent inspiration and ninety-nine percent perspiration)
01:07:26 <monochrom> See also my http://www.vex.net/~trebla/haskell/strict-field.xhtml
01:07:37 ski idly wonders how it was established that the code runs up to the branch
01:07:45 awpr too
01:07:49 × lbseale quits (~lbseale@user/ep1ctetus) (Read error: Connection reset by peer)
01:08:40 <monochrom> My theory is instead:
01:08:42 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
01:08:43 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
01:08:43 wroathe joins (~wroathe@user/wroathe)
01:09:07 <haskellchap> Interesting. In my real example the code was running and then threw error, even though the P was constructed at the top level there too.
01:09:27 <monochrom> "s <- M.get", even with State.Lazy, causes the preceding "g" to be seq'ed.
01:09:44 brettgilio joins (~brettgili@x-node.gq)
01:10:16 <monochrom> If g is seq'ed, then it causes the d in "P{g} = d" to be seq'ed.
01:10:51 <monochrom> If d is seq'ed, then Strict or "data = ... ! ..." causes its f field to be seq'ed, which means ff.
01:11:15 <monochrom> It totally doesn't matter whether s==4 or s/=4.
01:11:20 <haskellchap> Yep, I get it, I read the link and yes, I evaluate the parent definitely.
01:11:27 <haskellchap> Thanks for the explanation.
01:11:39 × o1lo01ol1o quits (~o1lo01ol1@2001:8a0:6d7a:df01:74db:7502:a3aa:3820) (Read error: Connection reset by peer)
01:12:06 hyiltiz joins (~quassel@31.220.5.250)
01:12:31 o1lo01ol1o joins (~o1lo01ol1@2001:8a0:6d7a:df01:74db:7502:a3aa:3820)
01:12:34 tabemann joins (~tabemann@2600:1700:7990:24e0:5901:20e0:5666:a3ee)
01:14:00 nitrix joins (~nitrix@user/nitrix)
01:16:25 × haskellchap quits (~haskellch@84-115-222-182.cable.dynamic.surfer.at) (Ping timeout: 256 seconds)
01:19:58 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
01:24:34 MQ-17J joins (~MQ-17J@8.6.144.117)
01:26:24 nitrix is now known as nitrix-or-treat
01:36:55 wrengr is now known as wrengr_away
01:37:57 [_] joins (~itchyjunk@user/itchyjunk/x-7353470)
01:40:22 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 252 seconds)
01:44:51 Neuromancer joins (~Neuromanc@user/neuromancer)
01:46:40 theproffesor joins (~theproffe@user/theproffesor)
01:49:52 × YoungChiefBTW quits (~youngchie@2001:470:69fc:105::214c) (Changing host)
01:49:52 YoungChiefBTW joins (~youngchie@user/youngchiefbtw)
01:53:43 [_] is now known as [itchyjunk]
01:53:51 × hyiltiz quits (~quassel@31.220.5.250) (Ping timeout: 245 seconds)
01:58:12 <jollygood2> does this seem reasonable way to avoid "Pattern match(es) are non-exhaustive" warning? do c <- oneOf "xyz"; case c of X -> � Y -> � _ error "parseXYZ: can't happen!"
01:58:31 <jollygood2> case c of 'x' � even
01:59:07 × jinsun quits (~quassel@user/jinsun) (Read error: Connection reset by peer)
02:01:28 <pavonia> Your syntax seems a bit mixed up, but I guess you mean the right thing
02:01:44 <jollygood2> it is possible, I typed it in irc client
02:02:11 × xff0x quits (~xff0x@2001:1a81:53d3:ff00:5c0b:f69b:2ab5:cb4c) (Ping timeout: 245 seconds)
02:02:20 <jollygood2> anyway, does error seem like a reasonable way to handle default case, that can't happen?
02:03:15 <ski> an alternative would be to use `<|>', i guess
02:04:14 xff0x joins (~xff0x@2001:1a81:5210:a600:f14:89c2:cfb:bd25)
02:04:24 <pavonia> Use error if something really shouldn't happen under any circumstances
02:04:42 hyiltiz joins (~quassel@31.220.5.250)
02:05:11 theproffesor parts (~theproffe@user/theproffesor) (Leaving)
02:05:18 <pavonia> (In this case there should be alternatives for 'y' and 'z')
02:07:11 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 265 seconds)
02:09:07 × bontaq quits (~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 265 seconds)
02:14:20 <dsal> jollygood2: `error` is `undefined` but you get to write an insult next to it.
02:14:44 <dsal> You can generally write much better code without `error` and then not end up sad later. :)
02:14:55 × Neuromancer quits (~Neuromanc@user/neuromancer) (Ping timeout: 265 seconds)
02:15:37 <jollygood2> yes, it has happened to me before that "can't happen" ends up happening anyway :). it really can't happen in here though, I think, but <|> is better yes
02:18:58 wroathe joins (~wroathe@user/wroathe)
02:23:13 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds)
02:23:26 gay joins (~quassel@77-120-141-90.kha.volia.net)
02:25:42 <byorgey> I use the 'error "Can't happen"' thing way too often, I guess. It has been an enlightening experience working on https://github.com/byorgey/swarm/ with the policy that there can be absolutely positively zero uses of 'undefined' or 'error', because if the game crashes it means a user loses all their progress.
02:26:57 <byorgey> so we have to come up with creative ways of either dealing with all cases gracefully, or reporting an error to the user (but not crashing the game) if something happens that really shouldn't.
02:30:30 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
02:44:23 werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
02:44:50 <dsal> Maybe works for "can't happen" things and composes reasonably well.
02:49:14 × td_ quits (~td@94.134.91.240) (Ping timeout: 265 seconds)
02:50:55 td_ joins (~td@94.134.91.160)
02:50:56 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 245 seconds)
02:52:51 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
02:59:52 × rekahsoft quits (~rekahsoft@52.129.35.150) (Ping timeout: 265 seconds)
03:05:04 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
03:15:18 wyrd joins (~wyrd@70.39.83.14)
03:26:21 × wyrd quits (~wyrd@70.39.83.14) (Quit: leaving)
03:27:56 Neuromancer joins (~Neuromanc@user/neuromancer)
03:30:31 × obfusk_ quits (~quassel@a82-161-150-56.adsl.xs4all.nl) (Ping timeout: 245 seconds)
03:31:10 × nitrix-or-treat quits (~nitrix@user/nitrix) (Quit: Genius is one percent inspiration and ninety-nine percent perspiration)
03:32:39 obfusk joins (~quassel@a82-161-150-56.adsl.xs4all.nl)
03:32:44 nitrix joins (~nitrix@user/nitrix)
03:42:35 wyrd joins (~wyrd@70.39.83.14)
03:44:30 × jess quits (~jess@libera/staff/jess) (Quit: Lost terminal)
03:45:34 jess joins (~jess@libera/staff/jess)
03:49:34 × ystael quits (~ystael@user/ystael) (Ping timeout: 252 seconds)
03:55:06 × shapr quits (~user@pool-100-36-247-68.washdc.fios.verizon.net) (Ping timeout: 245 seconds)
03:55:48 Gurkenglas joins (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de)
04:04:20 × zmt00 quits (~zmt00@user/zmt00) (Quit: Gone.)
04:06:04 zmt00 joins (~zmt00@user/zmt00)
04:08:34 × fizzsegfaultbuzz quits (~segfaultf@135-180-0-138.static.sonic.net) (Ping timeout: 268 seconds)
04:11:05 × emf quits (~emf@2620:10d:c090:400::5:c416) (Quit: emf)
04:13:08 emf joins (~emf@2620:10d:c090:400::5:c416)
04:28:19 × zebrag quits (~chris@user/zebrag) (Remote host closed the connection)
04:29:52 jinsun joins (~quassel@user/jinsun)
04:37:25 × machinedgod quits (~machinedg@135-23-192-217.cpe.pppoe.ca) (Ping timeout: 252 seconds)
04:37:25 × waleee quits (~waleee@h-98-128-228-119.na.cust.bahnhof.se) (Ping timeout: 252 seconds)
04:44:46 coot joins (~coot@37.30.52.44.nat.umts.dynamic.t-mobile.pl)
04:49:32 infinity0_ joins (~infinity0@occupy.ecodis.net)
04:49:33 infinity0 is now known as Guest732
04:49:33 × Guest732 quits (~infinity0@occupy.ecodis.net) (Killed (copper.libera.chat (Nickname regained by services)))
04:49:33 infinity0_ is now known as infinity0
04:51:10 falafel joins (~falafel@2603-8000-d800-688c-c469-52c4-b20d-779e.res6.spectrum.com)
05:05:31 × MQ-17J quits (~MQ-17J@8.6.144.117) (Ping timeout: 252 seconds)
05:06:14 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
05:09:24 × Neuromancer quits (~Neuromanc@user/neuromancer) (Ping timeout: 265 seconds)
05:20:16 × emf quits (~emf@2620:10d:c090:400::5:c416) (Quit: emf)
05:26:24 mbuf joins (~Shakthi@122.178.118.100)
05:27:47 × slowButPresent quits (~slowButPr@user/slowbutpresent) (Quit: leaving)
05:29:03 abrantesasf joins (~abrantesa@187.36.170.211)
05:30:09 × abrantesasf quits (~abrantesa@187.36.170.211) (Remote host closed the connection)
05:31:13 abrantesasf joins (~abrantesa@187.36.170.211)
05:31:47 × abrantesasf quits (~abrantesa@187.36.170.211) (Remote host closed the connection)
05:32:55 × aegon quits (~mike@174.127.249.180) (Remote host closed the connection)
05:33:28 even4void parts (even4void@came.here.for-some.fun) ()
05:35:43 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
05:36:37 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer)
05:38:45 lavaman joins (~lavaman@98.38.249.169)
05:39:38 × falafel quits (~falafel@2603-8000-d800-688c-c469-52c4-b20d-779e.res6.spectrum.com) (Remote host closed the connection)
05:39:53 falafel joins (~falafel@2603-8000-d800-688c-c469-52c4-b20d-779e.res6.spectrum.com)
05:43:08 × obfusk quits (~quassel@a82-161-150-56.adsl.xs4all.nl) (Quit: No Ping reply in 180 seconds.)
05:43:14 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 265 seconds)
05:44:17 obfusk joins (~quassel@a82-161-150-56.adsl.xs4all.nl)
05:46:32 takuan joins (~takuan@178-116-218-225.access.telenet.be)
05:53:59 carbolymer_ is now known as carbolymer
05:54:33 ubert joins (~Thunderbi@77.119.175.120.wireless.dyn.drei.com)
05:57:04 × mjs2600 quits (~mjs2600@c-24-91-3-49.hsd1.vt.comcast.net) (Quit: ZNC 1.8.2 - https://znc.in)
05:57:19 mjs2600 joins (~mjs2600@c-24-91-3-49.hsd1.vt.comcast.net)
06:04:15 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 276 seconds)
06:05:06 azimut joins (~azimut@gateway/tor-sasl/azimut)
06:12:30 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
06:20:06 × vjoki quits (~vjoki@2a00:d880:3:1::fea1:9ae) (Ping timeout: 245 seconds)
06:21:16 vjoki joins (~vjoki@2a00:d880:3:1::fea1:9ae)
06:25:28 jakalx parts (~jakalx@base.jakalx.net) ()
06:26:56 dhouthoo joins (~dhouthoo@178-117-36-167.access.telenet.be)
06:27:58 dschrempf joins (~dominik@070-207.dynamic.dsl.fonira.net)
06:35:27 Neuromancer joins (~Neuromanc@user/neuromancer)
06:37:11 × falafel quits (~falafel@2603-8000-d800-688c-c469-52c4-b20d-779e.res6.spectrum.com) (Ping timeout: 245 seconds)
06:38:18 jakalx joins (~jakalx@base.jakalx.net)
06:39:01 × brainfreeze quits (~brainfree@2a03:1b20:4:f011::20d) (Quit: Leaving)
06:41:46 fendor joins (~fendor@178.115.40.84.wireless.dyn.drei.com)
06:51:43 lortabac joins (~lortabac@2a01:e0a:541:b8f0:d23a:63c3:dec2:f7ab)
06:51:56 visortelle joins (~visortell@37.214.28.39)
06:52:38 × visortelle quits (~visortell@37.214.28.39) (Remote host closed the connection)
06:58:59 <dminuoso> byorgey: Perhaps this is an argument that for non-trivial code with "cant happen cases" being in IO is not such a bad idea.
07:07:52 × wyrd quits (~wyrd@70.39.83.14) (Quit: leaving)
07:08:03 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
07:08:06 <tdammers> I think it fits in nicely with the "small dangerous trusted core in IO, large trustworthy well-typed pure code to deal with all the complex logic" design
07:08:11 wyrd joins (~wyrd@70.39.83.14)
07:08:44 max22- joins (~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr)
07:09:22 × wyrd quits (~wyrd@70.39.83.14) (Client Quit)
07:09:31 chele joins (~chele@user/chele)
07:10:03 wyrd joins (~wyrd@70.39.83.14)
07:11:00 jtomas_ joins (~jtomas@95.red-88-11-64.dynamicip.rima-tde.net)
07:15:17 × thonkpod quits (~thonkpod@user/thonkpod) (Ping timeout: 246 seconds)
07:15:37 × jollygood2 quits (~bc8165b6@217.29.117.252) (Quit: http://www.okay.uz/ (Session timeout))
07:15:43 thonkpod joins (~thonkpod@user/thonkpod)
07:17:30 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
07:18:17 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
07:21:53 jinsun__ joins (~quassel@user/jinsun)
07:22:32 × wyrd quits (~wyrd@70.39.83.14) (Quit: leaving)
07:23:32 × econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity)
07:24:09 gehmehgeh joins (~user@user/gehmehgeh)
07:25:06 × jinsun quits (~quassel@user/jinsun) (Ping timeout: 245 seconds)
07:28:30 wyrd joins (~wyrd@gateway/tor-sasl/wyrd)
07:30:09 michalz joins (~michalz@185.246.204.93)
07:30:16 × hnOsmium0001 quits (uid453710@id-453710.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
07:30:40 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
07:33:10 ubert1 joins (~Thunderbi@77.119.175.120.wireless.dyn.drei.com)
07:33:50 × wyrd quits (~wyrd@gateway/tor-sasl/wyrd) (Quit: leaving)
07:34:04 wyrd joins (~wyrd@gateway/tor-sasl/wyrd)
07:34:23 × wyrd quits (~wyrd@gateway/tor-sasl/wyrd) (Client Quit)
07:35:34 wyrd joins (~wyrd@gateway/tor-sasl/wyrd)
07:35:38 oxide joins (~lambda@user/oxide)
07:40:01 cfricke joins (~cfricke@user/cfricke)
07:45:27 × azeem quits (~azeem@2a00:801:238:8585:a976:a6c:e179:1344) (Read error: Connection reset by peer)
07:45:44 azeem joins (~azeem@emp-85-170.eduroam.uu.se)
07:46:33 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
07:46:45 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
07:52:25 kuribas joins (~user@ip-188-118-57-242.reverse.destiny.be)
07:55:08 acidjnk_new joins (~acidjnk@p200300d0c703cb2624cf652eb5c49df1.dip0.t-ipconnect.de)
07:55:12 <dminuoso> tdammers: In part yes, though if you have these "impossible cant happen" situations in pure code, this results in one of several problems
07:55:28 × o1lo01ol1o quits (~o1lo01ol1@2001:8a0:6d7a:df01:74db:7502:a3aa:3820) (Remote host closed the connection)
07:56:05 <dminuoso> Encoding these error conditions into ADTs can be tricky or annoying at times due to compositionality
07:56:11 × jtomas_ quits (~jtomas@95.red-88-11-64.dynamicip.rima-tde.net) (Quit: Leaving)
07:56:44 <c_wraith> or a massive performance penalty
07:57:41 <dminuoso> Heh, was going to say that too.
07:58:06 <dminuoso> It's not a reason not to do this, but it can present challenges
07:58:39 <kuribas> just put some property tests on it to prove the invariant.
08:01:27 <kuribas> It just depends on how much the problem solves vs the effort required.
08:01:47 <c_wraith> I'm thinking of a particularly knotty bit of code I wrote... I think getting rid of the call to error completely invalidates the reason the code exists.
08:03:22 <dminuoso> Plus, you *can* catch error in IO
08:04:20 <dminuoso> Perhaps we should just use more `evaluate`
08:04:26 <c_wraith> also, it doesn't really help with the actual problem in that code, which is that if the circular reference is allowed to close, you get a self-referential thunk. No data type can fix *that* problem.
08:05:25 <dminuoso> c_wraith: Oh but that's not true!
08:05:36 <dminuoso> Pointers are magic
08:05:43 <kuribas> c_wraith: do you want to avoid self-referencing?
08:05:59 <kuribas> c_wraith: couldn't you use a monad to generate it?
08:06:12 <c_wraith> no. not even close.
08:07:20 <c_wraith> https://gist.github.com/chowells79/996f2749b088d287937e3eff11055522
08:09:08 × tzh quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz)
08:09:48 hendursa1 joins (~weechat@user/hendursaga)
08:10:21 × hendursaga quits (~weechat@user/hendursaga) (Ping timeout: 276 seconds)
08:10:56 <kuribas> c_wraith: could you make an intermediate, not self-referencial version, which you then validate and convert to tie the knot?
08:11:13 <c_wraith> that would entirely defeat the purpose
08:11:35 <kuribas> looks like an interesting problem, but I am busy right now...
08:11:38 <c_wraith> as it would add back all the overhead that's being eliminated by making them the same in the first place
08:13:26 <kuribas> I could look at it this evening, or tomorrow.
08:16:55 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Read error: Connection reset by peer)
08:17:36 geekosaur joins (~geekosaur@xmonad/geekosaur)
08:18:11 o1lo01ol1o joins (~o1lo01ol1@2001:8a0:6d7a:df01:74db:7502:a3aa:3820)
08:18:44 ub joins (~Thunderbi@178.115.37.32.wireless.dyn.drei.com)
08:19:37 × ubert1 quits (~Thunderbi@77.119.175.120.wireless.dyn.drei.com) (Ping timeout: 252 seconds)
08:20:06 × ubert quits (~Thunderbi@77.119.175.120.wireless.dyn.drei.com) (Ping timeout: 245 seconds)
08:20:06 ub is now known as ubert
08:26:58 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:ac5a:4bd6:3f7c:fb35) (Remote host closed the connection)
08:30:04 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
08:31:14 MQ-17J joins (~MQ-17J@8.6.144.117)
08:33:23 × max22- quits (~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr) (Remote host closed the connection)
08:33:51 × werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 265 seconds)
08:34:10 max22- joins (~maxime@2a01cb0883359800f335681c9791beec.ipv6.abo.wanadoo.fr)
08:52:20 × o1lo01ol1o quits (~o1lo01ol1@2001:8a0:6d7a:df01:74db:7502:a3aa:3820) (Remote host closed the connection)
08:52:54 Pickchea joins (~private@user/pickchea)
08:52:57 o1lo01ol1o joins (~o1lo01ol1@2001:8a0:6d7a:df01:74db:7502:a3aa:3820)
08:54:59 × o1lo01ol1o quits (~o1lo01ol1@2001:8a0:6d7a:df01:74db:7502:a3aa:3820) (Remote host closed the connection)
08:55:13 o1lo01ol1o joins (~o1lo01ol1@2001:8a0:6d7a:df01:74db:7502:a3aa:3820)
08:58:27 fendor_ joins (~fendor@77.119.208.38.wireless.dyn.drei.com)
09:00:56 × fendor quits (~fendor@178.115.40.84.wireless.dyn.drei.com) (Ping timeout: 245 seconds)
09:02:47 × o1lo01ol1o quits (~o1lo01ol1@2001:8a0:6d7a:df01:74db:7502:a3aa:3820) (Remote host closed the connection)
09:03:27 o1lo01ol1o joins (~o1lo01ol1@2001:8a0:6d7a:df01:74db:7502:a3aa:3820)
09:04:10 × dolio quits (~dolio@130.44.130.54) (Ping timeout: 252 seconds)
09:05:11 dolio joins (~dolio@130.44.130.54)
09:10:09 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 276 seconds)
09:20:01 mestre joins (~mestre@191.177.175.57)
09:21:20 tdaeayusr^ joins (~tdaeayusr@70.166.66.234)
09:25:15 trillp joins (~trillp@69.233.98.238)
09:26:03 × Pickchea quits (~private@user/pickchea) (Ping timeout: 265 seconds)
09:27:24 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:ac5a:4bd6:3f7c:fb35)
09:32:00 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:ac5a:4bd6:3f7c:fb35) (Ping timeout: 265 seconds)
09:33:19 × dschrempf quits (~dominik@070-207.dynamic.dsl.fonira.net) (Ping timeout: 252 seconds)
09:34:13 × Kaiepi quits (~Kaiepi@156.34.44.192) (Read error: Connection reset by peer)
09:34:25 mei6 joins (~mei@user/mei)
09:34:28 Kaiepi joins (~Kaiepi@156.34.44.192)
09:37:02 × acidjnk_new quits (~acidjnk@p200300d0c703cb2624cf652eb5c49df1.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
09:43:26 timCF joins (~timCF@200-149-20-81.sta.estpak.ee)
09:46:01 × tdaeayusr^ quits (~tdaeayusr@70.166.66.234) (Ping timeout: 252 seconds)
09:48:10 × MQ-17J quits (~MQ-17J@8.6.144.117) (Ping timeout: 252 seconds)
09:48:20 <timCF> Hello! Does anyone have an idea how I could get a some sort of a list/graph/tree of Async processes currently running with information about how they are related to each other, structured and linked? Basically I'm looking for experience similar to Erlang "observer" tool, but in form of data which I can programmatically handle - send some mertics to monitoring services etc.
09:51:45 <sshine> timCF, as far as I remember, Erlang's spawn_link creates a child process and grants the parent process certain runtime privileges for monitoring if the process died, and killing child processes.
09:53:05 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
09:53:23 <sshine> timCF, I don't know exactly how spawn_monitor is implemented, though. but maybe it happens by wrapping the function that the child process runs inside another function that handles monitoring requests?
09:54:31 <sshine> timCF, did you see https://hackage.haskell.org/package/distributed-process ?
09:56:56 <sshine> timCF, judging by the 2018 timestamp, I don't know how popular it is.
09:57:29 × Neuromancer quits (~Neuromanc@user/neuromancer) (Remote host closed the connection)
09:57:30 <timCF> sshine: yeah, I'm ex-Erlang programmer, and I did transfered a lot of ideas from it to my current Haskell development experience. Including linking spawned processes. Async libarary provides experience pretty close to low-level OTP functions like spawn and link. I do have some sort of generic supervisor trees implemented in terms of Async, and it mostly works. Just thinking that it might be very cool to
09:57:36 <timCF> visualize it, and use for some metrics
09:57:38 bontaq joins (~user@ool-45779fe5.dyn.optonline.net)
09:58:34 × LiaoTao quits (~LiaoTao@gateway/tor-sasl/liaotao) (Remote host closed the connection)
09:58:55 <timCF> sshine: distributed-process seems overkill, they do focus a lot on distributed Erlang-like features, which is pretty hard thing to do right
09:59:06 LiaoTao joins (~LiaoTao@gateway/tor-sasl/liaotao)
09:59:32 <sshine> yeah, it seems like they try to embed a large part of Erlang into Haskell, rather than use similar design patterns.
09:59:44 <sshine> or rather, create a large framework for replicating those design patterns.
10:00:19 <sshine> timCF, I suppose you could create a monitoring process that kept information about the processes it monitors, and have those types of monitoring processes contain the list/graph/tree data for visualising. does sound kinda frameworkey, though. :)
10:00:45 <sshine> sounds like a partial OTP implementation, hehe.
10:01:22 <sshine> timCF, did you see https://hackage.haskell.org/package/nqe then?
10:01:40 <timCF> sshine: in my opinion distributed Erlang features do have low demand and utility, and at the same time very hard to implement right. But dynamic supervision trees are actually very useful and practical, and simpler to implement)
10:01:49 jinsun__ is now known as jinsun
10:02:05 <timCF> sshine: I'll check it, thanks)
10:03:06 <sshine> timCF, it specifically has a Control.Concurrent.NQE.Supervisor module.
10:03:13 <sshine> timCF, and it doesn't seem very huge.
10:03:30 <sshine> timCF, and jprupp made it in 2020. :)
10:03:40 jollygood2 joins (~bc8165b6@217.29.117.252)
10:06:16 <jollygood2> hi. is there a way to do this without as much boilerplate?
10:06:37 <jollygood2> https://paste.tomsmeding.com/3qKex6gT
10:13:03 dyeplexer joins (~dyeplexer@user/dyeplexer)
10:13:26 <timCF> jollygood2: Looks like `uncurry` might do the job
10:13:44 <jollygood2> :t uncurry
10:13:45 <lambdabot> (a -> b -> c) -> (a, b) -> c
10:13:57 <jollygood2> hmm, how?
10:14:56 __monty__ joins (~toonn@user/toonn)
10:16:06 <timCF> jollygood2: I thought it might be useful to uncurry function of multiple arguments somehow
10:16:47 <jollygood2> yeah it seems similar, but I have list as an input, not a tuple
10:20:21 <timCF> jollygood2: well, you can't use fold to gradually apply arguments one by one, because accumulator needs to be the same type
10:21:11 <[exa]> jollygood2: there's a function called chunksOf or similarly that cuts the list into parts; then you'll either need to patternmatch the [a,b,c,d,e] manually or use some var-arg magic, such as the one in Text.Printf
10:21:23 <timCF> jollygood2: but you can recursively apply, decomposing list with pattern matching, and expressing your apply-like functions in terms of each other
10:22:33 <timCF> jollygood2: for example `apply5 f (x : xs) = apply4 (f x) xs`
10:23:31 <[exa]> anyway, using !! is discouraged. apply5 f (a:b:c:d:e:xs) = f a b c d e` is much less troublesome
10:28:32 <sshine> :t ap
10:28:33 <lambdabot> Monad m => m (a -> b) -> m a -> m b
10:29:50 <sshine> jollygood2, you have some functions liftM, liftM2, liftM3, etc. that share a similar cascading effect: https://hackage.haskell.org/package/base-4.15.0.0/docs/Control-Monad.html#g:7
10:29:55 <jollygood2> this worked apply5 f xs = apply4 f (dropFromEnd 1 xs) (last xs)
10:30:35 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
10:31:11 <jollygood2> not sure if it is much clearer. and I could pattern match instead, like [exa] said. but then what do I do if there aren't enough elements? return error? throw exception?
10:31:57 <jollygood2> sshine I'm familiar with liftM, but I'm not sure how I could use that function for this
10:32:10 <jollygood2> those functions*
10:32:32 × timCF quits (~timCF@200-149-20-81.sta.estpak.ee) (Quit: leaving)
10:34:10 <sshine> jollygood2, oh, hm. I'm beginning to see what you're trying to accomplish. you're trying to implement variadic functions, aren't you? i.e. functions with a number of arguments that vary at runtime.
10:34:52 Neuromancer joins (~Neuromanc@user/neuromancer)
10:34:52 <sshine> jollygood2, this is hard to do safely without dependent types, because you may at any point not have as many arguments as you assume.
10:35:57 <jollygood2> no I am not implementing variadic function. I have constructors that take different number of arguments, and a list of those arguments. code that precedes construction, that tests for some behavior, should ensure that I have the right number of arguments
10:36:34 <jollygood2> I just wanted to avoid cluttering the logic code with Constructor (x !! 0) (x !! 1) (x !! 2) (x !! 3) (x !! 4)
10:36:47 <jollygood2> vs apply5 Constructor xs
10:37:21 <sshine> jollygood2, did you read https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/ ? -- you want to end up in a state where, if you've asserted that you have the right amount of values, then the types prevent any other scenario.
10:37:30 <sshine> !! does not prevent any other scenario :)
10:37:31 <jollygood2> and, out of curiosity, I was wondering if there was a nicer way to implement apply* functions
10:38:11 <sshine> jollygood2, seems like an x-y problem. maybe if you showed what problem you're trying to solve with apply2, apply3, apply4, that problem can be remodelled to not need unsafe variadic functions.
10:39:29 <jollygood2> here's a short example that will, hopefully, make it clear what I'm doing. https://paste.tomsmeding.com/KzM7LiOJ
10:41:08 <jollygood2> includes HandValue definition: https://paste.tomsmeding.com/QSYLVhro
10:43:17 <jollygood2> [Card] includes both player's hole cards, and table cards. it would be ideal to use types to ensure invalid state can't happen, but I have no clue how I'd do that
10:43:27 acidjnk_new joins (~acidjnk@p200300d0c703cb2624cf652eb5c49df1.dip0.t-ipconnect.de)
10:47:46 dschrempf joins (~dominik@070-207.dynamic.dsl.fonira.net)
10:49:49 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
10:49:51 <sshine> jollygood2, sounds like [exa]'s suggestion of pattern matching is right. to answer your question, "what do I do if tehere aren't enough elements?" -- you want to catch that early on, not drag potentially-too-short lists around after a point where you've validated their length.
10:50:25 <jollygood2> that is what I was thinking as well, catch that during parsing, and then assume I have enough elements, to simplify logic code
10:50:42 <jollygood2> does apply* seem appropriate in here?
10:51:38 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
10:51:59 <sshine> jollygood2, could you post the HandValue type?
10:52:29 <jollygood2> it is on the second link. https://paste.tomsmeding.com/QSYLVhro
10:52:36 <sshine> thanks
10:52:36 × o1lo01ol1o quits (~o1lo01ol1@2001:8a0:6d7a:df01:74db:7502:a3aa:3820) (Ping timeout: 245 seconds)
10:53:32 <sshine> jollygood2, btw, I'm fairly certain that Texas Hold'em doesn't have five kickers in the NoPair case. you have one kicker, and if they're equal, it's a draw.
10:53:44 <lortabac> jollygood2: there is a simpler solution
10:54:03 <lortabac> add a type parameter to HandValue and make it a functor
10:54:18 <lortabac> then you'll get all those apply functions for free with DeriveFunctor
10:54:20 <sshine> haha
10:54:20 <jollygood2> sshine, other 3 to 4 kickers come from the table
10:54:28 <sshine> "There is a simpler solution. Use higher-kinded data!" ;)
10:54:54 <jollygood2> 3 to 5, even. if you have 2 and 3, all the kickers could come from the table
10:55:00 <sshine> jollygood2, so... the table cards are in your hand?
10:55:31 <jollygood2> [Card] in handValue contains both table and hand cards
10:55:42 <jollygood2> lortabac, can you elaborate, I'm not sure I understand
10:56:24 <sshine> jollygood2, my argument (whether it's valid or not) also applies for extending the hand to the table. so if you have two players who have sucky cards on their hands, and they tie for the highest single card on the table, no amount of sucky cards on their hand will make one hand better.
10:56:29 <lortabac> jollygood2: data HandValue a = NoPair a a a a a | OnePair Rank a a a ...
10:56:41 <lortabac> deriving (Functor)
10:56:55 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
10:57:29 <lortabac> but to be honest I haven't followed the whole discussion, so it might not apply to your specific case
10:57:32 <jollygood2> sshine, handValue returns the best possible hand, given your hole cards and table cards. if there's no pair, then there are 5 kickers
10:57:36 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
10:57:55 <jollygood2> highest 5 cards including table and your own cards
10:58:09 <jollygood2> lortabac, I have no clue either, but it seems interesting
10:58:23 <jollygood2> lortabac, not sure if this link helps: https://paste.tomsmeding.com/QSYLVhro
10:58:54 <lortabac> this solution will give you the possibility of mapping over all the Kickers in a HandValue
10:59:23 <lortabac> however if you don't have a HandValue in the first place, that's another problem
11:02:52 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
11:03:32 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
11:03:36 <jollygood2> I don't, I'm mapping [Card] to HandValue
11:05:03 <sshine> >_< I actually have a library for playing cards, but decided not to publish it because one Wikipedia rabbit hole led me to realise that what I believe are "playing cards" are really just "French-suited 52-card playing cards", where there's at least 5 other European types available, haha.
11:08:42 <jollygood2> I am basically trying to rewrite this in pure haskell, for fun. https://hackage.haskell.org/package/poker-eval-0.3.1/docs/Data-Poker.html
11:09:07 Inst joins (~Inst@2601:6c4:4080:3f80:4860:840:17cf:1bbb)
11:10:19 <maralorn> <sshine> ">_< I actually have a library..." <- It's really interesting how for poker or also all popular German card games French cards are the norm. There is even something called "German cards" here but no one knows it.
11:10:43 chexum_ joins (~quassel@gateway/tor-sasl/chexum)
11:10:52 <maralorn> (they are pretty similar though.)
11:10:59 × chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
11:11:13 × Neuromancer quits (~Neuromanc@user/neuromancer) (Ping timeout: 252 seconds)
11:11:47 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
11:11:52 AlexNoo_ joins (~AlexNoo@178.34.163.33)
11:12:01 <sshine> maralorn, I was interested in the Swiss ones because a friend who lives in Switzerland had a really odd looking deck in his home, and his Swiss guests would say that they know games that are only played with those.
11:12:52 <sshine> yeah, they're not really breaking the format. but the picture cards are named differently, and there's a different total amount of each card. some don't have 4 of each kind, but a different amount of different kinds.
11:14:01 × Alex_test quits (~al_test@178.34.161.78) (Ping timeout: 252 seconds)
11:15:00 geekosaur joins (~geekosaur@xmonad/geekosaur)
11:15:07 × AlexZenon quits (~alzenon@178.34.161.78) (Ping timeout: 252 seconds)
11:15:19 × AlexNoo quits (~AlexNoo@178.34.161.78) (Ping timeout: 245 seconds)
11:15:44 <sshine> jollygood2, I can see that you've derived the data type from this library. so, one of the things that I don't like about it is "The following must be true for a HandValue to be valid: All kickers must be in decending order. No Rank may not occur twice. The kickers may not construct higher-value hands." -- those constraints are not actually hard to construct using standard data types. so making a too
11:15:50 <sshine> lenient representation is perhaps only useful for being backwards-compatible with this poker library.
11:16:53 <jollygood2> sshine, how would I construct those constraints in types?
11:17:12 <sshine> jollygood2, e.g. "All kickers must be in descending order": NoPair (Set Kicker)
11:18:31 <jollygood2> ah I see.
11:18:57 <jollygood2> could still form an invalid hand though, but in a different way. you may have less than 5 kickers
11:19:39 <jollygood2> but it still nicer, kickers are sorted, and there it can't contain a pair or greater
11:19:57 Alex_test joins (~al_test@178.34.163.33)
11:21:16 AlexZenon joins (~alzenon@178.34.163.33)
11:23:29 × mestre quits (~mestre@191.177.175.57) (Quit: Lost terminal)
11:23:37 <jollygood2> as far as, say, king of hearts appearing twice, I think that is best handled when filtering input. as far as I can tell there's no way to implement that in types in haskell
11:24:07 <jollygood2> out of curiosity, would this be possible in a language like idris?
11:24:19 <sshine> jollygood2, well, it depends on the kind of poker you're modelling. you could expose one variant in a module with constructors that fail (Either PokerError) when you can't gather five kickers. but the logic for comparing two hands using any amount of kickers is still the same. (and yes, you might end up comparing two Set Kicker with a different amount of elements, and probably your variation of poker in
11:24:25 <sshine> that module doesn't allow different-sized hands, and that'd probably be a corner case you'd rather validate your way out of.)
11:24:43 <hpc> jollygood2: yes
11:24:51 <sshine> yeah. or Haskell with some effort.
11:24:56 <hpc> imagine say, your hand is a list
11:25:35 <hpc> (x :: card) : (xs :: cards1) :: cards2
11:25:45 <hpc> where cards1 can't contain x
11:25:51 <hpc> and cards2 = cards1 plus x
11:26:33 <hpc> well, more like a set than a list
11:27:07 <jollygood2> that looks a bit like peano numbers?
11:28:26 <sshine> more like type-level sets
11:28:41 <sshine> I guess
11:29:45 <hpc> there's probably better ways too, that is a particularly naive solution
11:30:17 <jollygood2> as a practical solution, is what I'm doing ok? just [Card], and apply*
11:30:31 <jollygood2> and ensure input is correct when parsing it
11:32:43 <lortabac> sshine: regarding your library, I have a suggestion: just do the Neapolitan cards, they are the only real playing cards :P
11:38:42 machinedgod joins (~machinedg@135-23-192-217.cpe.pppoe.ca)
11:41:18 lavaman joins (~lavaman@98.38.249.169)
11:43:34 timCF joins (~timCF@200-149-20-81.sta.estpak.ee)
11:45:25 × max22- quits (~maxime@2a01cb0883359800f335681c9791beec.ipv6.abo.wanadoo.fr) (Ping timeout: 260 seconds)
11:45:39 tfeb joins (~tfb@88.98.95.237)
11:46:11 <timCF> Hello! Does anybody know, do I need still use `Async.link` function when I'm using high-level `Async.withAsync` bracket? Basically I want bidirectional link, where if parent process terminate, child will do as well. As well as the other way around.
11:46:17 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 264 seconds)
11:46:17 jgeerds joins (~jgeerds@55d4da80.access.ecotel.net)
11:48:12 <sshine> lortabac, honestly, the point where I gave up was when I realised that even for one country's style of playing cards, you also have a history of variations. I guess I took the 'library' part too seriously. :P
11:49:30 × rembo10 quits (~rembo10@remulis.com) (Ping timeout: 260 seconds)
11:50:37 <lortabac> sshine: if you make it too generic it can become less useful
11:51:28 <lortabac> if I had to implement such a library, I'd just focus on one type of cards
11:55:35 Lycurgus joins (~juan@98.4.112.204)
11:58:13 <jollygood2> what's a better name for this? safeSucc x = if x == maxBound then minBound else succ x
11:59:30 × tfeb quits (~tfb@88.98.95.237) (Quit: died)
12:00:12 <geekosaur> wrapSucc
12:00:22 <dminuoso> rotate
12:00:32 <Lycurgus> intGLB
12:00:54 <geekosaur> I thought about rotate but the next step is to do the same with prev
12:01:04 <jollygood2> yes I also have safePred
12:01:27 <jollygood2> I like wrapSucc|Pred
12:03:34 rembo10 joins (~rembo10@remulis.com)
12:05:17 <merijn> That's still not safe, though :p
12:05:41 <merijn> Hot take: Enum as-is is a terrible class that should be excised from all code
12:06:29 <merijn> Let's make that the next major compat break in base >.>
12:07:01 <hpc> no way
12:07:16 <hpc> not until we get data Bool = TRUE | FALSE | FILE_NOT_FOUND in
12:07:23 <merijn> hpc: We already have that
12:07:28 <merijn> Just install acme-php
12:07:32 × rembo10 quits (~rembo10@remulis.com) (Client Quit)
12:08:24 rembo10 joins (~rembo10@remulis.com)
12:08:36 <merijn> hpc: This also seems to imply you think Enum is good, which I'm sorry to inform you is a clear sign of mental degradation :p
12:09:50 <hpc> oh don't worry, i have much clearer signs :D
12:11:20 <merijn> In fact, we should find out whos responsible for 10.2 of the Haskell 98 Report and retroactively withdraw their committee membership >.>
12:11:50 × coot quits (~coot@37.30.52.44.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
12:14:04 × kjak_ quits (~kjak@pool-108-45-56-21.washdc.fios.verizon.net) (Ping timeout: 252 seconds)
12:14:07 rond_ joins (~rond_@2a02:a31a:a23c:f480:2fd7:e087:5546:a438)
12:15:12 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
12:15:40 stiell joins (~stiell@gateway/tor-sasl/stiell)
12:23:20 slowButPresent joins (~slowButPr@user/slowbutpresent)
12:27:52 × dschrempf quits (~dominik@070-207.dynamic.dsl.fonira.net) (Quit: WeeChat 3.3)
12:27:53 <jollygood2> can I pattern match in MultiWayIf? something like if | (Just x = someFunc y) -> ..
12:29:02 <merijn> jollygood2: I mean, that's just case-of with a bunch of extra steps?
12:30:18 <jollygood2> yes, but that is one of dozen if clauses, so it would be convenient if the branch executed only if someFunc returns Just. I want functionality of if | (isJust $ someFunc y) -> fromJust $ someFunc y
12:30:18 × Lycurgus quits (~juan@98.4.112.204) (Quit: Exeunt)
12:31:36 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
12:32:21 <merijn> tbh, I find the use-case for a dozen if clauses questionable...I don't think you can pattern match in MultiWayIf, though?
12:32:42 <jollygood2> I am doing this: https://paste.tomsmeding.com/QSYLVhro
12:33:10 <jollygood2> in the updated code, isStraight returns Maybe Rank instead of Bool
12:33:10 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
12:33:42 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
12:34:46 <jollygood2> more context: https://paste.tomsmeding.com/teQxsvjX
12:34:49 <jollygood2> if needed
12:36:44 <jollygood2> if I am doing something else that is stupid feel free too comment :). I'm not sure I like [Card], or apply* functions
12:36:49 <merijn> jollygood2: btw, instead of reverse after sort, use Down
12:36:57 <merijn> > sortOn Down [1..5]
12:36:59 <lambdabot> [5,4,3,2,1]
12:37:02 <jollygood2> ah ok
12:37:13 <merijn> So you can just do "sortOn (Down . snd)"
12:37:18 motherfsck joins (~motherfsc@user/motherfsck)
12:37:23 <merijn> :t Down
12:37:24 <lambdabot> a -> Down a
12:37:35 <merijn> It's just a newtype with reversed comparisons
12:37:48 <jollygood2> that's neat
12:39:32 <merijn> btw, apply5 would be better of doing, like "apply5 f (a:b:c:d:e:_) = f a b c d e", the !! ends up rewalking the list each time
12:40:13 <jollygood2> yes. and what would I do if the list length doesn't match? return Maybe, error?
12:40:18 × rembo10 quits (~rembo10@remulis.com) (Quit: ZNC 1.8.2 - https://znc.in)
12:40:27 <merijn> I mean, right now it already errors anyway :p
12:40:31 <jollygood2> yeah :)
12:41:10 rembo10 joins (~rembo10@remulis.com)
12:42:13 <jollygood2> apply5 :: String -> (a -> a -> a -> a -> a -> b) -> [a] -> b, where String is error message, so if what shouldn't happen happens, I know what to check
12:42:26 <merijn> Personally I'd probably refactor to something like: https://paste.tomsmeding.com/ychadwJh
12:43:04 <merijn> That has the same result as the multiwayif, but no extension and you can pattern match however you like
12:43:35 <jollygood2> I think I would have deeply nested cases with that? because I need to shortcircuit. hand could contain both Straight and OnePair, for example
12:43:41 <merijn> You could also define new datatype for it
12:44:14 <merijn> ok, actually
12:44:17 <merijn> Here's an idea
12:45:02 <merijn> write separate function for each scoring "straightFlush :: [Card] -> Maybe HandValue", "flush :: [Card] -> Maybe HandValue", etc.
12:45:28 <merijn> Then you apply each of them to the hand and use catMaybes
12:45:33 <merijn> :t catMaybes
12:45:34 <lambdabot> [Maybe a] -> [a]
12:46:07 <merijn> So you get "[Card] -> [HandValue]"
12:46:12 <jollygood2> sounds good, I'll try
12:47:02 <jollygood2> you see anything wrong with using [Card] and just validating input before passing cards to handValue? instead of trying to encode some guarantees in the types
12:48:36 <merijn> tbh, I dislike having pre-conditions on inputs
12:48:48 <merijn> Usually easy to forget and easy to mess up
12:49:31 coot joins (~coot@37.30.52.44.nat.umts.dynamic.t-mobile.pl)
12:49:39 <jollygood2> so what should I do? common invalid input I can think of: not enough cards, or too many (should be between 5 and 7). identical cards repeating more than once
12:50:30 azimut joins (~azimut@gateway/tor-sasl/azimut)
12:54:03 <merijn> If you use Set instead of list you rule out identical cards :p
12:55:33 renzhi joins (~xp@2607:fa49:6500:b100::5845)
13:02:14 idris is now known as hippoid
13:05:18 shapr joins (~user@pool-100-36-247-68.washdc.fios.verizon.net)
13:08:36 AlexNoo_ is now known as AlexNoo
13:10:39 × hendursa1 quits (~weechat@user/hendursaga) (Ping timeout: 276 seconds)
13:18:22 ystael joins (~ystael@user/ystael)
13:20:57 max22- joins (~maxime@2a01cb0883359800f362ea56be7f8960.ipv6.abo.wanadoo.fr)
13:25:47 × azeem quits (~azeem@emp-85-170.eduroam.uu.se) (Read error: Connection reset by peer)
13:30:48 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:ac5a:4bd6:3f7c:fb35)
13:33:04 Pickchea joins (~private@user/pickchea)
13:33:20 azeem joins (~azeem@emp-85-170.eduroam.uu.se)
13:35:06 slack1256 joins (~slack1256@45.4.2.52)
13:35:22 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:ac5a:4bd6:3f7c:fb35) (Ping timeout: 252 seconds)
13:36:44 × rond_ quits (~rond_@2a02:a31a:a23c:f480:2fd7:e087:5546:a438) (Quit: Client closed)
13:38:51 hendursa1 joins (~weechat@user/hendursaga)
13:41:20 × nitrix quits (~nitrix@user/nitrix) (Quit: Genius is one percent inspiration and ninety-nine percent perspiration)
13:42:25 nitrix joins (~nitrix@user/nitrix)
13:46:52 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
13:49:33 × Pickchea quits (~private@user/pickchea) (Quit: Leaving)
13:52:02 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
13:55:07 × nvmd quits (~nvmd@user/nvmd) (Ping timeout: 252 seconds)
13:55:21 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
13:55:21 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
13:55:21 wroathe joins (~wroathe@user/wroathe)
13:56:45 nvmd joins (~nvmd@user/nvmd)
14:02:36 × ishutin quits (~ishutin@178-164-207-71.pool.digikabel.hu) (Ping timeout: 245 seconds)
14:03:20 × timCF quits (~timCF@200-149-20-81.sta.estpak.ee) (Quit: leaving)
14:09:39 ishutin joins (~ishutin@84-236-97-21.pool.digikabel.hu)
14:11:48 × jollygood2 quits (~bc8165b6@217.29.117.252) (Quit: http://www.okay.uz/ (Ping timeout))
14:14:45 × acidjnk_new quits (~acidjnk@p200300d0c703cb2624cf652eb5c49df1.dip0.t-ipconnect.de) (Ping timeout: 265 seconds)
14:16:27 × Lysanleo quits (~Lysanleo@124.161.121.202) (Read error: Connection reset by peer)
14:18:53 hnOsmium0001 joins (uid453710@id-453710.hampstead.irccloud.com)
14:22:13 <cigsender> jollygood2: what about something like this? https://paste.tomsmeding.com/cwfN7nm5
14:25:04 <cigsender> restricting your inputs to only what's valid allows you to exploit pattern-matching better
14:28:59 Sgeo joins (~Sgeo@user/sgeo)
14:33:46 <sshine> where did jollygood2 go?
14:34:03 cigsender shrugs
14:35:07 <sshine> /dcc get cigsender cig
14:35:57 <Hecate> cc cigsender :)
14:36:02 <sshine> I was going to suggest using a non-empty set since if you have at least one card, then no matter how you model your hand, you can always claim a high card.
14:36:20 <cigsender> is there a non-empty set in base?
14:36:29 <sshine> no, but there is one in nonempty-containers
14:36:40 <cigsender> hey Hecate <3
14:36:40 <sshine> and it's made by jle, so I'd think it's good.
14:37:12 <cigsender> ugh wow never knew i needed this
14:37:21 <sshine> I also never knew
14:37:29 <sshine> so I ended up rabbit-holing until they left, haha.
14:39:14 jollygood2 joins (~bc8165b6@217.29.117.252)
14:39:48 cigsender wonders about pattern-matching on containers other than Seq
14:39:54 <jollygood2> cigsender, got disconnected, let me check.
14:40:20 <sshine> jollygood2, welcome back.
14:40:35 <jollygood2> thanks!
14:41:08 <jollygood2> cigsender, I like that, data Table = Flop Card Card Card | Turn Card Card Card Card | River Card Card Card Card Card
14:41:23 <sshine> jollygood2, I was going to suggest that if you have a non-empty set of cards to represent your hand, then your Hand -> HandValue function can easily be total, since you can default to the high card (kicker).
14:41:23 <cigsender> could be nice to have patterns for matching the minimum or maximum of a Map or a Set
14:42:23 <sshine> cigsender, you have viewpatterns.
14:43:06 <cigsender> jollygood2: yes! if you only have certain states the Table can be in, you can exhaustively match all the valid states
14:43:13 <geekosaur> also sounds like something that might be doable with a pattern synonym
14:44:08 <cigsender> sshine: view patterns are nice but i was thinking closer to pattern synonyms, where you could (?) also match on an empty Map without an Eq constraint
14:45:08 <cigsender> not that you'd ever really be in that situation :)
14:45:24 <sshine> cigsender, I kinda like that patterns are kinda dumb and that functions are kinda smart. :P
14:45:35 × azeem quits (~azeem@emp-85-170.eduroam.uu.se) (Ping timeout: 268 seconds)
14:46:08 <sshine> cigsender, if patterns suddenly start computing things, I find it hard to reason about performance. (I think there was a similar debate about Erlang guards.)
14:47:01 <cigsender> sshine, that's a fair point, it's hard to reason about computational complexity when the computations are hidden :p
14:47:14 <cigsender> sshine, but then, how do you feel about YearMonthDay?
14:47:19 <geekosaur> that said min and max are cheap to compute
14:47:36 <sshine> cigsender, what's YearMonthDay?
14:47:41 <geekosaur> using one to search out something else in Set/Map is where you'd run into complexity
14:48:26 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 245 seconds)
14:48:28 <cigsender> it's a pattern synonym for the Day type in time that precalculates gregorian for you instead of the julian day https://hackage.haskell.org/package/time-1.12/docs/Data-Time-Calendar.html#v:YearMonthDay
14:48:29 azeem joins (~azeem@emp-85-170.eduroam.uu.se)
14:50:17 × VoidNoir0 quits (~VoidNoir0@72.80.203.52) (Quit: Connection closed)
14:50:42 <sshine> cigsender, ah, thanks, didn't know.
14:51:11 <sshine> cigsender, well, generally I'm not in favor. :) but it seems like a pretty good use-case for this kind of syntax.
14:52:33 <sshine> cigsender, if there's a somewhat constant, small computational overhead, I could totally accept it. not veto'ing. just saying it's a slippery slope. :P
14:53:08 × hippoid quits (~idris@184.105.6.88) (Quit: leaving)
14:53:20 <cigsender> just wanted to feel out your position a little more, sshine :)
14:54:03 ubert1 joins (~Thunderbi@178.115.37.32.wireless.dyn.drei.com)
14:54:33 <merijn> sshine: I have a nice bunch of abuse for pattern synonyms :p
14:55:23 <merijn> sshine: Mapping 3 (4?) different "constructors" to one single universal one that has a bunch of preconditions. So my code operating on it has a simple single representation to work on, while having convenient constructors
14:57:04 <sshine> merijn, as a library API designer, it sounds like a great tool, honestly.
14:57:16 × hyiltiz quits (~quassel@31.220.5.250) (Ping timeout: 252 seconds)
14:57:21 <jollygood2> ok I did data Table = Flop Card Card Card, but I'm not sure how to use the same code to evaluate the hand on the flop, turn and river, without pattern matching each case? if I convert Table to [Card], then I'm kind of back where I started?
14:57:30 <sshine> I've used pattern synonyms myself, but only ones that map very straight onto the internal representation.
14:57:44 hyiltiz joins (~quassel@31.220.5.250)
14:57:48 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
14:58:04 hippoid joins (~idris@184.105.6.88)
14:58:14 <hippoid> :t pure
14:58:15 <lambdabot> Applicative f => a -> f a
14:58:35 <hippoid> :t pure 10
14:58:36 <lambdabot> (Applicative f, Num a) => f a
14:59:02 <cigsender> jollygood2: you can convert Table to [Card] if you want, because you'll be sure inside handValue that you'll have at least 3
14:59:07 <jollygood2> I guess the advantage is that if I get [Card] from Table, I am guaranteed to have 3, 4 or 5 cards, even if the [Card] doesn't show that
14:59:13 <jollygood2> cigsender, yes
14:59:31 <hippoid> `pure 10` confuses me. What is the (Applicative f) for an Int?
14:59:49 <merijn> hippoid: What do you mean "for an Int"
15:00:03 <cigsender> :k Applicative
15:00:05 <lambdabot> (* -> *) -> Constraint
15:00:05 <merijn> hippoid: pure 10 *takes* an Int (simplifying the type of 10 for now)
15:00:15 <merijn> hippoid: It returns "whatever Applicative you want"
15:00:21 <merijn> > pure 10 :: Maybe Int
15:00:22 <lambdabot> Just 10
15:00:24 <hippoid> I thought I'd have to provide some kind of 'container' type as the first arg of pure
15:00:32 <jollygood2> Int is not Applicative, it is the value within Applicative
15:00:35 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
15:00:35 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
15:00:35 wroathe joins (~wroathe@user/wroathe)
15:00:38 <merijn> hippoid: *which* Applicative is inferred from the result
15:00:48 <cigsender> > pure @Maybe 10
15:00:50 <lambdabot> error:
15:00:50 <lambdabot> Pattern syntax in expression context: pure@Maybe
15:00:50 <lambdabot> Did you mean to enable TypeApplications?
15:00:53 <xsperry> > pure 10 :: [Int]
15:00:54 <lambdabot> [10]
15:01:06 <xsperry> > pure 10 :: IO Int
15:01:08 <lambdabot> <IO Int>
15:01:12 <hippoid> :t pure 10
15:01:13 <lambdabot> (Applicative f, Num a) => f a
15:01:21 <hippoid> what is f in that situation?
15:01:28 <merijn> hippoid: "any Applicative"
15:01:36 <merijn> hippoid: Which one, will be inferred when you try to use it
15:01:57 <merijn> > fromMaybe 0 (pure 10)
15:01:58 <lambdabot> 10
15:02:17 <jollygood2> > head $ pure 10
15:02:19 <lambdabot> 10
15:02:26 <merijn> hippoid: fromMaybe wants a "Maybe a", so GHC infers "pure 10" has type "Maybe Int" and chooses Maybe
15:02:41 <hippoid> wow, that's mindblowing
15:03:30 <hippoid> :t pure 10 :: Either Int
15:03:31 <lambdabot> error:
15:03:31 <lambdabot> • Expecting one more argument to ‘Either Int’
15:03:31 <lambdabot> Expected a type, but ‘Either Int’ has kind ‘* -> *’
15:03:37 <jollygood2> Either takes two types
15:03:39 <merijn> > pure 10 :: Either Bool Int
15:03:41 <lambdabot> Right 10
15:03:56 <cigsender> however:
15:04:02 <hippoid> ah ok, my mistake was thinking the second type would be inferred when I try to use it
15:04:03 <merijn> hippoid: Inference goes in both directions (unlike something like "auto" in C++/Java)
15:04:07 <cigsender> > pure 10 :: Either Int Bool
15:04:09 <lambdabot> error:
15:04:09 <lambdabot> • No instance for (Num Bool) arising from the literal ‘10’
15:04:09 <lambdabot> • In the first argument of ‘pure’, namely ‘10’
15:04:30 <jollygood2> hippoid it would be if you didn't specify it. but if you want to write explicit type, it has to be complete
15:04:45 <merijn> hippoid: If you (somehow) use something like that in a way where ghc *can't* infer the correct result, you will get an "ambiguous type" error
15:04:59 <merijn> > const 'a' (pure True) -- not sure this will give the error I want
15:05:01 <lambdabot> error:
15:05:01 <lambdabot> • Ambiguous type variable ‘f0’ arising from a use of ‘pure’
15:05:01 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds)
15:05:01 <lambdabot> prevents the constraint ‘(Applicative f0)’ from being solved.
15:05:12 <hippoid> merijn: can you say more about "both directions" and type inference? To start, what are the two endpoints of the two directions?
15:05:30 <merijn> hippoid: Success! As you can see "hey, this is *some* Applicative, but not enough context to infer *which*, thus it's ambiguous"
15:06:10 <merijn> hippoid: One end is "individual syntactical tokens" which usually have types, like 'a' being Char and the top level signature
15:06:48 <merijn> hippoid: If you have "foo :: Bar -> Baz -> Quux; foo = ..." then we have 2 types, the ones specified as foo's type signature and "the type of the actual body of foo"
15:07:07 <hippoid> is it correct to say one end is terms, and the other end is types?
15:07:11 <merijn> If we write "foo = 'a'" then the 2nd would be Char, for example
15:08:01 <merijn> hippoid: More like one end is the types we *claim* something is, the other end is "the types we know the actual terms have"
15:08:25 <xsperry> perhaps it might be easier to understand polymorphic values outside of Applicative context. for example minBound
15:08:31 <xsperry> :t minBound
15:08:32 <lambdabot> Bounded a => a
15:08:37 <xsperry> > minBound :: Int
15:08:39 <lambdabot> -9223372036854775808
15:08:42 <xsperry> > minBound :: Char
15:08:44 <lambdabot> '\NUL'
15:08:58 <xsperry> > [minBound ..] :: [Char]
15:09:00 <lambdabot> "\NUL\SOH\STX\ETX\EOT\ENQ\ACK\a\b\t\n\v\f\r\SO\SI\DLE\DC1\DC2\DC3\DC4\NAK\SY...
15:09:09 <merijn> hippoid: You can think of it as solving a bunch of equations. In the "fromMaybe 0 (pure 10)' case, then we have two pieces of information: 1) 'pure 10 :: Applicative f => f Int' and 2) 'pure 10 :: Maybe Int' (from the type of fromMaybe)
15:09:15 <maerwald> > minBound
15:09:17 <lambdabot> ()
15:09:34 <maerwald> > [minBound ..]
15:09:36 <lambdabot> [()]
15:09:43 <xsperry> maerwald, I doubt that helps :P
15:09:55 <merijn> hippoid: Now typechecking is a matter of "is there a solution where these types line up?" answer "yes *iff* 'f' = 'Maybe'"
15:09:58 <maerwald> > maxBound
15:10:00 <lambdabot> ()
15:10:00 <maerwald> :D
15:10:31 <hippoid> Are all these what is known as type unification?
15:10:39 <hippoid> *ideas
15:10:56 <merijn> hippoid: Type unification is part of the mechanical process of type checking/inference, yes
15:11:50 <hippoid> ahh ok, and you all are showing me examples of how to apply the logic of type checking/inference
15:12:03 <merijn> hippoid: Basically you assign every (sub)expression a new "unification" variable and then try to solve "is there a single mapping of 1 type to each unification variable that matches all restrictions"
15:13:05 <merijn> hippoid: In my example you have to try to unify "Maybe a" and "Applicative f => f Int" which works IFF 'a' = Int and 'f' = Maybe
15:13:33 doyougnu joins (~user@c-73-25-202-122.hsd1.or.comcast.net)
15:13:38 <hippoid> and that's what you mean by "both sides", there's an = in the middle, and then you can infer things from either side of that equal sign
15:13:44 <merijn> Right
15:14:38 <hippoid> ok, this has been very illuminating. Thanks merijn, xsperry, maerwald et al!
15:14:44 <lortabac> in practice unification alone is not sufficient to check a user-provided signature against the corresponding inferred type
15:15:06 <lortabac> you also need to check that the signature is more generic (or equal) than the inferred type
15:15:13 <lortabac> but I'm just nitpicking
15:15:45 <hippoid> right, because there can be many solutions, so you want the most generic one?
15:16:44 <lortabac> sorry I meant the inferred type is more generic than the signature
15:16:52 <carbolymer> if `MonadReader r m | m -> r`, why does this compile: https://bpa.st/YTRQ ? Is ghc assuming that there may be two different `MonadReader r m` for `m` at the same time?
15:17:21 <merijn> carbolymer: 'm' uniquely determines 'r'
15:17:25 <merijn> carbolymer: Not the other way around
15:17:46 <merijn> carbolymer: Now, obviously the same 'm' can't map to different 'r' and *you* know that
15:18:13 <merijn> carbolymer: But GHC won't discover that until you try and specify a *specific* 'm'
15:18:13 <carbolymer> merijn: I know that, but doesn't ghc too?
15:18:14 <lortabac> hippoid: so that this is valid (id :: Int -> Int; id x = x) but this is not (id :: a -> a; id x = x + 1)
15:18:18 <merijn> carbolymer: How?
15:18:28 <merijn> carbolymer: 'm' is unknown, so GHC knows nothing about it
15:18:37 <carbolymer> merijn: idk, just because functional dependency in MonadReader exists?
15:18:44 <merijn> GHC knows that *a specific* 'm' maps to a single unique 'r'
15:19:19 <hippoid> lortabac: because you can't use + on any type a
15:20:06 <lortabac> hippoid: exactly, a -> a means the function should be valid whatever 'a' is
15:21:07 <hippoid> lortabac: that's where that forall... stuff shows up. What is that called, that forall a.b... whatever notation?
15:22:14 zebrag joins (~chris@user/zebrag)
15:22:47 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
15:23:03 × slack1256 quits (~slack1256@45.4.2.52) (Remote host closed the connection)
15:23:04 <lortabac> I don't know, I call it forall :)
15:24:04 <lortabac> I have to go, sorry
15:24:16 <hippoid> thanks for your help
15:24:19 <hippoid> lortabac++
15:24:26 geekosaur joins (~geekosaur@xmonad/geekosaur)
15:24:31 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:d23a:63c3:dec2:f7ab) (Quit: WeeChat 2.8)
15:24:52 × hendursa1 quits (~weechat@user/hendursaga) (Quit: hendursa1)
15:25:31 hendursaga joins (~weechat@user/hendursaga)
15:26:13 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:ac5a:4bd6:3f7c:fb35)
15:28:20 <c_wraith> kuribas: I just remembered it's absolutely trivial to rewrite that code without the call to error. [] type-checks there, and by construction that case cannot happen, so anything is fine. The problem is that's actually less reader-friendly to make it look like a normal case when it's actually a logical contradiction.
15:29:55 <kuribas> c_wraith: add a comment?
15:30:12 <c_wraith> comments only mean something if they're read
15:30:57 <merijn> hippoid: RankNTypes (or one of the others)
15:31:30 <merijn> hippoid: Note that (in the underlying theory/language used within GHC) all types have an *implicit* forall for every type variable
15:31:48 <merijn> hippoid: So GHC internally considers "id :: a -> a" as if it is "id :: forall a . a -> a"
15:32:54 <carbolymer> merijn: hmm, I need to meditate on that
15:33:43 <dminuoso> c_wraith: I think the real problem is that "logical contradiction" part. The reason we have bugs in the first place, is because we assume invariants to hold. Sometimes, yes, they are provably correct. Otherwise they are not, or they become bugged on some future refactoring.
15:33:58 <dminuoso> If we were always right about our assumptions, we wouldn't have bugs in the first place.
15:34:09 <c_wraith> that's exactly why the error message says you refactored it wrong.
15:34:20 justsomeguy joins (~justsomeg@user/justsomeguy)
15:34:31 slack1256 joins (~slack1256@45.4.2.52)
15:34:33 <c_wraith> If you end up in that case, you refactored it wrong, even if it was total
15:34:51 <c_wraith> I think it's better to be told you got it wrong, instead of silently working incorrectly
15:35:18 <dminuoso> c_wraith: Not if it spontaneously takes down a critical application.
15:35:30 <dminuoso> Think the previous discussion was really about how `error` can really blow up entire programs.
15:36:52 <dminuoso> And these error dont always show during development
15:36:54 <kuribas> dminuoso: unsafePerformIO to show a warning instead?
15:37:22 <dminuoso> kuribas: Heh, imprecise exceptions means you cant even properly catch that exceptoin.
15:37:36 <dminuoso> And inside pure code, this is an even tricker business
15:38:27 <dminuoso> You're giving up a lot of nice properties about your pure code, which is why we didnt have IO in the first place...
15:38:36 werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
15:39:09 rond_ joins (~rond_@2a02:a31a:a23c:f480:2fd7:e087:5546:a438)
15:42:44 <c_wraith> I really actually mean "logical contradiction". Not just "that shouldn't happen". If you end up in that case, you have a thunk that needs to branch on the result of evaluating itself. The program will <<loop>> before it can throw that error.
15:43:04 ec joins (~ec@gateway/tor-sasl/ec)
15:43:09 <c_wraith> So you're crashing anyway
15:43:15 <c_wraith> the call to error is just documentation
15:43:25 <merijn> carbolymer: Basically, functional dependencies are nice an easy, 'cause you only have to "reason in one direction"
15:43:37 <merijn> carbolymer: Which simplifies how complicated things are to implement
15:44:11 <merijn> carbolymer: You are, effectively, asking "why doesn't GHC also reason *backwards*?" to which the answer is "because that's hard and why do hard things when you don't have to"
15:45:03 <kuribas> dminuoso: logging some warning, and returning a default value could be a decent alternative to simply crashing with an exception.
15:45:37 <kuribas> dminuoso: Then in pure code you could return Either err a
15:46:06 <merijn> carbolymer: Which happens to be super simple in the your example (because it's a super simple case), but doing that "in general" is hard
15:46:28 <dminuoso> kuribas: I would not, simply because due to the way IO works, that gives me no guarantees.
15:46:35 lavaman joins (~lavaman@98.38.249.169)
15:46:37 <dminuoso> Maybe this logs never, maybe this logs once, maybe this logs a thousand times
15:46:47 × mbuf quits (~Shakthi@122.178.118.100) (Quit: Leaving)
15:46:49 <dminuoso> If you already have this inside Either err, just feed it outside to IO
15:46:52 <dminuoso> Or feed IO in there
15:47:15 <dminuoso> Ive come to appreciate unsafePerformIO as a strong code smell that you probably should move what you have into IO
15:47:30 <dminuoso> Too many ways Ive been bitten poorly, unsafePerformIO is really dangerous in some strange ways
15:47:33 <jollygood2> I asked yesterday, so if I can repeat my question again, as I need to decide which xml library to use now. file is only 200 kB and I am reading it once, so I'm wondering which of the half a dozen xml libraries are the simplest to use?
15:47:34 <kuribas> dminuoso: then return "Maybe a" in pure code. if it's nothing log the warning (in IO), and return a default value.
15:47:45 <jollygood2> performance shouldn't matter
15:48:07 <dminuoso> kuribas: Whats the value of the Nothing then?
15:48:17 <dminuoso> You're throwing away information now, and have shitty IO semantics for logging.
15:48:18 <kuribas> dminuoso: use the Default typeclass.
15:48:36 <kuribas> dminuoso: I mean, the goal is to continue, right?
15:48:36 <dminuoso> kuribas: I do something similar, but I dont use unsafePerformIO
15:48:41 <dminuoso> kuribas: In our SDN compiler we have this
15:49:12 <kuribas> yeah, unsafePerformIO will likely give a miserable experience.
15:49:54 × ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds)
15:50:16 <dminuoso> kuribas: I have some `data CompEnv a = CompEnv { _comp_warnings :: IORef [OdinWarning], _comp_errors :: IORef [OdinError] }`
15:50:42 <dminuoso> And then my own `class UselessDefault a where useless :: a`
15:51:12 <kuribas> dminuoso: why not use Default then?
15:51:16 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
15:51:24 <dminuoso> And then I have critical errors that bail out immediately and phase critical errors that allow the compiler to continue its current phase and then abort
15:51:27 <kuribas> dminuoso: it's just as useless :)
15:51:28 <dminuoso> kuribas: because Default has no semantics
15:51:52 <dminuoso> With UselessDefault every type I have generates special magic values that are still recognizable
15:51:58 <dminuoso> should I ever use it in the wrong place
15:52:08 <dminuoso> So now I do stuff like:
15:52:31 <dminuoso> useless <$ configErr "Something bad has happened"
15:53:08 <dminuoso> And additional combinators like `>|>` allow me conditional sequencing if no errors are present, >> will just proceed, so my compiler phases/stages use `>|>` between them
15:53:30 <dminuoso> That way my compiler can go as long as it can, collecting as many errors as it can
15:54:23 <kuribas> right
15:55:05 <dminuoso> IORefs are great things. :)
15:59:17 lbseale joins (~lbseale@user/ep1ctetus)
16:01:10 × rond_ quits (~rond_@2a02:a31a:a23c:f480:2fd7:e087:5546:a438) (Quit: Client closed)
16:03:21 mc47 joins (~mc47@xmonad/TheMC47)
16:03:27 econo joins (uid147250@user/econo)
16:05:00 × justsomeguy quits (~justsomeg@user/justsomeguy) (Ping timeout: 260 seconds)
16:06:45 ec joins (~ec@gateway/tor-sasl/ec)
16:07:27 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 276 seconds)
16:08:50 × fgaz quits (~fgaz@2001:470:69fc:105::842) (Quit: Bridge terminating on SIGTERM)
16:08:50 × jneira[m] quits (~jneiramat@2001:470:69fc:105::d729) (Quit: Bridge terminating on SIGTERM)
16:08:50 × maerwald[m] quits (~maerwaldm@2001:470:69fc:105::1ee) (Quit: Bridge terminating on SIGTERM)
16:08:50 × siraben quits (~siraben@user/siraben) (Quit: Bridge terminating on SIGTERM)
16:08:50 × MatrixTravelerbo quits (~voyagert2@2001:470:69fc:105::22) (Quit: Bridge terminating on SIGTERM)
16:08:50 × sm quits (~sm@plaintextaccounting/sm) (Quit: Bridge terminating on SIGTERM)
16:08:50 × shiraeeshi[m] quits (~shiraeesh@2001:470:69fc:105::1:77) (Quit: Bridge terminating on SIGTERM)
16:08:51 × unrooted quits (~unrooted@2001:470:69fc:105::a4a) (Quit: Bridge terminating on SIGTERM)
16:08:51 × psydroid quits (~psydroid@user/psydroid) (Quit: Bridge terminating on SIGTERM)
16:08:51 × peddie quits (~peddie@2001:470:69fc:105::25d) (Quit: Bridge terminating on SIGTERM)
16:08:51 × cdsmith quits (~cdsmithma@2001:470:69fc:105::284) (Quit: Bridge terminating on SIGTERM)
16:08:51 × rednaZ[m] quits (~r3dnazmat@2001:470:69fc:105::ba70) (Quit: Bridge terminating on SIGTERM)
16:08:51 × ServerStatsDisco quits (~serversta@2001:470:69fc:105::1a) (Quit: Bridge terminating on SIGTERM)
16:08:51 × quantum quits (~quantum@user/quantum/x-8556232) (Quit: Bridge terminating on SIGTERM)
16:08:51 × Tisoxin quits (~ikosit@user/ikosit) (Quit: Bridge terminating on SIGTERM)
16:08:51 × Arathorn quits (~arathorn@2001:470:69fc:105::1f) (Quit: Bridge terminating on SIGTERM)
16:08:51 × denbrahe[m] quits (~denbrahem@2001:470:69fc:105::19c0) (Quit: Bridge terminating on SIGTERM)
16:08:51 × ongy[m] quits (~ongymatri@2001:470:69fc:105::5018) (Quit: Bridge terminating on SIGTERM)
16:08:51 × jophish quits (~jophish@2001:470:69fc:105::670) (Quit: Bridge terminating on SIGTERM)
16:08:51 × YoungChiefBTW quits (~youngchie@user/youngchiefbtw) (Quit: Bridge terminating on SIGTERM)
16:08:51 × PotatoHatsue quits (~berberman@2001:470:69fc:105::b488) (Quit: Bridge terminating on SIGTERM)
16:08:51 × kadoban quits (~kadoban@user/kadoban) (Quit: Bridge terminating on SIGTERM)
16:08:51 × wildsebastian quits (~wildsebas@2001:470:69fc:105::1:14b1) (Quit: Bridge terminating on SIGTERM)
16:08:51 × maralorn quits (~maralorn@2001:470:69fc:105::251) (Quit: Bridge terminating on SIGTERM)
16:08:51 × zwro[m] quits (~zwromatri@2001:470:69fc:105::1d4) (Quit: Bridge terminating on SIGTERM)
16:08:51 × ericson2314 quits (~ericson23@2001:470:69fc:105::70c) (Quit: Bridge terminating on SIGTERM)
16:08:51 × vaibhavsagar[m] quits (~vaibhavsa@2001:470:69fc:105::ffe) (Quit: Bridge terminating on SIGTERM)
16:08:51 × the-coot[m] quits (~the-cootm@2001:470:69fc:105::95f) (Quit: Bridge terminating on SIGTERM)
16:08:51 × carmysilna quits (~brightly-@2001:470:69fc:105::2190) (Quit: Bridge terminating on SIGTERM)
16:08:51 × Topik[m] quits (~topikmatr@2001:470:69fc:105::a082) (Quit: Bridge terminating on SIGTERM)
16:08:51 × bitonic quits (~bitonic@2001:470:69fc:105::1812) (Quit: Bridge terminating on SIGTERM)
16:08:51 × zfnmxt quits (~zfnmxtzfn@2001:470:69fc:105::2b32) (Quit: Bridge terminating on SIGTERM)
16:08:51 × Deide quits (~deide@user/deide) (Quit: Bridge terminating on SIGTERM)
16:08:51 × Christoph[m] quits (~hpotsirhc@2001:470:69fc:105::2ff8) (Quit: Bridge terminating on SIGTERM)
16:08:51 × kar1 quits (~kar1@2001:470:69fc:105::c308) (Quit: Bridge terminating on SIGTERM)
16:08:52 × tsmc[m] quits (~tsmcmatri@2001:470:69fc:105::1:7e1) (Quit: Bridge terminating on SIGTERM)
16:08:52 × Morrow[m] quits (~morrowmma@2001:470:69fc:105::1d0) (Quit: Bridge terminating on SIGTERM)
16:08:52 × Artem[m] quits (~artemtype@2001:470:69fc:105::75b) (Quit: Bridge terminating on SIGTERM)
16:08:52 × Ollie[m] quits (~ollieocha@2001:470:69fc:105::41a5) (Quit: Bridge terminating on SIGTERM)
16:08:52 × moats quits (~oats@user/oats) (Quit: Bridge terminating on SIGTERM)
16:08:52 × schuelermine[m] quits (~schuelerm@user/schuelermine) (Quit: Bridge terminating on SIGTERM)
16:08:52 × amesgen[m] quits (~amesgenm]@2001:470:69fc:105::82b) (Quit: Bridge terminating on SIGTERM)
16:08:52 × SawyerBergeron[m quits (~sawyerber@2001:470:69fc:105::3036) (Quit: Bridge terminating on SIGTERM)
16:08:52 × alexfmpe[m] quits (~alexfmpem@2001:470:69fc:105::38ba) (Quit: Bridge terminating on SIGTERM)
16:08:52 × Drew[m] quits (~drewefenw@2001:470:69fc:105::c8c4) (Quit: Bridge terminating on SIGTERM)
16:08:52 × Magnus[m] quits (~magthetch@2001:470:69fc:105::d1a7) (Quit: Bridge terminating on SIGTERM)
16:08:52 × ManofLetters[m] quits (~manoflett@2001:470:69fc:105::3be) (Quit: Bridge terminating on SIGTERM)
16:08:52 × fcortesi quits (~fcortesi@2001:470:69fc:105::f3a9) (Quit: Bridge terminating on SIGTERM)
16:08:52 × smichel17[m] quits (~smichel17@2001:470:69fc:105::2d32) (Quit: Bridge terminating on SIGTERM)
16:08:52 × kevin[m]1 quits (~pnotequal@2001:470:69fc:105::a54) (Quit: Bridge terminating on SIGTERM)
16:08:52 × jmcantrell quits (~jmcantrel@user/jmcantrell) (Quit: Bridge terminating on SIGTERM)
16:08:52 × santiagopim[m] quits (~santiagop@2001:470:69fc:105::e57d) (Quit: Bridge terminating on SIGTERM)
16:08:52 × hsek[m] quits (~hsekmatri@2001:470:69fc:105::d18f) (Quit: Bridge terminating on SIGTERM)
16:08:52 × marinelli[m] quits (~marinelli@2001:470:69fc:105::2d8) (Quit: Bridge terminating on SIGTERM)
16:08:52 × reddishblue[m] quits (~reddishbl@2001:470:69fc:105::21eb) (Quit: Bridge terminating on SIGTERM)
16:08:52 × unclechu quits (~unclechu@2001:470:69fc:105::354) (Quit: Bridge terminating on SIGTERM)
16:08:52 × aidy quits (~aidy@2001:470:69fc:105::c7b4) (Quit: Bridge terminating on SIGTERM)
16:08:52 × fendor[m] quits (~fendormat@2001:470:69fc:105::fcbd) (Quit: Bridge terminating on SIGTERM)
16:08:52 × srid[m] quits (~sridmatri@2001:470:69fc:105::1c2) (Quit: Bridge terminating on SIGTERM)
16:08:53 × ru0mad[m] quits (~ru0madmat@2001:470:69fc:105::9b2) (Quit: Bridge terminating on SIGTERM)
16:08:53 × thomasjm[m] quits (~thomasjmm@2001:470:69fc:105::c6d9) (Quit: Bridge terminating on SIGTERM)
16:08:53 × hjulle[m] quits (~hjullemat@2001:470:69fc:105::1dd) (Quit: Bridge terminating on SIGTERM)
16:08:53 × mekeor[m] quits (~mekeormat@2001:470:69fc:105::17e4) (Quit: Bridge terminating on SIGTERM)
16:08:53 × hughjfchen[m] quits (~hughjfche@2001:470:69fc:105::c29d) (Quit: Bridge terminating on SIGTERM)
16:08:53 × razor[m] quits (~razormone@2001:470:69fc:105::f048) (Quit: Bridge terminating on SIGTERM)
16:08:53 × bb010g quits (~bb010g@2001:470:69fc:105::9a5) (Quit: Bridge terminating on SIGTERM)
16:08:53 × bakinonion[m] quits (~bakinonio@2001:470:69fc:105::ddb3) (Quit: Bridge terminating on SIGTERM)
16:08:53 × Deewiant quits (~deewiant@2001:470:69fc:105::2fd3) (Quit: Bridge terminating on SIGTERM)
16:08:53 × dualinverter[m] quits (~dualinver@2001:470:69fc:105::16a7) (Quit: Bridge terminating on SIGTERM)
16:08:53 × oak- quits (~oakuniver@2001:470:69fc:105::fcd) (Quit: Bridge terminating on SIGTERM)
16:08:53 × ixlun quits (~ixlun@2001:470:69fc:105::41b3) (Quit: Bridge terminating on SIGTERM)
16:08:53 × jesser[m] quits (~jessermat@2001:470:69fc:105::d5ae) (Quit: Bridge terminating on SIGTERM)
16:08:53 × jinsun_ quits (~jinsun@user/jinsun) (Quit: Bridge terminating on SIGTERM)
16:08:53 × reza[m] quits (~rezaphone@2001:470:69fc:105::3eda) (Quit: Bridge terminating on SIGTERM)
16:08:53 × Orbstheorem quits (~orbstheor@2001:470:69fc:105::a56) (Quit: Bridge terminating on SIGTERM)
16:08:54 × gdhffd[m] quits (~gdhffdmat@2001:470:69fc:105::1:799) (Quit: Bridge terminating on SIGTERM)
16:08:54 × afotgkmnzj7asv3r quits (~afotgkmnz@2001:470:69fc:105::c24b) (Quit: Bridge terminating on SIGTERM)
16:08:54 × asdofindia-m quits (~akshaymat@2001:470:69fc:105::831) (Quit: Bridge terminating on SIGTERM)
16:08:54 × craige[m] quits (~craigemcw@2001:470:69fc:105::35f1) (Quit: Bridge terminating on SIGTERM)
16:08:54 × soft quits (~soft-matr@2001:470:69fc:105::c75) (Quit: Bridge terminating on SIGTERM)
16:08:54 × alex[m]1234567 quits (~alexchete@2001:470:69fc:105::1:1001) (Quit: Bridge terminating on SIGTERM)
16:08:54 × justosophy[m] quits (~justosoph@2001:470:69fc:105::572f) (Quit: Bridge terminating on SIGTERM)
16:08:54 × fakehacker[m] quits (~fakehacke@2001:470:69fc:105::b5f0) (Quit: Bridge terminating on SIGTERM)
16:08:54 × IgnatInsarov[m] quits (~kindaroma@2001:470:69fc:105::f5d9) (Quit: Bridge terminating on SIGTERM)
16:08:54 × dexmad[m] quits (~dexmadmat@2001:470:69fc:105::e056) (Quit: Bridge terminating on SIGTERM)
16:08:54 × monadfritz[m] quits (~ahdytmatr@2001:470:69fc:105::e1f1) (Quit: Bridge terminating on SIGTERM)
16:08:54 × wysteriary[m] quits (~wysteriar@2001:470:69fc:105::a42e) (Quit: Bridge terminating on SIGTERM)
16:08:54 × cloudy quits (~cloudy@2001:470:69fc:105::50c0) (Quit: Bridge terminating on SIGTERM)
16:08:54 × sam[m]12 quits (~sammtopoi@2001:470:69fc:105::e887) (Quit: Bridge terminating on SIGTERM)
16:08:54 × TomasJakl[m] quits (~jaklttchn@2001:470:69fc:105::a42) (Quit: Bridge terminating on SIGTERM)
16:08:54 × ilkecan[m] quits (~ilkecanma@2001:470:69fc:105::1:79b) (Quit: Bridge terminating on SIGTERM)
16:08:54 × codygman[m] quits (~codygman@2001:470:69fc:105::b4ba) (Quit: Bridge terminating on SIGTERM)
16:08:54 × stoicswe[m] quits (~deadlette@2001:470:69fc:105::d277) (Quit: Bridge terminating on SIGTERM)
16:08:55 × xosdy[m] quits (~xosdyalet@2001:470:69fc:105::31f7) (Quit: Bridge terminating on SIGTERM)
16:08:55 × Tavi[m] quits (~factoidde@2001:470:69fc:105::1:819) (Quit: Bridge terminating on SIGTERM)
16:08:55 × jchia[m] quits (~jchiamatr@2001:470:69fc:105::c50b) (Quit: Bridge terminating on SIGTERM)
16:08:55 × RosarioPulella[m quits (~rosariopu@2001:470:69fc:105::a57) (Quit: Bridge terminating on SIGTERM)
16:08:55 × ftzm[m] quits (~ftzmmatri@2001:470:69fc:105::1:dfc) (Quit: Bridge terminating on SIGTERM)
16:08:58 × hsiktas[m] quits (~hsiktasma@2001:470:69fc:105::30d4) (Quit: Bridge terminating on SIGTERM)
16:10:05 _ht joins (~quassel@82-169-194-8.biz.kpn.net)
16:10:31 × azeem quits (~azeem@emp-85-170.eduroam.uu.se) (Read error: Connection reset by peer)
16:12:06 × trillp quits (~trillp@69.233.98.238) (Quit: nyaa~)
16:12:22 azeem joins (~azeem@emp-85-170.eduroam.uu.se)
16:13:10 jchia[m] joins (~jchiamatr@2001:470:69fc:105::c50b)
16:14:26 × hippoid quits (~idris@184.105.6.88) (Quit: leaving)
16:16:33 × hendursaga quits (~weechat@user/hendursaga) (Ping timeout: 276 seconds)
16:16:40 × azeem quits (~azeem@emp-85-170.eduroam.uu.se) (Ping timeout: 260 seconds)
16:17:01 justsomeguy joins (~justsomeg@user/justsomeguy)
16:17:51 × ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds)
16:19:09 stiell joins (~stiell@gateway/tor-sasl/stiell)
16:19:52 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
16:22:44 azeem joins (~azeem@2a00:801:44b:8c08:deb2:1ae7:691a:354c)
16:23:29 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
16:24:04 × cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.3)
16:24:46 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
16:25:44 × oxide quits (~lambda@user/oxide) (Ping timeout: 265 seconds)
16:25:44 <jollygood2> is anyone familiar with tagsoup? I can't figure out how to get tag's children
16:25:45 MatrixTravelerbo joins (~voyagert2@2001:470:69fc:105::22)
16:25:45 dualinverter[m] joins (~dualinver@2001:470:69fc:105::16a7)
16:25:45 fgaz joins (~fgaz@2001:470:69fc:105::842)
16:25:45 peddie joins (~peddie@2001:470:69fc:105::25d)
16:25:45 cdsmith joins (~cdsmithma@2001:470:69fc:105::284)
16:25:45 Morrow[m] joins (~morrowmma@2001:470:69fc:105::1d0)
16:25:45 thomasjm[m] joins (~thomasjmm@2001:470:69fc:105::c6d9)
16:25:46 hsek[m] joins (~hsekmatri@2001:470:69fc:105::d18f)
16:25:46 ru0mad[m] joins (~ru0madmat@2001:470:69fc:105::9b2)
16:25:58 gdhffd[m] joins (~gdhffdmat@2001:470:69fc:105::1:799)
16:25:58 bb010g joins (~bb010g@2001:470:69fc:105::9a5)
16:25:58 ServerStatsDisco joins (~serversta@2001:470:69fc:105::1a)
16:25:58 amesgen[m] joins (~amesgenm]@2001:470:69fc:105::82b)
16:25:58 the-coot[m] joins (~the-cootm@2001:470:69fc:105::95f)
16:25:59 moats joins (~oats@user/oats)
16:26:11 soft joins (~soft-matr@2001:470:69fc:105::c75)
16:26:11 zfnmxt joins (~zfnmxtzfn@2001:470:69fc:105::2b32)
16:26:26 oak- joins (~oakuniver@2001:470:69fc:105::fcd)
16:26:28 kadoban joins (~kadoban@user/kadoban)
16:26:28 bitonic joins (~bitonic@2001:470:69fc:105::1812)
16:26:28 jophish joins (~jophish@2001:470:69fc:105::670)
16:26:28 ericson2314 joins (~ericson23@2001:470:69fc:105::70c)
16:26:28 Arathorn joins (~arathorn@2001:470:69fc:105::1f)
16:26:29 Ollie[m] joins (~ollieocha@2001:470:69fc:105::41a5)
16:26:29 PotatoHatsue joins (~berberman@2001:470:69fc:105::b488)
16:26:29 ixlun joins (~ixlun@2001:470:69fc:105::41b3)
16:26:29 unclechu joins (~unclechu@2001:470:69fc:105::354)
16:26:29 Deewiant joins (~deewiant@2001:470:69fc:105::2fd3)
16:26:29 unrooted joins (~unrooted@2001:470:69fc:105::a4a)
16:26:29 rednaZ[m] joins (~r3dnazmat@2001:470:69fc:105::ba70)
16:26:30 maralorn joins (~maralorn@2001:470:69fc:105::251)
16:26:30 denbrahe[m] joins (~denbrahem@2001:470:69fc:105::19c0)
16:26:35 × chele quits (~chele@user/chele) (Remote host closed the connection)
16:26:42 jesser[m] joins (~jessermat@2001:470:69fc:105::d5ae)
16:26:43 reza[m] joins (~rezaphone@2001:470:69fc:105::3eda)
16:26:43 quantum joins (~quantum@user/quantum/x-8556232)
16:26:43 marinelli[m] joins (~marinelli@2001:470:69fc:105::2d8)
16:26:43 hsiktas[m] joins (~hsiktasma@2001:470:69fc:105::30d4)
16:26:43 Orbstheorem joins (~orbstheor@2001:470:69fc:105::a56)
16:26:43 craige[m] joins (~craigemcw@2001:470:69fc:105::35f1)
16:26:43 afotgkmnzj7asv3r joins (~afotgkmnz@2001:470:69fc:105::c24b)
16:26:43 schuelermine[m] joins (~schuelerm@user/schuelermine)
16:26:43 razor[m] joins (~razormone@2001:470:69fc:105::f048)
16:26:43 sm joins (~sm@plaintextaccounting/sm)
16:26:44 reddishblue[m] joins (~reddishbl@2001:470:69fc:105::21eb)
16:26:56 justosophy[m] joins (~justosoph@2001:470:69fc:105::572f)
16:26:56 kevin[m]1 joins (~pnotequal@2001:470:69fc:105::a54)
16:26:56 Deide joins (~deide@user/deide)
16:27:08 fakehacker[m] joins (~fakehacke@2001:470:69fc:105::b5f0)
16:27:08 hughjfchen[m] joins (~hughjfche@2001:470:69fc:105::c29d)
16:27:08 Artem[m] joins (~artemtype@2001:470:69fc:105::75b)
16:27:20 IgnatInsarov[m] joins (~kindaroma@2001:470:69fc:105::f5d9)
16:27:20 srid[m] joins (~sridmatri@2001:470:69fc:105::1c2)
16:27:20 psydroid joins (~psydroid@user/psydroid)
16:27:20 Christoph[m] joins (~hpotsirhc@2001:470:69fc:105::2ff8)
16:27:31 × dka quits (~code-is-a@ns3059207.ip-193-70-33.eu) (Quit: My Ex-Girlfriend once told me: I'm not a slut, I'm just popular)
16:27:32 wysteriary[m] joins (~wysteriar@2001:470:69fc:105::a42e)
16:27:32 YoungChiefBTW joins (~youngchie@2001:470:69fc:105::214c)
16:27:32 zwro[m] joins (~zwromatri@2001:470:69fc:105::1d4)
16:27:44 stoicswe[m] joins (~deadlette@2001:470:69fc:105::d277)
16:27:45 sam[m]12 joins (~sammtopoi@2001:470:69fc:105::e887)
16:27:45 Topik[m] joins (~topikmatr@2001:470:69fc:105::a082)
16:27:45 kar1 joins (~kar1@2001:470:69fc:105::c308)
16:27:45 ongy[m] joins (~ongymatri@2001:470:69fc:105::5018)
16:27:45 alexfmpe[m] joins (~alexfmpem@2001:470:69fc:105::38ba)
16:27:45 asdofindia-m joins (~akshaymat@2001:470:69fc:105::831)
16:27:45 hjulle[m] joins (~hjullemat@2001:470:69fc:105::1dd)
16:27:45 Drew[m] joins (~drewefenw@2001:470:69fc:105::c8c4)
16:27:45 jneira[m] joins (~jneiramat@2001:470:69fc:105::d729)
16:27:46 Magnus[m] joins (~magthetch@2001:470:69fc:105::d1a7)
16:27:46 siraben joins (~siraben@user/siraben)
16:27:46 dexmad[m] joins (~dexmadmat@2001:470:69fc:105::e056)
16:27:46 smichel17[m] joins (~smichel17@2001:470:69fc:105::2d32)
16:27:46 SawyerBergeron[m joins (~sawyerber@2001:470:69fc:105::3036)
16:27:46 Tisoxin joins (~ikosit@user/ikosit)
16:27:58 monadfritz[m] joins (~ahdytmatr@2001:470:69fc:105::e1f1)
16:27:58 bakinonion[m] joins (~bakinonio@2001:470:69fc:105::ddb3)
16:27:58 alex[m]123 joins (~alexchete@2001:470:69fc:105::1:1001)
16:27:58 fcortesi joins (~fcortesi@2001:470:69fc:105::f3a9)
16:27:58 ManofLetters[m] joins (~manoflett@2001:470:69fc:105::3be)
16:27:58 cloudy joins (~cloudy@2001:470:69fc:105::50c0)
16:27:59 carmysilna joins (~brightly-@2001:470:69fc:105::2190)
16:27:59 fendor[m] joins (~fendormat@2001:470:69fc:105::fcbd)
16:27:59 aidy joins (~aidy@2001:470:69fc:105::c7b4)
16:28:11 TomasJakl[m] joins (~jaklttchn@2001:470:69fc:105::a42)
16:28:11 shiraeeshi[m] joins (~shiraeesh@2001:470:69fc:105::1:77)
16:28:14 dka joins (~code-is-a@ns3059207.ip-193-70-33.eu)
16:28:23 ilkecan[m] joins (~ilkecanma@2001:470:69fc:105::1:79b)
16:28:23 tsmc[m] joins (~tsmcmatri@2001:470:69fc:105::1:7e1)
16:28:39 codygman[m] joins (~codygman@2001:470:69fc:105::b4ba)
16:28:39 xosdy[m] joins (~xosdyalet@2001:470:69fc:105::31f7)
16:28:39 vaibhavsagar[m] joins (~vaibhavsa@2001:470:69fc:105::ffe)
16:28:39 santiagopim[m] joins (~santiagop@2001:470:69fc:105::e57d)
16:28:51 Tavi[m] joins (~factoidde@2001:470:69fc:105::1:819)
16:28:52 mekeor[m] joins (~mekeormat@2001:470:69fc:105::17e4)
16:28:52 jmcantrell joins (~jmcantrel@user/jmcantrell)
16:28:53 maerwald[m] joins (~maerwaldm@2001:470:69fc:105::1ee)
16:28:53 RosarioPulella[m joins (~rosariopu@2001:470:69fc:105::a57)
16:29:01 tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net)
16:29:05 ftzm[m] joins (~ftzmmatri@2001:470:69fc:105::1:dfc)
16:29:05 wildsebastian joins (~wildsebas@2001:470:69fc:105::1:14b1)
16:29:05 jinsun_ joins (~jinsun@user/jinsun)
16:29:17 mekeor[m] parts (~mekeormat@2001:470:69fc:105::17e4) ()
16:29:21 ec joins (~ec@gateway/tor-sasl/ec)
16:32:21 mekeor[m] joins (~mekeormat@2001:470:69fc:105::17e4)
16:41:58 × justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.2)
16:42:30 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
16:43:33 × kuribas quits (~user@ip-188-118-57-242.reverse.destiny.be) (Quit: ERC (IRC client for Emacs 26.3))
16:45:02 <geekosaur> jollygood2, one issue with tagsoup is that it's exactly that. (it's intended for parsing badly formed html where you can't even assume "children" is a thing)
16:45:32 <geekosaur> I mean, it manages to handle <a><b></a></b>
16:48:54 <maerwald> any gui library that works on windows and can be shipped reasonably?
16:48:58 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 252 seconds)
16:50:44 Null_A joins (~null_a@2601:645:8700:2290:6ce1:5557:ad33:ef82)
16:51:00 <geekosaur> in haskell? you already lost with "any gui library" imo
16:51:22 <geekosaur> I mean, there's gi-gtk, but bleargh
16:51:36 <maerwald> gtk can't be linked statically afair
16:51:58 <geekosaur> indeed it can't. and especially gi-gtk
16:52:39 Null_A_ joins (~null_a@2601:645:8700:2290:e4f7:cf97:bec9:9d10)
16:52:50 ars23 joins (~ars23@2a02:2f09:3e0b:6000:ecb0:eb26:7827:8e)
16:54:54 <maerwald> it seems you can only get haskellers attention about GUI when you mix it with "FRP"
16:55:04 <maerwald> and yet, nothing practical came out of it
16:55:31 <monochrom> A long time ago wx was quite preferred for covering Windows. I don't know about now.
16:55:38 <maerwald> it's abandoned
16:55:43 <maerwald> the issue tracker is on source forge
16:55:49 <maerwald> seems to not even build with v2
16:55:56 × Null_A quits (~null_a@2601:645:8700:2290:6ce1:5557:ad33:ef82) (Ping timeout: 245 seconds)
16:56:52 <geekosaur> wx kept changing faster than the haskell bindings could keep up :(
16:59:07 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
17:01:22 × turlando_ quits (~turlando@93-42-250-112.ip89.fastwebnet.it) (Quit: turlando_)
17:02:27 turlando joins (~turlando@93-42-250-112.ip89.fastwebnet.it)
17:02:28 × turlando quits (~turlando@93-42-250-112.ip89.fastwebnet.it) (Changing host)
17:02:28 turlando joins (~turlando@user/turlando)
17:11:30 × zebrag quits (~chris@user/zebrag) (Quit: Konversation terminated!)
17:17:13 hendursaga joins (~weechat@user/hendursaga)
17:18:56 <jollygood2> geekosaur, so tagsoup can't do that? what xml parsing library can?
17:19:43 × cheater quits (~Username@user/cheater) (Ping timeout: 265 seconds)
17:19:49 × mei6 quits (~mei@user/mei) (Quit: mei6)
17:19:55 <sm> g'day all
17:20:28 <sm> maerwald: fltk-hs or monomer ? worth a look
17:21:23 <monochrom> Perhaps the next thing worth trying is https://hackage.haskell.org/package/xml
17:21:47 <maerwald> sm: do they work on windows without dynamic linking?
17:23:01 theproffesor joins (~theproffe@user/theproffesor)
17:23:57 <sm> I don't know about the linking
17:24:13 fizzsegfaultbuzz joins (~segfaultf@135-180-0-138.static.sonic.net)
17:27:00 emf joins (~emf@2620:10d:c090:400::5:c2a5)
17:28:04 × emf quits (~emf@2620:10d:c090:400::5:c2a5) (Client Quit)
17:30:09 × Null_A_ quits (~null_a@2601:645:8700:2290:e4f7:cf97:bec9:9d10) (Remote host closed the connection)
17:30:28 × amk quits (~amk@109.255.169.126) (Remote host closed the connection)
17:30:44 Null_A joins (~null_a@2601:645:8700:2290:e4f7:cf97:bec9:9d10)
17:31:30 amk joins (~amk@109.255.169.126)
17:32:09 × Null_A quits (~null_a@2601:645:8700:2290:e4f7:cf97:bec9:9d10) (Remote host closed the connection)
17:32:24 Null_A joins (~null_a@2601:645:8700:2290:e4f7:cf97:bec9:9d10)
17:39:12 emf joins (~emf@163.114.132.1)
17:39:45 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
17:45:05 × Null_A quits (~null_a@2601:645:8700:2290:e4f7:cf97:bec9:9d10) (Remote host closed the connection)
17:45:25 × emf quits (~emf@163.114.132.1) (Read error: Connection reset by peer)
17:45:37 emf_ joins (~emf@2620:10d:c090:400::5:c2a5)
17:47:14 cheater joins (~Username@user/cheater)
17:47:55 × gay quits (~quassel@77-120-141-90.kha.volia.net) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
17:51:00 × ubert1 quits (~Thunderbi@178.115.37.32.wireless.dyn.drei.com) (Remote host closed the connection)
17:53:00 Null_A joins (~null_a@2601:645:8700:2290:e4f7:cf97:bec9:9d10)
17:54:58 × Inst quits (~Inst@2601:6c4:4080:3f80:4860:840:17cf:1bbb) (Ping timeout: 252 seconds)
17:57:45 × werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Remote host closed the connection)
17:59:23 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
18:00:31 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Client Quit)
18:01:19 CiaoSen joins (~Jura@p200300c95730dd002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
18:03:52 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
18:14:38 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
18:20:29 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
18:23:26 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
18:23:58 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
18:24:11 × YoungChiefBTW quits (~youngchie@2001:470:69fc:105::214c) (Changing host)
18:24:11 YoungChiefBTW joins (~youngchie@user/youngchiefbtw)
18:26:41 Pickchea joins (~private@user/pickchea)
18:28:42 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
18:30:57 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
18:32:29 wonko joins (~wjc@62.115.229.50)
18:35:57 × meinside quits (uid24933@id-24933.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
18:37:14 _bo joins (~bo@217.18.216.247)
18:37:21 × dyeplexer quits (~dyeplexer@user/dyeplexer) (Remote host closed the connection)
18:41:21 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
18:49:40 Lycurgus joins (~juan@98.4.112.204)
18:51:44 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
18:54:06 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:ac5a:4bd6:3f7c:fb35) (Remote host closed the connection)
18:54:56 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
18:56:32 werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
19:00:39 wrengr_away is now known as wrengr
19:01:47 × [exa] quits (exa@srv3.blesmrt.net) (Remote host closed the connection)
19:02:03 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Quit: FinnElija)
19:05:55 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
19:07:54 <shapr> Is hinotify the best way to do file watching on Linux these days?
19:09:34 <dminuoso> The only, really.
19:09:56 <dminuoso> I mean you can simply poll of course
19:10:07 × coot quits (~coot@37.30.52.44.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
19:11:39 × Lycurgus quits (~juan@98.4.112.204) (Quit: Exeunt)
19:13:12 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
19:17:51 d34df00d joins (~d34df00d@2600:1700:8c60:3a10::48)
19:18:00 <d34df00d> Hi!
19:18:26 <geekosaur> œ
19:18:44 <maerwald> shapr: it's a good library
19:19:16 <d34df00d> I'm trying to add https://github.com/input-output-hk/plutus as an extra-dep to my stack-based project, basically via `extra-deps: - github: ...`.
19:19:45 <maerwald> d34df00d: you shouldn't use stack for plutus
19:19:45 <d34df00d> The error I'm getting is `No cabal file found for Archive from https://github.com/input-output-hk/plutus/archive/e2cd641501d13715120329092b3a93df35493a44.tar.gz` — which is true, there's only cabal.project.
19:19:56 <d34df00d> maerwald: what should I use instead?
19:19:59 <maerwald> cabal
19:20:02 <d34df00d> Ah ok.
19:20:45 <d34df00d> I was kinda bitten recently by a to vague bound in a plutus dep, which surprisingly didn't bite other folks working on the same code base, so I was hoping stack would give me something more reproducible.
19:20:54 <d34df00d> s/a to /a too /
19:21:11 <maerwald> use a freeze file to make it reproducible
19:21:35 <d34df00d> TIL cabal freeze files
19:21:39 <geekosaur> more completely, plutus is a collection of packages, not just one package, and you'd have to inspect the cabal.project to determine the subprojects and their cabal files, and possibly which checkouts if they're separate fromn plutus itself
19:22:04 <maerwald> but I don't think you can expect the plutus script itself to be reproducible (I mean the actual script that you generate to submit to the chain)
19:22:14 <maerwald> GHC version and other stuff might leak into tit
19:22:15 <d34df00d> Ah, I don't care abou that.
19:22:19 <maerwald> ok
19:22:35 <d34df00d> I'm writing some purely haskell stuff around plutus ecosystem, no smart contracts yet.
19:22:51 <geekosaur> (cabal.project very roughly serves the sanme purpose as stack.yaml)
19:22:53 × jgeerds quits (~jgeerds@55d4da80.access.ecotel.net) (Ping timeout: 264 seconds)
19:22:55 <d34df00d> But that's interesting, thanks for the heads-up!
19:23:04 <maerwald> the stack file in plutus repo is outdated often. The developers use cabal primarily
19:24:20 × emf_ quits (~emf@2620:10d:c090:400::5:c2a5) (Quit: emf_)
19:29:30 tdaeayusr^^ joins (~tdaeayusr@70.166.66.234)
19:30:04 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
19:30:17 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
19:30:43 coot joins (~coot@37.30.52.44.nat.umts.dynamic.t-mobile.pl)
19:32:08 <d34df00d> Good to know. Thanks! I'll stick with cabal.
19:34:21 × werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Remote host closed the connection)
19:37:26 × abhixec quits (~abhixec@c-67-169-139-16.hsd1.ca.comcast.net) (Remote host closed the connection)
19:40:24 abhixec joins (~abhixec@c-67-169-139-16.hsd1.ca.comcast.net)
19:41:55 × bontaq quits (~user@ool-45779fe5.dyn.optonline.net) (Remote host closed the connection)
19:46:36 benin joins (~benin@183.82.206.194)
19:49:43 emf joins (~emf@2620:10d:c090:400::5:c2a5)
19:50:25 bitdex_ joins (~bitdex@gateway/tor-sasl/bitdex)
19:53:00 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 276 seconds)
19:53:01 × dsf quits (~dsf@cpe-66-75-56-205.san.res.rr.com) (Ping timeout: 245 seconds)
19:53:59 werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
19:54:30 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:1cce:2f0c:1ac6:f97f)
19:58:51 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:1cce:2f0c:1ac6:f97f) (Ping timeout: 245 seconds)
20:01:19 × Null_A quits (~null_a@2601:645:8700:2290:e4f7:cf97:bec9:9d10) (Remote host closed the connection)
20:02:43 pavonia joins (~user@user/siracusa)
20:04:18 Null_A joins (~null_a@2601:645:8700:2290:e4f7:cf97:bec9:9d10)
20:04:46 × benin quits (~benin@183.82.206.194) (Ping timeout: 252 seconds)
20:05:19 × juhp quits (~juhp@128.106.188.220) (Ping timeout: 252 seconds)
20:07:47 juhp joins (~juhp@128.106.188.220)
20:09:20 Lycurgus joins (~juan@98.4.112.204)
20:12:08 neurocyte0132889 joins (~neurocyte@213.188.113.91)
20:12:08 × neurocyte0132889 quits (~neurocyte@213.188.113.91) (Changing host)
20:12:08 neurocyte0132889 joins (~neurocyte@user/neurocyte)
20:13:46 × Pickchea quits (~private@user/pickchea) (Quit: Leaving)
20:14:37 × alx741 quits (~alx741@181.196.69.128) (Ping timeout: 252 seconds)
20:16:12 × hexology quits (~hexology@user/hexology) (Quit: hex on you ...)
20:20:08 fvr joins (uid503686@id-503686.uxbridge.irccloud.com)
20:20:42 fluxit joins (~fluxit@techsmix.net)
20:21:13 × mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection)
20:22:45 aegon joins (~mike@174.127.249.180)
20:22:53 × wyrd quits (~wyrd@gateway/tor-sasl/wyrd) (Quit: leaving)
20:24:20 × _ht quits (~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection)
20:30:32 × coot quits (~coot@37.30.52.44.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
20:32:11 × wonko quits (~wjc@62.115.229.50) (Ping timeout: 245 seconds)
20:34:30 × neurocyte0132889 quits (~neurocyte@user/neurocyte) (Ping timeout: 265 seconds)
20:36:26 × ars23 quits (~ars23@2a02:2f09:3e0b:6000:ecb0:eb26:7827:8e) (Quit: Leaving)
20:37:46 × tom_ quits (~tom@2a00:23c8:970c:4801:5b6a:e81b:79dc:f684) (Ping timeout: 252 seconds)
20:39:37 × Lycurgus quits (~juan@98.4.112.204) (K-Lined)
20:41:09 zincy joins (~tom@2a00:23c8:970c:4801:5b6a:e81b:79dc:f684)
20:42:46 × zincy quits (~tom@2a00:23c8:970c:4801:5b6a:e81b:79dc:f684) (Read error: Connection reset by peer)
20:45:23 Tuplanolla joins (~Tuplanoll@91-159-69-50.elisa-laajakaista.fi)
20:46:12 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
20:46:23 lavaman joins (~lavaman@98.38.249.169)
20:48:46 × dhouthoo quits (~dhouthoo@178-117-36-167.access.telenet.be) (Quit: WeeChat 3.3)
20:49:41 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
20:50:31 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 245 seconds)
20:51:59 __monty__ joins (~toonn@user/toonn)
20:53:32 Neuromancer joins (~Neuromanc@user/neuromancer)
20:55:05 × Cajun quits (~Cajun@user/cajun) (Ping timeout: 256 seconds)
20:56:44 acidjnk_new joins (~acidjnk@p200300d0c703cb2624cf652eb5c49df1.dip0.t-ipconnect.de)
20:56:47 × alzgh quits (~alzgh@user/alzgh) (Ping timeout: 256 seconds)
20:56:56 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb)
21:01:15 jgeerds joins (~jgeerds@55d4da80.access.ecotel.net)
21:01:45 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb) (Ping timeout: 268 seconds)
21:07:33 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb)
21:17:31 × ubert quits (~Thunderbi@178.115.37.32.wireless.dyn.drei.com) (Ping timeout: 265 seconds)
21:17:37 echoone joins (~echoone@2a02:8109:a1c0:5d05:58b9:5c9f:8b69:dc13)
21:20:53 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb) (Remote host closed the connection)
21:21:56 × Null_A quits (~null_a@2601:645:8700:2290:e4f7:cf97:bec9:9d10) (Remote host closed the connection)
21:24:34 × notzmv quits (~zmv@user/notzmv) (Ping timeout: 268 seconds)
21:25:02 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
21:26:22 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 265 seconds)
21:26:22 Lord_of_Life_ is now known as Lord_of_Life
21:27:15 Null_A joins (~null_a@2601:645:8700:2290:e4f7:cf97:bec9:9d10)
21:27:52 wyrd joins (~wyrd@gateway/tor-sasl/wyrd)
21:32:00 × rembo10 quits (~rembo10@remulis.com) (Quit: ZNC 1.8.2 - https://znc.in)
21:32:16 rembo10 joins (~rembo10@remulis.com)
21:33:45 × chexum_ quits (~quassel@gateway/tor-sasl/chexum) (Ping timeout: 276 seconds)
21:33:45 × jpds quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 276 seconds)
21:33:53 chexum joins (~quassel@gateway/tor-sasl/chexum)
21:34:52 jpds joins (~jpds@gateway/tor-sasl/jpds)
21:37:11 × Null_A quits (~null_a@2601:645:8700:2290:e4f7:cf97:bec9:9d10) (Remote host closed the connection)
21:44:14 × michalz quits (~michalz@185.246.204.93) (Remote host closed the connection)
21:49:08 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
21:55:35 × xff0x quits (~xff0x@2001:1a81:5210:a600:f14:89c2:cfb:bd25) (Ping timeout: 260 seconds)
21:56:32 xff0x joins (~xff0x@2001:1a81:5210:a600:1bfc:35a2:5bfe:31)
22:00:48 × fendor_ quits (~fendor@77.119.208.38.wireless.dyn.drei.com) (Remote host closed the connection)
22:01:22 × max22- quits (~maxime@2a01cb0883359800f362ea56be7f8960.ipv6.abo.wanadoo.fr) (Quit: Leaving)
22:01:27 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
22:02:25 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
22:02:41 × gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving)
22:03:40 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Quit: Leaving)
22:05:07 geekosaur joins (~geekosaur@xmonad/geekosaur)
22:08:15 × echoone quits (~echoone@2a02:8109:a1c0:5d05:58b9:5c9f:8b69:dc13) (Quit: Client closed)
22:08:49 zebrag joins (~chris@user/zebrag)
22:16:36 × agoraphobic_ quits (~agoraphob@ip11-173.bon.riksnet.se) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in)
22:16:37 × peterhil quits (~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi) (Read error: Connection reset by peer)
22:16:49 agoraphobic joins (~agoraphob@ip11-173.bon.riksnet.se)
22:17:31 peterhil joins (~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi)
22:17:42 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
22:18:04 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
22:18:24 × Tuplanolla quits (~Tuplanoll@91-159-69-50.elisa-laajakaista.fi) (Quit: Leaving.)
22:21:17 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb)
22:25:31 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb) (Ping timeout: 245 seconds)
22:26:09 × Gurkenglas quits (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) (Ping timeout: 265 seconds)
22:28:15 hexfive joins (~eric@50.35.83.177)
22:31:04 zero is now known as zzz
22:33:52 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
22:35:45 zzz is now known as yin
22:36:54 × hexfive quits (~eric@50.35.83.177) (Quit: WeeChat 3.0.1)
22:37:38 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
22:40:28 × werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Remote host closed the connection)
22:40:36 × jollygood2 quits (~bc8165b6@217.29.117.252) (Quit: http://www.okay.uz/ (Session timeout))
22:41:56 markusde joins (~makrus@2604:3d08:6f80:6b00::2ba7)
22:42:01 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
22:52:35 Null_A joins (~null_a@2601:645:8700:2290:e4f7:cf97:bec9:9d10)
22:52:35 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
22:52:46 MQ-17J joins (~MQ-17J@8.6.144.117)
22:53:01 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb)
22:53:46 abrantesasf joins (~abrantesa@187.36.170.211)
22:55:51 idris joins (~idris@184.105.6.88)
22:56:04 idris is now known as hippoid
23:04:39 <ph88> So when the S combinator in lambda calculus is written as S=λxyz.(xz)(yz). And <*> is the S combinator for the applicative instance. Then how can the type signature of <*> be compared with the lambda equation ? S=λxyz.(xz)(yz). VS (<*>) :: Applicative f => f (a -> b) -> f a -> f b
23:05:00 × Everything quits (~Everythin@37.115.210.35) (Quit: leaving)
23:06:48 <hpc> that lambda term more corresponds to the value of (<*>) for a specific instance
23:07:22 <hpc> you can probably work out which instance yourself
23:07:29 <hpc> hint: look at x
23:07:30 <hippoid> typeclassopedia talks about `Applicative` as a way to "encapsulate certain sorts of effectful computations". What are "effectful computations"?
23:08:15 <hippoid> wow, I jumped into this conversation at the right time apparently
23:08:24 <hpc> heh
23:09:17 <hippoid> is "effectful computations" the same things as "functions with side effects"?
23:09:45 <hpc> hippoid: it's shorthand for a fairly specific notion of "this thing expresses more than just being an integer or boolean or whatever"
23:09:58 <ph88> hpc, not sure what you are talking about
23:10:49 <hippoid> hmm
23:10:50 <hpc> ph88: S=λxyz.(xz)(yz) is value-level and Applicative f => f (a -> b) -> f a -> f b is type-level
23:11:01 <hpc> hippoid: so for example, IO or Maybe
23:11:12 <hippoid> :i Maybe
23:11:21 <hpc> or [] (the type, not the value)
23:11:35 <hpc> > (+) <$> [10, 20] <*> [1, 2]
23:11:37 <lambdabot> [11,12,21,22]
23:12:01 <hippoid> so what part of that expression is the "effectful computation"?
23:12:01 <ph88> hippoid, i also don't know but i have the idea that if you have a function a -> b it's just a function. And then when you box it (Just (a -> b)) it suddenly becomes a "computation" which needs to be unwrapped first
23:12:26 <hpc> the "effect" here is that you're doing all of the combinations and not just one specific addition
23:12:35 <hpc> in IO, the effect might be that the numbers come from stdin
23:12:44 <hpc> in Maybe, you might not have one of the numbers
23:13:04 <hpc> but underneath that you still have addition, or whatever other thing you want to do
23:13:19 <ph88> hpc, ye on value level there are 3 input parameters x, y, and z and on type level i just see two input type f (a -> b) and f a
23:13:28 <dminuoso> hippoid: The crucial part is that "effectful computation" is not something that will help you understand what we mean.
23:13:41 <hippoid> hpc: ok i think that makes sense. Typeclassopedia also talks about Applicative allowing a context for a computation, so the context could be Maybe or [] or Either ...
23:13:44 <dminuoso> hippoid: By that I mean, it's a notion that people usually adapt *after* they've grokked it.
23:13:57 <hpc> ph88: it only looks that way, some value of 'f' might be able to help you out there
23:14:09 <hpc> like how this use of id has more parameters than it should
23:14:12 <hpc> > id (+) 1 2
23:14:14 <lambdabot> 3
23:14:22 <hippoid> I'm grokking the Effect word is used somewhat differently than the meaning in "side effect"
23:14:48 <c_wraith> it's the same meaning in most senses, but crucially no longer on the side.
23:15:12 <hippoid> c_wraith: thats a good clarification
23:15:13 <dminuoso> hippoid: So the thing is, we usually mean it in a very lose, most general, notion.
23:15:29 <ph88> dminuoso, well interesting, been programming for a while and also didnt know what this term was supposed to mean
23:15:42 <Axman6> :t \x y z -> (x z) (y z)
23:15:42 <hpc> hippoid: it might help to look at it straight from the laws too, with no intuition
23:15:43 <lambdabot> (t1 -> t2 -> t3) -> (t1 -> t2) -> t1 -> t3
23:15:47 <hpc> and let the two ideas meet in the middle
23:15:50 <dminuoso> The effect of [] is that of non-determinism, the effect of Maybe is anonymous exceptions
23:16:01 <dminuoso> With Cont its.. uh. I dont even know how to describe that one
23:16:06 <Axman6> :t (<*>) `asTypeOf` \x y z -> (x z) (y z)
23:16:07 <lambdabot> (t1 -> t2 -> t3) -> (t1 -> t2) -> t1 -> t3
23:16:13 × _bo quits (~bo@217.18.216.247) (Quit: Leaving)
23:16:20 <hpc> there's a lot of ways that the idea of "side effects" can fail to fit with Applicative
23:16:43 <dminuoso> Personally I think "effects" is a red herring when it comes to Applicative.
23:16:46 <ph88> hpc, so you are saying the parameters are a, b, a of f (a -> b) -> f a ?
23:17:23 <hpc> not quite
23:17:43 <hpc> try taking the type Axman6 gave and making it fit the type of (<*>)
23:17:59 <hpc> or in unification speak, solve the equation (t1 -> t2 -> t3) -> (t1 -> t2) -> t1 -> t3 = f (a -> b) -> f a -> f b
23:18:21 <ph88> that's useful Axman6 thanks !
23:18:42 <hippoid> ok, i'm going to be satisfied with my current vague understandindg of that term and move on to more code
23:18:49 <ph88> hpc, i can see that t1 is analogous with f .. that explain all for me
23:18:58 <hpc> almost
23:19:01 <dminuoso> hippoid: Indeed. The intution will come on its own when you discover and work with more instances.
23:19:02 <Axman6> the type (t1 -> t2 -> t3) -> (t1 -> t2) -> t1 -> t3 can be written as: ((->) t1 (t2 -> t3) -> ((->) t1 t2) -> ((->) t1 t3) or even (((->) t1) (t2 -> t3) -> (((->) t1) t2) -> (((->) t1) t3)
23:19:06 <hpc> you're forgetting the (->)
23:19:15 <ph88> hpc, what about the -> ?
23:19:26 <Axman6> ph88: it's not t1, t1 has the wrong kind, you need something of type * -> * (or Type -> Type)
23:19:27 <hpc> well, f :: Type -> Type
23:19:34 <markusde> IMO Applicatives are the sacaffolding for effects, a monad is a way to combine effects. Like, in the Maybe applicative you can have computations that short circuit to Nothing, and you can combine expreession you know won't, but combining a -> Maybe a expressions needs a monad
23:19:34 <hpc> and t1 :: Type
23:19:44 <Axman6> :kind (->)
23:19:45 <hpc> (to jump up to the kind level for a moment)
23:19:56 <Axman6> % :kind (->)
23:19:56 <yahb> Axman6: * -> * -> *
23:20:00 <Axman6> % :kind (->) Int
23:20:00 <yahb> Axman6: * -> *
23:20:04 <c_wraith> try @kind to get lambdabot's attention
23:20:05 <Axman6> % :kind (->) Int Bool
23:20:05 <yahb> Axman6: *
23:20:14 <dminuoso> My personal interpretation is that Monads are inherently about sequencing things, and Applicatives are about branching and joining (in a diamond shape)
23:20:32 <ph88> hippoid, it's not so vague as you think. When you normally have a pure function doing 1 + 1 or whatever. Now if you have a box like Maybe you can also choose between Just x or Nothing .. that would be "the effect" of the Maybe. that's it really (afaik). So you have computation (1 + 1) put in box Just (1 + 1) and now you have a effectful computation
23:20:46 <Axman6> ph88: so, in the case of the function applicative, f ~ ((->) a)
23:20:48 <dminuoso> There's some ways in which this makes sense, but it's really just an analogy you end up when you have established a particular perspective. It's particularly terrible to explain any of this.
23:20:59 <markusde> dminuoso: I don't think that's incorrect, but it's incomplete. The sequencing operator (>>) doesn't imply bind
23:21:31 <dminuoso> markusde: In what way do you feel it to be incomplete?
23:21:56 <Axman6> hippoid: it's definitely fair to think that our use of "effect" is very general, because it definitely is general. What effect does Identity have? Well none. And what about Proxy? Even less than none! >_>
23:22:11 <hpc> haha, "less than none"
23:22:23 <dminuoso> And [] doesnt *really* model non-determinism, because there's still an ordering going on
23:22:24 <Axman6> =)
23:22:28 <dminuoso> But Logic does
23:22:31 <ph88> dminuoso, can you elaborate on branching and joining ?
23:22:38 <markusde> <dminuoso>: Bind does sequence, but sequence doesn't do bind! You need a way to combine effects and values.
23:23:09 <Axman6> hpc: in a sense, if the compiler is smart enough, then using the Proxy applicative will compile to doing nothing at all, which I think is fair to call doing less than no work at runtime :P
23:23:14 <dminuoso> markusde: and sequence is about traversable, your point?
23:23:17 <ph88> Axman6, should i be able to fill in ((->) a) for t1 and figure it out ?
23:23:50 <Axman6> ph88: no, you should be able to fil in f ~ ((->) a) (<*>)'s type
23:23:50 <hpc> for f, not t1
23:23:53 <Axman6> :t (<*>)
23:23:54 <lambdabot> Applicative f => f (a -> b) -> f a -> f b
23:23:54 <markusde> dminuoso: That's my bad. When I said sequence I meant (>>).
23:24:09 <dminuoso> % :t (<@>) -- ph88
23:24:09 <yahb> dminuoso: ComonadApply w => w (a -> b) -> w a -> w b
23:24:11 <dminuoso> % :t ident -- ph88
23:24:12 <yahb> dminuoso: Applicative f => f ()
23:24:15 <Axman6> % :t (<*>) @((->) Int)
23:24:16 <yahb> Axman6: (Int -> (a -> b)) -> (Int -> a) -> Int -> b
23:24:17 <dminuoso> Uh wait.
23:24:20 <dminuoso> Someone reset yahb
23:24:44 <dminuoso> % :t (<@>) -- ph88
23:24:44 <yahb> dminuoso: Applicative f => f a -> f b -> f (a, b)
23:24:46 <dminuoso> % :t ident -- ph88
23:24:46 <yahb> dminuoso: Applicative f => f ()
23:25:07 <c_wraith> Why must I constantly stumble over the line between clean and obfuscated?
23:25:08 <dminuoso> ph88: We can think of these two things as fully descriptive of Applicative, as an alternative to <*> and pure
23:25:43 <dminuoso> (Side note: In some edge cases of infinite structures it doesnt hold true, but lets gloss over this)
23:26:08 <dminuoso> ph88: Compare that with
23:26:11 <dminuoso> % :t (>>=)
23:26:11 <yahb> dminuoso: Monad m => m a -> (a -> m b) -> m b
23:26:35 <dminuoso> ph88: See how (>>=) has a sort of sequencing baked in? We can observe this even better if we adopt this notion:
23:26:48 <dminuoso> join :: f :*: f ~> f
23:27:00 <dminuoso> And think about associativity
23:27:00 <hpc> c_wraith: go full php filthy
23:27:08 <hpc> instance Num String, (<>) = getLine, the works
23:27:13 yin parts (~z@user/zero) ()
23:27:27 <ph88> Axman6, is (Int -> (a -> b)) -> (Int -> a) -> Int -> b supposed to look like S=λxyz.(xz)(yz) or what are you saying ?
23:27:34 <dminuoso> ph88: With the <@> description, you can see there's no dependencies. Conceptually we can think these two arguments as branches that come back together.
23:27:39 <dminuoso> Like a diamond
23:28:13 <c_wraith> hpc: that's... a different case. I'm talking like line 12 in https://paste.tomsmeding.com/1IQ276S4
23:28:25 <dminuoso> ph88: There's a pretty deep rabbit hole in which we can generalize applicative to running two separate/incompatible effects.
23:28:46 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 252 seconds)
23:28:48 <Axman6> ph88: it is exactly the type of that, assuming z has type Int
23:29:06 <hpc> oh yikes
23:29:38 <monochrom> c_wraith: I don't think it's obfuscated/ing
23:29:39 <ph88> dminuoso, i've never seen <@> and ident before
23:29:42 <dminuoso> ph88: Interesting side note, with the <@> and ident description, you end up with pretty cool and readable applicative laws, like `ident` being an identity with respect to <@> (up to an isomorphism)
23:30:00 <c_wraith> monochrom: I dunno, I get nervous when I see an uncurry
23:30:15 <c_wraith> It almost hurt to write it!
23:30:19 <hpc> there's probably a way to not have "maybe" there
23:30:29 <c_wraith> sure, pattern match. :P
23:30:39 <hpc> i was thinking do-notation
23:30:43 <monochrom> Then perhaps (\(x,y) -> PQ.insert x y)
23:30:52 <hpc> just shamelessly make it a few extra lines long
23:31:57 <hpc> give catMaybes . map uncons a name
23:32:18 <c_wraith> that line is a local minima for difficulty parsing it mentally. It just moves that difficulty into the semantic space.
23:32:35 <ph88> Axman6, ah ye i see it now. Still have to understand how the lambda expression represents the more general s combinator and <*> only for the instance of ((->) a) ... ill look at the equations for a bit
23:33:02 <monochrom> You know, go looks like an unfoldr, if you want obfuscating :)
23:33:33 <dminuoso> ph88: If you ever heard this "a monad is just a monoid..." joke, there's a cute interesting bit too. Applicative are monoids too (in the very same sense of that joke!), and you can in fact see this monoidal shape come into existence with this representatoin
23:33:47 notzmv joins (~zmv@user/notzmv)
23:33:58 <c_wraith> monochrom: I think it's more of an unfoldr
23:34:09 <dminuoso> Say: f <@> (g <@> h) ~~~ (f <@> h) <@> h
23:34:22 <dminuoso> Or `f <@> ident ~~~ f` and `ident <@> f ~~~ f`
23:34:40 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
23:34:41 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
23:34:41 wroathe joins (~wroathe@user/wroathe)
23:34:44 <hpc> you can also see a monoidal structure in Alternative - that one stands out quite a bit imo
23:34:56 <dminuoso> Monoids are everywhere.
23:35:20 <hpc> it's like the CS version of linearity
23:35:23 <hpc> when you have it, everything is easy
23:35:27 <c_wraith> it works over a seed value, updating it and emitting an element one update at a time. definitely an unfoldr. But that's not pleasant to write!
23:36:25 <ph88> dminuoso, so you can split and combine ? or how to get to diamond shape ?
23:36:41 <dminuoso> ph88: Imagine branching like haxl
23:36:50 <dminuoso> or perhaps optparse-applicative in a non-deterministic sense
23:37:16 <monochrom> (++) is at the same time <> and <|>
23:37:44 <monochrom> This should give you a whole ton of confusions until you sort it out, and then it's a whole ton of mathematical beauty.
23:37:56 <dminuoso> ph88: `f <@> g` in haxl would simply run two things in parallel and wait on the result of both.
23:39:47 <dminuoso> The only reason we never think of Applicative as perhaps generalizing "running in parallel" has to do with two facts. For one, most applicative instances also have a monad instance, and the other - this is related to the other - once you have a monad instance (which is semantically all about sequencing), there's this unwritten law demanding coherence between applicative and monad.
23:40:06 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 265 seconds)
23:41:42 <dminuoso> So as soon as there's a monad instance, the very same applicative instance would have the monadic sequencing via a trivial instance (being defined in terms of monad)
23:41:53 <dminuoso> Making applicative mostly blant.
23:42:38 <dminuoso> So more of then than not <$> is just a monadic interface, there's strangely very few things that are Applicative (or Selective, even) but not Monadic.
23:45:38 acidjnk_new3 joins (~acidjnk@p200300d0c703cb999d5eb9ee05a422b5.dip0.t-ipconnect.de)
23:46:02 <markusde> Hey I have a question about a monad transformer (?) I'm not sure exists
23:46:16 <markusde> I
23:46:48 <markusde> 'm looking to promote a Maybe monad into a list, so Nothing -> [] and Just x -> [x]
23:47:16 <markusde> Is this a monad transformer thing? or is it some other structure
23:47:29 <dminuoso> markusde: This is not a monad transformer
23:47:46 <dminuoso> The technical term is called "natural transformation", and its a thing
23:48:06 <dminuoso> % import Data.Maybe
23:48:06 <yahb> dminuoso:
23:48:08 <dminuoso> % :t maybeToList
23:48:08 <yahb> dminuoso: Maybe a -> [a]
23:48:12 <dminuoso> % :t listToMaybe
23:48:12 <yahb> dminuoso: [a] -> Maybe a
23:49:10 <monochrom> But natural transformation is very broad.
23:49:16 × acidjnk_new quits (~acidjnk@p200300d0c703cb2624cf652eb5c49df1.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
23:49:37 <markusde> dminuoso: I see! In CT Natrual transformations map functors to functors, right?
23:49:45 <markusde> I'm a little rusty
23:50:00 <dminuoso> Yes.
23:52:19 <c_wraith> monochrom: thanks, unfoldr made it both cleaner to look at and harder to understand! https://paste.tomsmeding.com/8u8NaXTp
23:52:35 <markusde> dminuoso: ty!
23:52:43 <c_wraith> and it's not using ViewPatterns anymore, so a double-win!
23:53:07 <monochrom> bwahahahaha
23:53:34 × Cale quits (~cale@cpef48e38ee8583-cm0c473de9d680.cpe.net.cable.rogers.com) (Ping timeout: 252 seconds)
23:54:05 <monochrom> markusde: I think "monad morphism" is more specific.
23:54:18 <monochrom> https://hackage.haskell.org/package/mmorph-1.2.0/docs/Control-Monad-Morph.html may help
23:56:07 × zaquest quits (~notzaques@5.128.210.178) (Remote host closed the connection)
23:57:05 yin joins (~z@user/zero)
23:57:08 <yin> hello
23:57:33 <geekosaur> hi
23:57:48 <yin> i'm trying to understand continuations
23:57:57 zaquest joins (~notzaques@5.128.210.178)
23:57:58 <yin> the Continuation Monad
23:57:58 × acidjnk_new3 quits (~acidjnk@p200300d0c703cb999d5eb9ee05a422b5.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
23:58:24 <monochrom> My http://www.vex.net/~trebla/haskell/cont.xhtml may help.
23:58:25 werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
23:58:46 <yin> i've started reading 3 different sources with 3 different approaches and i'm getting "Monad tutorial" flashbacks
23:59:09 <yin> thanks! let's give it a try
23:59:36 <c_wraith> It occurs to me...
23:59:42 <markusde> monochrom:that looks like it too. lots to read today ty!
23:59:48 <monochrom> I don't do analogies or intuitions. I do testable theories.

All times are in UTC on 2021-10-14.