Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,803,858 events total
2021-07-30 02:02:48 <euouae> why is it called rank N types?
2021-07-30 02:03:14 <c_wraith> The rank of a type is (in rough terms) how nested the foralls in it are
2021-07-30 02:03:30 × paravida quits (~myChateau@user/paravida) (Ping timeout: 240 seconds)
2021-07-30 02:03:31 <c_wraith> Without that extension, all foralls are implicit and at the top level - rank 1
2021-07-30 02:03:45 <c_wraith> That extension allows you to nest them arbitrarily deep
2021-07-30 02:04:10 <euouae> using the forall word?
2021-07-30 02:04:18 <c_wraith> yeah
2021-07-30 02:04:38 <euouae> seems like there's different kinds of 'type N' types
2021-07-30 02:04:42 <euouae> sorry, rank N
2021-07-30 02:05:12 × alx741 quits (~alx741@181.196.69.85) (Client Quit)
2021-07-30 02:05:47 <c_wraith> hmm. you can divide them up a bunch of different ways, but I don't think that's what you mean. Are you making a comparison to higher-kinded types?
2021-07-30 02:06:23 laman joins (laman@2600:3c02::f03c:92ff:fe3e:c08d)
2021-07-30 02:06:46 <euouae> forall a -> (forall b -> (forall c -> d)) and a -> (forall b -> (forall c -> forall d)) ?
2021-07-30 02:06:52 <euouae> Are not these both rank 2?
2021-07-30 02:07:07 <euouae> Ugh, are these not both rank 2? I'm way too tired
2021-07-30 02:08:50 <c_wraith> you mean forall a. a -> (forall b. b -> (forall c. c -> d)), and such with the other?
2021-07-30 02:09:01 <euouae> yeah
2021-07-30 02:09:40 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 258 seconds)
2021-07-30 02:09:48 <euouae> ok well take a rank 2 type X and form a -> b -> X and a -> X -> b. Seems like both are still rank 2
2021-07-30 02:09:51 <c_wraith> Those are higher-rank, but not meaningfully so. They can be rewritten to not nest the foralls, with no loss of generality
2021-07-30 02:10:13 <c_wraith> It's on the argument side that it gets more interesting
2021-07-30 02:10:32 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 256 seconds)
2021-07-30 02:11:20 <euouae> lechner: There's https://hackage.haskell.org/package/aeson-pretty-0.8.8/docs/Data-Aeson-Encode-Pretty.html
2021-07-30 02:11:38 <euouae> There's also https://hackage.haskell.org/package/aeson-pretty
2021-07-30 02:12:43 <c_wraith> I honestly have trouble thinking of a practical rank-3 type. I know some people have managed them, but I've always been able to do what I want with rank-2
2021-07-30 02:13:08 <c_wraith> Probably means I don't want things that are hard enough in that direction :)
2021-07-30 02:13:10 <euouae> Hey I'm having trouble with the State stuff as it is :)
2021-07-30 02:13:51 <c_wraith> anyway, the way runST uses it is a little bit indirect. But the reason for it is to prevent leaking STRef values between uses of runST
2021-07-30 02:14:06 <euouae> why is that important?
2021-07-30 02:14:15 <c_wraith> When that leaking is prevented, it's possible to prove that the results of runST are deterministic
2021-07-30 02:14:35 <euouae> ah okay, nice
2021-07-30 02:14:45 <euouae> That is a good trick
2021-07-30 02:14:51 <c_wraith> Therefore no matter how much mutability you use inside, runST doesn't impose an IO restriction or anything
2021-07-30 02:15:02 <euouae> I would never come up with it
2021-07-30 02:15:32 <c_wraith> But once you know about it, you can find your own uses - you create things in certain contexts and want to prevent them from leaking to other contexts? the ST trick does the job!
2021-07-30 02:16:03 <euouae> So for example a type with private info that you don't want leaked
2021-07-30 02:16:22 <euouae> such as when you're logging your apps actions and you don't want to log user credentials
2021-07-30 02:16:59 <euouae> is that anywhere close to what it is? I'm trying to get a feel fo rit
2021-07-30 02:17:11 <c_wraith> You can do stuff like that, though you need to watch out for it making types more complex than pay for themselves
2021-07-30 02:17:53 <euouae> Ok in this context it would be some form of type correctness for security, it might be a worthwhile tradeoff
2021-07-30 02:18:44 <lechner> euouae: thanks!
2021-07-30 02:19:14 <euouae> You're welcome :)
2021-07-30 02:24:20 pfurla_ joins (~pfurla@52.15.195.173.client.static.strong-in52.as13926.net)
2021-07-30 02:24:37 <euouae> c_wraith: Thank you :)
2021-07-30 02:24:51 <c_wraith> you're welcome
2021-07-30 02:25:10 <euouae> I feel like my place in the Haskell world would be to write some FFI for C
2021-07-30 02:25:14 <euouae> or C++
2021-07-30 02:25:38 <euouae> It would be fun to translate and redesign some APIs
2021-07-30 02:26:25 <euouae> but maybe another day... too many things left hanging :)
2021-07-30 02:26:58 × pfurla quits (~pfurla@ool-182ed2e2.dyn.optonline.net) (Ping timeout: 256 seconds)
2021-07-30 02:28:00 finn_elija joins (~finn_elij@user/finn-elija/x-0085643)
2021-07-30 02:28:01 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (zinc.libera.chat (Nickname regained by services)))
2021-07-30 02:28:01 finn_elija is now known as FinnElija
2021-07-30 02:28:03 nate3 joins (~nate@108-233-125-227.lightspeed.sntcca.sbcglobal.net)
2021-07-30 02:29:46 ext0l joins (~vector@157-131-102-171.fiber.dynamic.sonic.net)
2021-07-30 02:31:13 <ext0l> i'm a nixos user trying to set up a new haskell project. what's the current best practice? haskell.nix, cabal2nix, or? i'd like something with relatively little extra verbosity.
2021-07-30 02:31:50 pfurla joins (~pfurla@ool-182ed2e2.dyn.optonline.net)
2021-07-30 02:32:26 neightchan joins (~nate@108-233-125-227.lightspeed.sntcca.sbcglobal.net)
2021-07-30 02:33:20 pfurla__ joins (~pfurla@216.151.180.237)
2021-07-30 02:34:06 <ext0l> or just ignore all that and use the new-foo commands, i guess?
2021-07-30 02:34:49 × pfurla_ quits (~pfurla@52.15.195.173.client.static.strong-in52.as13926.net) (Ping timeout: 268 seconds)
2021-07-30 02:36:40 × pfurla quits (~pfurla@ool-182ed2e2.dyn.optonline.net) (Ping timeout: 268 seconds)
2021-07-30 02:38:00 <dsal> "the current best practice" is fighting words. :)
2021-07-30 02:38:11 <dsal> I still use stack for most development + haskell.nix
2021-07-30 02:40:08 <ext0l> haha
2021-07-30 02:40:31 matthias1 joins (~igloo@4.15.245.90)
2021-07-30 02:40:36 <drakonis> itc: nix users
2021-07-30 02:41:04 <ext0l> haskell.nix seems nice; is it in common use? it seems to come up less than the other options i saw
2021-07-30 02:43:33 <dsal> I don't know how to judge common. I have several projects using it, so it's common among my projects.
2021-07-30 02:43:41 × hrnz quits (~ulli@irc.plumbing) (Quit: das ist mir zu bld hier; bb)
2021-07-30 02:43:59 <ext0l> fair enough
2021-07-30 02:44:04 × curiousgay quits (~curiousga@77-120-186-48.kha.volia.net) (Ping timeout: 268 seconds)
2021-07-30 02:44:10 hrnz joins (~ulli@irc.plumbing)
2021-07-30 02:44:20 <dsal> It gets updated once per day with all the latest things, so it's at least maintainedish.
2021-07-30 02:45:19 <dsal> I mostly do stack for the least effort for spinning up a project. 'stack new x' gives me my defaults with my test suite ready to go so I can just `stack test --file-watch` and get moving.
2021-07-30 02:45:53 <ext0l> yeah, that does seem really nice
2021-07-30 02:47:18 × shapr quits (~user@pool-100-36-247-68.washdc.fios.verizon.net) (Ping timeout: 272 seconds)
2021-07-30 02:47:20 <dsal> Many folks make good arguments for why modern cabal itself is better, but I've still not successfully moved a project to plain cabal.
2021-07-30 02:47:22 × matthias1 quits (~igloo@4.15.245.90) (Ping timeout: 256 seconds)
2021-07-30 02:49:26 × euouae quits (~euouae@user/euouae) (Quit: Client closed)
2021-07-30 02:50:30 × mrkajetanp quits (~mrkajetan@2a01:4b00:ea36:6c00:7994:941c:3f5d:2b88) (Quit: ZNC 1.7.2+deb3 - https://znc.in)
2021-07-30 02:50:49 mrkajetanp joins (~mrkajetan@88.98.245.28)
2021-07-30 02:50:57 <lechner> being a beginner, i came here for the past half year and started with stack. a month ago someone said to use just cabal, and i never looked back. i am on debian bullseye
2021-07-30 02:55:29 <ext0l> i'm going to try stack --nix, and if that doesn't work well for me i'll go from there
2021-07-30 02:58:06 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 250 seconds)
2021-07-30 02:58:08 × td_ quits (~td@94.134.91.37) (Ping timeout: 256 seconds)
2021-07-30 02:58:10 <dsal> I just have `nix:\n enable: true` in ~/.stack/config.yaml
2021-07-30 02:58:32 × nate3 quits (~nate@108-233-125-227.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 250 seconds)
2021-07-30 02:59:17 × funsafe quits (~funsafe@2601:1c1:4200:938f:32aa:eb39:2110:e2ea) (Ping timeout: 245 seconds)
2021-07-30 03:00:01 td_ joins (~td@94.134.91.212)
2021-07-30 03:00:18 funsafe joins (~funsafe@c-71-59-221-7.hsd1.wa.comcast.net)
2021-07-30 03:01:05 <ext0l> yeah that
2021-07-30 03:03:45 × roboguy_ quits (~roboguy_@2605:a601:afe7:9f00:b4cc:f31a:f38e:2215) (Remote host closed the connection)
2021-07-30 03:03:56 <dsal> The one annoying thing is every stack.yaml needs `nix:\n packages: [ zlib ]`
2021-07-30 03:04:07 <ext0l> oh really? weird
2021-07-30 03:04:17 roboguy_ joins (~roboguy_@2605:a601:afe7:9f00:b4cc:f31a:f38e:2215)
2021-07-30 03:04:31 <dsal> It's hard to build anything that doesn't eventually use zlib, and it's not in the build shell.
2021-07-30 03:04:50 <ext0l> aaah
2021-07-30 03:05:00 × roboguy_ quits (~roboguy_@2605:a601:afe7:9f00:b4cc:f31a:f38e:2215) (Remote host closed the connection)
2021-07-30 03:05:12 roboguy_ joins (~roboguy_@2605:a601:afe7:9f00:b4cc:f31a:f38e:2215)

All times are in UTC.