Home liberachat/#haskell: Logs Calendar

Logs on 2022-01-18 (liberachat/#haskell)

00:02:04 × DNH quits (~DNH@2a02:8108:1100:16d8:6155:4b1c:4cef:c11c) (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:02:17 × n3rdy1 quits (~n3rdy1@2600:1700:4570:3480:1b88:50f:dae0:9293) (Ping timeout: 240 seconds)
00:03:19 alx741 joins (~alx741@157.100.93.160)
00:06:53 Shiranai joins (~Shiranai@190.237.13.17)
00:07:11 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
00:07:55 <Axman6> it is also (%%~)
00:09:07 <Shiranai> Hello, I want to compute the list of differences of a Int list, i.e. `difs [1,3,6] == [2,4]`. I can do this by pattern matching but I'm wondering if there is some way to do if by using folds or maps
00:09:37 <c_wraith> Shiranai: it's typical to do it with a zip
00:09:41 <monochrom> Does it mean difs [a,b,c,d] = [b-a, c-b, d-c]?
00:09:53 <jackdk> monochrom: no d-c
00:09:56 <Shiranai> monochrom yes
00:10:03 <jackdk> Shiranai: what is `difs []`?
00:10:18 <Shiranai> jackdk []
00:10:38 <Shiranai> same with `difs [n]`
00:11:02 <jackdk> Shiranai: you can write it as a map after zipping the list with its own tail, but you'll need to handle the empty list separately
00:11:17 merijn joins (~merijn@c-001-002-002.client.esciencecenter.eduvpn.nl)
00:11:18 <monochrom> [b-a, c-b, d-c] = zipWith (-) [b,c,d] [a,b,c,d]
00:11:18 <c_wraith> jackdk: nap, zip handles the empty list
00:11:29 <Axman6> > zipWith f [a,b,c] [d,e,f]
00:11:30 <c_wraith> Err. *nah*.
00:11:30 <lambdabot> error:
00:11:30 <lambdabot> • Ambiguous type variable ‘c0’ arising from a use of ‘show_M421258202089...
00:11:30 <lambdabot> prevents the constraint ‘(Show c0)’ from being solved.
00:11:36 <Axman6> > zipWith f [a,b,c] [d,e,f] :: [Expr]
00:11:37 <lambdabot> [f a d,f b e,f c f]
00:11:57 <jackdk> c_wraith: but `tail` doesn't
00:12:10 <geekosaur> your f is ambiguous there
00:12:17 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 240 seconds)
00:12:18 <c_wraith> jackdk: but zip/zipWith does. The order it examines its arguments in is defined.
00:12:24 <Axman6> iif you're careful zipWith won't evaluate the tail []
00:12:27 <c_wraith> > zipWith [] undefined
00:12:28 <monochrom> Consider "drop 1"
00:12:29 <lambdabot> error:
00:12:29 <lambdabot> • Couldn't match expected type ‘a1 -> b -> c’
00:12:29 <lambdabot> with actual type ‘[a0]’
00:12:36 <c_wraith> > zipWith (+) [] undefined
00:12:37 <lambdabot> []
00:12:45 <jackdk> wow, TIL. cool.
00:12:46 <c_wraith> No special cases needed
00:12:48 <Shiranai> yeah I think I need to cover the [] case with an if-statement and then dothe zip thing
00:12:58 <Shiranai> ooo
00:13:00 <Shiranai> nice
00:13:03 <jackdk> until five seconds ago I would've agreed with you
00:13:06 <Axman6> nope, no need to use if here at all
00:13:22 <monochrom> c_wraith: May I entice you with a prank algebra exercise? Expand and simplify (x-a)(x-b)(x-c)...(x-z). >:)
00:13:22 <Axman6> if is almost always a code smell in haskell too
00:13:37 × biog quits (~user1@159.224.42.85) (Quit: ZZZzzz…)
00:13:47 <geekosaur> 0
00:13:53 <Axman6> I set x = a, and get ... 0
00:14:03 <Axman6> hmmm, I feel tricked
00:14:08 <geekosaur> don;t even need that, x-x is in the middle of it
00:14:15 × Adran quits (~adran@botters/adran) (Quit: Este é o fim.)
00:14:24 <Axman6> yeah. I've been had!
00:14:25 <monochrom> This is similar to the "f c f" there. >:)
00:15:31 <Axman6> > product $ zipWith (-) (repeat x) [a,b,c,d,e,f,g] :: Expr
00:15:32 <lambdabot> 1 * (x - a) * (x - b) * (x - c) * (x - d) * (x - e) * (x - f) * (x - g)
00:15:57 <Axman6> > iterate simplify $ (product $ zipWith (-) (repeat x) [a,b,c,d,e,f,g] :: Expr)
00:15:59 <lambdabot> error:
00:15:59 <lambdabot> • Variable not in scope: simplify :: Expr -> Expr
00:15:59 <lambdabot> • Perhaps you meant ‘simply’ (imported from Control.Lens)
00:16:13 <Axman6> of course lens has something called simply
00:16:21 <geekosaur> ^5
00:16:29 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
00:16:34 × little_mac quits (~little_ma@2601:410:4300:3ce0:ed98:da79:669a:f2be) (Remote host closed the connection)
00:17:06 <jackdk> Axman6: and in keeping with today's theme, it is yet another `id`
00:17:08 <Axman6> simply :: forall p f s a rep (r :: TYPE rep). (Optic' p f s a -> r) -> Optic' p f s a -> r -- | This is an adverb that can be used to modify many other Lens combinators to make them require simple lenses, simple traversals, simple prisms or simple isos as input.
00:17:28 Axman6 glares at edwardk
00:17:44 <jackdk> the real prank is that everything in lens is actually `id` (/s)
00:19:11 <Axman6> :t id id id id id id id id
00:19:12 <lambdabot> a -> a
00:20:28 edwardk feels his neck burning and looks up.
00:20:34 <Axman6> from :: AnIso s t a b -> Iso b a t s <- this is what got us into this whole COVID mess in the first place!
00:20:49 <jackdk> "how many `id`s have we got in this lib, anyhow?" (with apologies to Mel Brooks and Col. Sandurz)
00:21:00 ksqsf joins (~user@134.209.106.31)
00:21:05 <edwardk> Axman6: it just 'id', so 'simply' seems well named
00:21:38 <Axman6> I just feel like I've been pranked half the time I look at lens' definitions and it's always id
00:21:45 <edwardk> =)
00:21:58 Adran joins (~adran@botters/adran)
00:22:10 <edwardk> if you ignore the newtypes even more of its definitions are just id in disguise
00:22:50 <Axman6> "It turns out all we actually needed from SKI was I"
00:24:55 × 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)
00:24:56 alx741 joins (~alx741@157.100.93.160)
00:25:01 <awpr> so I just accidentally wrote a maybe-kinda-useful extensible records library while trying to write a joke extensible records library: https://replit.com/@AndrewPritchard/ImplicitParamRecords2#Main.hs
00:25:31 dka joins (~code-is-a@ns3059207.ip-193-70-33.eu)
00:25:32 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 240 seconds)
00:25:46 <geekosaur> now I'm wondering if that's how lens started out :þ
00:26:47 <awpr> the central idea: if I horribly abuse ImplicitParams to represent the fields, then GHC's constraint solver will do all the "hard" work of plumbing fields around for me
00:27:39 <awpr> why you should use it over _any other inferior extensible records library_: it ~~accidentally~~totally on purpose has something equivalent to RecordWildCards.
00:27:41 <boxscape_> vulkan let's me create a SurfaceKHR which is a newtype over Word64, but for GLFW-b, I need a Ptr instead. What's the proper way to convert a Word64 into a Ptr? (I'm assuming the Word64 is simply the memory address)
00:28:19 <Axman6> what's IP stand for?
00:28:21 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
00:28:43 <awpr> that's the internal class under the hood for ImplicitParams: `?aoeu :: Int` is actually `IP "aoeu" Int`
00:28:43 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
00:29:45 <boxscape_> ...alternatively, is there a way to create a fresh Ptr for an arbitrary type?
00:30:52 × Shiranai quits (~Shiranai@190.237.13.17) (Quit: Connection closed)
00:31:23 zmt01 joins (~zmt00@user/zmt00)
00:31:31 <boxscape_> (without allocating any memory for it)
00:31:41 <EvanR> boxscape_, Word64... really...
00:32:01 <jackdk> convert to Word, and use WordPtr newtype, then wordPtrToPtr?
00:32:03 <EvanR> well, it might be coercable
00:32:10 <boxscape_> I can try that
00:32:13 <boxscape_> thanks
00:32:13 <jackdk> haven't done ffi for a while, ymmv
00:32:34 ksqsf joins (~user@134.209.106.31)
00:32:37 × zmt00 quits (~zmt00@user/zmt00) (Ping timeout: 240 seconds)
00:32:50 aplainze1akind joins (~johndoe@captainludd.powered.by.lunarbnc.net)
00:32:54 <Axman6> awpr: I hate this, it just feels like data soup, there's no structure D: but it works, and I'm curious how well it works and performs
00:33:11 <jackdk> docs for distributive say: Categorically every Distributive functor is actually a right adjoint, and so it must be Representable endofunctor and preserve all limits. This is a fancy way of saying it isomorphic to (->) x for some x. this means Distributive and Representable are equivalent concepts on Hask?
00:33:32 × xff0x quits (~xff0x@2001:1a81:53cb:cc00:be2f:4794:e7a4:33cb) (Ping timeout: 240 seconds)
00:33:41 <awpr> I have no idea other than that it seems to work for the examples at the bottom of the file. I don't have any plans to use it for anything beyond entertainment though
00:33:43 <jackdk> I assume this is not the case on Hask^Hask -> Hask (I've been thinking about rank2 representable as a way to index record fields with a GADT)
00:33:48 × waleee quits (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 250 seconds)
00:34:28 <awpr> jackdk, that's https://hackage.haskell.org/package/ten-0.1.0.2/docs/Data-Ten-Representable.html#t:Representable10 FWIW
00:34:49 xff0x joins (~xff0x@2001:1a81:53cb:cc00:10bf:48ef:429:dca8)
00:34:55 × hamishmack_ quits (sid389057@id-389057.hampstead.irccloud.com) (Ping timeout: 268 seconds)
00:34:59 <Axman6> maybe ImplicitParams died too early (even if they do live on in the stack traces' implementation)
00:35:03 × Jon quits (jon@dow.land) (Quit: ZNC - http://znc.in)
00:35:04 × Hobbyboy quits (Hobbyboy@hobbyboy.co.uk) (Quit: The BNC has broken!)
00:35:24 <jackdk> awpr: another one! I was only aware of rank2classes, conkin, and barbies.
00:35:32 × ProofTechnique quits (sid79547@id-79547.ilkley.irccloud.com) (Ping timeout: 268 seconds)
00:35:32 × amir quits (sid22336@user/amir) (Ping timeout: 268 seconds)
00:35:33 <awpr> I think future versions of https://hackage.haskell.org/package/hkd-0.1/docs/Data-HKD.html are slated to have something equivalent too?
00:35:38 <jackdk> thanks for the link. a shame none seem to be canonical
00:36:10 × cstml[m] quits (~cstmlmatr@2001:470:69fc:105::1:5c07) (Ping timeout: 268 seconds)
00:36:10 × jmcantrell quits (~jmcantrel@user/jmcantrell) (Ping timeout: 268 seconds)
00:36:10 × Topik[m] quits (~topikmatr@2001:470:69fc:105::a082) (Ping timeout: 268 seconds)
00:36:10 × jneira[m] quits (~jneiramat@2001:470:69fc:105::d729) (Ping timeout: 268 seconds)
00:36:11 × Nate[m]1 quits (~m52957mat@2001:470:69fc:105::1:591a) (Ping timeout: 268 seconds)
00:36:11 × marinelli[m] quits (~marinelli@2001:470:69fc:105::2d8) (Ping timeout: 268 seconds)
00:36:11 × eoiles[m] quits (~eoilesmat@2001:470:69fc:105::1:6164) (Ping timeout: 268 seconds)
00:36:11 × kadoban quits (~kadoban@user/kadoban) (Ping timeout: 268 seconds)
00:36:11 × wildsebastian quits (~wildsebas@2001:470:69fc:105::1:14b1) (Ping timeout: 268 seconds)
00:36:11 × aidy quits (~aidy@2001:470:69fc:105::c7b4) (Ping timeout: 268 seconds)
00:36:11 × vaibhavsagar[m] quits (~vaibhavsa@2001:470:69fc:105::ffe) (Ping timeout: 268 seconds)
00:36:11 × benjamin[m]1234 quits (~benjaminm@2001:470:69fc:105::1:3f2f) (Ping timeout: 268 seconds)
00:36:11 × IgnatInsarov[m] quits (~kindaroma@2001:470:69fc:105::f5d9) (Ping timeout: 268 seconds)
00:36:11 × carmysilna quits (~brightly-@2001:470:69fc:105::2190) (Ping timeout: 268 seconds)
00:36:11 × kawzeg quits (kawzeg@2a01:7e01::f03c:92ff:fee2:ec34) (Ping timeout: 268 seconds)
00:36:11 × hexagoxel quits (~hexagoxel@2a01:4f8:c0c:e::2) (Ping timeout: 268 seconds)
00:36:17 × mrmonday quits (~robert@what.i.hope.is.not.a.tabernaevagant.es) (Ping timeout: 240 seconds)
00:36:32 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 240 seconds)
00:36:41 <awpr> huh, I didn't find rank2classes when I surveyed the ecosystem... amusingly its description is extremely similar to mine
00:36:46 × hsiktas[m] quits (~hsiktasm]@2001:470:69fc:105::30d4) (Ping timeout: 268 seconds)
00:36:46 × aplainzetakind quits (~johndoe@captainludd.powered.by.lunarbnc.net) (Ping timeout: 268 seconds)
00:36:46 × cyphase quits (~cyphase@user/cyphase) (Ping timeout: 268 seconds)
00:36:46 × maralorn quits (~maralorn@2001:470:69fc:105::251) (Ping timeout: 268 seconds)
00:36:46 × siraben quits (~siraben@user/siraben) (Ping timeout: 268 seconds)
00:36:46 × parseval quits (sid239098@id-239098.helmsley.irccloud.com) (Ping timeout: 268 seconds)
00:36:46 × oxytocat quits (~alloca@user/suppi) (Ping timeout: 268 seconds)
00:36:46 × krjst quits (~krjst@2604:a880:800:c1::16b:8001) (Ping timeout: 268 seconds)
00:36:46 × thonkpod quits (~thonkpod@user/thonkpod) (Ping timeout: 268 seconds)
00:36:55 hamishmack_ joins (sid389057@id-389057.hampstead.irccloud.com)
00:37:02 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 240 seconds)
00:37:15 × robertm quits (robertm@lattice.rojoma.com) (Ping timeout: 250 seconds)
00:37:15 × zaquest quits (~notzaques@5.130.79.72) (Remote host closed the connection)
00:37:37 waleee-cl joins (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4)
00:37:51 kawzeg joins (kawzeg@2a01:7e01::f03c:92ff:fee2:ec34)
00:37:57 ProofTechnique joins (sid79547@id-79547.ilkley.irccloud.com)
00:38:02 parseval joins (sid239098@id-239098.helmsley.irccloud.com)
00:38:03 amir joins (sid22336@user/amir)
00:38:04 mrmonday joins (~robert@what.i.hope.is.not.a.tabernaevagant.es)
00:38:05 <awpr> I'd love for `ten` to become canonical (afaik it's as complete as any other one), but it looks like `hkd` will win by virtue of `lens` depending on it in the moderate future
00:38:08 cyphase joins (~cyphase@user/cyphase)
00:38:08 oxytocat joins (~alloca@user/suppi)
00:38:25 thonkpod joins (~thonkpod@user/thonkpod)
00:38:25 Jon joins (jon@dow.land)
00:38:30 <jackdk> at least hkd doesn't have that awful Identity-erasing type familyy
00:38:53 <jackdk> why does `lens` need to depend on `hkd`?
00:38:54 hexagoxel joins (~hexagoxel@hexagoxel.de)
00:38:56 robertm joins (robertm@lattice.rojoma.com)
00:39:01 <awpr> yeah, people seem to love that thing for reasons I can't understand
00:39:01 krjst joins (~krjst@2604:a880:800:c1::16b:8001)
00:39:03 Hobbyboy joins (Hobbyboy@hobbyboy.co.uk)
00:39:03 zaquest joins (~notzaques@5.130.79.72)
00:39:28 <jackdk> because they don't reach a point where the inconsistency it introduces becomes painful
00:39:28 <awpr> (re: `hkd` becoming canonical) in which case I'll probably just try to get the novel stuff from `ten` absorbed into `hkd`
00:40:34 <boxscape_> actually I lied, I do need to allocate the memory, so maybe I should just use Foreign.Marshal.Alloc.malloc. Only problem is I'm not sure there's a way to programmatically find out how much memory I need for SurfaceKHR, but I guess I'll just have to rely on them never changing the size
00:40:53 <awpr> IIUC the reason for growing the dependency is that `distributive` can be expressed in a much more performant way by being built on top of HKD ideas, with the core method being `Functor10 f => f g -> g (f Identity)`
00:40:55 <boxscape_> s/malloc/mallocBytes
00:41:06 <jackdk> awpr: you don't seem to have contravariant, and nobody seems to have divisible and decidable , but I don't know if those are useful for at rank2
00:41:29 × yauhsien quits (~yauhsien@61-231-62-246.dynamic-ip.hinet.net) (Ping timeout: 256 seconds)
00:41:38 <awpr> yeah, true, I typed it in but left it commented out because I didn't have a use for it at the time
00:42:07 <awpr> also don't know if Divisible10 and Decidable10 would be useful
00:43:48 <boxscape_> ah, never mind, I suppose I can use malloc because it's Storable, solving that issue
00:44:42 <jackdk> awpr: I like that you have variants of sequenceA etc that are ergonomic when you have Identity kicking around
00:44:57 × waleee-cl quits (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 240 seconds)
00:44:57 alx741 joins (~alx741@157.100.93.160)
00:45:32 <monochrom> identity strikes again, this time at the type level too :)
00:45:33 <awpr> yeah, tbh I just wasn't sure which form was more useful, so I threw both in there. the names get a bit dense though
00:45:49 Nate[m]1 joins (~m52957mat@2001:470:69fc:105::1:591a)
00:45:51 × merijn quits (~merijn@c-001-002-002.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds)
00:46:09 cstml[m] joins (~cstmlmatr@2001:470:69fc:105::1:5c07)
00:46:12 jneira[m] joins (~jneiramat@2001:470:69fc:105::d729)
00:46:17 carmysilna joins (~brightly-@2001:470:69fc:105::2190)
00:46:26 jmcantrell joins (~jmcantrel@user/jmcantrell)
00:47:15 <awpr> the main thing in `ten` that I'm not aware of any other library doing well is dealing with constraints that are common to every field type: `fmap10C @Show (Const . show)` says if you have a record where every field has a Show instance, then you can just go and 'show' each field with relatively little fanfare
00:48:00 <jackdk> https://hackage.haskell.org/package/constraints-extras gives you that, and gets used a bit in the DMapverse
00:48:39 kadoban joins (~kadoban@user/kadoban)
00:48:56 <awpr> ah yeah, looks like a very similar implementation
00:49:21 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
00:50:16 × kaph quits (~kaph@net-2-47-208-144.cust.vodafonedsl.it) (Ping timeout: 250 seconds)
00:50:30 <awpr> along the same lines, https://hackage.haskell.org/package/ten-unordered-containers is similar functionality to DMap except with a valid license
00:50:30 <jackdk> but if hkd is going to be everywhere because it's depended on by the 500lb gorilla of teh haskell depgraph, then the best thing to do may be to pump your best ideas into that?
00:50:56 <awpr> yeah, that's probably the direction it'll end up going
00:52:24 wildsebastian joins (~wildsebas@2001:470:69fc:105::1:14b1)
00:52:29 <jackdk> interesting to see these libraries coming out with Google copyrights and recent dates. Have they started adopting more Haskell?
00:52:37 eoiles[m] joins (~eoilesmat@2001:470:69fc:105::1:6164)
00:52:38 Topik[m] joins (~topikmatr@2001:470:69fc:105::a082)
00:52:40 vaibhavsagar[m] joins (~vaibhavsa@2001:470:69fc:105::ffe)
00:52:42 IgnatInsarov[m] joins (~kindaroma@2001:470:69fc:105::f5d9)
00:52:42 <awpr> well I've started open-sourcing more Haskell
00:52:43 marinelli[m] joins (~marinelli@2001:470:69fc:105::2d8)
00:52:53 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
00:52:53 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
00:52:53 wroathe joins (~wroathe@user/wroathe)
00:53:42 benjamin[m]1234 joins (~benjaminm@2001:470:69fc:105::1:3f2f)
00:54:16 aidy joins (~aidy@2001:470:69fc:105::c7b4)
00:54:43 maralorn joins (~maralorn@2001:470:69fc:105::251)
00:54:43 siraben joins (~siraben@user/siraben)
00:55:20 <jackdk> noice
00:55:23 hsiktas[m] joins (~hsiktasm]@2001:470:69fc:105::30d4)
00:58:06 × zfnmxt quits (~zfnmxtzfn@2001:470:69fc:105::2b32) (Changing host)
00:58:06 zfnmxt joins (~zfnmxtzfn@user/zfnmxt)
00:59:32 × jgeerds quits (~jgeerds@55d4090e.access.ecotel.net) (Ping timeout: 240 seconds)
01:01:25 lavaman joins (~lavaman@98.38.249.169)
01:01:47 machinedgod joins (~machinedg@24.105.81.50)
01:04:01 ksqsf joins (~user@134.209.106.31)
01:05:32 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 240 seconds)
01:07:17 × zebrag quits (~chris@user/zebrag) (Quit: Konversation terminated!)
01:07:29 alx741 joins (~alx741@157.100.93.160)
01:08:32 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 240 seconds)
01:09:05 Shiranai joins (~Shiranai@190.237.13.17)
01:09:27 <Shiranai> Why can't I eta reduce `f x = (*3) $ div 2 x` to `f = (*3) $ div 2`?
01:09:44 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
01:10:08 <Axman6> )@src ($)
01:10:11 <Axman6> @src ($)
01:10:11 <lambdabot> f $ x = f x
01:10:31 <Axman6> div 2 is the argument x
01:10:55 <Axman6> so what you've written is ((*3) (div 2))
01:11:16 pavonia joins (~user@user/siracusa)
01:11:24 <Axman6> which is ((\n ->n*3) (\p -> div 2 p))
01:11:28 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
01:11:50 <Axman6> you _can_ write (*3) . div 2
01:11:55 <Axman6> @src (.)
01:11:55 <lambdabot> (f . g) x = f (g x)
01:12:02 × CiaoSen quits (~Jura@p200300c95737a2002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
01:12:53 <Shiranai> ohh got it, thanks!
01:14:38 <Axman6> it's worth going through this exercise, translating both expressions and see what you get back - what does ((\n ->n*3) (\p -> div 2 p)) become?
01:15:33 × wroathe quits (~wroathe@user/wroathe) (Read error: Connection reset by peer)
01:16:02 × Rembane quits (~Rembane@li346-36.members.linode.com) (Ping timeout: 265 seconds)
01:16:10 Rembane joins (~Rembane@li346-36.members.linode.com)
01:16:59 × fiddlerwoaroof quits (~fiddlerwo@user/fiddlerwoaroof) (Quit: Gone.)
01:17:00 × justJustache quits (~justache@user/justache) (Remote host closed the connection)
01:17:28 waleee-cl joins (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4)
01:17:35 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
01:18:00 justJustache joins (~justache@user/justache)
01:18:05 × bens quits (~bens@www.typius.com) (Ping timeout: 268 seconds)
01:18:17 fiddlerwoaroof joins (~fiddlerwo@user/fiddlerwoaroof)
01:18:28 bens joins (~bens@www.typius.com)
01:20:46 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
01:20:46 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
01:20:46 wroathe joins (~wroathe@user/wroathe)
01:24:08 ksqsf joins (~user@134.209.106.31)
01:24:32 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 240 seconds)
01:24:48 × ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds)
01:25:55 ec joins (~ec@gateway/tor-sasl/ec)
01:26:36 alx741 joins (~alx741@157.100.93.160)
01:31:08 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
01:32:19 × ProfSimm quits (~ProfSimm@87.227.196.109) (Ping timeout: 256 seconds)
01:44:26 cross_ is now known as cross
01:46:02 × Gurkenglas quits (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) (Ping timeout: 240 seconds)
01:47:46 alx741 joins (~alx741@157.100.93.160)
01:48:20 lavaman joins (~lavaman@98.38.249.169)
01:49:17 × xsperry quits (~xs@user/xsperry) (Remote host closed the connection)
01:50:24 xsperry joins (~xs@user/xsperry)
01:51:47 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
01:55:58 × Shiranai quits (~Shiranai@190.237.13.17) (Quit: Connection closed)
01:58:37 × mvk quits (~mvk@2607:fea8:5cdd:f000::55f8) (Ping timeout: 240 seconds)
01:58:44 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 250 seconds)
01:58:57 × SlowLearner quits (~SlowLearn@2804:14c:65a1:452d:faeb:2e8a:da33:265f) (Ping timeout: 256 seconds)
02:01:50 Erutuon joins (~Erutuon@user/erutuon)
02:02:08 × werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Quit: Lost terminal)
02:04:15 werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
02:05:49 califax- joins (~califax@user/califx)
02:08:45 × slack1256 quits (~slack1256@186.11.99.46) (Ping timeout: 256 seconds)
02:08:55 alx741 joins (~alx741@157.100.93.160)
02:10:18 × califax quits (~califax@user/califx) (Ping timeout: 276 seconds)
02:10:19 califax- is now known as califax
02:10:44 kaph joins (~kaph@net-2-47-208-144.cust.vodafonedsl.it)
02:11:27 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
02:12:19 deadmarshal joins (~deadmarsh@95.38.228.70)
02:16:32 × deadmarshal quits (~deadmarsh@95.38.228.70) (Ping timeout: 240 seconds)
02:18:40 × waleee-cl quits (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 250 seconds)
02:20:32 × alp quits (~alp@user/alp) (Ping timeout: 240 seconds)
02:22:08 × xff0x quits (~xff0x@2001:1a81:53cb:cc00:10bf:48ef:429:dca8) (Ping timeout: 250 seconds)
02:24:02 xff0x joins (~xff0x@2001:1a81:5209:df00:e795:8bea:73be:6c45)
02:24:17 neurocyte0917090 joins (~neurocyte@IP-185189141194.dynamic.medianet-world.de)
02:24:17 × neurocyte0917090 quits (~neurocyte@IP-185189141194.dynamic.medianet-world.de) (Changing host)
02:24:17 neurocyte0917090 joins (~neurocyte@user/neurocyte)
02:26:01 <alexfmpe[m]> @free x :: Int
02:26:01 <lambdabot> x = x
02:26:02 × neurocyte091709 quits (~neurocyte@user/neurocyte) (Ping timeout: 240 seconds)
02:26:02 neurocyte0917090 is now known as neurocyte091709
02:28:02 alx741 joins (~alx741@157.100.93.160)
02:28:23 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 268 seconds)
02:31:06 waleee-cl joins (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4)
02:31:21 <Axman6> awpr: I feel at least a blog post is deserved from that record thing
02:31:55 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
02:32:08 lavaman joins (~lavaman@98.38.249.169)
02:38:19 ksqsf joins (~user@134.209.106.31)
02:41:44 merijn joins (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl)
02:43:32 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 240 seconds)
02:55:04 × waleee-cl quits (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 250 seconds)
02:57:40 <Axman6> Anyone know if anyone has written a linker in Haskell?
03:01:12 nunggu joins (~q@user/nunggu)
03:02:59 × tomku quits (~tomku@user/tomku) (Read error: Connection reset by peer)
03:03:48 <jackdk> what are you thinking of Axman6
03:05:26 little_mac joins (~little_ma@2601:410:4300:3ce0:ed98:da79:669a:f2be)
03:06:15 <Axman6> I was reading https://maskray.me/blog/2021-12-19-why-isnt-ld.lld-faster and thinking "Surely linking is just tying the knot"
03:07:34 tomku joins (~tomku@user/tomku)
03:08:02 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 240 seconds)
03:10:25 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
03:10:25 finn_elija joins (~finn_elij@user/finn-elija/x-0085643)
03:10:25 finn_elija is now known as FinnElija
03:11:24 × ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds)
03:15:04 × Everything quits (~Everythin@46-133-77-215.mobile.vf-ua.net) (Quit: leaving)
03:16:11 × merijn quits (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds)
03:19:44 ksqsf joins (~user@134.209.106.31)
03:21:25 × pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.4)
03:24:41 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 256 seconds)
03:27:32 × raym quits (~raym@user/raym) (Ping timeout: 240 seconds)
03:29:36 raym joins (~raym@user/raym)
03:35:51 × td_ quits (~td@94.134.91.126) (Ping timeout: 256 seconds)
03:37:12 × little_mac quits (~little_ma@2601:410:4300:3ce0:ed98:da79:669a:f2be) (Remote host closed the connection)
03:37:30 little_mac joins (~little_ma@2601:410:4300:3ce0:c076:ae6d:3ec6:202c)
03:37:32 td_ joins (~td@muedsl-82-207-238-179.citykom.de)
03:41:00 × geranim0 quits (~geranim0@modemcable242.171-178-173.mc.videotron.ca) (Ping timeout: 250 seconds)
03:46:35 <lagash> "First comes love..."
03:51:42 mbuf joins (~Shakthi@136.185.86.67)
03:52:44 × mbuf quits (~Shakthi@136.185.86.67) (Remote host closed the connection)
03:54:48 Jing joins (~hedgehog@240e:390:7c53:a7e1:a9:59ba:3231:6160)
03:56:36 × little_mac quits (~little_ma@2601:410:4300:3ce0:c076:ae6d:3ec6:202c) (Ping timeout: 250 seconds)
03:57:56 mbuf joins (~Shakthi@136.185.86.67)
04:05:02 ksqsf joins (~user@134.209.106.31)
04:06:01 jackson99 joins (~bc8147f2@cerf.good1.com)
04:06:46 vysn joins (~vysn@user/vysn)
04:09:32 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 240 seconds)
04:12:27 × burnsidesLlama quits (~burnsides@dhcp168-045.wadham.ox.ac.uk) (Remote host closed the connection)
04:13:03 <Axman6> Then comes code...
04:16:48 yauhsien joins (~yauhsien@61-231-62-246.dynamic-ip.hinet.net)
04:21:51 × yauhsien quits (~yauhsien@61-231-62-246.dynamic-ip.hinet.net) (Ping timeout: 268 seconds)
04:31:49 dyeplexer joins (~dyeplexer@user/dyeplexer)
04:36:28 × ezzieyguywuf quits (~Unknown@user/ezzieyguywuf) (Ping timeout: 250 seconds)
04:37:12 jinsun__ joins (~quassel@user/jinsun)
04:38:33 ezzieyguywuf joins (~Unknown@user/ezzieyguywuf)
04:39:09 × alMalsamo quits (~alMalsamo@gateway/tor-sasl/almalsamo) (Ping timeout: 276 seconds)
04:41:01 × jinsun quits (~quassel@user/jinsun) (Ping timeout: 256 seconds)
04:41:48 Erutuon joins (~Erutuon@user/erutuon)
04:43:45 <Axman6> awpr: ... why ten/10?
04:44:31 <Axman6> ah, not in the README but is in Data.Ten - reading
04:47:37 × emf quits (~emf@2620:10d:c090:400::5:2d26) (Ping timeout: 240 seconds)
04:50:20 emf joins (~emf@2620:10d:c090:400::5:2d26)
04:53:58 ksqsf joins (~user@134.209.106.31)
04:58:32 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 240 seconds)
04:59:54 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
05:01:14 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
05:01:35 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Client Quit)
05:01:56 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
05:06:05 slack1256 joins (~slack1256@186.11.99.46)
05:08:43 jenna8912 joins (~jenna@c-107-5-104-51.hsd1.mi.comcast.net)
05:11:50 ksqsf joins (~user@134.209.106.31)
05:12:29 × troydm quits (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 252 seconds)
05:12:30 merijn joins (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl)
05:16:11 deadmarshal joins (~deadmarsh@95.38.228.70)
05:16:46 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 250 seconds)
05:21:26 troydm joins (~troydm@host-176-37-124-197.b025.la.net.ua)
05:21:48 × boxscape_ quits (~boxscape_@p4ff0b9d5.dip0.t-ipconnect.de) (Quit: Connection closed)
05:23:27 <awpr> hmm, the GitHub repo README is more thorough, but not shown on Hackage. I should find a way to get that included (I think it's just extra-source-files, but this README is in the directory above the package, so it might take an extra symlink or copy or something)
05:23:30 <awpr> https://github.com/google/hs-ten/issues/6
05:23:34 ksqsf joins (~user@134.209.106.31)
05:30:55 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 268 seconds)
05:36:28 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds)
05:38:26 × dyeplexer quits (~dyeplexer@user/dyeplexer) (Ping timeout: 250 seconds)
05:43:36 × bens quits (~bens@www.typius.com) (Quit: leaving)
05:44:18 <Axman6> Great, thanks :)
05:44:59 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
05:44:59 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
05:44:59 wroathe joins (~wroathe@user/wroathe)
05:44:59 × gentauro quits (~gentauro@user/gentauro) (Read error: Connection reset by peer)
05:45:19 gentauro joins (~gentauro@user/gentauro)
05:46:57 × merijn quits (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) (Ping timeout: 268 seconds)
05:48:02 × vysn quits (~vysn@user/vysn) (Ping timeout: 240 seconds)
05:49:32 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 240 seconds)
05:49:42 arjun_ joins (~arjun@user/arjun)
05:50:18 mvk joins (~mvk@2607:fea8:5cdd:f000::55f8)
05:50:42 <arjun_> hi
05:50:59 <arjun_> what's the least painful way to bound a type range?
05:51:21 <arjun_> if i want a type that only is Float 0.0 to 1.0 and would error on range outside it
05:57:42 ksqsf joins (~user@134.209.106.31)
05:59:15 × slowButPresent quits (~slowButPr@user/slowbutpresent) (Quit: leaving)
05:59:50 <c_wraith> if Float/Double weren't pariahs at the type level, I'd say the refined package. But they are, so... not that.
06:00:19 <arjun_> what's even a pariah? : P
06:01:12 <jackdk> c_wraith is saying that you can't have typelevel Float/Double like you can Int
06:01:44 <c_wraith> pariah - someone/something that must be avoided.
06:01:45 <jackdk> I would probably write `data Clamped a = Clamped { cMin :: a, cMax :: a, cVal :: a }`
06:01:49 <arjun_> i want to ask why but im scared lol
06:01:55 × werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Quit: Lost terminal)
06:02:02 <c_wraith> I honestly have no idea.
06:02:21 <c_wraith> I don't know why GHC didn't promote all the primitive types when it promoted String and Integer
06:02:59 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 268 seconds)
06:03:12 <arjun_> i'd rather have them checked compile time rather than blowing at runtime or being have to carry around a smart constructor
06:03:32 alMalsamo joins (~alMalsamo@gateway/tor-sasl/almalsamo)
06:03:38 <arjun_> things like Type 0.3 + Type 0.4 should be allowed since they result in Type 0.7
06:04:00 <arjun_> but Type 1.0 + Type 0.4 should be not since > 1.0
06:04:02 <c_wraith> that seems... difficult... to do at compile time
06:04:24 <c_wraith> ie, it only would work with completely static paths
06:04:31 <c_wraith> um.. code paths
06:04:46 <c_wraith> Any time something might behave differently based on input, it would fail
06:07:04 <arjun_> refine seems alright
06:10:05 <arjun_> refined*
06:12:55 <Axman6> data Probability = Probability Word64 -- represents 1/n
06:12:58 <Axman6> >_>
06:13:18 <Axman6> hmm, I guess that makes 0.75 very difficult to represent
06:15:37 <awpr> if that's meant to be a way of mapping things onto [0,1) by definition: `newtype Unity = Unity Double -- represents 0.5 + 0.5*log(p/(1-p))` is one traditional way to do it.
06:17:05 <Axman6> > map (\p -> 0.5 + 0.5*log(p/(1-p))) [0,1,10,-1,-10]
06:17:07 <lambdabot> [-Infinity,Infinity,NaN,NaN,NaN]
06:17:31 <Axman6> > map (\p -> 0.5 + 0.5*log(p/(1-p))) [0.1,0.5,0.9]
06:17:32 <lambdabot> [-0.5986122886681096,0.5,1.5986122886681098]
06:17:35 <arjun_> it's not to map
06:17:47 <awpr> I got the specifics very wrong, but it's meant to turn "approaches infinity" into "approaches 1" and "approaches -infinity" into "approaches 0"
06:18:49 <Axman6> Interesting - would love to learn more
06:19:07 <awpr> > map (\a -> exp a / (1 + exp a)) [-1000, -100, -10, -1, 0, 1, 10, 100, 1000)
06:19:09 <lambdabot> <hint>:1:75: error: parse error on input ‘)’
06:19:17 <awpr> > map (\a -> exp a / (1 + exp a)) [-1000, -100, -10, -1, 0, 1, 10, 100, 1000]
06:19:18 <lambdabot> [0.0,3.720075976020836e-44,4.5397868702434395e-5,0.2689414213699951,0.5,0.73...
06:19:55 `2jt joins (~jtomas@10.red-83-58-228.dynamicip.rima-tde.net)
06:21:36 <awpr> > map (\a -> realToFrac (exp a / (1 + exp a)) :: Fixed Milli) [-1000 :: Double, -100, -10, -1, 0, 1, 10, 100, 1000]
06:21:38 <lambdabot> error:
06:21:38 <lambdabot> Ambiguous occurrence ‘Fixed’
06:21:38 <lambdabot> It could refer to
06:21:53 <EvanR> Axman6, egyptian fractions to the rescue or something
06:22:24 ksqsf joins (~user@134.209.106.31)
06:22:47 <EvanR> arjun_, if possible, make a new type for 0 to 1 and only have api functions that make sense for those, i.e. times but not plus
06:23:25 <Axman6> yeah you can't make a sensible Num instance for that
06:24:02 <arjun_> EvanR, how do i newtype a range?
06:25:11 × deadmarshal quits (~deadmarsh@95.38.228.70) (Ping timeout: 268 seconds)
06:25:57 <Axman6> @hoogle log1p
06:25:57 <lambdabot> Numeric log1p :: Floating a => a -> a
06:25:57 <lambdabot> GHC.Float log1p :: Floating a => a -> a
06:25:57 <lambdabot> Protolude log1p :: Floating a => a -> a
06:29:03 <EvanR> arjun_, a new type wrapper allows you to control how values are constructed, gating them behind a check, in this case that they are in range
06:29:17 <EvanR> aol keyword "smart constructor"
06:29:42 <EvanR> that's a runtime techinque though
06:29:55 <EvanR> but it's not painful
06:31:17 × zmt01 quits (~zmt00@user/zmt00) (Ping timeout: 240 seconds)
06:38:08 × kaph quits (~kaph@net-2-47-208-144.cust.vodafonedsl.it) (Ping timeout: 268 seconds)
06:39:32 × notzmv quits (~zmv@user/notzmv) (Ping timeout: 240 seconds)
06:40:14 deadmarshal joins (~deadmarsh@95.38.228.70)
06:44:05 <arjun_> > a new type wrapper allows you to control how values are constructed, gating them behind a check
06:44:07 <lambdabot> <hint>:1:7: error: parse error on input ‘type’
06:44:09 <arjun_> i didn't know that
06:44:21 <arjun_> do you have an example the top of your head EvanR ?
06:46:28 × xff0x quits (~xff0x@2001:1a81:5209:df00:e795:8bea:73be:6c45) (Ping timeout: 250 seconds)
06:46:32 michalz joins (~michalz@185.246.204.101)
06:46:50 <arjun_> nvm, i think i found it : p
06:46:53 <arjun_> https://www.haskell.org/tutorial/moretypes.html
06:47:15 xff0x joins (~xff0x@2001:1a81:5209:df00:1935:85e:8166:55b)
06:50:27 alp joins (~alp@user/alp)
06:53:47 × vglfr quits (~vglfr@46.96.179.132) (Ping timeout: 256 seconds)
06:54:21 × hololeap quits (~hololeap@user/hololeap) (Excess Flood)
06:55:43 fef joins (~thedawn@user/thedawn)
06:55:44 _ht joins (~quassel@2a02:a468:b619:1:c1f2:a735:3541:23f8)
06:55:46 hololeap joins (~hololeap@user/hololeap)
07:06:43 fcc977 joins (~kaph@151.19.243.144)
07:07:48 slac19759 joins (~slack1256@191.125.99.76)
07:09:35 × deadmarshal quits (~deadmarsh@95.38.228.70) (Ping timeout: 268 seconds)
07:10:12 × slack1256 quits (~slack1256@186.11.99.46) (Ping timeout: 268 seconds)
07:10:53 mikoto-chan joins (~mikoto-ch@213.177.151.239)
07:11:32 max22- joins (~maxime@2a01cb0883359800958d49fa3415ab33.ipv6.abo.wanadoo.fr)
07:15:03 coot joins (~coot@89-64-85-93.dynamic.chello.pl)
07:15:30 × fcc977 quits (~kaph@151.19.243.144) (Remote host closed the connection)
07:15:50 fcc977 joins (~kaph@151.19.243.144)
07:17:35 MajorBiscuit joins (~MajorBisc@c-001-025-054.client.tudelft.eduvpn.nl)
07:18:18 deadmarshal joins (~deadmarsh@95.38.228.70)
07:19:50 yauhsien joins (~yauhsien@61-231-62-246.dynamic-ip.hinet.net)
07:22:33 little_mac joins (~little_ma@2601:410:4300:3ce0:6136:2d74:4238:7594)
07:23:06 <arjun_> anyway i can borrow or point to the fromInteger method of Double's Num ? :P
07:23:20 <arjun_> and _just_ the fromInteger method
07:26:02 × yauhsien quits (~yauhsien@61-231-62-246.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
07:27:03 × foul_owl quits (~kerry@94.140.8.107) (Ping timeout: 256 seconds)
07:32:02 × deadmarshal quits (~deadmarsh@95.38.228.70) (Ping timeout: 240 seconds)
07:32:12 mc47 joins (~mc47@xmonad/TheMC47)
07:34:00 × wyrd quits (~wyrd@gateway/tor-sasl/wyrd) (Ping timeout: 276 seconds)
07:37:02 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 240 seconds)
07:37:39 newsham joins (~newsham@2603-800c-2d00-e994-c564-1d76-1f18-c3ec.res6.spectrum.com)
07:37:47 <newsham> ?bot
07:37:47 <lambdabot> :)
07:37:53 <newsham> > fix id
07:37:55 <lambdabot> *Exception: <<loop>>
07:38:00 <newsham> hi
07:40:01 Erutuon joins (~Erutuon@user/erutuon)
07:40:39 foul_owl joins (~kerry@97-126-11-68.tukw.qwest.net)
07:41:55 × shriekingnoise quits (~shrieking@201.231.16.156) (Quit: Quit)
07:42:53 cfricke joins (~cfricke@user/cfricke)
07:42:58 merijn joins (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl)
07:53:54 lortabac joins (~lortabac@2a01:e0a:541:b8f0:8c5a:efae:38ab:4ad2)
07:55:16 gehmehgeh joins (~user@user/gehmehgeh)
07:55:56 × fcc977 quits (~kaph@151.19.243.144) (Read error: Connection reset by peer)
07:58:18 × alp quits (~alp@user/alp) (Ping timeout: 268 seconds)
07:59:21 × wagle quits (~wagle@quassel.wagle.io) (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
07:59:41 fcc977 joins (~kaph@151.43.53.126)
07:59:55 wagle joins (~wagle@quassel.wagle.io)
08:00:07 deadmarshal joins (~deadmarsh@95.38.228.70)
08:01:50 kuribas joins (~user@ptr-25vy0ia11vvy5vw4h88.18120a2.ip6.access.telenet.be)
08:01:50 × wagle quits (~wagle@quassel.wagle.io) (Client Quit)
08:02:23 wagle joins (~wagle@quassel.wagle.io)
08:02:34 o joins (~niko@libera/staff/niko)
08:03:15 × fcc977 quits (~kaph@151.43.53.126) (Remote host closed the connection)
08:04:32 fcc977 joins (~kaph@151.43.53.126)
08:05:00 <hololeap> is there a preferred way to stream data from a TCP connection, which can handle network errors, EOF, and the like? I'm looking at the connection library, but it seems like it's missing something to stream the incoming chunks into something like attoparsec and still deal with errors and closing the socket on EOF.
08:06:21 <kuribas> hololeap: conduit, streamly, pipes, etc... ?
08:06:41 <kuribas> any decent streaming library would give you that.
08:07:23 alp joins (~alp@user/alp)
08:07:49 <kuribas> https://hackage.haskell.org/package/conduit-extra-1.3.5
08:07:51 <hololeap> sure, but those libraries don't seem to have any network-specific functions. this seems like something that would be common enough to have a preferred solution
08:07:57 × fcc977 quits (~kaph@151.43.53.126) (Read error: Connection reset by peer)
08:08:11 fcc977 joins (~kaph@151.43.53.126)
08:08:17 <kuribas> https://hackage.haskell.org/package/conduit-extra-1.3.5/docs/Data-Conduit-Network.html
08:08:49 <hololeap> ok. I will add that I _did_ look at that and could not understand how to actually use it
08:09:40 <kuribas> there are probably tutorials somewhere.
08:10:03 dhouthoo joins (~dhouthoo@178-117-36-167.access.telenet.be)
08:11:11 <kuribas> If you first read a tutorial on using conduit, then the types for the more specific libraries should make more sense.
08:11:22 <hololeap> this looks like what I'm looking for, but it hasn't been updated in a couple years: https://hackage.haskell.org/package/conduit-connection-0.1.0.5/docs/Network-Connection-Conduit.html#v:connectFromHandle
08:11:34 <hololeap> I guess I'll just have to try it out
08:12:32 <hololeap> conduit makes sense, and I could probably build this myself, but it seems like _such_ a common problem that there must be a prebuilt solution. the Data.Conduit.Network module just confuses me
08:13:51 <hololeap> sourceSocket and sinkSocket make sense. the rest is just poorly documented
08:14:13 <hololeap> data AppData -- The data passed to an Application.
08:14:16 <hololeap> ok thanks
08:14:59 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
08:15:11 <kuribas> yeah, that module is poorly documented.
08:17:02 × merijn quits (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) (Ping timeout: 240 seconds)
08:20:45 ubert1 joins (~Thunderbi@p200300ecdf09949ebd4b43e35031000e.dip0.t-ipconnect.de)
08:24:24 × fcc977 quits (~kaph@151.43.53.126) (Ping timeout: 250 seconds)
08:29:46 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
08:30:13 × max22- quits (~maxime@2a01cb0883359800958d49fa3415ab33.ipv6.abo.wanadoo.fr) (Remote host closed the connection)
08:32:32 max22- joins (~maxime@lfbn-ren-1-1026-62.w92-139.abo.wanadoo.fr)
08:34:48 × deadmarshal quits (~deadmarsh@95.38.228.70) (Ping timeout: 250 seconds)
08:40:57 wyrd joins (~wyrd@gateway/tor-sasl/wyrd)
08:50:15 machinedgod joins (~machinedg@24.105.81.50)
08:50:43 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 268 seconds)
08:51:16 × bontaq quits (~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 250 seconds)
08:52:28 notzmv joins (~zmv@user/notzmv)
08:57:09 × n8chan quits (~nate@108-233-125-227.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 256 seconds)
08:59:16 merijn joins (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl)
09:00:20 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
09:03:36 jgeerds joins (~jgeerds@55d4090e.access.ecotel.net)
09:04:19 chele joins (~chele@user/chele)
09:07:58 n8chan joins (~nate@108-233-125-227.lightspeed.sntcca.sbcglobal.net)
09:09:47 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 256 seconds)
09:10:56 Erutuon joins (~Erutuon@user/erutuon)
09:11:46 <hololeap> conduit-connection at least compiles on my system, so that's a good sign
09:12:48 wmacmil joins (~wmacmil@83-233-165-97.cust.bredband2.com)
09:14:06 × wyrd quits (~wyrd@gateway/tor-sasl/wyrd) (Ping timeout: 276 seconds)
09:15:14 rusrushal13 joins (~rusrushal@2401:4900:447e:3bb1:d351:e0e8:3fcf:bb54)
09:15:31 Pickchea joins (~private@user/pickchea)
09:16:51 wyrd joins (~wyrd@gateway/tor-sasl/wyrd)
09:17:40 allbery_b joins (~geekosaur@xmonad/geekosaur)
09:17:40 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b)))
09:17:43 allbery_b is now known as geekosaur
09:20:22 vysn joins (~vysn@user/vysn)
09:20:23 × rusrushal13 quits (~rusrushal@2401:4900:447e:3bb1:d351:e0e8:3fcf:bb54) (Ping timeout: 256 seconds)
09:27:15 timCF joins (~timCF@200-149-20-81.sta.estpak.ee)
09:27:38 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
09:27:52 lavaman joins (~lavaman@98.38.249.169)
09:28:00 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
09:28:49 deadmarshal joins (~deadmarsh@95.38.228.70)
09:29:01 <timCF> Hello! Is there some type and corresponding transformer similar to Either/ExceptT which behaves similar way, but don't fail on first Left value, and keep going accumulating Left values into some sort of monoid, let's say a list?
09:30:07 <merijn> Validation from
09:30:10 <merijn> @hackage either
09:30:10 <lambdabot> https://hackage.haskell.org/package/either
09:31:14 <timCF> merijn: thanks! I knew it was there something like this, but totally forgot name. I guess I have to implement transformer myself if I need?
09:31:40 <merijn> arguably there is no transformer, because it's not a lawful Monad
09:31:46 × tzh quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz)
09:31:59 <timCF> aah, got it
09:34:04 <lortabac> there is also Errors in Control.Applicative.Lift
09:34:36 Gurkenglas joins (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de)
09:35:13 <lortabac> I've never used it though
09:36:02 ksqsf joins (~user@134.209.106.31)
09:36:33 × aplainze1akind quits (~johndoe@captainludd.powered.by.lunarbnc.net) (Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net)
09:36:45 aplainzetakind joins (~johndoe@captainludd.powered.by.lunarbnc.net)
09:38:27 <timCF> lortabac: I guess it's kinda the same like Validation? Allows independent applicative computations, but not if computations do depend on each other (monadic)
09:38:44 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
09:39:09 <merijn> timCF: You can trivially convert between Validation and Either, though. So you can write some wrapper around >>= that unwraps and rewraps
09:39:54 × econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity)
09:40:23 <lortabac> timCF: I think so, but Validation is more widely used, so probably a better choice
09:41:02 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 240 seconds)
09:42:45 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
09:43:44 <timCF> I think I'll try Validation for now, at least it's clear how to replace Either in pure computations to simplify error accumulation
09:44:13 <timCF> Places with side-effects more tricky of course
09:45:15 Vajb joins (~Vajb@2001:999:50:e6be:1e98:9376:d93e:4506)
09:46:31 <kuribas> timCF: also checkout "these"
09:47:32 <kuribas> https://hackage.haskell.org/package/these
09:48:44 takuan joins (~takuan@178-116-218-225.access.telenet.be)
09:52:05 <timCF> kuribas: you mean ChronicleT?
09:52:27 <kuribas> yeah, ChrincleT is the transformer version of these.
09:53:02 × ubert1 quits (~Thunderbi@p200300ecdf09949ebd4b43e35031000e.dip0.t-ipconnect.de) (Remote host closed the connection)
09:53:28 <kuribas> ChronicleT
09:53:35 ksqsf joins (~user@134.209.106.31)
09:53:43 × little_mac quits (~little_ma@2601:410:4300:3ce0:6136:2d74:4238:7594) (Remote host closed the connection)
09:54:23 × jgeerds quits (~jgeerds@55d4090e.access.ecotel.net) (Ping timeout: 256 seconds)
09:58:21 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 256 seconds)
09:58:31 lavaman joins (~lavaman@98.38.249.169)
10:02:19 × Akiva quits (~Akiva@user/Akiva) (Ping timeout: 256 seconds)
10:02:25 <hololeap> at least Applicatives compose, so you can get a Validation "applicative transformer"
10:03:29 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 268 seconds)
10:03:32 <hololeap> you're just stuck with combining results, not chaining them
10:03:36 × alx741 quits (~alx741@157.100.93.160) (Quit: alx741)
10:04:51 <merijn> Data.Functor.Compose :)
10:08:32 × foul_owl quits (~kerry@97-126-11-68.tukw.qwest.net) (Ping timeout: 240 seconds)
10:10:20 DNH joins (~DNH@2a02:8108:1100:16d8:edf9:3833:cff9:92b3)
10:13:10 × Pickchea quits (~private@user/pickchea) (Ping timeout: 250 seconds)
10:13:46 ksqsf joins (~user@134.209.106.31)
10:16:32 × xff0x quits (~xff0x@2001:1a81:5209:df00:1935:85e:8166:55b) (Ping timeout: 240 seconds)
10:17:22 xff0x joins (~xff0x@2001:1a81:5209:df00:5e7c:4acd:2a77:4d24)
10:17:32 × deadmarshal quits (~deadmarsh@95.38.228.70) (Ping timeout: 240 seconds)
10:18:55 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 256 seconds)
10:20:59 deadmarshal joins (~deadmarsh@95.38.228.70)
10:21:22 × arjun_ quits (~arjun@user/arjun) (Ping timeout: 268 seconds)
10:22:29 foul_owl joins (~kerry@174-21-143-101.tukw.qwest.net)
10:31:04 <hololeap> oh, hey Validation is an example of a Selective functor
10:31:04 × Vajb quits (~Vajb@2001:999:50:e6be:1e98:9376:d93e:4506) (Read error: Connection reset by peer)
10:31:12 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
10:31:30 <merijn> All monad and applicatives are selective
10:31:42 <merijn> the real question is: Which ones have interesting selective instances :p
10:31:47 × machinedgod quits (~machinedg@24.105.81.50) (Remote host closed the connection)
10:32:20 <hololeap> all monads are selective, but not all applicatives, I don't think. but I haven't grokked selective yet
10:32:55 machinedgod joins (~machinedg@24.105.81.50)
10:34:32 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
10:34:46 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
10:35:26 <merijn> hololeap: They are, because there's even a default implementation for Applicative :p
10:36:27 <merijn> See selectA
10:36:57 <merijn> The default Applicative/Monad implementation don't allow "proper" under-/overestimation
10:37:04 <hololeap> yeah, I'm looking at that now. it says: We can write a function with the type signature of select using the Applicative type class, but it will always execute the effects associated with the second argument, hence being potentially less efficient.
10:37:31 <merijn> hololeap: The same goes for Monad, though :)
10:37:45 <hololeap> no, it shouldn't
10:39:03 <hololeap> because you can peek into the contents of the monad and check if it is Left or Right, then execute the `f (a -> b)` only if it's needed
10:39:53 fcc977 joins (~kaph@151.43.53.126)
10:40:05 ksqsf joins (~user@134.209.106.31)
10:40:56 <merijn> Then you can't get Overapproximation, though?
10:41:22 <hololeap> I don't know what that means
10:41:38 <hololeap> is that from the paper?
10:41:41 <merijn> hololeap: Yeah
10:41:51 <hololeap> I haven't read it yet
10:42:10 <hololeap> I'm just looking at the types from the module
10:42:15 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
10:42:32 <merijn> hololeap: The point of selective is that you can inspect "what's the minimum effects guaranteed to execute" (underapproximation) vs "what is the maximum amount of effects executed?" (overapproximation)
10:43:07 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 256 seconds)
10:43:20 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
10:43:28 × fcc977 quits (~kaph@151.43.53.126) (Client Quit)
10:43:41 fcc977 joins (~kaph@151.43.53.126)
10:44:19 <hololeap> well, with a Monad you can choose to execute the secondary effect and discard the `a -> b` result. with an Applicative you don't have that choice
10:44:56 <hololeap> the default implementation selectM just skips the execution of `y` if the inner value is Right: https://hackage.haskell.org/package/selective-0.5/docs/src/Control.Selective.html#selectM
10:45:05 Lord_of_Life_ is now known as Lord_of_Life
10:47:32 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds)
10:52:28 <hololeap> instance Monoid m => Applicative (Over m) where ...
10:52:46 <hololeap> how can you have a Monoid on something with the kind (Type -> Type)?
10:53:05 <hololeap> oh, no `a` is just a phantom type here
10:53:32 kaph joins (~kaph@151.43.53.126)
10:53:36 <hololeap> newtype Over m a = Over { getOver :: m }
10:53:53 × aeka quits (~aeka@user/hiruji) (Read error: Connection reset by peer)
10:54:27 × fcc977 quits (~kaph@151.43.53.126) (Ping timeout: 256 seconds)
10:56:55 × kaph quits (~kaph@151.43.53.126) (Read error: Connection reset by peer)
10:57:11 aeka joins (~aeka@user/hiruji)
10:58:23 kaph joins (~kaph@151.43.53.126)
10:59:48 <hololeap> this seems like it could be interesting, although I don't quite understand it at the moment: https://hackage.haskell.org/package/selective-0.5/docs/src/Control.Selective.html#line-421
11:00:57 × fef quits (~thedawn@user/thedawn) (Remote host closed the connection)
11:01:24 alx741 joins (~alx741@157.100.93.160)
11:03:00 × kaph quits (~kaph@151.43.53.126) (Remote host closed the connection)
11:03:09 leibniz joins (~leibniz@cpc101088-sgyl37-2-0-cust22.18-2.cable.virginm.net)
11:03:35 <leibniz> hi, is anyone online? i was asking something the other day but there was noone around
11:03:54 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
11:04:01 <hololeap> 732
11:04:23 <leibniz> similar to the number online then, i guess many are not infact real users
11:04:49 <leibniz> someone suggested it would be more likely to find actual people during the daytime
11:05:42 <leibniz> im just trying to find the question i asked in the logs, hang on
11:06:44 <geekosaur> many are real users, but IRC is 24/7 and people are around according to their timezones/work schedules
11:07:39 <leibniz> sorry i got distracted looking up Control.Selective which hololeap mentioned
11:09:16 <Axman6> leibniz: you definitely qwon't get any help if you dson't ask your question :)
11:09:39 <leibniz> i cant find it in the logs...
11:09:52 <hololeap> ax the axman
11:09:56 <leibniz> i probably didnt phrase it all that well anyway, i could try again i suppose
11:10:32 <leibniz> so you need to start with a listlike thing that has the tail wrapped in a monad
11:10:45 <leibniz> then you cant write a "lazy traverse" instance
11:11:01 <leibniz> since not all applicatives commute with the monad
11:11:08 <Axman6> sounds just like the various streaming/iteratee libraries
11:11:08 <leibniz> im wondering about this phenomina
11:11:42 kaph joins (~kaph@151.43.53.126)
11:11:53 <leibniz> the proposal is that for these monadically wrapped tail lists, that there should be something other than traverse
11:12:08 <leibniz> its much more high level as a consideration than a streaming library
11:12:24 <Axman6> they're all essentially some variiation of data Step m a r = Done r | Step a (m (Step m a r)
11:12:35 <leibniz> exactly
11:12:54 <Axman6> do you have example of the type you're talking about?
11:12:56 <leibniz> listT done right, i have seen it called
11:13:04 <hololeap> logict?
11:13:43 <leibniz> data MList' m a = MNil | a `MCons` MList m a
11:13:44 <leibniz> type MList m a = m (MList' m a)
11:13:44 <leibniz> newtype ListT m a = ListT { runListT :: MList m a }
11:13:54 <leibniz> from; https://wiki.haskell.org/ListT_done_right
11:14:33 <Axman6> that's essentially what Step above is
11:14:48 <leibniz> hololeap: thats; (a -> m r -> m r) -> m r -> m r
11:14:57 <leibniz> not sure that is the same
11:15:29 <Axman6> the only difference is the Done r
11:15:31 <leibniz> seems like a continuation wrapping a head value somehow
11:15:42 <leibniz> Axman6: sure, yours would have an instance
11:15:59 <leibniz> basically the idea is that any monadically wrapped tail thing should
11:16:04 <leibniz> if its strictly infinite even
11:16:07 <leibniz> etc.
11:16:35 × newsham quits (~newsham@2603-800c-2d00-e994-c564-1d76-1f18-c3ec.res6.spectrum.com) (Quit: Client closed)
11:16:43 <leibniz> oh right, yours is nonempty
11:17:11 <leibniz> anyway, i cant quite communicate this properly
11:17:18 × deadmarshal quits (~deadmarsh@95.38.228.70) (Ping timeout: 250 seconds)
11:17:24 <leibniz> and i dont think i would be able to write a coherent proposal for the class
11:17:29 <Axman6> well, it would be empty if you got rid of the monadic return value r thst most streaming libraries provide because it's often useful
11:17:42 deadmarshal joins (~deadmarsh@95.38.228.70)
11:17:44 <hololeap> if I understand logict correctly, (a -> m r -> m r) corresponds to MCons, and the second (m r) corresponds to (m MNil),
11:18:25 <hololeap> I might be wrong there
11:18:34 <leibniz> yeah, so its like a continuation right? it says, "given a constructor and a list, ill give you back a new list" presumably acting as a continuation over the head
11:19:31 <leibniz> i guess i should check its instances to see if thats actually what its doing, but in any case, i dont think it seems like the same thing as ListT or Axmans nonempty version
11:19:33 × alMalsamo quits (~alMalsamo@gateway/tor-sasl/almalsamo) (Ping timeout: 276 seconds)
11:19:47 <hololeap> I think (a -> m r -> m r) is the success continuation and the second (m r) is the failure case
11:20:10 <leibniz> what makes you suggest it here?
11:20:15 <Axman6> yeah, that's just the... church encoding of the type above, roughly speaking
11:20:20 <leibniz> ah ok
11:20:25 <leibniz> so it should have an instance also
11:20:29 <Axman6> they are equivallent
11:20:30 <hololeap> because it's literally been called ListT done right
11:20:34 <Axman6> -ish
11:20:37 <leibniz> fair
11:20:54 <leibniz> sure, if its an instance of the class, no problem
11:20:57 <Axman6> basially all the streaming libraries are some variation of the ListT done right idea
11:21:06 <leibniz> im sure there are are a bunch of equivalent encodings
11:21:22 <leibniz> the point is to work at the class level to encapsulate all of them under the same abstraction
11:21:29 arjun_ joins (~arjun@user/arjun)
11:21:50 <leibniz> Axman6: i just dont see how its a "library" its more like a Functor, its a class
11:22:11 <leibniz> calling it a library is kind of dismising it as a fundamental thing
11:22:38 <leibniz> and not having the correct abstraction presented formally means its rewritten needlessly
11:22:46 pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
11:23:08 <Axman6> I think that's because the details of implementation matter when you care about performance
11:23:23 <hololeap> you would have to look into the differences between e.g. conduit and pipes. I'm not sure they have such a common interface
11:23:23 <leibniz> the point is that we can give the monadically wrapped tail things Functor instances, etc, but fail at Traverse
11:23:33 <hololeap> there is
11:23:36 <hololeap> @hackage streaming-commons
11:23:36 <lambdabot> https://hackage.haskell.org/package/streaming-commons
11:23:42 <hololeap> but I doubt that's what you want
11:24:01 <leibniz> im trying to formulate a proposal
11:24:13 <leibniz> for a class similar to Traverse
11:24:41 <leibniz> that takes into account this thing about the Applicative and Monad not commuting and this messing up lazyness
11:24:41 <hololeap> well, even Traverse doesn't specify if its instance is lazy or eager in the implementation
11:25:30 <leibniz> the point is that it would be blocking in a blocking tail call, eg if evaluating the tail called a server in realtime to get the next value
11:25:51 <leibniz> you need lazyness for them to compose - to get the "algebra"
11:26:28 <leibniz> since really you should be able to pass the heads as they are made available, through several traverse like opperations
11:27:12 <Axman6> what is the type of functions you want to travewrse with? just a -> m b?
11:27:13 <leibniz> but unless the constructor and the applicative in the traversal commute, which they dont in general, because of the monad, then this is not possible
11:28:11 <leibniz> Axman6: i can see two options, either you demand the monad and applicative commute, and just use the types as they appear in traverse
11:28:14 <leibniz> :t traverse
11:28:15 <lambdabot> (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)
11:28:37 <leibniz> or you specialise Applicative f to be StateL
11:28:49 <leibniz> and just have mapAccumL
11:28:52 <leibniz> :t mapAccumL
11:28:53 <lambdabot> Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)
11:29:01 <leibniz> as the thing you need to implement for the class
11:29:23 <hololeap> it sounds like you're talking about three different types here. a Traversable, an Applicative, and a Monad... but the combinators you've mentioned only have two of those
11:29:45 <leibniz> obviously the monadic context allows some generalization, ie (a -> b -> m (a, c))
11:30:46 waleee-cl joins (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4)
11:31:02 × coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot)
11:31:08 <leibniz> hololeap: Traversable requires that the deconstructed head is returned into an applicative, which are then sequenced together. however, for the traverse instance, the constructor is mapped into the applicative, and unless you want to sequence together all the applicatives (not lazy) to then be able to chain togther all the constructors
11:31:25 <leibniz> then you need to comute the constructor with the applicative, and then the monad and applicative need to comute
11:32:02 <hololeap> what makes you think that sequencing applicatives isn't ever lazy?
11:32:15 × kaph quits (~kaph@151.43.53.126) (Read error: Connection reset by peer)
11:32:52 <leibniz> the point is that you either need the monad and applicative to commute, or that the "applicatives can be sequenced lazyily" as you suggest... though im not too sure about this
11:33:00 <leibniz> basicall i know it works with StateL
11:33:26 <hololeap> also, where is Monad coming into this. traverse just mentions Traversable and Applicative
11:33:45 <leibniz> and this specialised/restricted behaviour is enough to make it nice and useful
11:33:54 <leibniz> hololeap: the monad wraps the tail
11:34:37 × chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
11:34:43 <hololeap> hm, are you sure that the functor wrapping the tail needs to be a monad for this to work?
11:34:44 <leibniz> Monda m => t m a
11:34:49 __monty__ joins (~toonn@user/toonn)
11:34:58 alMalsamo joins (~alMalsamo@gateway/tor-sasl/almalsamo)
11:35:00 chexum joins (~quassel@gateway/tor-sasl/chexum)
11:35:10 <leibniz> i guess there is no actual requirement for it to be a monad.
11:35:21 <hololeap> because applicatives always compose, which seems to be the issue you're worried about
11:35:34 <hololeap> I'd have to work this out by hand to see what you're talking about specifically
11:35:38 kaph joins (~kaph@151.43.53.126)
11:36:03 <leibniz> you want to not have to sequence together all the applicatives all the way to the basecase of a potentially infinte stream
11:36:15 <leibniz> in order to start composing together the constructors
11:36:40 <leibniz> you want each head in turn to be available to subsequent traversals
11:36:51 <leibniz> this being basically "lazyness"
11:37:13 × deadmarshal quits (~deadmarsh@95.38.228.70) (Ping timeout: 268 seconds)
11:37:13 <leibniz> at some point you need the "monad" and applicative to commute
11:38:10 <leibniz> hololeap; i guess you would run into the issue trying to get a monoidally composable traverse like opperation for monadically wrapped tails in a strictly infinite stream
11:39:16 <leibniz> im not sure whats the correct way to present it though, either you require the commutation opperation is made available by a superclass
11:39:39 <leibniz> or you just restrict the arbitrary applicative in traverse to StateL and just work with mapAccumL opperations
11:39:52 <hololeap> so we are talking about some structure that looks like this: x : m ( y : m ( z : m [] ) )
11:39:59 <leibniz> yes
11:43:16 CiaoSen joins (~Jura@p200300c95737a2002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
11:43:45 × kaph quits (~kaph@151.43.53.126) (Ping timeout: 256 seconds)
11:44:51 <leibniz> im not sure how to move the discussion along, i guess it would be good to see someone else understand where the snag of commutation arises
11:45:19 <hololeap> I'm trying to translate this into free monads if possible, because that might give some insight
11:45:51 <leibniz> oh, ok
11:48:56 <hololeap> Free (Compose ((,) x) m) () -- this is what it seems to be equivalent to, but the insight fizzled. probably because I still don't understand the problem correctly. maybe write up some code demonstrating what you're trying to do
11:49:18 <hololeap> sorry, I've got limited energy right now
11:50:47 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 268 seconds)
11:51:09 <leibniz> not a problem
11:51:33 <leibniz> i guess you could use Cofree aswell
11:51:53 <leibniz> anyway, its not really an issue of which representation you use for the monadically wrapped tail thing
11:52:21 <leibniz> more of how to present the class that all of these instantiate
11:52:34 <hololeap> I just don't see the connection between the monads composing and the lazy/eager issue
11:52:51 <leibniz> i cant tell if i should propose the version with the applicative restricted to StateL or the version with a commutation relation via a superclass
11:53:26 <leibniz> hololeap: i guess since they are only monads as an artefact of using IO as m, to demonstraite how with a "blocking" class
11:53:29 <leibniz> call*
11:53:42 <leibniz> that the basecase would be inaccessible
11:53:42 × cheater quits (~Username@user/cheater) (Ping timeout: 250 seconds)
11:54:04 <leibniz> its the applicative that compise
11:54:07 <leibniz> compose*
11:54:17 <leibniz> the monadic bind opperation isnt actually used i dont think
11:55:00 <leibniz> maybe it is somewhere, eg to flatten down a double nesting if the function returns the result in a monad aswell
11:55:16 <hololeap> I need to get some sleep, but good luck with your proposal
11:55:19 <sshine> what's the GHC extension that implies that nested type signatures refer to the parent variable if there isn't an explicit 'forall' in the inner type signature?
11:55:25 <sshine> ScopedTypeVariables?
11:55:27 <leibniz> (Applicative f,Monad m) => a -> m (f a)
11:56:04 <leibniz> sshine: no you need an outer forall for that to work
11:56:11 <hololeap> sshine: probably RankNTypes
11:56:53 SummerSonw joins (~The_viole@203.77.49.232)
11:56:56 <leibniz> oh right, yes, you can ommit the forall on the inner type signature in a where block, nested like you say. its both RankNTypes and ScopedTypeVariables in combination
11:57:11 coot joins (~coot@89-64-85-93.dynamic.chello.pl)
11:57:47 <leibniz> hololeap: ok thanks for your help
11:58:05 <leibniz> i wonder if Axman is still online, im not sure if anyone managed to follow what i was writing
12:02:15 <hololeap> try to work out a signature for your function first... would it be: (Traversable t, Applicative f, Monad m) => (a -> f b) -> t m a -> f (t m b) ?
12:02:28 <hololeap> anyway, gnight
12:03:02 <leibniz> (Traversable t, Applicative f, Monad m,Commutes f m) => (a -> m (f b)) -> t m a -> f (t m b)
12:03:22 <leibniz> or, setting f ~ StateL, and using mapAccumL
12:03:27 <leibniz> :t mapAccumL
12:03:28 <lambdabot> Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)
12:03:50 <leibniz> Traversable t => (a -> b ->m  (a, c)) -> a -> t m b -> (a, t m c)
12:04:01 <leibniz> erp, not Traversable
12:04:04 Midjak joins (~Midjak@may53-1-78-226-116-92.fbx.proxad.net)
12:04:15 <leibniz> whatever this new class would be called
12:04:21 <sshine> https://gist.github.com/sshine/8f350c862a1e49a1e7a3e1fca5bd12b6 -- 'employee' and 'skill' were originally fixed types, and I'd like to parameterise them. but somehow unification fails. I'm not sure if the Ord constraints are messing it up, or what.
12:06:31 <leibniz> sshine: does it still throw an error if you enable AllowAmbiguousTypes?
12:07:06 <sshine> leibniz, yes.
12:07:13 <leibniz> or a functional dependecy stating that skill can be determined from employee
12:07:32 <sshine> I'm not sure how to express that.
12:07:47 <sshine> I thought I didn't have to express functional dependencies for this.
12:08:29 <leibniz> it seems like it cant infer skill in the return type from employee in the input type
12:09:06 <leibniz> i would have thought that with ApplowAmbiguousTypes you could just specify both with a typeApplication
12:09:29 <leibniz> s/typo/notypo
12:10:25 deadmarshal joins (~deadmarsh@95.38.228.70)
12:11:03 <leibniz> the fundep is for a class, my mistake sorry
12:11:18 <leibniz> maybe injective types?
12:14:55 × deadmarshal quits (~deadmarsh@95.38.228.70) (Ping timeout: 256 seconds)
12:15:55 lavaman joins (~lavaman@98.38.249.169)
12:16:06 <leibniz> aha
12:16:14 <leibniz> you need a type application on "staff"
12:18:07 <leibniz> er, or somewhere else, since staff actually has the correct "skill" and something else is expecting an arbitrary skill
12:18:32 <leibniz> im guessing Set.empty
12:20:45 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 256 seconds)
12:21:12 <leibniz> erg! it was your foralls!
12:21:23 <leibniz> you need to have them in one forall statement for some reason!
12:22:02 <leibniz> such a weird error, its a bug?
12:22:21 <leibniz> sshine^
12:23:27 × leibniz quits (~leibniz@cpc101088-sgyl37-2-0-cust22.18-2.cable.virginm.net) (Quit: Connection closed)
12:25:02 deadmarshal joins (~deadmarsh@95.38.228.70)
12:25:16 × arjun_ quits (~arjun@user/arjun) (Remote host closed the connection)
12:25:28 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
12:27:10 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 268 seconds)
12:27:42 cosimone joins (~user@93-47-230-83.ip115.fastwebnet.it)
12:29:50 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
12:30:30 geranim0 joins (~geranim0@modemcable242.171-178-173.mc.videotron.ca)
12:31:48 jkaye joins (~jkaye@2601:281:200:1958:8e74:ef22:c471:c2e)
12:33:57 cheater joins (~Username@user/cheater)
12:35:36 slack1256 joins (~slack1256@186.11.99.46)
12:38:16 × slac19759 quits (~slack1256@191.125.99.76) (Ping timeout: 268 seconds)
12:43:24 × stiell_ quits (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 276 seconds)
12:43:57 echoone joins (~echoone@188.74.32.13)
12:45:36 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
12:46:04 xlei_ joins (~akans@pool-71-125-19-142.nycmny.fios.verizon.net)
12:46:51 × xlei_ quits (~akans@pool-71-125-19-142.nycmny.fios.verizon.net) (Client Quit)
12:47:42 caro_ joins (~caro@212.83.144.58)
12:47:47 × xlei quits (~akans@pool-71-125-19-142.nycmny.fios.verizon.net) (Ping timeout: 256 seconds)
12:48:13 xlei_ joins (~akans@pool-71-125-19-142.nycmny.fios.verizon.net)
12:48:19 fef joins (~thedawn@user/thedawn)
12:48:59 caro_ is now known as caro
12:49:32 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds)
12:50:52 ksqsf joins (~user@134.209.106.31)
12:51:29 × jackson99 quits (~bc8147f2@cerf.good1.com) (Quit: CGI:IRC (Session timeout))
12:53:31 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
12:55:53 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 256 seconds)
12:56:11 stiell_ joins (~stiell@gateway/tor-sasl/stiell)
12:56:24 × wyrd quits (~wyrd@gateway/tor-sasl/wyrd) (Ping timeout: 276 seconds)
12:56:44 wyrd joins (~wyrd@gateway/tor-sasl/wyrd)
12:57:34 burnsidesLlama joins (~burnsides@dhcp168-015.wadham.ox.ac.uk)
12:58:00 × max22- quits (~maxime@lfbn-ren-1-1026-62.w92-139.abo.wanadoo.fr) (Ping timeout: 268 seconds)
13:07:49 ksqsf joins (~user@134.209.106.31)
13:08:21 × deadmarshal quits (~deadmarsh@95.38.228.70) (Ping timeout: 256 seconds)
13:08:22 Pickchea joins (~private@user/pickchea)
13:08:32 × burnsidesLlama quits (~burnsides@dhcp168-015.wadham.ox.ac.uk) (Remote host closed the connection)
13:13:25 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 268 seconds)
13:15:55 slowButPresent joins (~slowButPr@user/slowbutpresent)
13:16:32 leibniz joins (~leibniz@cpc101088-sgyl37-2-0-cust22.18-2.cable.virginm.net)
13:17:02 <leibniz> so how do you open a proposal anyway?
13:18:45 ksqsf joins (~user@134.209.106.31)
13:19:42 deadmarshal joins (~deadmarsh@95.38.228.70)
13:21:45 × fef quits (~thedawn@user/thedawn) (Ping timeout: 276 seconds)
13:23:35 kaph joins (~kaph@net-2-47-208-144.cust.vodafonedsl.it)
13:23:50 <leibniz> i was hoping to get some feedback on which was the best way to phrase it before doing so though
13:23:59 rusrushal13 joins (~rusrushal@2401:4900:4471:78e2:d490:6737:3704:78a1)
13:24:19 × SummerSonw quits (~The_viole@203.77.49.232) (Quit: Leaving)
13:24:29 <tomsmeding> a ghc implementation proposal?
13:24:31 <leibniz> basically the "refine the applicative to StateL" version, or "allow all applicatives that commute with the tails monad" version
13:24:37 SummerSonw joins (~The_viole@203.77.49.232)
13:24:38 <leibniz> tomsmeding: yeah
13:24:45 <tomsmeding> look here https://github.com/ghc-proposals/ghc-proposals
13:24:48 <leibniz> thanks
13:25:45 × SummerSonw quits (~The_viole@203.77.49.232) (Client Quit)
13:25:48 × echoone quits (~echoone@188.74.32.13) (Quit: Client closed)
13:26:17 <leibniz> hmm, it doesnt seem like a new Prelude class is one of the types of thing that a proposal is for
13:26:50 × xkuru quits (~xkuru@user/xkuru) (Read error: Connection reset by peer)
13:27:06 <tomsmeding> leibniz: maybe here? https://github.com/haskell-core/core-libraries-proposals
13:27:09 <jkaye> leibniz, Would that not be more of a library change than a GHC change?
13:27:21 <jkaye> tomsmeding, Yep just what I was thinking
13:27:21 <leibniz> yeah
13:27:25 <leibniz> thanks
13:27:27 SummerSonw joins (~The_viole@203.77.49.232)
13:27:35 <merijn> leibniz: What class would that be?
13:27:57 <merijn> leibniz: Also, changes to Prelude are fairly unpopular because they affect nearly all code
13:28:12 <leibniz> its just another class... shouldnt be a breaking change
13:28:19 <leibniz> depends which version, the commuting type i havent actually been using so i dont have a name for
13:28:34 <tomsmeding> another class _is_ a breaking change, for user code that used that same name for something else :)
13:28:38 <leibniz> the version which requires the user to implement a monadic version of mapAccumL im calling a Scanner
13:28:48 <merijn> leibniz: If that classes' name conflicts with anything in existing code, it *is* breaking
13:29:04 <tomsmeding> might want to consider putting it not in Prelude, but somewhere else in base
13:29:11 <tomsmeding> then it's not a breaking change
13:29:12 <leibniz> tomsmeding: ok, modulo naming conflicts... oh right, i guess you cant guarantee the name is unused. guess a hackage search could show up any conflicts though
13:29:13 × whatsupdoc quits (uid509081@id-509081.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
13:29:20 <tomsmeding> (I didn't read any of the stuff before in this channel, sorry)
13:29:23 <merijn> leibniz: You are introducing a new typename/function names in the global scope of every program//library without an explicit Prelude
13:29:29 <merijn> leibniz: But why prelude?
13:29:38 <leibniz> because its basically Traverse
13:29:40 <merijn> leibniz: Why not in a different module in base?
13:29:46 <leibniz> ie, its about as high level as you can get
13:30:05 <leibniz> sure, maybe eg. Data.Scanner or something
13:30:19 <merijn> Traversable in Prelude was already controversial and that one was widely used before the change :p
13:30:19 <leibniz> idk how to ensure its shipped with base though
13:30:36 <leibniz> its quite category theoretic
13:30:39 <leibniz> things like Functor
13:30:54 <leibniz> basicaly formalising the abstraction of map for regular lists
13:31:03 <merijn> leibniz: Will this class a superclass of existing stuff in base?
13:31:04 <leibniz> this is along those lines
13:31:27 <merijn> If not, then it could just as easily be outside of base, though
13:31:30 <leibniz> merijn: im not sure, i dont think so since it requires an extra parameter
13:31:51 <merijn> @hackage witherable
13:31:51 <lambdabot> https://hackage.haskell.org/package/witherable
13:31:59 <leibniz> its kind of like Monad m => Traversable (f m)
13:32:01 <merijn> leibniz: i.e. why couldn't it be a separate package like witherable?
13:32:24 <leibniz> functor ships with base though?
13:32:30 <leibniz> thats the proposal
13:32:36 <leibniz> that it qualifies for that kind of status
13:32:51 <leibniz> otherwise it would just be a library, i guess thats what im having to defend
13:33:02 <leibniz> but cant argue more than just its formal centrality
13:33:08 <merijn> leibniz: Making base bigger is a rather unpopular idea
13:33:35 <leibniz> if it was missing something like Functor, im sure it would be addapted despite this
13:33:36 <merijn> leibniz: Because the bigger base is, the more often breaking changes happen, so we either have to accept "base continually breaking"
13:33:46 <merijn> or "stuff doesn't change because it'd break base"
13:33:55 <leibniz> ok, well this wasnt discovered before
13:33:56 fef joins (~thedawn@user/thedawn)
13:34:10 <leibniz> its unlikely it will need to be added again either
13:34:36 <leibniz> sorry if that seems like a strange argument. but i cant exactly predict "no similar discoveries will occur"
13:34:49 <leibniz> and can only argue that this is fundamental enough
13:34:55 <leibniz> which i guess is debatable
13:36:01 <leibniz> if it "started a trend of inflating base", i guess as long as it was sufficiently justified, this wouldnt be a bad thing
13:36:16 <leibniz> "search for higher order formalisms"
13:36:26 <ksqsf> base is already a big mudball; i kinda hope there will be a base 5 rewrite :]
13:37:42 <leibniz> my main reason for approaching the committee is because i cant argue these rationalisations, or design the library sufficiently to have it accepted
13:37:47 <leibniz> alone
13:37:49 <geekosaur> we already had one split base,m maybe it's time for another
13:38:47 <leibniz> i dont want to get into the details too much, but i have reason to believe this to be a very high order abstraction, based on some theorems to do with isomorphic containers
13:39:20 <leibniz> something like "the monad on the tail can contain the structure directing index required for shaped pattern matching"
13:41:15 <leibniz> which is where (for anything (traversable containers?) more shaped than lists, eg trees)  you need extra data on the constructor to retain the shape during traversal implemented by pattern matching on a head/tail opperation (the structure directing index is required as an argument to the constructor)
13:41:18 burnsidesLlama joins (~burnsides@dhcp168-015.wadham.ox.ac.uk)
13:41:37 <leibniz> since the monadic tail thing subsumes this, and thats a pretty high level thing, i guess that makes this super high level
13:42:01 <leibniz> "its really a thing" => "it should go in base"
13:42:10 <lortabac> leibniz: if it can technically be implemented as a new library, I'd do it as a library anyway
13:42:21 × deadmarshal quits (~deadmarsh@95.38.228.70) (Ping timeout: 256 seconds)
13:42:25 <leibniz> point is that would have me doing it alone
13:42:48 <leibniz> id rather kind of consult on the design of a proposal and have people that can do things properly do it
13:42:53 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
13:43:11 <tomsmeding> the advantage of writing a library is that you can completely rewrite it when you get new insight :)
13:43:19 <leibniz> might seem like a cop out, but i think its both complex and important enough to have it done by pros, instead of me
13:43:20 <tomsmeding> for example insight from other people
13:43:43 <tomsmeding> I think a proposal for including stuff in base would be stronger anyway if there is an existing implementation that people can look at
13:43:44 <lortabac> in any case it's better to make a library, then it can be moved to base if it becomes popular enough
13:43:46 <leibniz> iv written it several times, at this point im suggesting a proposal that would involve the GHC team
13:44:20 <leibniz> lortabac: i think thats whats being debated, i disagree, i think infact that assertion is whats preventing its acceptance
13:44:41 <merijn> "the GHC team" always makes me think that people think GHC has a whole lot more people than it does :p
13:44:51 <leibniz> ok "you lot"
13:45:05 <leibniz> :-/
13:45:15 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
13:45:28 <tomsmeding> I feel like the best way to continue would be to write up what you think, and post it in this channel, on reddit and perhaps on haskell weekly, and get discussions going
13:45:52 <leibniz> did you see the presentation in the scrollup?
13:46:04 <tomsmeding> if you feel like you're to a point where you think "this is a good idea and it should be implemented in this form", make a proposal
13:46:08 <tomsmeding> no sorry lol
13:46:12 <leibniz> right...
13:46:16 <tomsmeding> hence my point, make a writeup in one document
13:46:23 <leibniz> im saying i cant
13:46:39 <leibniz> i have the theoretical results but cant write well enough
13:47:08 <leibniz> which is difficult for both myself and the comunity, since neither party actually benifits from the existence of the results
13:48:05 <leibniz> this is why i was asking for "help drfing a proposal"
13:48:17 <leibniz> drafting*
13:49:23 <leibniz> tomsmeding: also, its stateable in one line
13:50:52 <leibniz> "my thing is either a refinement over traverse, to the StateL Applicative, for monadically wrapped tail list-like things, or its a requirement that a more general applicative comute with the monad, to ensure the lazy traversability permits monoidal composition in a blocking monadic streaming setting for example"
13:50:58 <leibniz> or various similar presentations
13:51:48 <leibniz> "scanner algebras" result from the version refining the applicative to StateL, idk much about the general version with the commuting
13:51:51 <tomsmeding> sounds interesting but still very abstract
13:52:06 <tomsmeding> "I have the theoretical results" sounds like you have some more mathematical results; is that true?
13:53:17 <leibniz> theres some theorems like "everything of a certain style is isomorphic to free lists - so basically is trees, so thats what you want structure directing indexes for, and abstractions that subsume these"
13:53:26 <leibniz> the theorem being the isomorphic to trees statement
13:54:22 <leibniz> "theoretically, this is important" ... :-/
13:54:39 <leibniz> sorry...
13:55:28 <lortabac> I'd suggest this: if you have some mathematical insights to share, write a blog post; if you have an implementation, write a library; if you have a vague intuition that needs to be refined, write a post on Reddit
13:56:03 <leibniz> so basically you suggest not approaching it directly on the active channel, and presenting it in a way which i have stated i cannot
13:56:04 <leibniz> thanks!
13:56:09 <leibniz> i think i should go
13:56:20 × cosimone quits (~user@93-47-230-83.ip115.fastwebnet.it) (Remote host closed the connection)
13:56:27 <leibniz> perhaps these results, at some point, can be written by someone other than myself
13:56:31 <leibniz> peace
13:56:33 × leibniz quits (~leibniz@cpc101088-sgyl37-2-0-cust22.18-2.cable.virginm.net) (Quit: Connection closed)
13:56:40 <tomsmeding> ideas like these typically benefit from writing some kind of exposition, and feedbacking a fixed piece of text
13:56:40 <tomsmeding> oh
13:56:47 <tomsmeding> o/
13:57:10 <yushyin> oO
14:01:24 alx741 joins (~alx741@157.100.93.160)
14:04:41 deadmarshal joins (~deadmarsh@95.38.228.70)
14:04:46 <ksqsf> :( ghc doesn't let me use 𝟙 as an identifier
14:05:29 <geekosaur> > generalCategory '𝟙'
14:05:31 <lambdabot> DecimalNumber
14:07:50 <ksqsf> it's not a number anyway
14:08:08 <geekosaur> > 𝟙
14:08:09 <lambdabot> <hint>:1:1: error: lexical error at character '\120793'
14:08:18 × neurocyte091709 quits (~neurocyte@user/neurocyte) (Ping timeout: 268 seconds)
14:08:34 neurocyte0917090 joins (~neurocyte@user/neurocyte)
14:08:35 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
14:08:46 <geekosaur> interesting the category is number but you can't use it as one
14:11:42 × michalz quits (~michalz@185.246.204.101) (Remote host closed the connection)
14:12:47 × rusrushal13 quits (~rusrushal@2401:4900:4471:78e2:d490:6737:3704:78a1) (Ping timeout: 256 seconds)
14:13:21 × neverwas quits (jpneverwas@swissbox.unperson.link) (Ping timeout: 256 seconds)
14:13:53 <pfurla-matrix> !whois puffnfresh
14:14:28 pfurla joins (~pfurla@2804:d41:4331:4800:2caa:3e9f:9236:25d4)
14:14:41 <geekosaur> did you want /whois ?
14:15:31 <sshine> is there a notify service on libera chat?
14:16:19 <pfurla-matrix> I did but I am in a matrix.org bridge , bang-ircCommand is supposed to be a irc command, but apparently only in special chat room
14:16:35 <geekosaur> looks like they have memoserv. need to have a registered nick both to send and to receive
14:16:53 <geekosaur> lambdabot also has @tell
14:22:20 neverwas joins (jpneverwas@swissbox.unperson.link)
14:23:06 Snoopy4 joins (~Snoopy@host-82-49-101-122.retail.telecomitalia.it)
14:23:33 <Snoopy4> Haskell is the esoteric language with the most money invested in, and still manages to suck. Congrats ^^
14:23:47 × Snoopy4 quits (~Snoopy@host-82-49-101-122.retail.telecomitalia.it) (Client Quit)
14:25:58 michalz joins (~michalz@185.246.204.122)
14:26:38 <sshine> haha
14:26:48 <sshine> if that were true
14:27:00 <kuribas> well, someone invested money in haskell, that's good news :)
14:27:09 <sshine> I think there are legacy languages that have way more money invested and "suck" in a different sense :)
14:27:21 alx741 joins (~alx741@157.100.93.160)
14:27:48 <geekosaur> javascript immediately came to mind for some reason
14:27:55 <sshine> but I'm impressed at how far Haskell has gotten in production considering how impractical its toolchain is, and how hard the language itself is to learn. :D
14:28:00 <kuribas> I agree that haskell sucks, just less than other languages :)
14:28:34 <sshine> kuribas, I recall that being the motto behind mutt, the email client. how many still use that? ;)
14:28:58 <geekosaur> it's still my go-to if I'm limited to TUI
14:29:15 <sshine> I'll quit email before I get a good email client.
14:29:20 <geekosaur> thankfully that doesn't happen much any more, but.
14:30:08 <sshine> apparently people use email to send these "job contracts" and "job applications" and they keep bugging me to check it. it's so unproductive!
14:30:27 <sshine> like, don't they have /dcc send?
14:31:13 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
14:31:18 × fef quits (~thedawn@user/thedawn) (Quit: Leaving)
14:33:57 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
14:33:57 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
14:33:57 wroathe joins (~wroathe@user/wroathe)
14:35:02 nvmd joins (~nvmd@user/nvmd)
14:36:06 ystael joins (~ystael@user/ystael)
14:38:51 × deadmarshal quits (~deadmarsh@95.38.228.70) (Ping timeout: 256 seconds)
14:39:16 vglfr joins (~vglfr@46.96.165.111)
14:40:32 deadmarshal joins (~deadmarsh@95.38.228.70)
14:41:17 leibniz joins (~leibniz@cpc101088-sgyl37-2-0-cust22.18-2.cable.virginm.net)
14:41:30 <leibniz> hey, sorry, i had to duck out
14:41:55 <leibniz> i think we were discussing the format of the proposal
14:42:11 <leibniz> where there were considerations about limited bandwidth
14:42:49 <leibniz> i personally dont feel confident to author a persistent article
14:43:06 <leibniz> it seems this is a sticking point
14:44:33 <merijn> sshine: What makes you say the toolchain is impractical?
14:44:52 × deadmarshal quits (~deadmarsh@95.38.228.70) (Ping timeout: 250 seconds)
14:44:57 <leibniz> i guess this means that the most help i can be is to answer any questions anyone has
14:44:58 <merijn> I'm genuinely curious, because nearly every other language I use has toolchains that seem way less practical than cabal
14:45:14 razetime joins (~quassel@49.207.203.87)
14:45:32 <leibniz> merijn: it seemed like a flippant comment
14:45:41 <merijn> And I'm also curious which toolchains you've used that seem better...
14:46:18 <leibniz> discussing the merits of haskell as a language on a channel dedicated to haskell seems a bit pointless
14:46:42 <leibniz> its not as if its advertising to anyone not already part of the community
14:47:19 <leibniz> but certainly stack, by allowing persistent builds across time, is an unprecedentedly useful tool, setting haskells toolchain arguably ahead of any other language
14:47:22 alx741 joins (~alx741@157.100.93.160)
14:49:14 shriekingnoise joins (~shrieking@201.231.16.156)
14:49:16 mmhat joins (~mmh@55d4d6e9.access.ecotel.net)
14:49:51 × leibniz quits (~leibniz@cpc101088-sgyl37-2-0-cust22.18-2.cable.virginm.net) (Quit: Connection closed)
14:50:28 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
14:51:11 <merijn> I fear you have much more faith in stack than I, and that's not the part of the toolchain I'd consider good, tbh :p
14:51:57 <ksqsf> cabal is great. it is mostly declarative but also supports advanced constructs like 'if'.
14:52:39 <ksqsf> though some keywords are really weird, like 'hs-source-dirs'
14:52:57 <merijn> ksqsf: Seems perfectly cromulent?
14:54:14 <ksqsf> it's acceptable but i don't know why there is 'hs-'
14:54:35 <sclv> cabal also allows persistent builds across time and also lots of tools for lots of languages
14:54:50 <Sqaure> i couldnt get hs-source-dirs to handle ../some/path some days ago. But im on some 2-3 yo cabal version.
14:54:58 <sclv> The idea has been around a minute
14:55:32 <sclv> src dirs shouldn’t handle paths like that because those don’t go into tarballs
14:56:01 <merijn> ksqsf: You can package C sources in Haskell packages (and there's work on C++ too, and no reason other languages couldn't be included)
14:56:49 <merijn> ksqsf: so hs- lets you distinguish from (potential) future extensions such as c-source-dirs and cxx-source-dirs, etc. :)
14:56:54 <sshine> merijn, I like Rust's cargo a lot :) I *think* Go's toolchain is good (but I've never used it), and I *have* used Perl's, which is not that bad, although, of course, the language itself is... let's not go there. :-P
14:56:58 <ksqsf> merijn: nice to know, thanks
14:57:11 Guest49 joins (~Guest49@2405:201:1e:5848:ecc5:3ef:bb63:fa9f)
14:58:05 <Guest49> Hi
14:58:28 <merijn> sshine: Go's toolchain is only good if you believe "sacrificing hundreds/thousands of man hours to ensure everything always works with HEAD of everything else" is both feasible and good
14:59:03 <Guest49> Is there a way that I can contribute to Haskell?
14:59:21 <sshine> merijn, good toolchains require sacrifices. I can't say what went into it, but I did once try to install Go code, and it was easy.
14:59:22 <merijn> Depends what kinda contributions you are interested in making? :)
14:59:38 <merijn> sshine: Hackage doesn't have the manpower to make that work
14:59:44 LukeHoersten joins (~LukeHoers@user/lukehoersten)
14:59:56 <sshine> merijn, I think you can make a statement about the quality of a tool without making a moral statement about how it came to be. but sure, the latter is not unimportant.
14:59:57 <fendor[m]> didn't go move to a cargo like approach?
15:00:06 <merijn> sshine: It's the same with people saying "oh, bet debian packages make this work!". Sure, by virtue of throwing hundreds of man hours to fix each individual issue"
15:00:08 max22- joins (~maxime@2a01cb08833598005d86ce1a880654d8.ipv6.abo.wanadoo.fr)
15:00:37 <sshine> merijn, I also use Debian. apparently I believe in sacrificing humans.
15:00:39 <sshine> :P
15:00:40 <merijn> sshine: I'm saying the quality you observe isn't a part of the tool, but the manpower thrown against the problem
15:00:52 <maerwald> I doubt that
15:00:56 <merijn> sshine: i.e. if we threw the same manpower at hackage we'd have the same result
15:01:09 <maerwald> debian is the perfect example: lots of manpower and lots of f-ups
15:01:43 <sshine> merijn, the tool is the thing I download and see working, because of the time spent to make it work. it sounds like you're justifying why a tool isn't bad because people didn't kill themselves fixing it (yet) :)
15:02:26 <Guest49> Something simple, maybe adding a small but missing feature in the std lib. or maybe some issue that I can try to fix
15:02:59 <Clint> debian doesn't have lots of manpower
15:03:23 <sshine> Guest49, this might be for you: https://discourse.haskell.org/t/a-new-future-for-cryptography-in-haskell/3888
15:03:38 <ksqsf> Clint: why? debian has ~1000 DDs and DMs
15:03:56 <sshine> Clint, I think what's meant here is that Debian's maintainer model depends on manpower.
15:04:04 <merijn> sshine: I don't mean "fixing the tool" I mean that most breakage isn't breakage in the tooling, but in the packages you are trying to install
15:04:06 <Clint> ksqsf: most of whom are not active
15:04:30 <sshine> merijn, my software isn't broken, you're giving it wrong inputs!
15:04:34 <merijn> sshine: Most "cabal problems" are "this set of dependencies doesn't install", which is not a problem with cabal, but with your dependencies
15:04:57 <ksqsf> NixOS has far less manpower, but a great tool (Nix) helps a lot
15:05:02 <merijn> Clint: It does compared to Hackage
15:05:16 <merijn> Clint: Hackage has, like, low double digit people *at best*
15:05:36 <ksqsf> iirc Nix ships even more packages than Debian does
15:06:27 <sshine> merijn, maybe it is impossible to even define the quality of a tool without making statements about its dependencies, and so any statement about the tool is really a statement about other things. :-D somehow, this completely derails any comparative assessment about toolchains.
15:06:44 × Guest49 quits (~Guest49@2405:201:1e:5848:ecc5:3ef:bb63:fa9f) (Quit: Client closed)
15:07:13 <merijn> sshine: The quality of a toolchain, to me, is how easily you can integrate it into larger systems. How predictable it's behaviour is. etc.
15:07:57 <merijn> cabal-install is very predictable, allows for all the possible control I've needed and integrates into larger build system fairly well (there's some room for improvement still, but infinitely better than, say, pip)
15:08:59 alx741 joins (~alx741@157.100.93.160)
15:08:59 <maerwald> not sure a constraint solver is really what you'd call predictable from a user pov
15:09:21 × max22- quits (~maxime@2a01cb08833598005d86ce1a880654d8.ipv6.abo.wanadoo.fr) (Ping timeout: 268 seconds)
15:09:32 <merijn> maerwald: It is a 1) a predictable constraint solver and 2) you can freeze it and/or use index-state to achieve that for users
15:09:33 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
15:10:21 <maerwald> I'm not sure what a predictable constraint solver is... I'm talking about naive user interaction
15:10:40 <maerwald> stack has predictability as a priority, I don't think cabal has
15:11:50 <merijn> maerwald: as of v2-build the solver is (to the best of my knowledge) deterministic, so that the same index-state will always produce the same plan (and always preferring the newest admissible versions)
15:12:07 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
15:12:15 <maerwald> sure
15:12:27 <maerwald> well, not exactly, but almost
15:12:32 <maerwald> flags and pkg-config can change that
15:12:39 <sshine> merijn, I'm talking about the experience of using the tool. in the case of Cabal, the experience is pretty good in spite of how you can delegate the responsibility/probability of success to however coherent the package graph you happen to refer to at the time of evaluation. clearly there's some ideological difference here where it seems like you don't want any one point of failure to reflect the quality
15:12:45 <sshine> of "the thing" (tool, language, ecosystem, whatever), whereas with e.g. Stack's snapshots, you do get something to point your fingers at if it breaks, but you also have to sacrifice humans to make those snapshots both consistent and recent.
15:12:55 zmt01 joins (~zmt00@user/zmt00)
15:13:15 texasmynsted joins (~texasmyns@99.96.221.112)
15:14:11 <ksqsf> I think most of this UX problem is just that GHC insists on having a set of compatible versions
15:14:40 Sgeo joins (~Sgeo@user/sgeo)
15:15:22 <maerwald> merijn: from a user POV, cabal is not predictable. By default, the input is mutable/rolling and the result of a resolution is not something they would be able to predict
15:15:27 <ksqsf> ksqsf: while Rust just compiles and links every needed major versions
15:15:51 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
15:16:10 <sshine> ksqsf, a set of compatible versions of what?
15:16:19 <ksqsf> sshine: build-depends
15:16:35 × dsrt^ quits (~dsrt@wsip-98-188-242-61.mc.at.cox.net) (Remote host closed the connection)
15:17:38 <merijn> ksqsf: GHC actually admits conflicting versions, to some extend
15:18:03 <merijn> ksqsf: But it's messy and hairy and cabal doesn't allow it for that reason, because it's likely to break shit
15:18:13 <merijn> *extent
15:21:05 jackson99 joins (~bc8147f2@cerf.good1.com)
15:21:39 <ksqsf> hmm, I'm not really sure GHC can be like Rust in this regard; Rust has more restrictions on class instances for coherence
15:22:34 × Pickchea quits (~private@user/pickchea) (Ping timeout: 250 seconds)
15:23:15 <ksqsf> but it would be great if it turned out to be feasible
15:23:52 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
15:23:52 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
15:23:52 wroathe joins (~wroathe@user/wroathe)
15:26:05 × ksqsf quits (~user@134.209.106.31) (Remote host closed the connection)
15:26:24 ksqsf joins (~user@134.209.106.31)
15:27:27 xb0o2 joins (~xb0o2@user/xb0o2)
15:27:44 × LukeHoersten quits (~LukeHoers@user/lukehoersten) (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:28:28 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds)
15:28:50 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
15:29:01 alx741 joins (~alx741@157.100.93.160)
15:30:46 geekosaur joins (~geekosaur@xmonad/geekosaur)
15:37:26 × zmt01 quits (~zmt00@user/zmt00) (Quit: Leaving)
15:37:33 max22- joins (~maxime@2a01cb0883359800e30a3abeb76df7a4.ipv6.abo.wanadoo.fr)
15:37:35 shapr joins (~user@98-159-193-131.scottsboro.org)
15:38:26 zmt00 joins (~zmt00@user/zmt00)
15:38:57 × alp quits (~alp@user/alp) (Ping timeout: 268 seconds)
15:39:21 laslmtdbm^ joins (~laslmtdbm@wsip-98-188-242-61.mc.at.cox.net)
15:47:39 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
15:47:40 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:81c9:f67f:1443:f972)
15:47:54 × sm2n quits (ae95cb1267@user/sm2n) (Remote host closed the connection)
15:47:54 × filwisher quits (2e6936c793@2604:bf00:561:2000::170) (Remote host closed the connection)
15:47:54 × tdmm quits (1c9b9145fc@2604:bf00:561:2000::1c8) (Remote host closed the connection)
15:47:54 × jkoshy quits (99b9359beb@2604:bf00:561:2000::10f) (Remote host closed the connection)
15:47:54 × jakzale quits (6291399afa@user/jakzale) (Remote host closed the connection)
15:47:54 × samhh quits (7569f027cf@2604:bf00:561:2000::e4) (Remote host closed the connection)
15:47:54 × evanrelf quits (3addc196af@2604:bf00:561:2000::f0) (Remote host closed the connection)
15:47:54 × bsima1 quits (9d7e39c8ad@2604:bf00:561:2000::dd) (Remote host closed the connection)
15:47:54 × Ankhers quits (e99e97ef8e@2604:bf00:561:2000::2a2) (Remote host closed the connection)
15:47:54 × raghavgururajan quits (ea769b8000@user/raghavgururajan) (Remote host closed the connection)
15:47:54 × lukec quits (9dfd4d094e@2604:bf00:561:2000::10e) (Remote host closed the connection)
15:47:54 × fluffyballoon quits (45ce440a48@2604:bf00:561:2000::e2) (Remote host closed the connection)
15:48:26 filwisher joins (2e6936c793@2604:bf00:561:2000::170)
15:48:27 bsima1 joins (9d7e39c8ad@2604:bf00:561:2000::dd)
15:48:27 lukec joins (9dfd4d094e@2604:bf00:561:2000::10e)
15:48:28 samhh joins (7569f027cf@2604:bf00:561:2000::e4)
15:48:37 jakzale joins (6291399afa@user/jakzale)
15:48:37 Ankhers joins (e99e97ef8e@2604:bf00:561:2000::2a2)
15:48:42 evanrelf joins (3addc196af@2604:bf00:561:2000::f0)
15:48:42 fluffyballoon joins (45ce440a48@2604:bf00:561:2000::e2)
15:48:42 tdmm joins (1c9b9145fc@2604:bf00:561:2000::1c8)
15:48:42 jkoshy joins (99b9359beb@2604:bf00:561:2000::10f)
15:48:45 sm2n joins (ae95cb1267@user/sm2n)
15:48:49 raghavgururajan joins (ea769b8000@user/raghavgururajan)
15:49:06 n3rdy1 joins (~n3rdy1@2600:1700:4570:3480::41)
15:49:43 myShoggoth joins (~myShoggot@97-120-67-120.ptld.qwest.net)
15:52:02 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:81c9:f67f:1443:f972) (Ping timeout: 250 seconds)
15:52:16 ec joins (~ec@gateway/tor-sasl/ec)
15:53:51 × jlamothe quits (~jlamothe@198.251.61.229) (Quit: leaving)
15:53:55 stiell joins (~stiell@gateway/tor-sasl/stiell)
15:54:28 cosimone joins (~user@93-47-230-83.ip115.fastwebnet.it)
15:55:45 ProfSimm joins (~ProfSimm@176-12-60-137.pon.spectrumnet.bg)
15:55:48 <sclv> rust’s model can lead to both compile time and runtime failures https://doc.rust-lang.org/cargo/reference/resolver.html#version-incompatibility-hazards
15:55:55 × SummerSonw quits (~The_viole@203.77.49.232) (Ping timeout: 256 seconds)
15:56:23 <sclv> haskellers are just less forgiving of such things and so the safer more restrictive choice is made
15:57:36 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
15:58:24 × stiell_ quits (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 276 seconds)
15:59:38 × ProfSimm quits (~ProfSimm@176-12-60-137.pon.spectrumnet.bg) (Remote host closed the connection)
15:59:57 ProfSimm joins (~ProfSimm@176-12-60-137.pon.spectrumnet.bg)
16:00:02 jakalx joins (~jakalx@base.jakalx.net)
16:02:21 Hildegunst joins (~luc@80.248.12.109.rev.sfr.net)
16:04:04 alx741 joins (~alx741@157.100.93.160)
16:06:05 × ProfSimm quits (~ProfSimm@176-12-60-137.pon.spectrumnet.bg) (Remote host closed the connection)
16:06:24 ProfSimm joins (~ProfSimm@176-12-60-137.pon.spectrumnet.bg)
16:07:38 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
16:07:51 newsham joins (~newsham@2603-800c-2d00-e994-c564-1d76-1f18-c3ec.res6.spectrum.com)
16:08:10 jlamothe joins (~jlamothe@198.251.61.229)
16:08:32 × laslmtdbm^ quits (~laslmtdbm@wsip-98-188-242-61.mc.at.cox.net) (Ping timeout: 240 seconds)
16:10:15 × merijn quits (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds)
16:16:44 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:8c5a:efae:38ab:4ad2) (Quit: WeeChat 2.8)
16:17:32 × shapr quits (~user@98-159-193-131.scottsboro.org) (Ping timeout: 240 seconds)
16:17:52 lavaman joins (~lavaman@98.38.249.169)
16:18:00 × burnsidesLlama quits (~burnsides@dhcp168-015.wadham.ox.ac.uk) (Remote host closed the connection)
16:19:20 laslmtdbm^ joins (~laslmtdbm@wsip-98-188-242-61.mc.at.cox.net)
16:20:37 × myShoggoth quits (~myShoggot@97-120-67-120.ptld.qwest.net) (Ping timeout: 240 seconds)
16:22:33 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 256 seconds)
16:24:05 alx741 joins (~alx741@157.100.93.160)
16:25:12 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 268 seconds)
16:26:05 ksqsf joins (~user@134.209.106.31)
16:27:03 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
16:28:40 Henson joins (~kvirc@107-179-133-201.cpe.teksavvy.com)
16:29:33 yauhsien joins (~yauhsien@61-231-62-246.dynamic-ip.hinet.net)
16:31:52 myShoggoth joins (~myShoggot@97-120-67-120.ptld.qwest.net)
16:32:16 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
16:33:53 × yauhsien quits (~yauhsien@61-231-62-246.dynamic-ip.hinet.net) (Ping timeout: 256 seconds)
16:34:57 <Henson> Hi everyone, I'm trying to understand this performance confusion I'm encountering with the following Haskell code https://paste.tomsmeding.com/U6K7rBaM. It's just a simple benchmark to crunch a quadratic curve fit 1 million times. On my (old) laptop this runs in 0.02 seconds. However, if I change line 8 from "!pVal" to "pVal" then it runs in 2.0 seconds. Why is there such an enormous performance boost for this simple strict evaluation?
16:35:57 <Henson> I'm trying to understand this as I have much more complicated code that does something similar, and I'm wondering if I can make the performance much greater with a few simple bang patterns in the right spot.
16:35:57 × perrierjouet quits (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Quit: WeeChat 3.4)
16:36:22 <Henson> well, similar code embedded in a much more complicated program.
16:36:49 <sm> it's laziness at work. Accumulators in tight loops are something you want to be evaluated eagerly
16:36:55 perrierjouet joins (~perrier-j@modemcable012.251-130-66.mc.videotron.ca)
16:37:43 <Henson> sm: is there a way I can profile my code to determine what parts are being held up by laziness and where I should add eager evaluations?
16:37:53 <sm> Debug.Trace can be useful for seeing when things are being evaluated
16:38:03 × cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.3)
16:38:06 × Jing quits (~hedgehog@240e:390:7c53:a7e1:a9:59ba:3231:6160) (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:38:58 <sm> there's no magic tool alas, it's one of the skills a haskeller needs to develop. Though in practice, I find it doesn't come up that often in real code
16:39:08 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
16:39:08 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
16:39:08 wroathe joins (~wroathe@user/wroathe)
16:39:21 <sm> I don't think a profile helps here...
16:39:23 <Henson> sm: but the pVal isn't even an accumulator, it's just an index to prevent Haskell from reusing the previously calculated inputs and outputs
16:39:50 <c_wraith> I keep thinking about this. There is a simple set of rules to follow to prevent space use problems. It should be possible to write some sort of assistance to validate that you're following those rules.
16:40:27 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
16:41:58 <sm> c_wraith++
16:42:17 Pickchea joins (~private@user/pickchea)
16:43:04 <sm> Henson: I hear you. I can't see the exact mechanism myself, but I would guess the tuple is the problem, maybe the strict pval helps force it ?
16:43:33 <c_wraith> the problem comes from going "this set of rules is simple" to actually writing the rules down. Because they aren't actually quite so simple when you deal with all the extra cases
16:43:51 <Henson> sm: in the more complex production code there's a simple "p2 = sum $ map (\(t,p) -> p*t) (zip times positions)" where times :: [Double] and positions :: [Double] that takes up a big chunk of the time when profiling. It's a pretty simple operation, but gets done a lot. If the times and positions lists need to be evaluated to calculate p3, does the evaluation of those lists count towards the...
16:43:59 <sm> tuples always cause thunk leaks so should not be used as an accumulator
16:44:09 <shane> You know the way the `time` library has `UTCTime` and `NominalDiffTime`, where `NominalDiffTime` is a number, and can be added to and subtracted from `UTCTime`, and `UTCTime` can be subtracted from itself to produce a `NominalDiffTime`, but `UTCTime` is not itself a number? And there's a related thing going on with the `.+^`, `.-^` and `.-.` operators from `Linear.Affine`. What I want to ask is, is there a
16:44:15 <shane> general name for this type of thing in abstract algebra, and are there any Haskell packages that try to implement it?
16:44:15 <Henson> sm: calculation time of p3, or does it get attributed to the functions that went into producing the times and positions lists?
16:44:31 <c_wraith> You can use a tuple in an accumulator as long as your function producing them seqs the elements first.
16:44:53 <c_wraith> Strictness isn't about the data structures you use, it's about when things get evaluated.
16:45:19 <sm> c_wraith: if we could at least write them down such that a human could evaluate/check them relatively easily, that would still be a big help
16:45:42 alx741 joins (~alx741@157.100.93.160)
16:45:55 <c_wraith> remember that a strict pair type doesn't do anything you couldn't do by writing seq twice by hand. :)
16:46:02 × xff0x quits (~xff0x@2001:1a81:5209:df00:5e7c:4acd:2a77:4d24) (Ping timeout: 240 seconds)
16:46:31 <Henson> c_wraith: how do I seq the elements first? just seq the list, or figure out how to deepseq them?
16:46:52 <c_wraith> deepseq is more of a debugging tool. It'll never show up in optimized code.
16:46:55 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
16:46:59 xff0x joins (~xff0x@2001:1a81:5209:df00:b3fa:3a32:fd8e:f809)
16:47:00 <c_wraith> It's not efficient at all
16:47:16 × pfurla quits (~pfurla@2804:d41:4331:4800:2caa:3e9f:9236:25d4) (Quit: gone to sleep. ZZZzzz…)
16:47:59 <Henson> also, the performance problems of laziness comes up all the time for me in my reading, and the difficulty in reasoning about performance and space issues. Was it a good idea to make Haskell a lazy language, given that so few others are? Not to derail my own conversation here, but what are the benefits of laziness in practice, as I mostly hear about the downsides of it.
16:47:59 <sm> Henson: I don't know the answer to your profiling q, seeing the profile and code might help. I have found profiles hard and sometimes misleading to read
16:48:01 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
16:48:12 <c_wraith> Henson: that line you're talking about doesn't look like a problem. I mean, you probably want to use zipWith instead of zip + map, but that's for clarity rather than performance
16:48:51 <c_wraith> Henson: if that line is being credited with a performance problem, it's in the generation of one of those lists. not that line itself
16:49:07 <c_wraith> and laziness is wonderful.
16:49:18 <c_wraith> It lets you write code that's actually efficiently composable
16:49:40 burnsidesLlama joins (~burnsides@dhcp168-015.wadham.ox.ac.uk)
16:49:45 <sm> Henson: it's generally considered worthwhile for forcing purity and supporting greater abstraction, although people always wonder what a "strict haskell" would be like
16:50:19 <Henson> c_wraith: do you have any suggestions as to avenues and techniques I could investigate to try to get the lists to be evaluated eagerly? Should I target the sites where they are produced for eager evaluation, or where they're consumed, or (hopefully not) somewhere in-between?
16:50:24 <sm> it's also not as much of a problem in practice as it may sound - for most people
16:50:35 <maerwald> Henson: forcing evaluation of 'a' in quadFit seems to have the same effect
16:50:55 × xb0o2 quits (~xb0o2@user/xb0o2) (Quit: Client closed)
16:50:59 Henson tests
16:51:42 <c_wraith> Henson: that question is... not going to lead you anywhere useful. If you're producing lists, you don't want to do it strictly. What you want to be doing is making sure that consuming the spine of the list doesn't generate nested thunks.
16:51:47 × coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot)
16:53:08 × n3rdy1 quits (~n3rdy1@2600:1700:4570:3480::41) (Ping timeout: 250 seconds)
16:53:12 <maerwald> sm: until it is and then you're in big trouble
16:53:14 <maerwald> :)
16:53:18 <c_wraith> Henson: a lot of the trouble people have is that not realizing that producing lazy data structures must be done with as much care as consuming them.
16:53:20 <Henson> c_wraith: can you explain that more? I know what thunks are, but don't really understand what you're suggesting or how I would make sure I'm not doing that.
16:53:34 × MajorBiscuit quits (~MajorBisc@c-001-025-054.client.tudelft.eduvpn.nl) (Ping timeout: 268 seconds)
16:53:57 zebrag joins (~chris@user/zebrag)
16:53:59 <sm> we should have a reading list for this topic
16:54:02 × burnsidesLlama quits (~burnsides@dhcp168-015.wadham.ox.ac.uk) (Ping timeout: 240 seconds)
16:54:09 <sm> @where laziness
16:54:09 <lambdabot> I know nothing about laziness.
16:54:19 <maerwald> sm: it's a constantly moving target
16:54:32 <c_wraith> maerwald: it really isn't. If you get it right, you've got it right.
16:54:42 lbseale joins (~ep1ctetus@user/ep1ctetus)
16:54:44 <maerwald> c_wraith: unless inlining is involved
16:54:55 <c_wraith> things only move if you get it wrong and depend on the compiler to rescue you
16:55:26 <maerwald> there's no right or wrong in terms of optimization tricks for the inliner
16:56:39 <Henson> maerwald: how did you force it? I put a bang on a in quadFit and it made it about twice as fast, but the bang on pVal makes it 70 times faster.
16:57:25 <maerwald> Henson: in seq a (accA + a, accB + b, accC + c)
16:57:49 <Henson> c_wraith: I'm also interested in learning more about how to carefully produce and consume lazy data structures
16:57:59 <maerwald> I also played a little with using a lambda as argument to foldl'
16:58:09 <maerwald> which also seemed to make some difference in some circumstance
16:58:27 Danishman joins (~Danishman@2-104-144-110-cable.dk.customer.tdc.net)
16:59:30 <Henson> maerwald: interesting! seq'ing any of a,b,c or pVal (at least) cause the performance increase
16:59:44 × vglfr quits (~vglfr@46.96.165.111) (Ping timeout: 268 seconds)
17:00:41 whatif joins (~user@123.123.223.41)
17:00:52 <Henson> maerwald: how is it that "seq a" makes a difference, but putting a bang on (!a,b,c) doesn't make a difference? Don't they do the same thing?
17:00:53 <whatif> why there's so many String in haskell?
17:01:37 <whatif> Data.ByteString, Data.ByteString.Lazy.Internal.ByteString, [Word 8], Data.Text, Lazy blabla
17:01:42 <razetime> https://mmhaskell.com/blog/2017/5/15/untangling-haskells-strings
17:01:45 <whatif> what's wrong with string
17:01:47 <c_wraith> Henson: it's a somewhat big topic, and I don't have anything prepared. The best I can do right now is say that I finally started understanding how to think about this after reading https://apfelmus.nfshost.com/blog/2013/08/21-space-invariants.html
17:01:56 <maerwald> Henson: also check out this: https://paste.tomsmeding.com/P3xMdKX9
17:01:59 deadmarshal joins (~deadmarsh@95.38.228.70)
17:02:15 <maerwald> there I force inside quadFit... but it only works if using the lambda-form above or so
17:02:28 <geekosaur> whatif: everything? one string type does not actually cover all use cases, and most programmers do stupid things with them
17:02:39 <whatif> I need Data.ByteString.Lazy.Internal.ByteString to write to file, there's no writeFile implement, only Data.ByteString has writeFile
17:02:45 <ksqsf> whatif: String is a linked list of characters, which is unreasonable in practice
17:02:57 <c_wraith> whatif: String has always been underspecified. Some languages just let you ignore that. Look at Rust if you want to see what being *really* careful about strings looks like
17:03:17 × Hildegunst quits (~luc@80.248.12.109.rev.sfr.net) (Ping timeout: 240 seconds)
17:03:18 <c_wraith> ksqsf: String is fine when its semantics are correct. But often they aren't.
17:03:50 <geekosaur> https://hackage.haskell.org/package/bytestring-0.11.2.0/docs/Data-ByteString-Lazy.html#v:writeFile
17:04:38 <whatif> geekosaur: what's the 'Internal' here mean?
17:04:48 <c_wraith> nothing.
17:04:49 alx741 joins (~alx741@157.100.93.160)
17:04:52 <shane> If anyone was wondering, I found the answer to my question above: torsors
17:04:52 <c_wraith> literally ignore it.
17:05:02 <c_wraith> Internal means that the normal name wasn't imported
17:05:04 <ksqsf> c_wraith: sure, if you only consider the semantics; but my point is that String is slow, and if you use String as a store format, it can take much RAM
17:05:05 <whatif> c_wraith: then why people don't remove it?
17:05:06 <geekosaur> that you didn't import Data.ByteString.Lazy so it hunted it down to its source, which is the core implementation in the Internal module
17:05:28 <sm> @where+ spaceleaks https://apfelmus.nfshost.com/blog/2013/08/21-space-invariants.html
17:05:28 <lambdabot> Good to know.
17:05:31 <geekosaur> you almost never care. just import Data.ByteString.Lazy and get on with life
17:05:37 vglfr joins (~vglfr@46.96.165.111)
17:06:06 n3rdy1 joins (~n3rdy1@2600:1700:4570:3480:1b88:50f:dae0:9293)
17:06:07 Hildegunst joins (~luc@80.248.12.109.rev.sfr.net)
17:06:09 sm wonders why is lambdabot so slow
17:06:17 <geekosaur> as to why Strict vs. Lazy, Strict is faster but you probably don't want to suck a 10GB file into memeory to operate on it, so we have Lazy as well
17:06:26 × Hildegunst quits (~luc@80.248.12.109.rev.sfr.net) (Client Quit)
17:06:31 × deadmarshal quits (~deadmarsh@95.38.228.70) (Ping timeout: 268 seconds)
17:06:57 <maerwald> lazy bytestring is poor man's streaming
17:07:30 econo joins (uid147250@user/econo)
17:08:08 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
17:08:49 fendor joins (~fendor@178.115.55.2.wireless.dyn.drei.com)
17:09:23 <Henson> c_wraith: thank you for the help and suggestions on the literature. I'll take a look at that
17:09:52 <Henson> maerwald: thanks for tinkering around with the code and suggesting improvments. I'll see what I'm able to do with the production code.
17:10:05 <whatif> how I can turn Data.ByteString.Lazy.Internal.String to String?
17:10:20 <ksqsf> unpack
17:10:29 <whatif> ksqsf: unpack get [Word8]
17:10:32 × mikoto-chan quits (~mikoto-ch@213.177.151.239) (Ping timeout: 240 seconds)
17:10:38 <whatif> and what the heck Word8 is?
17:10:50 × CiaoSen quits (~Jura@p200300c95737a2002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
17:11:12 <ksqsf> @hoogle Word8 -> Char
17:11:12 <lambdabot> Data.ByteString.Internal w2c :: Word8 -> Char
17:11:13 <lambdabot> Data.Text.Internal.Unsafe.Char unsafeChr8 :: Word8 -> Char
17:11:13 <lambdabot> Data.Bits.Utils w82c :: Word8 -> Char
17:11:35 <maerwald> uhm
17:12:09 <maerwald> that might not be what you want
17:12:20 <ksqsf> actually Word8-version ByteString is not intended to be directly used as String
17:12:24 <whatif> there's no w2c in Data.ByteString.Lazy
17:12:34 <maerwald> whatif: what's the data? UTF-8?
17:12:37 <geekosaur> no, it's an internal function
17:12:38 mikoto-chan joins (~mikoto-ch@213.177.151.239)
17:12:45 <ksqsf> you probably want decodeUtf8, or Char8-version ByteString if you only care about ASCII
17:13:03 <whatif> ksqsf: then why unpack Data.ByteString.Lazy get Word8
17:13:29 <ksqsf> whatif: it's a byte array.
17:13:37 <maerwald> https://hackage.haskell.org/package/text-2.0/docs/Data-Text-Lazy-Encoding.html#v:decodeUtf8With
17:13:57 <maerwald> then T.unpack
17:14:03 <whatif> ksqsf: does Data.ByteString.Encoding come with ghc?
17:14:37 <whatif> @hoogle ByteString -> String
17:14:37 <lambdabot> Control.Lens.Internal.ByteString unpackStrict8 :: ByteString -> String
17:14:37 <lambdabot> Control.Lens.Internal.ByteString unpackLazy8 :: ByteString -> String
17:14:37 <lambdabot> Data.ByteString.Lazy.UTF8 toString :: ByteString -> String
17:14:43 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
17:18:33 × chele quits (~chele@user/chele) (Remote host closed the connection)
17:18:42 × razetime quits (~quassel@49.207.203.87) (Ping timeout: 250 seconds)
17:19:02 <whatif> Data.ByteString.Lazy.UTF8.toString can't work on Data.ByteString.Internal.ByteString, what?
17:19:13 × mikoto-chan quits (~mikoto-ch@213.177.151.239) (Ping timeout: 256 seconds)
17:19:26 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:81c9:f67f:1443:f972)
17:19:43 <whatif> is there twenty kinds of String in Haskell?
17:20:10 <monochrom> 2
17:20:19 <maerwald> whatif: yes
17:20:21 tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net)
17:20:22 <monochrom> String and Text.
17:20:36 <whatif> monochrom: and Char and Word8
17:20:39 <monochrom> That's right, ByteString doesn't count.
17:20:48 <whatif> and a bunch of Lazy or Internel
17:20:54 mikoto-chan joins (~mikoto-ch@213.177.151.239)
17:20:58 <whatif> monochrom: what a pain in the ass
17:21:12 <maerwald> whatif: https://mmhaskell.com/blog/2017/5/15/untangling-haskells-strings
17:21:25 <monochrom> Unless your "string" means the C kind of string, i.e., bytes. In that case, 1, ByteString. That's right, String and Text don't count.
17:21:56 <polyphem_> whatif: https://gist.github.com/dino-/28b09c465c756c44b2c91d777408e166
17:21:56 <ksqsf> string, text (strict + lazy), bytestring (strict + lazy) * (char8 + word8)
17:22:07 <ksqsf> only 7 you need to know ;)
17:22:30 <whatif> why the Lazy thing can't work on Internal thing?
17:22:36 <whatif> or the verse
17:22:52 <ksqsf> you're using a strict bytestring
17:23:31 <ksqsf> @hoogle fromStrict
17:23:31 <lambdabot> Data.ByteString.Lazy fromStrict :: ByteString -> ByteString
17:23:31 <lambdabot> Data.ByteString.Lazy.Char8 fromStrict :: ByteString -> ByteString
17:23:32 <lambdabot> Data.Text.Lazy fromStrict :: Text -> Text
17:24:12 polyphem_ is now known as polyphem
17:24:13 <maerwald> whatif: they're different data types
17:24:25 <maerwald> for performance reasons
17:24:49 <maerwald> so yes, it's a mess
17:24:50 alx741 joins (~alx741@157.100.93.160)
17:25:01 <whatif> how I turn a Internal.ByteString to a String?
17:25:13 <whatif> I need a FilePath
17:25:29 <maerwald> whatif: on what platform?
17:25:31 <whatif> scotty give me a Internal.ByteString
17:25:37 <whatif> maerwald scotty
17:25:43 <whatif> maerwald debian
17:25:45 <monochrom> Yeah, that's actually platform-dependent territory.
17:25:45 <slack1256> Is this correct syntax for setting SCC and get info at call sites? https://pastebin.com/AWiRncm5
17:26:01 <maerwald> whatif: where did scotty obtain that filepath from?
17:26:21 <whatif> maerwald FileInfo
17:27:15 <maerwald> whatif: on unix, a filepath can have arbitrary encoding
17:27:32 burnsidesLlama joins (~burnsides@dhcp168-015.wadham.ox.ac.uk)
17:27:37 <maerwald> most people assume utf-8
17:28:43 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
17:28:43 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
17:29:44 <whatif> maerwald found it, Data.ByteString.Char8.unpack
17:29:51 <maerwald> whatif: that will truncate
17:31:38 <monochrom> It's only good for ASCII.
17:31:59 <whatif> what's the proper way, assume utf-8
17:32:14 <maerwald> whatif: that depends where the filepath is from
17:32:30 <whatif> maerwald debian linux
17:32:37 qeqeqw1 joins (~qeqeqw3@2001:861:3a04:e320:31ea:a59b:1c06:51f4)
17:32:48 <maerwald> I mean... can you know what's the encoding... is it on your machine? Is it sent to you?
17:32:55 <whatif> utf-8
17:33:00 <monochrom> A lot of people assume ASCII to head-in-sand so they don't have to answer those tough questions.
17:33:18 <ksqsf> https://paste.tomsmeding.com/ArEYKick if it's utf8, using 'text' is pretty easy
17:33:32 <maerwald> whatif: there's https://hackage.haskell.org/package/base-4.16.0.0/docs/GHC-IO-Encoding.html#v:getFileSystemEncoding
17:36:12 <maerwald> whatif: https://github.com/hasufell/abstract-filepath/blob/a913d715d8971224b45ef22a7b9ceaa263a77601/abstract-filepath/lib/AFP/OsString/Common.hs#L161-L162
17:36:24 <maerwald> that's an example of using current filesystem encoding to turn bytestring into String
17:37:13 deadmarshal joins (~deadmarsh@95.38.228.70)
17:38:09 <sclv> shane those things are usually called torsors? you can also just view it as an affine space i guess
17:39:06 × mbuf quits (~Shakthi@136.185.86.67) (Quit: Leaving)
17:40:00 hippoid joins (~hippoid@184.105.6.88)
17:40:52 <slack1256> It seems that call-site SCC do not appear when reporting exceptions via +RTS -xc . Does somebody know how to track who threw an exceptions?
17:41:48 Akiva joins (~Akiva@user/Akiva)
17:42:36 turlando joins (~turlando@93-42-250-112.ip89.fastwebnet.it)
17:42:36 × turlando quits (~turlando@93-42-250-112.ip89.fastwebnet.it) (Changing host)
17:42:36 turlando joins (~turlando@user/turlando)
17:43:52 Hildegunst joins (~luc@80.248.12.109.rev.sfr.net)
17:43:53 CiaoSen joins (~Jura@p200300c95737a2002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
17:44:52 alx741 joins (~alx741@157.100.93.160)
17:46:28 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
17:47:48 <slack1256> Nevermind, they seem to do. The exception was not thrown from where I excepted.
17:48:27 × Hildegunst quits (~luc@80.248.12.109.rev.sfr.net) (Ping timeout: 268 seconds)
17:53:18 × ProfSimm quits (~ProfSimm@176-12-60-137.pon.spectrumnet.bg) (Remote host closed the connection)
17:53:38 ProfSimm joins (~ProfSimm@176-12-60-137.pon.spectrumnet.bg)
17:53:51 alp joins (~alp@user/alp)
17:53:58 <shane> sclv: I figured it out eventually, but I appreciate you getting back to me!
17:56:28 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 268 seconds)
17:57:48 × whatif quits (~user@123.123.223.41) (Quit: ERC (IRC client for Emacs 26.3))
17:58:19 × ProfSimm quits (~ProfSimm@176-12-60-137.pon.spectrumnet.bg) (Ping timeout: 256 seconds)
18:01:32 coot joins (~coot@89-64-85-93.dynamic.chello.pl)
18:02:51 alx741 joins (~alx741@157.100.93.160)
18:03:13 yauhsien joins (~yauhsien@61-231-62-246.dynamic-ip.hinet.net)
18:03:26 kritzefitz joins (~kritzefit@debian/kritzefitz)
18:05:02 × jkaye quits (~jkaye@2601:281:200:1958:8e74:ef22:c471:c2e) (Ping timeout: 240 seconds)
18:05:46 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
18:05:56 xb0o2 joins (~xb0o2@user/xb0o2)
18:06:18 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
18:08:14 fef joins (~thedawn@user/thedawn)
18:11:25 <zzz> why should we avoid GADTs if we don't need them?
18:13:59 <geekosaur> did something tell you that?
18:14:25 <geekosaur> I mean, there are those who prefer GADT syntax even for non-GADTs
18:14:33 <slack1256> Anybody has used the `mold` linker with ghc?
18:14:38 <geekosaur> (and GADTSyntax is a language option)
18:14:52 <geekosaur> slack1256, it's been tried in #ghc, ask there but they had problems with it
18:16:15 × coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot)
18:16:55 whatsupdoc joins (uid509081@id-509081.hampstead.irccloud.com)
18:17:54 × Pickchea quits (~private@user/pickchea) (Quit: Leaving)
18:19:47 × perrierjouet quits (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Quit: WeeChat 3.4)
18:20:01 ksqsf joins (~user@134.209.106.31)
18:20:37 <geekosaur> zzz, beyond that, there are those who believe existentials (the main purpose of GADTs) are often an anti-pattern.
18:20:59 × gdd quits (~gdd@129.199.146.230) (Ping timeout: 256 seconds)
18:21:28 <geekosaur> you should probably read the arguments in both directions and make your own decision; the fact that they are still around and used suggests it's not a clear-cut "this is bad"
18:21:31 × yauhsien quits (~yauhsien@61-231-62-246.dynamic-ip.hinet.net) (Remote host closed the connection)
18:21:42 kspalaiologos joins (~kspalaiol@user/kspalaiologos)
18:22:31 perrierjouet joins (~perrier-j@modemcable012.251-130-66.mc.videotron.ca)
18:22:52 alx741 joins (~alx741@157.100.93.160)
18:23:00 ub joins (~Thunderbi@141.98.252.232)
18:23:12 <zzz> oh i remember someone saying we should avoid it but never understood why. thanks
18:23:15 × ubert quits (~Thunderbi@141.98.252.232) (Ping timeout: 256 seconds)
18:23:15 ub is now known as ubert
18:23:24 <EvanR> GADTs are awesome
18:23:29 <EvanR> totally rad, even
18:24:32 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 240 seconds)
18:24:42 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
18:27:52 hippoid parts (~hippoid@184.105.6.88) ()
18:27:56 × kspalaiologos quits (~kspalaiol@user/kspalaiologos) (Quit: Leaving)
18:28:43 ksqsf joins (~user@134.209.106.31)
18:30:23 <zzz> agree
18:30:54 <zzz> i even prefer GADT syntax for non-GADTs
18:31:06 yauhsien joins (~yauhsien@61-231-62-246.dynamic-ip.hinet.net)
18:31:06 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
18:32:31 <zzz> and we can now use it in newtype decls, nice
18:34:05 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 268 seconds)
18:35:20 <EvanR> really
18:35:32 × yauhsien quits (~yauhsien@61-231-62-246.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
18:35:33 <EvanR> does that mean you can have existential newtype
18:36:47 ksqsf joins (~user@134.209.106.31)
18:38:32 × troydm quits (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 240 seconds)
18:39:16 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:81c9:f67f:1443:f972) (Remote host closed the connection)
18:40:56 × gentauro quits (~gentauro@user/gentauro) (Quit: leaving)
18:40:57 wombat875 joins (~neilfulwi@pool-72-89-24-154.nycmny.fios.verizon.net)
18:41:11 gentauro joins (~gentauro@user/gentauro)
18:41:26 × gentauro quits (~gentauro@user/gentauro) (Client Quit)
18:42:36 gentauro joins (~gentauro@user/gentauro)
18:45:08 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
18:45:24 × ksqsf quits (~user@134.209.106.31) (Remote host closed the connection)
18:45:45 ksqsf joins (~user@134.209.106.31)
18:47:44 <geekosaur> existential newtype seems unlikely since it'd have at least two fields (the value and its dictionary)?
18:47:54 alx741 joins (~alx741@157.100.93.160)
18:48:16 <EvanR> that assumes you put a constraint
18:48:34 <EvanR> which I guess is often implied by using existential types
18:48:53 <EvanR> and I guess that is the anti-pattern you were talking about
18:48:59 <geekosaur> they're kinda useless without?
18:49:45 <geekosaur> "great, I have a value but no clue what I can do with it"
18:50:19 <EvanR> in tricky code where internally you have external information on how to unwrap the unknown value, and you just want something like old GHC.Any
18:50:30 <EvanR> and you don't want an extra wrapper
18:50:37 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 256 seconds)
18:50:47 <EvanR> er, internally, you have tricky extra information
18:50:47 <awpr> contrived as this is, it demonstrates why that's not completely true: `data Thing where Thing :: Dict (Show a) -> a -> Thing`
18:51:14 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
18:51:22 <EvanR> yes geekosaur is probably thinking, either a constraint or a paired thing that uses a
18:51:57 ProfSimm joins (~ProfSimm@87.227.196.109)
18:52:05 merijn joins (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl)
18:52:27 <awpr> yeah, you can obtain "things to do with" the existentials by their relation to other fields, like `data Generator a where Generator :: b -> (b -> (a, b)) -> Generator a`
18:52:33 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
18:52:52 <EvanR> which is besides the point of newtypes, which have only 1 field
18:53:08 jinsun__ is now known as jinsun
18:53:20 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
18:53:46 <awpr> could have a newtype over a tuple, or a newtype over any type that mentions the existential twice
18:54:32 <EvanR> if they wrapped type has fields, then it could have used its own existential
18:54:36 <monochrom> geekosaur: As the user's guide says, as you observed, a useful existential type is not going to be a semantic newtype; a syntactic newtype (that the compiler secretly s/newtype/data/ under the hood) is no problem but the GHC devs are too lazy to do it until they hear enough requests.
18:55:07 geekosaur joins (~geekosaur@xmonad/geekosaur)
18:55:25 <maerwald> awpr: you don't need GADT syntax for that though
18:55:25 <awpr> but even without other fields, you can get interesting things: `data Colimit f where Colimit :: f a -> Colimit f`, s.t. `Colimit (Int,)` is isomorphic to `Int`
18:56:09 <EvanR> ok so that looks like a good time for a newtype
18:56:18 <EvanR> but it's illegal
18:56:36 <maerwald> that just makes it more exciting
18:57:19 <awpr> maerwald: hmm? you mean the Generator example being expressible with just ExistentialTypes? needing GADT syntax wasn't the point, it was doing something useful with unconstrained existentials
18:57:58 <monochrom> I had to decode the GADT syntax to recognize the existential type...
18:58:47 <maerwald> awpr: ExistentialQuantification
18:58:51 <monochrom> I recognize that there is now a school of thought of using only GADT syntax to write existential types.
19:00:12 <EvanR> it seems like since you can use GADT to write newtypes, there's gotta be special case there to see if you used existentials and tell you no xD
19:00:26 <EvanR> why not just make it work
19:03:03 val-host joins (~val-host@2a02:2f0f:9108:b00:6891:37fc:a7bd:3738)
19:03:23 Erutuon joins (~Erutuon@user/erutuon)
19:03:40 ksqsf joins (~user@134.209.106.31)
19:05:09 <awpr> oh right, I forgot the name since I never end up enabling it explicitly
19:06:12 × val-host quits (~val-host@2a02:2f0f:9108:b00:6891:37fc:a7bd:3738) (Client Quit)
19:06:32 × deadmarshal quits (~deadmarsh@95.38.228.70) (Ping timeout: 240 seconds)
19:07:39 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
19:07:55 alx741 joins (~alx741@157.100.93.160)
19:08:35 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 256 seconds)
19:10:35 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
19:12:47 zwro[m] joins (~zwromatri@2001:470:69fc:105::1d4)
19:15:24 × michalz quits (~michalz@185.246.204.122) (Ping timeout: 268 seconds)
19:17:03 × dhouthoo quits (~dhouthoo@178-117-36-167.access.telenet.be) (Quit: WeeChat 3.4)
19:18:54 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
19:21:03 × merijn quits (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds)
19:21:26 ksqsf joins (~user@134.209.106.31)
19:22:45 × DNH quits (~DNH@2a02:8108:1100:16d8:edf9:3833:cff9:92b3) (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:26:30 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 268 seconds)
19:28:52 alx741 joins (~alx741@157.100.93.160)
19:29:49 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
19:32:58 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
19:33:26 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
19:33:26 finn_elija joins (~finn_elij@user/finn-elija/x-0085643)
19:33:26 finn_elija is now known as FinnElija
19:34:21 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
19:36:32 troydm joins (~troydm@host-176-37-124-197.b025.la.net.ua)
19:37:39 ksqsf joins (~user@134.209.106.31)
19:39:05 DNH joins (~DNH@2a02:8108:1100:16d8:edf9:3833:cff9:92b3)
19:39:40 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:81c9:f67f:1443:f972)
19:39:59 × fef quits (~thedawn@user/thedawn) (Quit: Leaving)
19:40:30 <EvanR> are instances based on Generics inherently less efficient than handcoded ones for a given type
19:40:33 eron joins (~eron@2804:431:c7c2:3848:71e8:6fbf:96e2:3117)
19:40:45 <EvanR> or is there some GHC magic
19:41:01 <awpr> not inherently less efficient, but sometimes they are
19:41:41 <awpr> the hope is that GHC will be able to inline from/to, do some optimization, and annihilate them against each other so that the result is the same as if it never went through generics
19:41:55 <EvanR> oh, nice
19:41:59 <monochrom> GHC does not have magic. However, efficiency depends on the actual class and methods.
19:42:03 <[exa]> there are "pretty good chances" that it inlines to a form that is more less equivalent to what you'd get by writing the instances by hand
19:42:22 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:81c9:f67f:1443:f972) (Remote host closed the connection)
19:42:28 <awpr> but if the particular instance has something that prevents that from working, or if the type is big enough that GHC doesn't want to inline it, then it's likely to become a disaster
19:42:32 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 268 seconds)
19:42:32 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:81c9:f67f:1443:f972)
19:42:53 <monochrom> I don't see myself handwriting a more efficient Show than the usual Generics solution, for example.
19:43:02 ksqsf joins (~user@134.209.106.31)
19:43:09 <monochrom> It's the same structural recursion.
19:43:26 <awpr> (disaster: ) because actually executing to/from at runtime involves allocating/scrutinizing a _ton_ of data constructors
19:43:28 <EvanR> yes but this business of first converting to a generic rep, then coming back
19:43:39 <EvanR> at each element of the structure
19:43:58 × bliminse quits (~bliminse@host86-188-36-178.range86-188.btcentralplus.com) (Quit: leaving)
19:43:58 <EvanR> e.g. if it's a 4 field record, it'll become a (a :*: b) :*: (c :*: d)
19:44:04 <monochrom> Ah, OK yeah.
19:44:36 Hildegunst joins (~luc@80.248.12.109.rev.sfr.net)
19:44:36 <awpr> `case (case x of Left a -> L1 a; Right b -> R1 b) of L1 a -> showString "Left" ... ; R1 b -> showString "Right" ...`
19:45:13 <awpr> this can be optimized easily enough to `case x of Left a -> showString "Left" ... ; Right b -> showString "Right" ...`
19:45:13 Hildegun1t joins (~luc@80.248.12.109.rev.sfr.net)
19:45:38 <monochrom> Damn, the world is more magical than I thought.
19:45:42 × Hildegun1t quits (~luc@80.248.12.109.rev.sfr.net) (Client Quit)
19:46:00 <EvanR> so from-tos can be fused?
19:46:23 <awpr> effectively yeah, in good cases they get inlined and eventually vanish
19:46:29 <EvanR> that is amazing
19:47:32 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 240 seconds)
19:48:14 × perrierjouet quits (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Quit: WeeChat 3.4)
19:48:21 <awpr> unfortunately it's a bit brittle in that there's some cutoff point where GHC stops thinking it's worth it to inline from/to, compile times skyrocket, runtime performance gets slow, and there's not really anything you can do about it as a library author
19:48:30 perrierjouet joins (~perrier-j@modemcable012.251-130-66.mc.videotron.ca)
19:49:02 × Hildegunst quits (~luc@80.248.12.109.rev.sfr.net) (Ping timeout: 240 seconds)
19:49:02 <awpr> cutoff point in terms of the size (number of constructors/fields) of the type whose Generic instance is being used
19:49:09 <EvanR> as a user though, you can write an offending instance by hand
19:49:31 <awpr> yeah, that's true
19:49:31 <EvanR> and remove deriving Generic
19:49:48 alx741 joins (~alx741@157.100.93.160)
19:50:05 <awpr> but then you have to notice that's happening, which is rarely obvious unless you're already looking at Core
19:50:09 × eron quits (~eron@2804:431:c7c2:3848:71e8:6fbf:96e2:3117) (Quit: Client closed)
19:50:21 <EvanR> if no one notices it's slow, then it's fast!
19:51:02 × Midjak quits (~Midjak@may53-1-78-226-116-92.fbx.proxad.net) (Ping timeout: 240 seconds)
19:51:17 <awpr> alternatively if no one notices your Generic instance is slow due to inlining failure, then it's an ambient performance tax that just gets lumped into a vague cultural belief that Haskell is slow
19:52:20 <monochrom> This is why I look at Core all the time.
19:52:57 <monochrom> My ratio of looking at Core to looking at profiling graphs is 99:1.
19:52:58 × alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer)
19:54:00 <EvanR> I don't even see Core anymore, just blonde, brunette, redhead
19:54:37 <EvanR> (a reference to this really old movie The Matrix)
19:54:58 <Rembane> EvanR: Good reference. Good movie.
19:55:11 <sm> truthfully ? that's interesting then
19:55:27 <sm> (monochrom)
19:55:49 <awpr> profiling graph is just a hint about what Core to look at :)
19:56:06 <EvanR> getting a core output and looking at it seems somewhat more ergonomic than profiling graph
19:56:21 × mjs2600 quits (~mjs2600@c-24-91-3-49.hsd1.vt.comcast.net) (Ping timeout: 256 seconds)
19:56:23 <EvanR> since it's text
19:56:24 sm resolves to read more core in 2022
19:57:38 <sm> but which reveals relevant insights more l efficiently
19:58:06 bliminse joins (~bliminse@host86-188-36-178.range86-188.btcentralplus.com)
19:58:26 sm doesn't get as far as charts, but does read textual profile output from time to time
19:58:45 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
19:59:21 <monochrom> I am an extreme. But awpr is at the truth in the middle. A profiling graph can only tell you where to dig. It still doesn't dig for you.
20:00:29 geekosaur joins (~geekosaur@xmonad/geekosaur)
20:01:31 <sm> gtoolkit.com advocates "moldable development": casually whipping up just the custom tools and visualizations you need at any point. I want this
20:02:39 × ubert quits (~Thunderbi@141.98.252.232) (Quit: ubert)
20:05:25 × juhp quits (~juhp@128.106.188.82) (Ping timeout: 256 seconds)
20:05:52 <EvanR> that's some ironman sh*t
20:06:04 <EvanR> jarvis, show me something
20:06:28 <sm> :)
20:06:41 <monochrom> "I'm going to send you to the MIT student lab"
20:06:45 juhp joins (~juhp@128.106.188.82)
20:08:07 <sm> could be a point of contact between the smalltalk and haskell worlds. (needs a haskell parser added)
20:08:16 × gehmehgeh quits (~user@user/gehmehgeh) (Remote host closed the connection)
20:09:00 gehmehgeh joins (~user@user/gehmehgeh)
20:11:15 × ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds)
20:13:00 ec joins (~ec@gateway/tor-sasl/ec)
20:17:53 × geranim0 quits (~geranim0@modemcable242.171-178-173.mc.videotron.ca) (Ping timeout: 256 seconds)
20:18:51 xkuru joins (~xkuru@user/xkuru)
20:19:17 lavaman joins (~lavaman@98.38.249.169)
20:21:09 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
20:21:32 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
20:23:51 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 268 seconds)
20:24:47 × ProfSimm quits (~ProfSimm@87.227.196.109) (Remote host closed the connection)
20:25:06 ProfSimm joins (~ProfSimm@87.227.196.109)
20:25:42 mjs2600 joins (~mjs2600@c-24-91-3-49.hsd1.vt.comcast.net)
20:25:49 travv0 joins (sid293381@user/travv0)
20:31:02 Tuplanolla joins (~Tuplanoll@91-159-68-166.elisa-laajakaista.fi)
20:32:15 ksqsf joins (~user@134.209.106.31)
20:33:11 × kmein quits (~weechat@user/kmein) (Quit: ciao kakao)
20:33:31 kmein joins (~weechat@user/kmein)
20:37:02 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 240 seconds)
20:39:23 ubert joins (~Thunderbi@p200300ecdf09949e91b35a252eb85141.dip0.t-ipconnect.de)
20:39:26 × ubert quits (~Thunderbi@p200300ecdf09949e91b35a252eb85141.dip0.t-ipconnect.de) (Client Quit)
20:41:02 × qeqeqw1 quits (~qeqeqw3@2001:861:3a04:e320:31ea:a59b:1c06:51f4) (Ping timeout: 240 seconds)
20:41:19 jkaye joins (~jkaye@2601:281:200:1958:2b64:9a7d:6899:8349)
20:41:29 pfurla joins (~pfurla@2804:d41:4331:4800:31ef:1aaf:1e7:47d)
20:46:58 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
20:48:15 × kuribas quits (~user@ptr-25vy0ia11vvy5vw4h88.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 26.3))
20:49:13 hololeap_ joins (~hololeap@user/hololeap)
20:49:14 × kojo5551 quits (~kojo5551@fep.grid.pub.ro) (Remote host closed the connection)
20:49:18 Midjak joins (~Midjak@may53-1-78-226-116-92.fbx.proxad.net)
20:50:49 val-host joins (~val-host@2a02:2f0f:9108:b00:6891:37fc:a7bd:3738)
20:50:59 × notzmv quits (~zmv@user/notzmv) (Ping timeout: 268 seconds)
20:51:35 kojo5551 joins (~kojo5551@fep.grid.pub.ro)
20:52:12 × hololeap quits (~hololeap@user/hololeap) (Ping timeout: 276 seconds)
20:52:31 × val-host quits (~val-host@2a02:2f0f:9108:b00:6891:37fc:a7bd:3738) (Client Quit)
20:55:28 slac52114 joins (~slack1256@191.125.99.76)
20:57:09 × dut quits (~dut@user/dut) (Quit: Leaving)
20:57:32 × slack1256 quits (~slack1256@186.11.99.46) (Ping timeout: 240 seconds)
21:00:13 × mikoto-chan quits (~mikoto-ch@213.177.151.239) (Ping timeout: 256 seconds)
21:01:36 ubert joins (~Thunderbi@p200300ecdf09949e91b35a252eb85141.dip0.t-ipconnect.de)
21:02:15 mikoto-chan joins (~mikoto-ch@213.177.151.239)
21:03:03 pavonia joins (~user@user/siracusa)
21:03:10 × vysn quits (~vysn@user/vysn) (Ping timeout: 250 seconds)
21:10:32 × mikoto-chan quits (~mikoto-ch@213.177.151.239) (Ping timeout: 240 seconds)
21:10:38 × ec quits (~ec@gateway/tor-sasl/ec) (Remote host closed the connection)
21:11:10 ec joins (~ec@gateway/tor-sasl/ec)
21:12:08 slack1256 joins (~slack1256@186.11.27.197)
21:14:10 Pickchea joins (~private@user/pickchea)
21:14:33 × slac52114 quits (~slack1256@191.125.99.76) (Ping timeout: 256 seconds)
21:16:34 × _ht quits (~quassel@2a02:a468:b619:1:c1f2:a735:3541:23f8) (Remote host closed the connection)
21:18:01 merijn joins (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl)
21:23:19 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
21:25:21 × wyrd quits (~wyrd@gateway/tor-sasl/wyrd) (Ping timeout: 276 seconds)
21:26:26 ksqsf joins (~user@134.209.106.31)
21:31:41 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 268 seconds)
21:32:05 × mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection)
21:33:24 dut joins (~dut@user/dut)
21:36:43 × gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving)
21:37:57 jgeerds joins (~jgeerds@55d4090e.access.ecotel.net)
21:41:03 × xlei_ quits (~akans@pool-71-125-19-142.nycmny.fios.verizon.net) (Quit: ZNC 1.9.x-git-167-81df4dec - https://znc.in)
21:43:48 Zugul joins (~Zugul@52.173.255.131)
21:43:55 MajorBiscuit joins (~MajorBisc@2a02:a461:129d:1:6d4c:38a4:18b7:4b48)
21:44:10 <Zugul> !help
21:44:24 <Zugul> ??
21:52:21 × merijn quits (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds)
21:52:51 <geekosaur> yes?
21:54:04 <monochrom> We have not bots here.
21:54:15 <monochrom> err I can't type. We have no bots here.
21:54:32 × jle` quits (~jle`@cpe-23-240-75-236.socal.res.rr.com) (Ping timeout: 240 seconds)
21:55:05 sm whispers /msg lambdabot @help
21:56:29 jle` joins (~jle`@cpe-23-240-75-236.socal.res.rr.com)
21:57:17 <monochrom> Ugh I just rediscovered that "@quote monochrom monad" is full of past wisdom I forgot. :)
21:58:14 geekosaur sends monochrom a burrito
22:02:43 × MajorBiscuit quits (~MajorBisc@2a02:a461:129d:1:6d4c:38a4:18b7:4b48) (Quit: WeeChat 3.3)
22:05:11 <monochrom> I had a quote that's way more general than burrito!
22:05:18 <monochrom> @quote monochrom monad.*dinner
22:05:18 <lambdabot> monochrom says: We the haskell community should henceforth use "what is a monad" as our secret code for "dinner time!"
22:06:22 <Rembane> That's a very good quote.
22:06:28 <monochrom> :)
22:07:17 <wombat875> kl
22:07:25 × wombat875 quits (~neilfulwi@pool-72-89-24-154.nycmny.fios.verizon.net) (Quit: WeeChat 2.2-dev)
22:07:44 wombat875 joins (~neilfulwi@pool-72-89-24-154.nycmny.fios.verizon.net)
22:08:06 <wombat875> lol sorry still trying to figure out weechat shortcuts
22:10:00 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
22:11:15 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
22:12:08 × fendor quits (~fendor@178.115.55.2.wireless.dyn.drei.com) (Remote host closed the connection)
22:13:37 × ystael quits (~ystael@user/ystael) (Ping timeout: 268 seconds)
22:14:02 × wombat875 quits (~neilfulwi@pool-72-89-24-154.nycmny.fios.verizon.net) (Ping timeout: 240 seconds)
22:15:00 wombat875 joins (~neilfulwi@pool-72-89-24-154.nycmny.fios.verizon.net)
22:15:01 ystael joins (~ystael@user/ystael)
22:17:17 × ystael quits (~ystael@user/ystael) (Read error: Connection reset by peer)
22:17:28 ystael joins (~ystael@user/ystael)
22:20:33 ksqsf joins (~user@134.209.106.31)
22:23:30 × ksqsf quits (~user@134.209.106.31) (Remote host closed the connection)
22:24:01 <d34df00d> Is there anything in quickcheck that'll give me a random partition of a list?
22:24:16 <d34df00d> (that is, a list of sublists such that their concatenation is equal to the original list)
22:25:17 × xb0o2 quits (~xb0o2@user/xb0o2) (Quit: Client closed)
22:27:38 werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
22:27:39 × wmacmil quits (~wmacmil@83-233-165-97.cust.bredband2.com) (Ping timeout: 256 seconds)
22:27:41 <d34df00d> Ok, I think it's a three-liner and not worth a library.
22:28:32 × `2jt quits (~jtomas@10.red-83-58-228.dynamicip.rima-tde.net) (Ping timeout: 240 seconds)
22:28:39 <hpc> it's worth a library if you write javascript^W^Wbelieve in yourself :D
22:28:45 <Rembane> d34df00d: How did you solve it? :)
22:29:42 <d34df00d> Rembane: for an empty or singleton list, return the list containing of that list. Otherwise, pick a number between (1; length xs), `take` that many off the list, recur on the `drop`, append the result of the `take` to the recursive call result.
22:29:59 <d34df00d> Not proven to give statistically meaningful results, but OK for my purposes.
22:30:09 <monochrom> A library would need to parametrize a lot of things, e.g., the distribution of how many splittings, the distribution of each actual splitting point, etc etc...
22:30:55 <Rembane> d34df00d: Nice solution! You can use splitAt if you want to have take and drop in the same function.
22:31:13 <d34df00d> Yep, that's in fact what I'm doing :]
22:31:16 <hpc> i wonder how many quick checks haven't been written because writing that partitioning code yourself is too annoying
22:31:40 <d34df00d> splitAt is nice and handy!
22:31:47 <Rembane> d34df00d: Sweet! :) You can also use partitionM and feed it a Bool generator, but I don't know if it's worth that extra library.
22:31:57 <Rembane> hpc: Seven! At least!
22:32:07 <d34df00d> Rembane: that'll mess up the ordering of the elements, I think?
22:32:09 ksqsf joins (~user@134.209.106.31)
22:32:23 <hpc> maybe even eight!
22:32:33 <monochrom> Hrm, what does partitionM do again?
22:32:38 <Rembane> d34df00d: Yup, I totally missed that you wanted the ordering to be the same.
22:33:03 <Rembane> monochrom: partition but with monads! https://hackage.haskell.org/package/extra-1.7.10/docs/Control-Monad-Extra.html#v:partitionM
22:33:11 × Danishman quits (~Danishman@2-104-144-110-cable.dk.customer.tdc.net) (Quit: Leaving)
22:33:38 <monochrom> Thanks.
22:34:22 <Rembane> np!
22:37:03 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 268 seconds)
22:39:24 ksqsf joins (~user@134.209.106.31)
22:41:22 × CiaoSen quits (~Jura@p200300c95737a2002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
22:42:46 Swahili joins (~Swahili@a95-94-208-187.cpe.netcabo.pt)
22:43:14 <Swahili> Q: In ghci, the commands :l or :r, what are these called? Can I say utility commands?
22:43:26 <Swahili> or is there a name for it?
22:43:59 Sindai joins (~Sindai@2a01cb0583e8cd008d228a3c88136061.ipv6.abo.wanadoo.fr)
22:44:05 × perrierjouet quits (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Quit: WeeChat 3.4)
22:44:50 <hpc> ghci's :help just calls them commands
22:44:56 perrierjouet joins (~perrier-j@modemcable012.251-130-66.mc.videotron.ca)
22:45:05 <hpc> unless you mean those specifically?
22:45:24 <geekosaur> the user's guide doesn't distinguish either
22:45:39 <geekosaur> the only commands it treats specially are :set and :seti
22:48:12 <monochrom> You can safely say "command". If you really like "utility command", I think it is also clear.
22:49:17 <Swahili> hpc: thank you!
22:49:36 <Swahili> geekosaur: monochrom thank you!
22:50:00 × alp quits (~alp@user/alp) (Ping timeout: 268 seconds)
22:50:47 × laslmtdbm^ quits (~laslmtdbm@wsip-98-188-242-61.mc.at.cox.net) (Remote host closed the connection)
22:54:36 × ubert quits (~Thunderbi@p200300ecdf09949e91b35a252eb85141.dip0.t-ipconnect.de) (Remote host closed the connection)
22:57:08 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 250 seconds)
22:57:15 × burnsidesLlama quits (~burnsides@dhcp168-015.wadham.ox.ac.uk) (Remote host closed the connection)
22:58:37 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
22:58:37 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
22:58:37 wroathe joins (~wroathe@user/wroathe)
23:00:14 notzmv joins (~zmv@user/notzmv)
23:04:19 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
23:04:44 × wombat875 quits (~neilfulwi@pool-72-89-24-154.nycmny.fios.verizon.net) (Quit: WeeChat 2.2-dev)
23:06:02 × Henson quits (~kvirc@107-179-133-201.cpe.teksavvy.com) (Ping timeout: 268 seconds)
23:06:22 yauhsien joins (~yauhsien@61-231-62-246.dynamic-ip.hinet.net)
23:09:04 alp joins (~alp@user/alp)
23:10:37 ksqsf joins (~user@134.209.106.31)
23:11:35 × yauhsien quits (~yauhsien@61-231-62-246.dynamic-ip.hinet.net) (Ping timeout: 268 seconds)
23:13:37 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
23:15:39 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 256 seconds)
23:17:41 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
23:17:45 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 268 seconds)
23:19:17 × _FlawLess_ quits (~user@2a01:e0a:a4:7098::10) (Ping timeout: 240 seconds)
23:26:27 × unyu quits (~pyon@user/pyon) (Quit: Reboot.)
23:27:43 burnsidesLlama joins (~burnsides@dhcp168-015.wadham.ox.ac.uk)
23:28:48 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
23:30:43 shapr joins (~user@2601:7c0:c37c:46d0:9d97:8334:355a:b331)
23:32:51 wmacmil joins (~wmacmil@83-233-165-97.cust.bredband2.com)
23:33:57 × cosimone quits (~user@93-47-230-83.ip115.fastwebnet.it) (Ping timeout: 256 seconds)
23:36:06 × Tuplanolla quits (~Tuplanoll@91-159-68-166.elisa-laajakaista.fi) (Quit: Leaving.)
23:36:47 ksqsf joins (~user@134.209.106.31)
23:40:08 × perrierjouet quits (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Quit: WeeChat 3.4)
23:41:32 × ksqsf quits (~user@134.209.106.31) (Ping timeout: 240 seconds)
23:43:51 laslmtduuuk^ joins (~laslmtduu@wsip-98-188-242-61.mc.at.cox.net)
23:44:21 × max22- quits (~maxime@2a01cb0883359800e30a3abeb76df7a4.ipv6.abo.wanadoo.fr) (Remote host closed the connection)
23:44:56 × Zugul quits (~Zugul@52.173.255.131) (Remote host closed the connection)
23:45:21 deadmarshal joins (~deadmarsh@95.38.228.70)
23:45:50 × newsham quits (~newsham@2603-800c-2d00-e994-c564-1d76-1f18-c3ec.res6.spectrum.com) (Quit: Client closed)
23:47:47 × DNH quits (~DNH@2a02:8108:1100:16d8:edf9:3833:cff9:92b3) (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:48:15 × mmhat quits (~mmh@55d4d6e9.access.ecotel.net) (Quit: WeeChat 3.4)
23:49:49 × deadmarshal quits (~deadmarsh@95.38.228.70) (Ping timeout: 256 seconds)
23:53:39 merijn joins (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl)
23:54:12 ksqsf joins (~user@134.209.106.31)
23:57:19 perrierjouet joins (~perrier-j@modemcable012.251-130-66.mc.videotron.ca)

All times are in UTC on 2022-01-18.