Logs on 2023-01-12 (liberachat/#haskell)
| 00:00:48 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 00:01:48 | × | Kaiepi quits (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) (Ping timeout: 252 seconds) |
| 00:03:19 | × | AlexZenon quits (~alzenon@178.34.160.164) (Ping timeout: 260 seconds) |
| 00:04:10 | × | Alex_test quits (~al_test@178.34.160.164) (Ping timeout: 272 seconds) |
| 00:05:15 | × | mizlan quits (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) (Ping timeout: 256 seconds) |
| 00:11:36 | → | Alex_test joins (~al_test@178.34.160.164) |
| 00:12:44 | → | AlexZenon joins (~alzenon@178.34.160.164) |
| 00:24:34 | → | stef204 joins (~stef204@user/stef204) |
| 00:25:29 | × | cheater quits (~Username@user/cheater) (Ping timeout: 246 seconds) |
| 00:25:56 | → | cheater joins (~Username@user/cheater) |
| 00:30:56 | → | merijn joins (~merijn@c-001-001-015.client.esciencecenter.eduvpn.nl) |
| 00:32:30 | → | jmorris joins (uid537181@id-537181.uxbridge.irccloud.com) |
| 00:33:22 | × | stef204 quits (~stef204@user/stef204) (Quit: WeeChat 3.8) |
| 00:34:35 | → | wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com) |
| 00:34:35 | × | wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
| 00:34:35 | → | wroathe joins (~wroathe@user/wroathe) |
| 00:40:17 | → | perrierjouet joins (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) |
| 00:40:34 | → | king_gs joins (~Thunderbi@187.201.110.169) |
| 00:41:57 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 00:43:27 | × | thyriaen quits (~thyriaen@2a01:aea0:dd4:4bae:6245:cbff:fe9f:48b1) (Remote host closed the connection) |
| 00:44:47 | → | califax joins (~califax@user/califx) |
| 00:46:02 | → | mechap1 joins (~mechap@user/mechap) |
| 00:48:42 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:ac96:e33a:7cce:aea0) (Remote host closed the connection) |
| 00:49:00 | × | mechap quits (~mechap@user/mechap) (Ping timeout: 255 seconds) |
| 00:58:23 | × | waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 260 seconds) |
| 01:00:44 | → | king_gs1 joins (~Thunderbi@2806:103e:29:45ac:af0:afaf:29e7:dd60) |
| 01:00:44 | × | king_gs quits (~Thunderbi@187.201.110.169) (Read error: Connection reset by peer) |
| 01:00:44 | king_gs1 | is now known as king_gs |
| 01:01:42 | → | Kaiepi joins (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) |
| 01:04:02 | × | merijn quits (~merijn@c-001-001-015.client.esciencecenter.eduvpn.nl) (Ping timeout: 246 seconds) |
| 01:08:38 | × | perrierjouet quits (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) (Quit: WeeChat 3.8) |
| 01:10:33 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
| 01:10:55 | → | thongpv87 joins (~thongpv87@2402:9d80:31e:1d9:8ed3:aaf7:616c:caf3) |
| 01:12:15 | × | thongpv quits (~thongpv87@2402:9d80:307:760e:3c34:cc21:e6b2:3db) (Read error: Connection reset by peer) |
| 01:16:40 | → | albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
| 01:29:46 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 01:30:32 | × | xff0x_ quits (~xff0x@2405:6580:b080:900:2f22:406e:df40:398b) (Ping timeout: 252 seconds) |
| 01:35:07 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 248 seconds) |
| 01:38:43 | → | fizbin joins (~fizbin@user/fizbin) |
| 01:39:00 | × | cods quits (~fred@82-65-232-44.subs.proxad.net) (Ping timeout: 260 seconds) |
| 01:39:10 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 272 seconds) |
| 01:39:20 | → | rburkholder joins (~blurb@96.45.2.121) |
| 01:39:54 | → | cods joins (~fred@82-65-232-44.subs.proxad.net) |
| 01:42:02 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:ac96:e33a:7cce:aea0) |
| 01:42:16 | × | king_gs quits (~Thunderbi@2806:103e:29:45ac:af0:afaf:29e7:dd60) (Ping timeout: 252 seconds) |
| 01:43:32 | × | fizbin quits (~fizbin@user/fizbin) (Remote host closed the connection) |
| 01:43:50 | → | fizbin joins (~fizbin@user/fizbin) |
| 01:45:20 | → | perrierjouet joins (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) |
| 01:45:22 | → | johnw_ joins (~johnw@2600:1700:cf00:db0:bdcf:33ab:b8ee:3af) |
| 01:46:23 | × | johnw quits (~johnw@2600:1700:cf00:db0:2df3:add9:d7a8:37bf) (Ping timeout: 252 seconds) |
| 01:47:46 | × | jwiegley quits (~jwiegley@2600:1700:cf00:db0:2df3:add9:d7a8:37bf) (Ping timeout: 252 seconds) |
| 01:50:33 | → | waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
| 02:05:12 | × | Kaiepi quits (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) (Remote host closed the connection) |
| 02:05:35 | → | Kaiepi joins (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) |
| 02:07:14 | × | jle`` quits (~jusle@user/jle/x-3894663) (Ping timeout: 260 seconds) |
| 02:07:14 | × | koala_man quits (~vidar@157.146.251.23.bc.googleusercontent.com) (Ping timeout: 260 seconds) |
| 02:07:37 | → | jle`` joins (~jusle@user/jle/x-3894663) |
| 02:09:02 | → | koala_man joins (~vidar@157.146.251.23.bc.googleusercontent.com) |
| 02:11:56 | × | fizbin quits (~fizbin@user/fizbin) (Ping timeout: 246 seconds) |
| 02:12:14 | → | king_gs joins (~Thunderbi@187.201.110.169) |
| 02:12:33 | → | xff0x_ joins (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) |
| 02:12:44 | × | tremon quits (~tremon@83-85-213-108.cable.dynamic.v4.ziggo.nl) (Quit: getting boxed in) |
| 02:15:51 | × | Umeaboy quits (~Umeaboy@94-255-145-133.cust.bredband2.com) (Quit: Leaving) |
| 02:21:44 | × | waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 246 seconds) |
| 02:23:05 | × | cheater quits (~Username@user/cheater) (Remote host closed the connection) |
| 02:28:04 | → | waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
| 02:30:58 | × | machinedgod quits (~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 265 seconds) |
| 02:37:28 | → | instantaphex joins (~jb@c-73-171-252-84.hsd1.fl.comcast.net) |
| 02:38:21 | × | waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 255 seconds) |
| 02:40:50 | × | king_gs quits (~Thunderbi@187.201.110.169) (Ping timeout: 260 seconds) |
| 02:40:55 | × | jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 268 seconds) |
| 02:43:13 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 252 seconds) |
| 02:52:35 | × | zaquest quits (~notzaques@5.130.79.72) (Remote host closed the connection) |
| 02:54:28 | → | zaquest joins (~notzaques@5.130.79.72) |
| 03:01:48 | → | merijn joins (~merijn@c-001-001-015.client.esciencecenter.eduvpn.nl) |
| 03:12:43 | × | jero98772 quits (~jero98772@2800:484:1d80:d8ce:9815:cfda:3661:17bb) (Remote host closed the connection) |
| 03:16:15 | → | [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 03:27:43 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Ping timeout: 260 seconds) |
| 03:34:55 | × | merijn quits (~merijn@c-001-001-015.client.esciencecenter.eduvpn.nl) (Ping timeout: 252 seconds) |
| 03:43:47 | → | pottsy joins (~pottsy@129.227.183.244) |
| 03:55:32 | → | finn_elija joins (~finn_elij@user/finn-elija/x-0085643) |
| 03:55:32 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija))) |
| 03:55:32 | finn_elija | is now known as FinnElija |
| 04:02:18 | × | td_ quits (~td@83.135.9.40) (Ping timeout: 272 seconds) |
| 04:03:45 | → | td_ joins (~td@83.135.9.35) |
| 04:05:52 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection) |
| 04:06:40 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 265 seconds) |
| 04:08:53 | → | dykai[m] joins (~dykaimatr@2001:470:69fc:105::2:f326) |
| 04:17:20 | × | notzmv quits (~zmv@user/notzmv) (Ping timeout: 255 seconds) |
| 04:21:26 | → | wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com) |
| 04:21:26 | × | wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
| 04:21:26 | → | wroathe joins (~wroathe@user/wroathe) |
| 04:22:05 | × | wroathe quits (~wroathe@user/wroathe) (Client Quit) |
| 04:23:06 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 04:25:44 | × | Kaiepi quits (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) (Ping timeout: 272 seconds) |
| 04:30:07 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 04:34:25 | × | mizlan quits (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) (Ping timeout: 256 seconds) |
| 04:42:41 | → | notzmv joins (~zmv@user/notzmv) |
| 04:56:47 | × | thegeekinside quits (~thegeekin@189.217.82.244) (Remote host closed the connection) |
| 04:58:07 | × | Vajb quits (~Vajb@2001:999:78d:d7:457c:7773:573e:6903) (Read error: Connection reset by peer) |
| 04:58:35 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) |
| 05:01:45 | → | merijn joins (~merijn@c-001-001-015.client.esciencecenter.eduvpn.nl) |
| 05:02:16 | × | jmorris quits (uid537181@id-537181.uxbridge.irccloud.com) (Quit: Connection closed for inactivity) |
| 05:02:19 | × | myxokephale quits (~myxokepha@cpe-65-28-251-121.cinci.res.rr.com) (Quit: myxokephale) |
| 05:02:43 | → | myxokephale joins (~myxokepha@cpe-65-28-251-121.cinci.res.rr.com) |
| 05:03:24 | × | instantaphex quits (~jb@c-73-171-252-84.hsd1.fl.comcast.net) (Ping timeout: 260 seconds) |
| 05:05:11 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) (Read error: Connection reset by peer) |
| 05:05:39 | → | Vajb joins (~Vajb@2001:999:78d:d7:457c:7773:573e:6903) |
| 05:06:54 | × | merijn quits (~merijn@c-001-001-015.client.esciencecenter.eduvpn.nl) (Ping timeout: 272 seconds) |
| 05:17:56 | → | mbuf joins (~Shakthi@49.204.137.60) |
| 05:19:10 | <hololeap> | anyone know of a lib that has a quicksort function for vectors? |
| 05:20:46 | <hololeap> | looks like massiv does |
| 05:21:53 | → | talismanick joins (~talismani@2601:200:c181:8250::ce24) |
| 05:22:46 | <c_wraith> | hololeap: https://hackage.haskell.org/package/vector-algorithms |
| 05:22:59 | <c_wraith> | quicksort is not always the fastest |
| 05:23:55 | <c_wraith> | However, it does have introsort if you need quicksort specifically |
| 05:24:44 | <hololeap> | no, quicksort was just an efficient sort alg that came to mind |
| 05:25:54 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 272 seconds) |
| 05:25:58 | → | Kaiepi joins (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) |
| 05:26:57 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 05:28:49 | <hololeap> | c_wraith: which module would you recommend? I'm just trying to find the median of a vector of numbers |
| 05:33:07 | → | thegeekinside joins (~thegeekin@189.217.82.244) |
| 05:38:40 | <c_wraith> | hololeap: that's what https://hackage.haskell.org/package/vector-algorithms-0.9.0.1/docs/Data-Vector-Algorithms-Intro.html#v:select is for |
| 05:41:40 | × | thegeekinside quits (~thegeekin@189.217.82.244) (Read error: Connection reset by peer) |
| 05:41:54 | × | oldfashionedcow quits (~Rahul_San@user/oldfashionedcow) (Quit: WeeChat 3.7.1) |
| 05:45:40 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 05:50:03 | × | mizlan quits (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) (Ping timeout: 255 seconds) |
| 05:51:43 | <sclv> | hololeap: there's an O(n) algo for median -- i don't think even using "select" from the vector package gets you to it tho? |
| 05:51:56 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
| 05:52:58 | <sclv> | https://rcoh.me/posts/linear-time-median-finding/ |
| 05:53:02 | → | Unicorn_Princess joins (~Unicorn_P@user/Unicorn-Princess/x-3540542) |
| 05:55:06 | <sclv> | ah here it is, nice! https://hackage.haskell.org/package/quickselect |
| 06:00:15 | × | Kaiepi quits (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) (Ping timeout: 265 seconds) |
| 06:02:07 | <c_wraith> | sclv: the docs sure look like it's O(n) |
| 06:03:33 | <sclv> | i don’t see how or where |
| 06:04:16 | <c_wraith> | "Moves the least k elements to the front of the array in no particular order." |
| 06:04:23 | <c_wraith> | that's exactly a description of the results of quickselect |
| 06:06:42 | <dolio> | It might not be in certain pathological cases, for the same reason quicksort can be bad. |
| 06:07:17 | × | phma quits (~phma@2001:5b0:210b:f228:90ee:6ca1:3fdb:df) (Read error: Connection reset by peer) |
| 06:08:33 | → | phma joins (phma@2001:5b0:210f:51a8:d2f8:1120:28e8:9d5c) |
| 06:08:56 | <sclv> | ah, i see |
| 06:09:57 | <dolio> | vector-algorithms has a select that fixes that the same way as introsort. |
| 06:10:13 | <c_wraith> | I linked to the vector-algorithms introsort select |
| 06:10:28 | <dolio> | Oh, yeah. |
| 06:13:53 | → | alfonsox joins (~quassel@103.87.57.33) |
| 06:15:39 | <dolio> | I think selects are usually O(n log k), so if you're using k = n/2 to find the median, you can do better with a dedicated median finding algorithm. |
| 06:16:41 | → | cheater joins (~Username@user/cheater) |
| 06:19:40 | <c_wraith> | quick select (avoiding the pathological cases) gives you looking at n + n/2 + n/4 + n/8 + etc work |
| 06:20:00 | <c_wraith> | there might be slightly faster things, but they're not going to be asymptotically faster. |
| 06:21:19 | → | Kaiepi joins (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) |
| 06:26:26 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 06:30:25 | → | merijn joins (~merijn@c-001-001-015.client.esciencecenter.eduvpn.nl) |
| 06:32:21 | → | bgs joins (~bgs@212-85-160-171.dynamic.telemach.net) |
| 06:38:49 | <Profpatsch> | If I have a type like newtype Foo (lbl :: k) val = Foo val |
| 06:39:30 | <Profpatsch> | How can I say “if (val ~ f a) and f implements functor, then (Foo lbl) implements functor” |
| 06:41:06 | <jackdk> | Profpatsch: `instance (val ~ f a, Functor f) => Functor (Foo lbl)`? Might need `-XTypeFamilies` or `-XGADTs` and `-XFlexibleInstances` |
| 06:43:53 | <Profpatsch> | jackdk: I think that doesn’t cut it, I’d need to reference the val on the right somehow |
| 06:44:03 | <[Leary]> | Uh. `Foo lbl` should have `Functor` unconditionally? It sounds like the `Functor` you want is `Compose (Foo lbl) f`. |
| 06:44:09 | → | trev joins (~trev@user/trev) |
| 06:44:16 | → | king_gs joins (~Thunderbi@2806:103e:29:45ac:af0:afaf:29e7:dd60) |
| 06:44:37 | <Profpatsch> | Yeah, I was thinking doing Compose somehow … Oh you mean I just implement the Functor instance for Foo first |
| 06:45:24 | → | laalyn joins (~laalyn@c-73-241-126-7.hsd1.ca.comcast.net) |
| 06:45:33 | <jackdk> | That seems better yeah |
| 06:45:39 | <Profpatsch> | brain fart |
| 06:45:49 | <Profpatsch> | I mean this is essentially Tagged |
| 06:45:51 | <Profpatsch> | So yeah |
| 06:46:05 | <Profpatsch> | It’s too early in the day |
| 06:47:54 | <Profpatsch> | Maybe a helper function mapFoo :: Functor f => (a -> b) -> Foo x (f a) -> Foo x (f b) |
| 06:51:40 | <[Leary]> | AKA `fmap . fmap`. |
| 06:51:41 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 06:51:45 | <Profpatsch> | yep |
| 06:51:55 | <Profpatsch> | though I’ll not have a Functor instance on Foo in this case |
| 06:52:19 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 06:56:16 | × | hgolden quits (~hgolden@cpe-172-251-233-141.socal.res.rr.com) (Remote host closed the connection) |
| 06:57:49 | → | hgolden joins (~hgolden@cpe-172-251-233-141.socal.res.rr.com) |
| 06:59:14 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 07:02:59 | → | kenran joins (~user@user/kenran) |
| 07:03:50 | × | merijn quits (~merijn@c-001-001-015.client.esciencecenter.eduvpn.nl) (Ping timeout: 252 seconds) |
| 07:20:18 | × | kenran quits (~user@user/kenran) (Remote host closed the connection) |
| 07:24:16 | → | chele joins (~chele@user/chele) |
| 07:25:48 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 265 seconds) |
| 07:32:29 | × | Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 07:34:54 | × | bgs quits (~bgs@212-85-160-171.dynamic.telemach.net) (Remote host closed the connection) |
| 07:36:11 | × | mizlan quits (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) (Ping timeout: 248 seconds) |
| 07:37:17 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:ac96:e33a:7cce:aea0) (Remote host closed the connection) |
| 07:39:07 | → | razetime joins (~Thunderbi@117.193.3.126) |
| 07:40:52 | → | kurbus joins (~kurbus@user/kurbus) |
| 07:42:00 | × | laalyn quits (~laalyn@c-73-241-126-7.hsd1.ca.comcast.net) (Quit: Client closed) |
| 07:45:35 | → | laalyn joins (~laalyn@c-73-241-126-7.hsd1.ca.comcast.net) |
| 07:50:02 | × | razetime quits (~Thunderbi@117.193.3.126) (Ping timeout: 252 seconds) |
| 07:50:56 | × | bontaq quits (~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 272 seconds) |
| 07:51:49 | × | kurbus quits (~kurbus@user/kurbus) (Quit: Client closed) |
| 07:52:02 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 07:53:32 | → | lortabac joins (~lortabac@2a01:e0a:541:b8f0:f424:d85:2acf:22a3) |
| 07:58:40 | × | king_gs quits (~Thunderbi@2806:103e:29:45ac:af0:afaf:29e7:dd60) (Ping timeout: 265 seconds) |
| 08:04:03 | → | razetime joins (~Thunderbi@117.193.3.126) |
| 08:05:04 | × | shapr quits (~user@68.54.166.125) (Ping timeout: 252 seconds) |
| 08:06:39 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 08:09:38 | <talismanick> | So, I came across this justification for Servant's design: https://www.servant.dev/posts/2018-07-12-servant-dsl-typelevel.html |
| 08:09:43 | → | MajorBiscuit joins (~MajorBisc@2001:1c00:2402:2d00:9eeb:34cf:63b3:9e5b) |
| 08:10:52 | <talismanick> | They say they could achieve much the same as in the example with GADTs instead for stable domains which don't require the full flexibility of Servant |
| 08:10:53 | × | mizlan quits (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) (Ping timeout: 256 seconds) |
| 08:11:23 | <maerwald> | or TH |
| 08:11:34 | <talismanick> | Are there maintained alternatives to Servant which take this route? I see Trasa, but it seems to have been a bit since it was last updated |
| 08:11:40 | → | cfricke joins (~cfricke@user/cfricke) |
| 08:12:08 | × | hsw quits (~hsw@2001-b030-2303-0104-0172-0025-0012-0132.hinet-ip6.hinet.net) (Quit: Leaving) |
| 08:13:00 | <talismanick> | maerwald: Yesod takes that approach IIRC. Still kicking, right? |
| 08:14:28 | <maerwald> | I remember tdammers saying it's conceptually interesting to have the API as a type, regardless of the concrete original use case (which was to generate many distinct clients). However, I think what really matters is that you can easily *consume* the API in a structured format. Whether that's a type or a generated ADT, I think doesn't matter that much. You don't accidentially feed the wrong API |
| 08:14:30 | <maerwald> | into a consumer. The type is consumed at only one place, really. |
| 08:15:20 | <maerwald> | servant allows you to walk over the type via typeclasses and do your thing |
| 08:15:27 | <maerwald> | that can be achieved in a number of other ways too |
| 08:16:20 | → | hsw joins (~hsw@112-104-142-182.adsl.dynamic.seed.net.tw) |
| 08:17:40 | <maerwald> | talismanick: yeah, TH has a lot of drawbacks |
| 08:18:02 | <maerwald> | unstable, breaks cross-compiling, untrustworthy, ... |
| 08:18:27 | → | nschoe joins (~q@2a01:e0a:8e:a190:5de0:4d3b:2a11:c4dd) |
| 08:22:55 | × | ft quits (~ft@p4fc2a257.dip0.t-ipconnect.de) (Quit: leaving) |
| 08:24:19 | → | king_gs joins (~Thunderbi@187.201.110.169) |
| 08:25:23 | × | titibandit quits (7efad7d72e@2a00:c70:1:178:170:40:189:1) (Ping timeout: 246 seconds) |
| 08:28:02 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 08:30:32 | → | acidjnk_new joins (~acidjnk@p200300d6e715c419193affabe67df89f.dip0.t-ipconnect.de) |
| 08:31:22 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 08:32:35 | × | mizlan quits (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) (Ping timeout: 260 seconds) |
| 08:38:05 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:54fb:433:f271:a472) |
| 08:40:47 | → | merijn joins (~merijn@c-001-001-015.client.esciencecenter.eduvpn.nl) |
| 08:42:19 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:54fb:433:f271:a472) (Ping timeout: 248 seconds) |
| 08:44:35 | → | gmg joins (~user@user/gehmehgeh) |
| 08:44:44 | → | fserucas joins (~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7) |
| 08:46:56 | × | hololeap quits (~quassel@user/hololeap) (Quit: Bye) |
| 08:48:01 | → | hololeap joins (~quassel@user/hololeap) |
| 08:48:17 | → | enoq joins (~enoq@2a05:1141:1f5:5600:b9c9:721a:599:bfe7) |
| 08:52:32 | → | avicenzi joins (~avicenzi@2a00:ca8:a1f:b004::c32) |
| 08:53:23 | → | machinedgod joins (~machinedg@d198-53-218-113.abhsia.telus.net) |
| 08:58:58 | × | pottsy quits (~pottsy@129.227.183.244) (Quit: Leaving) |
| 09:00:00 | × | machinedgod quits (~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 260 seconds) |
| 09:00:09 | × | jbggs[m]1 quits (~jbggsmatr@2001:470:69fc:105::2:995f) (Quit: You have been kicked for being idle) |
| 09:00:23 | × | talismanick quits (~talismani@2601:200:c181:8250::ce24) (Ping timeout: 255 seconds) |
| 09:01:29 | → | machinedgod joins (~machinedg@d198-53-218-113.abhsia.telus.net) |
| 09:05:30 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 09:09:55 | × | mizlan quits (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) (Ping timeout: 260 seconds) |
| 09:16:01 | → | zeenk joins (~zeenk@2a02:2f04:a014:8700::7fe) |
| 09:16:34 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 09:18:05 | × | Katarushisu quits (~Katarushi@cpc147790-finc20-2-0-cust502.4-2.cable.virginm.net) (Quit: The Lounge - https://thelounge.chat) |
| 09:18:52 | → | Katarushisu joins (~Katarushi@cpc147790-finc20-2-0-cust502.4-2.cable.virginm.net) |
| 09:18:53 | × | ubert quits (~Thunderbi@p548c9ce5.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
| 09:19:15 | → | ubert joins (~Thunderbi@p200300ecdf264e90ea29c278ebba470c.dip0.t-ipconnect.de) |
| 09:21:30 | → | kuribas joins (~user@ip-188-118-57-242.reverse.destiny.be) |
| 09:21:31 | × | king_gs quits (~Thunderbi@187.201.110.169) (Read error: Connection reset by peer) |
| 09:21:37 | → | king_gs1 joins (~Thunderbi@2806:103e:29:45ac:af0:afaf:29e7:dd60) |
| 09:23:55 | king_gs1 | is now known as king_gs |
| 09:25:09 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 09:36:27 | × | L29Ah quits (~L29Ah@wikipedia/L29Ah) (Ping timeout: 256 seconds) |
| 09:37:05 | × | tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz) |
| 09:38:45 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 09:42:02 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 09:45:59 | × | panovia quits (~user@user/siracusa) (Quit: Bye!) |
| 09:46:14 | <kuribas> | is dhall dependently typed? |
| 09:47:03 | <kuribas> | it looks like types are first class objects: https://github.com/dhall-lang/vscode-dhall-lsp-server |
| 09:48:21 | <merijn> | I don't see how "types are first class objects" and "dependently typed" even relate to each other? |
| 09:48:50 | <dminuoso> | maerwald: And the type magic route makes it extremely hard to understand, extend or debug. And the diagnotics when any kind of mistake occurs are horribad. |
| 09:49:23 | → | razetime1 joins (~Thunderbi@117.193.3.126) |
| 09:50:07 | <dminuoso> | Not to mention the extreme compilation performance in both memory usage and time with servant apps. |
| 09:50:13 | <kuribas> | merijn: the second implies the first |
| 09:50:16 | <dminuoso> | I think TH is a better choice. |
| 09:50:18 | <kuribas> | merijn: but not the other way |
| 09:50:40 | × | shriekingnoise_ quits (~shrieking@186.137.175.87) (Ping timeout: 252 seconds) |
| 09:50:44 | × | razetime quits (~Thunderbi@117.193.3.126) (Ping timeout: 246 seconds) |
| 09:50:44 | razetime1 | is now known as razetime |
| 09:50:51 | <dminuoso> | At the very least some of the TH problems (safety or unstable) are solvable in principle. |
| 09:51:21 | <dminuoso> | The only other option that avoids all these problems is by taking the API description out of Haskell and use something like openapi3 code generators. |
| 09:52:18 | × | ix quits (~ix@2a02:8010:674f:0:d65d:64ff:fe52:5efe) (Quit: WeeChat 3.7.1) |
| 09:52:39 | × | zeenk quits (~zeenk@2a02:2f04:a014:8700::7fe) (Quit: Konversation terminated!) |
| 09:52:41 | × | gmg quits (~user@user/gehmehgeh) (Quit: Leaving) |
| 09:54:22 | <maerwald> | dminuoso: yes... it's basically a solved problem :D (openapi3) |
| 09:54:23 | <kuribas> | dhall looks nice, but a bit too much haskell-like |
| 09:55:02 | <kuribas> | for example, being able to omit Optional types would make a lot of sense for a configuration language. |
| 09:55:18 | <kuribas> | perhaps structural typing would be better also than nominal typing. |
| 09:56:48 | <dminuoso> | maerwald: Of course we would also need a json-en/decoder generator for that as well. |
| 09:57:34 | <dminuoso> | I think most languages get around that particular need, because structural parsing never occurs in most of them, because you just map the JSON structure to something equivalent. |
| 09:57:47 | <dminuoso> | Which gets rid of the lexical structure, but the syntactic structure is still there.. |
| 09:58:03 | <dminuoso> | However, this is still solvable. |
| 09:58:17 | → | EvanR_ joins (~EvanR@user/evanr) |
| 09:58:55 | × | EvanR quits (~EvanR@user/evanr) (Ping timeout: 260 seconds) |
| 09:59:08 | <dminuoso> | In some sense, its actually much better than what servant-openapi3 does. With that route, you end up handwriting/fixing the openapi specs anyway if you deviate from the default JSON instances of aeson. |
| 09:59:17 | <dminuoso> | Which breaks a lot of the "write once" comfort |
| 10:00:48 | × | opticblast quits (~Thunderbi@secure-165.caltech.edu) (Quit: opticblast) |
| 10:00:58 | <dminuoso> | It's also nice that you can simply generate the stub code in a Build.hs script, ensuring there's no drift |
| 10:01:00 | <dminuoso> | Mmm |
| 10:01:04 | → | opticblast joins (~Thunderbi@secure-165.caltech.edu) |
| 10:01:11 | → | paulpaul1076 joins (~textual@95-29-5-111.broadband.corbina.ru) |
| 10:01:16 | <dminuoso> | The more I think about it, openapi3 seems more reasonable than servant. :( |
| 10:02:01 | <kuribas> | dminuoso: but you still need to type your API. |
| 10:02:07 | <maerwald> | for? |
| 10:02:20 | <kuribas> | dminuoso: you cannot typecheck your api using just openapi AFAIK... |
| 10:02:26 | <dminuoso> | kuribas: of course you can. |
| 10:02:32 | <dminuoso> | GHC will do it for you based on the stub code. |
| 10:03:02 | → | teo joins (~teo@user/teo) |
| 10:03:08 | × | opticblast quits (~Thunderbi@secure-165.caltech.edu) (Read error: Connection reset by peer) |
| 10:03:11 | <kuribas> | right |
| 10:03:27 | → | opticblast joins (~Thunderbi@secure-165.caltech.edu) |
| 10:03:45 | <kuribas> | at least you need to map the openapi types to some haskell names. |
| 10:04:08 | <dminuoso> | All openapi code generators already do that. |
| 10:04:17 | <dminuoso> | There's some well established patterns for it. |
| 10:05:25 | <kuribas> | dminuoso: it works well when all the specification is in openapi. But sometimes you want to generate some specifcation from code. |
| 10:05:52 | <maerwald> | openapi does not support SSE |
| 10:05:56 | <maerwald> | that's a problem |
| 10:05:59 | <dminuoso> | What is SSE? |
| 10:06:04 | <maerwald> | server-sent events |
| 10:06:22 | <maerwald> | I've worked on a blockchain project using that (with servant) |
| 10:06:29 | <kuribas> | is SSE rest? |
| 10:06:30 | <maerwald> | (and patching servant to support it) |
| 10:07:02 | <dminuoso> | I guess no matter what, you have to make compromises. |
| 10:07:13 | <dminuoso> | And decide whether the upsides and downsides are worth it. |
| 10:07:24 | <dminuoso> | For servant I just think its downsides are not visibly clear to unsuspecting beginners. |
| 10:07:36 | <maerwald> | kuribas: why not |
| 10:07:42 | <maerwald> | kinda orthogonal |
| 10:08:17 | <kuribas> | maerwald: http != REST |
| 10:08:21 | <dminuoso> | No. |
| 10:08:34 | <dminuoso> | Oh sorry, yes. |
| 10:08:41 | <dminuoso> | kuribas: So? |
| 10:08:49 | <maerwald> | I don't understand what your question is then |
| 10:09:03 | <dminuoso> | HTTP != TCP, that doesnt mean flow control doesnt work to HTTPs advantage either. |
| 10:09:41 | <dminuoso> | With SSE, you could simply send fresh HTML to the browser from the server automatically |
| 10:09:57 | <dminuoso> | REST has little to do with how you get that HTML |
| 10:10:15 | <dminuoso> | Its more the dance between the human user, the user agent and how you interact with websites. |
| 10:10:46 | <dminuoso> | I think in some sense, SSE could actually be an integral part of non-trivial REST applications. |
| 10:11:05 | <maerwald> | I was susprised that it actually worked :D |
| 10:11:27 | <maerwald> | with curl even etc |
| 10:11:46 | <dminuoso> | Given that SSE would allow for concurrent updates, it might be argued that its useful for accurately conveying concurrent changes to your documents in a shared environment. |
| 10:11:47 | <[Leary]> | kuribas: It's been a while since I wrote any Dhall, but I don't believe the type system is dependent; the value and type levels remain separate, with types appearing values but not the converse---just like System F or GHC Haskell's STVs & TypeApplications. It /is/ structural, however. Re Optional, there are other ways to omit fields of any type in favour of a default value. I suspect that making Optional fields actually optional would wreak havoc on |
| 10:11:47 | <[Leary]> | the types, and just isn't worth it. |
| 10:12:15 | <maerwald> | dminuoso: well, for blockchain it obviously lets you subscribe to blockchain events |
| 10:12:25 | <dminuoso> | maerwald: yup |
| 10:13:44 | <maerwald> | I guess go people would just pubsub it |
| 10:14:25 | <dminuoso> | THe only advantage of using websockets is that its more common technology and you're more likely to have tools for that interacftion |
| 10:14:40 | <dminuoso> | At the cost of complexity because now you have bidirectional communication channels with signalling interleaved |
| 10:14:55 | <dminuoso> | SSE seems simpler if unidirectional messages suffice |
| 10:15:16 | <dminuoso> | And if all you care for is blockchain updates, see seems sufficient |
| 10:15:49 | <maerwald> | well, people use microservices as architecture patterns too, no matter the complexity and then point to all the good ecosystem tooling around it |
| 10:16:18 | <dminuoso> | there isnt really an ecosystem for "microservices" as thats not a particular protocol/encoding/technology |
| 10:16:44 | <dminuoso> | Unless all you want to say is "you can wireshark the communication between components more easily than lldb interaction between modules" |
| 10:17:12 | <maerwald> | they have all their prometheus tools etc |
| 10:17:13 | <dminuoso> | Microservices are usually an artifact of organizational structure, not technological needs. |
| 10:17:19 | <maerwald> | yes |
| 10:17:41 | <maerwald> | so I think it's not about complexity today anymore, it's about convenience |
| 10:17:41 | <dminuoso> | Some exceptions exist. We have a small stack of microservices to facilitate polyglot. |
| 10:17:56 | <dminuoso> | Website driver? Python with Django. Backend? Haskell |
| 10:18:58 | <dminuoso> | Which often is also just an organizational thing. |
| 10:19:37 | <dminuoso> | You have that go team developing component A, and that pythong team writing component B. In order for both to collaborate, you either enter FFI nightmares, or let them talk via some RPC mechanism |
| 10:20:05 | <dminuoso> | (For us it actually was a technical choice, because I dont want to suffer mental damage from writing a webpage in haskell) |
| 10:20:22 | <dminuoso> | And at the same time I didnt truth python enough to express the business logic of it. |
| 10:20:29 | <dminuoso> | s/truth/trust/ |
| 10:20:50 | → | ix joins (~ix@2a02:8010:674f:0:d65d:64ff:fe52:5efe) |
| 10:22:43 | → | titibandit joins (7efad7d72e@jabberfr.org) |
| 10:22:51 | <maerwald> | yes, that's why I think that interoperable languages are the future |
| 10:23:06 | <maerwald> | something like the C#, F#, F* stack, but even better |
| 10:26:12 | <dminuoso> | Im not sure you are realistically going to get that if those products dont come from the same company. |
| 10:26:20 | × | mizlan quits (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) (Ping timeout: 255 seconds) |
| 10:26:29 | <maerwald> | I'm fine to be employed by Microsoft |
| 10:26:33 | <dminuoso> | My claim is going to be: .NET is the best you are going to get. |
| 10:27:06 | <dminuoso> | Outside, HTTP/JSON interaction seems to fit the organization best: |
| 10:27:08 | <dminuoso> | There is none. |
| 10:27:49 | <maerwald> | Microsoft actually invests a lot of stuff into good engineering. When researching about e.g. language security, half of the stuff comes from that direction. |
| 10:28:03 | <maerwald> | it's just not a very homogenous organization |
| 10:28:32 | <dminuoso> | I think you can only get so big as a homogeneous organization |
| 10:28:44 | × | machinedgod quits (~machinedg@d198-53-218-113.abhsia.telus.net) (Quit: Lost terminal) |
| 10:29:21 | <dminuoso> | At the scale of Microsoft you start worrying about whether departments generally align with your overall general goals, rather than something detailed as technical coherence. |
| 10:29:56 | <dminuoso> | The holy grail seems to require Borg nanites. |
| 10:30:32 | <maerwald> | I'd be up for that, but I fear that may amplify my ADHD, hearing a couple of million voices in my head |
| 10:30:41 | <maerwald> | 5 is already too much |
| 10:32:03 | × | xff0x_ quits (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) (Ping timeout: 268 seconds) |
| 10:32:58 | <dminuoso> | I would be interested in retconning Borg to be an experiment from the Vulcans for "perfect unity" |
| 10:33:17 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 268 seconds) |
| 10:33:56 | <dminuoso> | Or heck, it wouldnt even be a retcon. It was never explained in the first place. |
| 10:35:25 | → | machinedgod joins (~machinedg@d198-53-218-113.abhsia.telus.net) |
| 10:35:28 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 10:35:38 | × | king_gs quits (~Thunderbi@2806:103e:29:45ac:af0:afaf:29e7:dd60) (Quit: king_gs) |
| 10:37:12 | → | gnalzo joins (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) |
| 10:38:21 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 10:40:03 | × | laalyn quits (~laalyn@c-73-241-126-7.hsd1.ca.comcast.net) (Quit: Client closed) |
| 10:40:32 | × | troydm quits (~troydm@user/troydm) (Ping timeout: 252 seconds) |
| 10:43:13 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 10:50:35 | × | acidjnk_new quits (~acidjnk@p200300d6e715c419193affabe67df89f.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 10:55:13 | × | cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.7.1) |
| 10:55:45 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 10:56:45 | → | jinsun__ joins (~jinsun@user/jinsun) |
| 10:56:45 | jinsun | is now known as Guest439 |
| 10:56:45 | × | Guest439 quits (~jinsun@user/jinsun) (Killed (silver.libera.chat (Nickname regained by services))) |
| 10:56:45 | jinsun__ | is now known as jinsun |
| 10:58:16 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 11:00:26 | <kuribas> | [Leary]: the problem I have with using union for default values, which is the solution normally used in dhall, is that required values become optional, since they are filled with any value. |
| 11:02:38 | × | opticblast quits (~Thunderbi@secure-165.caltech.edu) (Read error: Connection reset by peer) |
| 11:02:57 | → | opticblast joins (~Thunderbi@secure-165.caltech.edu) |
| 11:03:11 | → | v0id_ptr joins (~adrift@user/ptr-frac7al/x-0038398) |
| 11:03:24 | × | opticblast quits (~Thunderbi@secure-165.caltech.edu) (Read error: Connection reset by peer) |
| 11:03:38 | → | opticblast joins (~Thunderbi@secure-165.caltech.edu) |
| 11:03:58 | × | opticblast quits (~Thunderbi@secure-165.caltech.edu) (Client Quit) |
| 11:04:17 | → | opticblast joins (~Thunderbi@secure-165.caltech.edu) |
| 11:11:23 | <Axman6> | @hoogle Profunctor p => (a -> (b,c)) -> (x -> y -> z) -> p b x -> p c y -> p a z |
| 11:11:24 | <lambdabot> | No results found |
| 11:11:34 | <Axman6> | This should be a thing right? |
| 11:12:30 | <Axman6> | @hoogle (a -> (b,c)) -> (x -> y -> z) -> (b -> x) -> (c -> y) -> (a -> z) |
| 11:12:31 | <lambdabot> | No results found |
| 11:12:39 | <Axman6> | @djinn (a -> (b,c)) -> (x -> y -> z) -> (b -> x) -> (c -> y) -> (a -> z) |
| 11:12:39 | <lambdabot> | f a b c d e = |
| 11:12:39 | <lambdabot> | case a e of |
| 11:12:39 | <lambdabot> | (f, g) -> b (c f) (d g) |
| 11:14:33 | <dminuoso> | That's a profunctor uncurry, no? |
| 11:15:43 | <dminuoso> | uncurry' :: Strong p => p a (b -> c) -> p (a, b) c |
| 11:16:07 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 11:17:55 | → | xff0x_ joins (~xff0x@2405:6580:b080:900:c56:6e84:5fde:af1e) |
| 11:17:58 | <dminuoso> | Axman6: Or partially at least. |
| 11:25:48 | × | econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity) |
| 11:27:07 | → | mmhat joins (~mmh@p200300f1c7123c0cee086bfffe095315.dip0.t-ipconnect.de) |
| 11:30:08 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 246 seconds) |
| 11:37:30 | × | mizlan quits (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) (Ping timeout: 260 seconds) |
| 11:39:34 | <Axman6> | posibly... |
| 11:40:20 | <Axman6> | I was thinking about how you'd split inputs to Folds from foldl and combine them |
| 11:40:45 | <Axman6> | I also want Profunctor p => (a -> Either b c) -> ... |
| 11:45:32 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 11:52:13 | × | v0id_ptr quits (~adrift@user/ptr-frac7al/x-0038398) (Ping timeout: 268 seconds) |
| 11:54:14 | × | enoq quits (~enoq@2a05:1141:1f5:5600:b9c9:721a:599:bfe7) (Quit: enoq) |
| 11:54:55 | × | SasoriZero quits (~SasoriZer@098-147-198-034.res.spectrum.com) (Quit: Client closed) |
| 11:56:05 | → | ub joins (~Thunderbi@p548c9ce5.dip0.t-ipconnect.de) |
| 11:56:34 | × | ubert quits (~Thunderbi@p200300ecdf264e90ea29c278ebba470c.dip0.t-ipconnect.de) (Remote host closed the connection) |
| 11:56:34 | ub | is now known as ubert |
| 11:57:00 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 11:57:54 | × | Kaiepi quits (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) (Ping timeout: 252 seconds) |
| 12:01:20 | → | __monty__ joins (~toonn@user/toonn) |
| 12:01:25 | × | mizlan quits (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) (Ping timeout: 260 seconds) |
| 12:02:05 | <jackdk> | Axman6: `(a -> (b,c)) -> (x -> y -> z) -> p b x -> p c y -> p a z` you'll find something like that in `product-profunctors` - use `(***!)` and then `dimap` |
| 12:03:24 | <jackdk> | Although given dminuoso's observation I'm not sure what the product-profunctors interface gives you beyond `Strong` |
| 12:04:57 | <jackdk> | And I guess your `Either`-ish one can be built out of `Choice`, though in both cases you probably need `Category` as well so you can compose |
| 12:06:21 | <jackdk> | At which point, you might be close to `Arrow` except that you don't have `arr`, and I'm not sure if there's a way you can cook up `p () ()` or `p Void Void`, which can sometimes be useful |
| 12:07:31 | <jackdk> | If anyone knows the `class Foo p` which provides `punit :: p () ()`, I would be interested to know about it |
| 12:08:29 | → | acidjnk_new joins (~acidjnk@p200300d6e715c419c07576573e5a57fd.dip0.t-ipconnect.de) |
| 12:10:58 | × | nschoe quits (~q@2a01:e0a:8e:a190:5de0:4d3b:2a11:c4dd) (Remote host closed the connection) |
| 12:11:21 | <dminuoso> | https://hackage.haskell.org/package/dlist-1.0/docs/Data-DList.html |
| 12:11:23 | <dminuoso> | data DList a where ... |
| 12:11:27 | <dminuoso> | https://hackage.haskell.org/package/dlist-1.0/docs/src/Data.DList.Internal.html#DList |
| 12:11:30 | <dminuoso> | newtype DList a = UnsafeDList {unsafeApplyDList :: [a] -> [a]} |
| 12:11:38 | <dminuoso> | What on earth is haddock smoking to render this as `data DList`? |
| 12:12:11 | → | nschoe joins (~q@2a01:e0a:8e:a190:76ab:f87d:ce8:9a0c) |
| 12:12:48 | <dminuoso> | Is this a strange bug when you bundle pattern synonyms in the export of it? |
| 12:16:48 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 12:17:32 | <raehik> | dminuoso: on a glance, the unsafe constructor doesn't seem to be exported from Data.DList, only the patsyms, so that's what I'd expect |
| 12:18:05 | <raehik> | (but when you click `# Source` you get sent to the internal module where those are defined, always confusing) |
| 12:19:28 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 272 seconds) |
| 12:21:27 | × | razetime quits (~Thunderbi@117.193.3.126) (Read error: Connection reset by peer) |
| 12:21:44 | → | razetime joins (~Thunderbi@117.193.3.126) |
| 12:23:30 | <dminuoso> | + |
| 12:25:09 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 12:27:15 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 12:37:55 | <eldritchcookie[4> | today i am working on a binding to the allegro 5 game programming library |
| 12:38:22 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Read error: Connection reset by peer) |
| 12:40:53 | × | jinsun quits (~jinsun@user/jinsun) (Read error: Connection reset by peer) |
| 12:41:08 | → | cfricke joins (~cfricke@user/cfricke) |
| 12:44:48 | × | werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 272 seconds) |
| 12:46:03 | <jackdk> | I am trying to solve the "what classes should I derive for this type?" problem in Amazonka, which involves accumulating information from multiple sources as well as dealing with cycles. |
| 12:46:18 | <eldritchcookie[4> | cool |
| 12:46:41 | <eldritchcookie[4> | what are the classes you are considering: |
| 12:46:43 | <eldritchcookie[4> | ? |
| 12:46:44 | <jackdk> | A service definition could have a `Configuration` struct holds a `ConfigurationList` list which can hold one or more `Configuration`s. A "struct" can derive the intersection of the derivable classes of its fields; a list can derive `Semigroup` and `Monoid`as well as whatever its element type can derive. A `Configuration` also holds a `SensitivePropertiesMap` which means that it cannot derive `Read`, and therefore `Configuration` should not try either. |
| 12:48:03 | <jackdk> | Propagators seem like a promising fit here, though I can't find any mature-looking libraries - any recommendations? But I am also open to pointers to algorithms or advice on implementing this by hand. |
| 12:49:33 | <jackdk> | eldritchcookie[4: Just common classes: Show, Eq, Ord, Read, Hashable, Generic, Semigroup, Monoid, Enum, etc. 90+% of the work is already there, but I've uncovered a latent bug with only shows if you have mutually-recursive structures and the default list of derivable classes is not right. |
| 12:55:28 | → | jinsun joins (~jinsun@user/jinsun) |
| 12:57:51 | <eldritchcookie[4> | i find these kind of metaprograms just so interesting, i was considering doing one to read a c header file and then automatically generate imports and default marshalling to/from haskell however i just found no reliable way to import all of the public api of a c header and only the relevant parts |
| 12:58:10 | <Profpatsch> | such a shame that ApplicativeDo can’t figure out |
| 12:58:26 | <Profpatsch> | data Foo = Foo { foo, bar } |
| 12:58:36 | <Profpatsch> | do foo <- getFoo |
| 12:58:49 | <Profpatsch> | f $ do |
| 12:58:56 | <Profpatsch> | bar <- getBar |
| 12:59:00 | <Profpatsch> | pure Foo {..} |
| 12:59:15 | <Profpatsch> | last pure one less leading space ofc |
| 12:59:46 | <eldritchcookie[4> | shouldn't you do pure $ Foo {..} ? |
| 12:59:55 | <Profpatsch> | So you have to return a tuple with all fields in the nested block into the outer block & destructure again |
| 13:00:32 | <Profpatsch> | eldritchcookie[4: eh, that’s a weird rule of record updates, the space between `Constructor {..}` binds more tightly than function application |
| 13:00:50 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 13:01:00 | <eldritchcookie[4> | TIL |
| 13:01:03 | <Profpatsch> | It’s the same as writing pure $ Foo {..} |
| 13:01:11 | <Profpatsch> | I know it’s bad taste to leave out the brackets :) |
| 13:01:30 | → | werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
| 13:03:58 | <Profpatsch> | there really should be an inheritance field projection or something, where you can say Foo { x { foo }, y { bar } } |
| 13:04:03 | <Axman6> | jackdk: can you do it by keep a list of classes that should be excluded? anything which contains (transitively) a SensitivePropertiesMap should have the the set [NoRead] or something |
| 13:04:04 | <Profpatsch> | to project the fields of x and y into Foo |
| 13:04:40 | <Profpatsch> | And maybe even with .. as long as the fields in x and y don’t overlap |
| 13:04:48 | <Profpatsch> | And it should be resolved via HasField |
| 13:05:02 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 246 seconds) |
| 13:05:46 | × | mmhat quits (~mmh@p200300f1c7123c0cee086bfffe095315.dip0.t-ipconnect.de) (Quit: WeeChat 3.8) |
| 13:06:03 | <eldritchcookie[4> | how can i get all set bits of a Int? i know how to check for a bit |
| 13:07:10 | <jackdk> | eldritchcookie[4: `Data.Bits.complement 0` might do it |
| 13:07:17 | <dminuoso> | Depending on the hardware. |
| 13:07:29 | <dminuoso> | Ah no |
| 13:07:34 | <dminuoso> | jackdk: not quite what they asked for. |
| 13:07:50 | <dminuoso> | But I misread it the same way too first. |
| 13:08:12 | <jackdk> | dminuoso: oh right, "get all set bits". `Data.Bits.popCount` then? |
| 13:08:32 | <dminuoso> | jackdk: they want `Bits a => a -> [Bool]` I think. |
| 13:08:46 | <dminuoso> | Or `Bits a => a -> [Int]` equivalently |
| 13:08:57 | <eldritchcookie[4> | yes |
| 13:09:08 | <eldritchcookie[4> | worst case i test each of my enum constants |
| 13:09:43 | <dminuoso> | Ah, bitmask encoding of a list of nullary constructors? |
| 13:09:53 | <jackdk> | Axman6: I don't think you need negative values like `NoRead` - because the set of classes is small and finite you can just repeatedly take the intersection. I expect it will turn out to be an ad hoc, informally-specified, bug-ridden, slow implementation of propagators. |
| 13:10:08 | → | fizbin joins (~fizbin@user/fizbin) |
| 13:10:54 | <Axman6> | I mean, you know the set of classes you'd like to derive, but if you record exceptions to that set, then you can just derive all the ones which haven't been excluded |
| 13:11:29 | <Axman6> | so you don't pass around [Show, Eq, Ord] etc, you pass around [NoRead, NoToJSON] |
| 13:11:35 | <dminuoso> | eldritchcookie[4: Are you looking to write a kind of `Int -> [Options]` function? |
| 13:12:27 | <eldritchcookie[4> | yes |
| 13:12:44 | <dminuoso> | How many bit positions are there? |
| 13:12:45 | <jackdk> | Axman6: yeah but it's more complex than that - I also know relations like "ConfigurationList derives everything Configuration does, plus Semigroup and Monoid". I'm going to sleep on it, I think. |
| 13:12:46 | <Axman6> | @hoogle Bits a => Int -> a -> Bool |
| 13:12:46 | <lambdabot> | Text.Printer.Integral nnBits :: (BitSystem s, Num ?, Bits ?, Printer p) => s -> ? -> p |
| 13:12:47 | <lambdabot> | Algebra.ModuleBasis propDimension :: C a v => a -> v -> Bool |
| 13:12:47 | <lambdabot> | Text.Regex.Posix (=~) :: (RegexMaker Regex CompOption ExecOption source, RegexContext Regex source1 target) => source1 -> source -> target |
| 13:12:58 | <Axman6> | @hoogle Bits a => a -> Int -> Bool |
| 13:12:59 | <lambdabot> | Data.Bits testBit :: Bits a => a -> Int -> Bool |
| 13:12:59 | <lambdabot> | Protolude testBit :: Bits a => a -> Int -> Bool |
| 13:13:00 | <lambdabot> | BasePrelude testBit :: Bits a => a -> Int -> Bool |
| 13:13:10 | <jackdk> | :t Data.Bits.Lens.bits |
| 13:13:11 | <lambdabot> | (Num b, Bits b, Indexable Int p, Applicative f) => p Bool (f Bool) -> b -> f b |
| 13:13:35 | <jackdk> | The source of that function might give some inspiration, even if you don't want to use lens |
| 13:14:04 | <dminuoso> | I dont any of these are helpful |
| 13:14:09 | <dminuoso> | They already pointed out they know about testBit |
| 13:14:55 | <Axman6> | onBits n = let sz = bitSize n in filter (testBit n) [sz-1, sz-2 .. 0] |
| 13:15:06 | <dminuoso> | eldritchcookie[4: Do you also care about the other direction (that is encoding a bitmask)? |
| 13:16:10 | <Axman6> | or something |
| 13:16:35 | × | trev quits (~trev@user/trev) (Remote host closed the connection) |
| 13:17:29 | <eldritchcookie[4> | that is easy just foldr1 (.|.) (fmap fromEnum list) |
| 13:17:35 | × | mizlan quits (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) (Ping timeout: 260 seconds) |
| 13:17:56 | <Axman6> | :t fromEnum |
| 13:17:58 | <lambdabot> | Enum a => a -> Int |
| 13:18:03 | <dminuoso> | eldritchcookie[4: I wouldnt use Enum for this |
| 13:18:08 | <dminuoso> | It's a poor hack that is fairly brittle |
| 13:18:12 | <Axman6> | eldritchcookie[4: did you wrtie a broken Enum instance? |
| 13:18:43 | <eldritchcookie[4> | no it is written by c2hs |
| 13:18:44 | <eldritchcookie[4> | which i assume is working as intended |
| 13:19:18 | <Axman6> | I hope that's not what c2hs is doing... |
| 13:19:22 | <dminuoso> | Me too. |
| 13:19:29 | <Axman6> | can you look at the code it generates? |
| 13:19:40 | <Axman6> | because that's definitely an absue of Enum |
| 13:20:15 | <dminuoso> | But for what its worth, Ive seen this abuse relatively frequently |
| 13:20:32 | <dminuoso> | I think in part its precisely because we dont have a communicatable way of tagging stuff like this to data constructors. |
| 13:20:46 | <dminuoso> | I really wdant something like |
| 13:20:49 | → | igghibu joins (~igghibu@178.249.211.100) |
| 13:21:03 | × | fizbin quits (~fizbin@user/fizbin) (Ping timeout: 265 seconds) |
| 13:22:00 | → | Kaiepi joins (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) |
| 13:22:00 | <dminuoso> | data Color = Red {-## 1 ##-} | Green {-## 2 ##-} | Blue {-## 3 ##-} |
| 13:22:19 | <dminuoso> | Such that you can then generate code via generics or TH, but pull out that meta data in order to build appropriate serialize/deserializers |
| 13:22:23 | <dminuoso> | or maybe attach additional information |
| 13:22:49 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 13:22:53 | <dminuoso> | Maybe ANN should be exposed to Generics. |
| 13:23:16 | <dminuoso> | (Not sure whether ANN pragmas are available in TH) |
| 13:25:40 | <raehik> | dminuoso: the generics libs I've seen tend to use constructor & field names to accomplish that. e.g. aeson |
| 13:26:20 | <dminuoso> | raehik: great idea! |
| 13:26:38 | <raehik> | I have an aeson-like for binary data at binrep that would do what you ask there (no good examples/tutorials tho) |
| 13:27:14 | <dminuoso> | data Thing = Thing1 { _field1__Xbig_endian_yes__Xlimit_10__Xdocumentation_this_is_a_fancy_string :: String } |
| 13:27:19 | <dminuoso> | raehik: ^- indeed. this is doable. |
| 13:28:08 | <dminuoso> | The main issue with aeson is, that when you use generics or TH, the decoding information is detached from the insatnce. |
| 13:28:24 | <dminuoso> | Which presents further problems if you want to generate matching openapi specs for instance |
| 13:28:45 | <dminuoso> | *the decoding information is detached from the data type site |
| 13:29:20 | <dminuoso> | I essentially want go struct tags. |
| 13:29:26 | <dminuoso> | They are one of the best features of Go I think. |
| 13:29:46 | × | razetime quits (~Thunderbi@117.193.3.126) (Ping timeout: 272 seconds) |
| 13:29:58 | <dminuoso> | ANN gets there, but Typeable is awkward to use |
| 13:30:15 | <raehik> | could you thrust that into some newtype wrapper? but with poor useability... |
| 13:30:26 | <dminuoso> | Well you can ANN constructors |
| 13:30:39 | <raehik> | ANN? |
| 13:32:06 | <dminuoso> | Mmm, was ANN removed? |
| 13:32:23 | <int-e> | https://downloads.haskell.org/ghc/latest/docs/users_guide/extending_ghc.html#source-annotations |
| 13:32:32 | <raehik> | just found it on an old docs page. interesting |
| 13:32:33 | <dminuoso> | Strange, the search failed me completely |
| 13:32:52 | <int-e> | "ghc annotations" were my keywords |
| 13:33:05 | <dminuoso> | I just searched for `ANN` |
| 13:33:15 | <dminuoso> | https://downloads.haskell.org/ghc/latest/docs/users_guide/search.html?q=ann&check_keywords=yes&area=default |
| 13:33:26 | <int-e> | I thought that would go badly... it's bound to be some kind of neural network :P |
| 13:34:00 | <int-e> | oh |
| 13:34:05 | <int-e> | "search" |
| 13:34:12 | <dminuoso> | https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/pragmas.html?highlight=pragmas |
| 13:34:19 | <dminuoso> | Doubly strange, ANN is not listed here either |
| 13:34:21 | <int-e> | (I assumed that would be a generic search engine) |
| 13:34:33 | <dminuoso> | Which strengthed my assumption that ANN was removed |
| 13:34:43 | <int-e> | ah, that is a blunder |
| 13:34:43 | → | mestre joins (~mestre@191.177.185.178) |
| 13:42:48 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:54fb:433:f271:a472) |
| 13:47:13 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:54fb:433:f271:a472) (Ping timeout: 252 seconds) |
| 13:58:36 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 13:58:54 | × | sgarcia quits (sgarcia@swarm.znchost.com) (Ping timeout: 260 seconds) |
| 13:59:34 | → | sgarcia joins (sgarcia@swarm.znchost.com) |
| 14:00:42 | × | nschoe quits (~q@2a01:e0a:8e:a190:76ab:f87d:ce8:9a0c) (Quit: Switching off) |
| 14:00:59 | → | nschoe joins (~q@2a01:e0a:8e:a190:76ab:f87d:ce8:9a0c) |
| 14:01:22 | → | mechap2 joins (~mechap@user/mechap) |
| 14:02:31 | <geekosaur> | yeh, ANN is poorly documented |
| 14:02:48 | <geekosaur> | I think there should be at least a pointer in the pragmas section |
| 14:04:16 | × | mechap1 quits (~mechap@user/mechap) (Ping timeout: 252 seconds) |
| 14:05:10 | × | Kaiepi quits (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) (Remote host closed the connection) |
| 14:05:32 | → | Kaiepi joins (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) |
| 14:05:54 | → | fizbin joins (~fizbin@user/fizbin) |
| 14:07:04 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 14:10:47 | → | thegeekinside joins (~thegeekin@189.217.82.244) |
| 14:11:09 | → | razetime joins (~Thunderbi@117.193.3.126) |
| 14:17:07 | → | kurbus joins (~kurbus@user/kurbus) |
| 14:17:50 | × | acidjnk_new quits (~acidjnk@p200300d6e715c419c07576573e5a57fd.dip0.t-ipconnect.de) (Ping timeout: 246 seconds) |
| 14:18:58 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 14:22:02 | → | tremon joins (~tremon@83-85-213-108.cable.dynamic.v4.ziggo.nl) |
| 14:29:49 | × | koala_man quits (~vidar@157.146.251.23.bc.googleusercontent.com) (Ping timeout: 260 seconds) |
| 14:31:09 | → | koala_man joins (~vidar@157.146.251.23.bc.googleusercontent.com) |
| 14:37:15 | → | acidjnk_new joins (~acidjnk@p200300d6e715c41991b51abbec1d93c2.dip0.t-ipconnect.de) |
| 14:39:01 | × | igghibu quits (~igghibu@178.249.211.100) (Quit: igghibu) |
| 14:42:07 | <raehik> | jackdk might you have some examples of using derivingvia and newtypes to get clean "improved defaults" for type classes? I swear I've read a ton of your code but google won't show it to me |
| 14:43:40 | <dminuoso> | raehik: Btw, I think I have an idea how to generalize over non-stateful and stateful flatparse variants! |
| 14:43:44 | <dminuoso> | Without using TemplateHaskell |
| 14:43:48 | <raehik> | WAIT it was iceland_jack probably. lol |
| 14:43:53 | <raehik> | dminuoso :O |
| 14:44:12 | <dminuoso> | A cunning and simple plan that should work for maybe 90% of the bindings. |
| 14:44:12 | <raehik> | or typeclasses? (I always assumed that would be possible but extremely annoying) |
| 14:44:17 | <zebrag[m]> | The last line is supposed to be Church encoding of lambda calculus, but I really dont get it. The inhabitant of the type is from me, and totally disregard the RHS. |
| 14:44:17 | <zebrag[m]> | 3 = λx.λf.f(f(f x)) :: ∀α.α -> (α -> α) -> α |
| 14:44:17 | <zebrag[m]> | p = λx.λy.x : :: ∀α.α -> α -> α |
| 14:44:17 | <zebrag[m]> | λx.x :: ∀α.((α -> α) -> α) -> (α -> α -> α) -> α ?? |
| 14:44:47 | <dminuoso> | raehik: typeclasses might work too, but I was rather thinking of using CPP helpers. |
| 14:45:48 | <dminuoso> | Either way, Im still not convinced Stateful is a realistic option for serious users. |
| 14:45:59 | <dminuoso> | 64 bit is not enough for indention parsing |
| 14:46:22 | <dminuoso> | Or you might have to conjure up some clever encoding strategies |
| 14:47:11 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "") |
| 14:47:17 | → | cheater_ joins (~Username@user/cheater) |
| 14:47:28 | <zebrag[m]> | ∀α.((α -> α) -> α) -> (α -> α -> α) -> α, supposed to be Chruch encoding of lambda calculus is from https://homepages.inf.ed.ac.uk/slindley/papers/unembedding.pdf |
| 14:48:16 | <zebrag[m]> | I can see how it sort of encode lam and app, but I don't get the step chuch encoding |
| 14:48:53 | <zebrag[m]> | section 2.2 folding over syntax |
| 14:48:56 | × | cheater quits (~Username@user/cheater) (Ping timeout: 246 seconds) |
| 14:49:02 | cheater_ | is now known as cheater |
| 14:49:45 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 14:51:46 | → | L29Ah joins (~L29Ah@wikipedia/L29Ah) |
| 14:52:26 | → | trev joins (~trev@user/trev) |
| 14:55:09 | <ncf> | i'd say the church encoding of λx.x is λlam.λapp.lam(λx.x) |
| 14:55:49 | × | jonathanx_ quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection) |
| 14:55:56 | <ncf> | church-encoded things generally take constructors as arguments and then build a data structure from those constructors |
| 14:56:16 | <jean-paul[m]> | with Aeson, how do I read a property of a property all at once? I know how to have nested values with FromJSON instances but I have some JSON where the interpretation of the inner value depends on something from the outer value and I don't see how to handle that except by mushing everything together into a single parseJSON function. |
| 14:57:23 | <jean-paul[m]> | But I also don't see how to get "the foo property of the bar property of the current object" |
| 14:57:45 | <ncf> | in this case it's a bit boring, but if you wanted to encode λf.λx.f(f x) (i.e. the church encoding of the church encoding of 2), you'd probably do λlam.λabs.lam(λf.lam(λx.app f (app f x))) |
| 14:58:26 | <zebrag[m]> | (reading you) |
| 14:59:55 | → | jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) |
| 15:01:40 | <zebrag[m]> | <ncf> "church-encoded things generally..." <- I'm pretty sure it's a good way to put it. |
| 15:02:54 | <jean-paul[m]> | Eh okay, not sure why I didn't see the obvious thing of just using the Monad instance for Parser between the two steps. |
| 15:03:56 | → | shapr joins (~user@68.54.166.125) |
| 15:08:01 | → | jonathanx_ joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) |
| 15:08:04 | × | jonathanx_ quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Client Quit) |
| 15:08:06 | × | machinedgod quits (~machinedg@d198-53-218-113.abhsia.telus.net) (Remote host closed the connection) |
| 15:08:45 | <dminuoso> | jean-paul[m]: part of the problem is that functions like withObject have a strange parameter order. |
| 15:09:07 | → | machinedgod joins (~machinedg@d198-53-218-113.abhsia.telus.net) |
| 15:09:38 | × | lortabac quits (~lortabac@2a01:e0a:541:b8f0:f424:d85:2acf:22a3) (Quit: WeeChat 2.8) |
| 15:09:55 | <jean-paul[m]> | My 2nd or 3rd try did involve flip (withObject label), indeed. I still didn't get it to work because of the mismatch between Value and Parser a but maybe if I paid attention to that it could have worked. |
| 15:10:16 | → | shriekingnoise joins (~shrieking@186.137.175.87) |
| 15:10:32 | <dminuoso> | You cant just do something naive as: do { r <- f .: "users"; withArray "list-of-users" r $ \users -> ... } |
| 15:10:59 | <dminuoso> | It needs an extra flip, weird let bindings, parameter shuffling, its all a bit annoying |
| 15:10:59 | × | jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Ping timeout: 264 seconds) |
| 15:11:08 | <int-e> | Hmm, 3 = λx.λf. f (f (f x)) <-- who uses that argument order? |
| 15:11:13 | × | acidjnk_new quits (~acidjnk@p200300d6e715c41991b51abbec1d93c2.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
| 15:12:06 | → | jumper149 joins (~jumper149@base.felixspringer.xyz) |
| 15:12:44 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 15:13:34 | <zebrag[m]> | int-e: as opposed to λf.λx. f (f (f x))? |
| 15:13:36 | × | kurbus quits (~kurbus@user/kurbus) (Quit: Client closed) |
| 15:14:29 | <zebrag[m]> | I supposed both are legit? |
| 15:14:56 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Quit: Leaving) |
| 15:15:13 | × | machinedgod quits (~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 252 seconds) |
| 15:15:31 | <zebrag[m]> | suppose* |
| 15:15:35 | <jumper149> | I just noticed the instance `Monad (ContT r m)` doesn't have a `Monad m` superclass constraint. :O |
| 15:15:54 | <dminuoso> | Yup. |
| 15:16:35 | × | mizlan quits (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) (Ping timeout: 255 seconds) |
| 15:16:41 | <dminuoso> | If you think about it, you dont even have that monad yet, its part of the continuation that someone else will fulfill. |
| 15:17:07 | <dminuoso> | The only reason we keep `m` as a separate parameter is to allow for stuff like a MonadTrans instance |
| 15:17:14 | → | machinedgod joins (~machinedg@d198-53-218-113.abhsia.telus.net) |
| 15:17:21 | <dminuoso> | (Well I guess that is the only reason) |
| 15:17:40 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 15:18:29 | <dminuoso> | Well and I guess it lets us talk about things like MonadIO or MonadFail |
| 15:18:58 | <jackhill> | is https://wingolog.org/archives/2004/07/25/literate-programming-with-guile-lib still state of the art for literate programming with guile? |
| 15:20:25 | <jackhill> | oops, wrong channel, sorry! |
| 15:20:33 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 15:21:07 | <int-e> | zebrag[m]: They both seem legit, but putting `f` first is standard. Mostly because Church did it that way, presumably because the "partial application" `n f`, that is n-fold application of `f` is quite a bit more useful than fixing the final argument of such a iteration. |
| 15:22:11 | × | Kaiepi quits (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) (Ping timeout: 260 seconds) |
| 15:23:11 | <zebrag[m]> | I'm wondering if there isn't an argument related to System F for doing it the other way around? |
| 15:25:19 | <int-e> | If you want to mechanically derive the type from a data declaration, then you'd probably treat data N = Z | S N differently from data N = S N | Z. |
| 15:25:49 | <eldritchcookie[4> | i must be blind what do i need to match this type? There is no default marshaller for this combination of Haskell and C type: |
| 15:25:49 | <eldritchcookie[4> | Haskell type: (FunPtr ((FunPtr (IO ())) -> IO CInt)) |
| 15:25:49 | <eldritchcookie[4> | C type : (C2HSImp.FunPtr ((C2HSImp.FunPtr (IO ())) -> (IO C2HSImp.CInt))) |
| 15:26:29 | <int-e> | So there's a disconnect between the standard data type definition for natural numbers (putting the base case first) and the standard Church encoding (which puts the base case second). |
| 15:26:44 | <int-e> | s/Church encoding/Church numerals/ |
| 15:26:48 | <jumper149> | dminuoso: You are saying `ContT r m a` and `Cont (m r) a` are equivalent? |
| 15:27:34 | <dminuoso> | `ContT r m a` and `Cont r a` are. |
| 15:28:14 | <dminuoso> | If we ignore typeclass instances a bit |
| 15:28:51 | <dminuoso> | The instance differences is usually just a matter of ergonomics, but anything you can do with one you can do with the other |
| 15:29:29 | <int-e> | zebrag[m]: my view is colored by actually having done programming in pure lambda calculus. The standard Church numerals allow mul = \a b -> \f -> a (b f) and even exp = \a b -> b a; the flipped version would have mul = \a b -> \f x -> a x (\x -> b x f) instead and I don't actually want to work out `exp`. |
| 15:30:11 | <int-e> | (`exp` being exponentiation, `exp a b = a^b`) |
| 15:31:14 | <jumper149> | :t runCont (undefined :: Cont (m r) a) |
| 15:31:16 | <lambdabot> | forall k a (m :: k -> *) (r :: k). (a -> m r) -> m r |
| 15:31:25 | <jumper149> | runContT (undefined :: ContT r m a) |
| 15:31:27 | <ncf> | the one-line argument for the λf.λx order is that it makes the type of naturals an endomorphism type, and these compose monoidally |
| 15:31:39 | <jumper149> | :t runContT (undefined :: ContT r m a) |
| 15:31:40 | <lambdabot> | forall k a (m :: k -> *) (r :: k). (a -> m r) -> m r |
| 15:32:13 | <jumper149> | This is what I meant. The types only match when you use `Cont (m r) a`. |
| 15:32:15 | <dminuoso> | Sure. |
| 15:32:22 | <zebrag[m]> | ncf yes, well, I copied the type from the article in front of me, I didn't give it too much thinking |
| 15:32:43 | <zebrag[m]> | but yes, your version seems more standard |
| 15:32:53 | <dminuoso> | jumper149: What is curious about this, is that Cont is powerful enough to subsume ContT. |
| 15:32:56 | <dminuoso> | Usually only the other way holds. |
| 15:33:28 | <dminuoso> | If we look in details, its not exactly true, because at the very least you cant get a MonadTrans instance with Cont |
| 15:33:31 | <zebrag[m]> | ncf and possibly more convenient |
| 15:33:51 | → | kurbus joins (~kurbus@user/kurbus) |
| 15:33:54 | <dminuoso> | But that's only a type position problem, you can still write the `lift` function, but just not as a MonadTrans instance |
| 15:34:18 | <jumper149> | Hmmm, well what is not exactly true about it. What if we define it the other way around. `data Cont = ...` and `type ContT = ...` as a type alias? |
| 15:34:41 | <dminuoso> | jumper149: try writing a MonadTrans instance for it. |
| 15:35:35 | <dminuoso> | class (forall m. Monad m => Monad (t m)) => MonadTrans t where lift :: Monad m => m a -> t m a |
| 15:36:40 | <int-e> | ncf: can you repeat that in plain english :) |
| 15:37:04 | <ncf> | (a -> a) -> (a -> a) is of the form b -> b |
| 15:37:18 | <dminuoso> | But like I said, this is only a type position problem, a function `lift :: Monad m => m a -> Cont (m r) a` can still be written |
| 15:37:29 | <int-e> | (Well, I can decipher it but I would never put it into those words.) |
| 15:37:35 | <ncf> | so addition is just composition... well, i suppose the quantifier complicates things |
| 15:37:38 | <dminuoso> | There's of course issues in higher order code resulting from this, but oh well |
| 15:37:59 | × | kurbus quits (~kurbus@user/kurbus) (Client Quit) |
| 15:38:31 | <int-e> | Also my brain thinks this makes a whole lot more sense after replacing "endomorphism type" by `Endo`. |
| 15:38:45 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 15:38:49 | <ncf> | that's what it is :) |
| 15:39:07 | <int-e> | `type ChurchNat x = Endo (Endo x)` |
| 15:39:46 | <jumper149> | dminuoso: I'll try it out for a little bit |
| 15:40:39 | <ncf> | ℕ = Π (Endo ∘ Endo) |
| 15:40:49 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 15:40:50 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 15:46:48 | <eldritchcookie[4> | i am using c2hs and it is saying it can't marshal my value but the types are the same any ideas |
| 15:46:58 | <eldritchcookie[4> | src/Allegro/FFI/System.chs:10: (column 36) [ERROR] >>> Missing "in" marshaller! |
| 15:46:58 | <eldritchcookie[4> | There is no default marshaller for this combination of Haskell and C type: |
| 15:46:58 | <eldritchcookie[4> | Haskell type: (FunPtr ((FunPtr (IO ())) -> (IO CInt))) |
| 15:46:58 | <eldritchcookie[4> | C type : (C2HSImp.FunPtr ((C2HSImp.FunPtr (IO ())) -> (IO C2HSImp.CInt))) |
| 15:47:35 | <eldritchcookie[4> | is there some problem with creating or receiving function pointers |
| 15:49:08 | <eldritchcookie[4> | ? |
| 15:49:27 | <merijn> | eldritchcookie[4: Not really |
| 15:50:11 | <jumper149> | Well you can't really use partially applied type synonyms for one thing ^^ |
| 15:50:40 | <eldritchcookie[4> | there aren't any partially applied type synonym in this case |
| 15:51:15 | <jumper149> | I'm still talking about the ContT stuff, sorry :D |
| 15:51:44 | → | barak joins (~barak@bzq-84-110-161-42.cablep.bezeqint.net) |
| 15:52:03 | ncf | . o O ( ℕ = (m : Monoid) -> Endo m ) |
| 15:52:17 | <geekosaur> | maybe the ContT stuff should move to #haskell-in-depth if it's going to continue |
| 15:52:19 | <ncf> | parametricity to the rescue |
| 15:54:35 | → | gabiruh joins (~gabiruh@vps19177.publiccloud.com.br) |
| 15:55:44 | × | fizbin quits (~fizbin@user/fizbin) (Ping timeout: 255 seconds) |
| 15:56:19 | × | mestre quits (~mestre@191.177.185.178) (Quit: leaving) |
| 15:56:24 | → | Kaiepi joins (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) |
| 15:56:35 | → | mestre joins (~mestre@191.177.185.178) |
| 15:57:44 | → | kenran joins (~user@user/kenran) |
| 15:58:14 | dminuoso | idly wonders why Cont vs ContT is haskell-in-depth while church encoded lambda calculus is not |
| 15:58:44 | <jumper149> | dminuoso: This is the best I could come up with: http://ix.io/4l00 |
| 16:00:01 | <jumper149> | The only advantage here is that the type of `Cont` is simpler. |
| 16:00:04 | × | finsternis quits (~X@23.226.237.192) (Read error: Connection reset by peer) |
| 16:00:36 | × | kenran quits (~user@user/kenran) (Remote host closed the connection) |
| 16:00:48 | <dminuoso> | % class (forall m. Monad m => Monad (t m)) => MyMonadTrans t where mylift :: Monad m => m a -> t m a |
| 16:00:48 | <yahb2> | <no output> |
| 16:00:52 | <dminuoso> | % :k MyMonadTrans |
| 16:00:52 | <yahb2> | MyMonadTrans :: ((* -> *) -> * -> *) -> Constraint |
| 16:00:53 | <jumper149> | And I guess it is quite nice, that we can derive the instances for `ContT |
| 16:01:02 | <dminuoso> | jumper149: It just wont kind check. |
| 16:01:04 | <jumper149> | I used transformers 0.6 in case you wondered |
| 16:02:35 | <zebrag[m]> | ncf int-e hmm, sorry I mixed the nicks when answering for the order of λx.λf vs λf.λx |
| 16:02:52 | <eldritchcookie[4> | for some reason if i change my declaration from a standalone fun to a call it works |
| 16:03:01 | <dminuoso> | jumper149: The type in question must, itself, have a type of `(Type -> Type) -> Type -> Type`, but your `MyCont :: Type -> Type -> Type` |
| 16:03:24 | <dminuoso> | Now you could widen that up with PolyKinds I suppose |
| 16:03:42 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 16:05:01 | <dminuoso> | Ah but no that wont work with the type |
| 16:05:23 | × | avicenzi quits (~avicenzi@2a00:ca8:a1f:b004::c32) (Ping timeout: 265 seconds) |
| 16:05:26 | <jumper149> | `MyCont :: Type -> Type -> Type` and `MyContT :: Type -> (Type -> Type) -> Type -> Type`. What is wrong with that exactly? |
| 16:06:03 | <dminuoso> | jumper149: Im just saying you cant make an `instance MonadTrans MyCont` |
| 16:06:11 | <dminuoso> | And that's the limitation of it. |
| 16:06:19 | <jumper149> | Yeah, that doesnt work, right |
| 16:06:23 | <dminuoso> | In lower order code its just an inconvenience, but in higher order code it could be a show stopper |
| 16:06:27 | <jumper149> | You woul |
| 16:07:33 | <jumper149> | You would need something like a typelevel lambda to write: MonadTrans (Λ m a -> MyCont (m r) a) |
| 16:08:28 | <jumper149> | But obviously that's quite far from reality :D |
| 16:08:28 | × | gnalzo quits (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 3.7.1) |
| 16:14:14 | × | geekosaur quits (~geekosaur@xmonad/geekosaur) (Quit: Leaving) |
| 16:22:40 | → | gtdg joins (~gtdg@nat-eduroam-76-gw-01-lne.lille.inria.fr) |
| 16:24:01 | → | geekosaur joins (~geekosaur@xmonad/geekosaur) |
| 16:24:06 | → | troydm joins (~troydm@user/troydm) |
| 16:32:00 | × | chele quits (~chele@user/chele) (Remote host closed the connection) |
| 16:42:35 | × | mizlan quits (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) (Ping timeout: 256 seconds) |
| 16:45:16 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:54fb:433:f271:a472) |
| 16:45:19 | → | Lycurgus joins (~juan@user/Lycurgus) |
| 16:46:34 | <eldritchcookie[4> | i am writing bindings to allegro 5 how can i test x function doesn't segfaults under these conditions? |
| 16:47:36 | <Lycurgus> | if you mean the cl impl i'd like an url to ur project |
| 16:49:04 | <Lycurgus> | or maybe not since 5 is fossilized |
| 16:49:04 | <eldritchcookie[4> | sorry i didn't understand? |
| 16:49:19 | Lycurgus | checks the log |
| 16:49:23 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:54fb:433:f271:a472) (Ping timeout: 246 seconds) |
| 16:49:31 | <eldritchcookie[4> | 5 is the latest version it currently is on 5.2.8;0 |
| 16:51:16 | × | jinsl quits (~jinsl@2408:8207:255f:27d0:211:32ff:fec8:6aea) (Quit: ZNC - https://znc.in) |
| 16:51:21 | → | laalyn joins (~laalyn@c-73-241-126-7.hsd1.ca.comcast.net) |
| 16:52:10 | <Lycurgus> | still looks like allegro common lisp, by an absence of anything else |
| 16:52:38 | <Lycurgus> | but it's 10 so that's a defeasor |
| 16:52:53 | <Lycurgus> | and allegro is a common name |
| 16:52:55 | <eldritchcookie[4> | i think we are talking about different allegros i mean https://liballeg.org/ this allegro |
| 16:53:01 | → | jinsl joins (~jinsl@2408:8207:255f:27d0:211:32ff:fec8:6aea) |
| 16:54:05 | <Lycurgus> | so 'unity' would have been unambiguously a game thing for me but not 'allegro' |
| 16:54:18 | <Lycurgus> | carry on |
| 16:55:26 | × | mbuf quits (~Shakthi@49.204.137.60) (Quit: Leaving) |
| 16:55:33 | <eldritchcookie[4> | if i have a c call which could possibly segfault is there any way to prevent my whole haskell program from segfaulting? |
| 16:56:01 | <Lycurgus> | ur supposed the catch the fault |
| 16:56:07 | × | jinsl quits (~jinsl@2408:8207:255f:27d0:211:32ff:fec8:6aea) (Client Quit) |
| 16:57:01 | <eldritchcookie[4> | is it an exception? so i can use something like catch? |
| 16:57:28 | <Lycurgus> | typically it would be a useful event in a debugger |
| 16:58:14 | <eldritchcookie[4> | i am talking about context of unit tests |
| 16:58:28 | <eldritchcookie[4> | how can i test well this call doesn't segfaults safely? |
| 17:00:12 | → | jinsl joins (~jinsl@123.120.176.13) |
| 17:00:38 | × | Lycurgus quits (~juan@user/Lycurgus) (Quit: Exeunt: personae.ai-integration.biz) |
| 17:00:48 | <mauke> | subprocess |
| 17:01:18 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 17:03:04 | <eldritchcookie[4> | so i use forkOS ? |
| 17:04:03 | × | gtdg quits (~gtdg@nat-eduroam-76-gw-01-lne.lille.inria.fr) (Ping timeout: 260 seconds) |
| 17:05:48 | × | cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.7.1) |
| 17:06:27 | <geekosaur> | no, that's a bound thread. `createProcess` from the `process` package |
| 17:07:22 | × | cheater quits (~Username@user/cheater) (Ping timeout: 252 seconds) |
| 17:08:17 | <geekosaur> | there's no way to do it within the same system process because there's no way to guarantee after a segfault that e.g. the heap hasn't been overwritten with garbage |
| 17:08:54 | <EvanR_> | I thought a segfault happens *instead of* access to memory |
| 17:08:59 | EvanR_ | is now known as EvanR |
| 17:09:20 | <geekosaur> | problem with that being the segfault may happen afterward when said garbaged heap is accessed |
| 17:09:48 | <geekosaur> | (think gc, which you have little control over) |
| 17:10:21 | <EvanR> | you mean, a segfault being a symptom of some other problem which corrupts memory and then tries to access invalid memory |
| 17:10:52 | <geekosaur> | a wild memory access may access invalid memory directly, or corrupt memory |
| 17:11:16 | → | cheater joins (~Username@user/cheater) |
| 17:11:21 | <EvanR> | what's the connection between that and a seg fault, or am I thinking of a page fault |
| 17:11:41 | <EvanR> | you can corrupt the heap all you want and no segfault |
| 17:11:42 | <geekosaur> | segfault is "something followed a pointer to an invalid page" |
| 17:12:06 | <geekosaur> | the heap can and does contain pointers, so if corrupted those pointers may lead to segfaults |
| 17:12:35 | <EvanR> | in which case it crashed because you got lucky, and the invalid access wasn't the actual problem that needs to be solved |
| 17:12:48 | → | cheater_ joins (~Username@user/cheater) |
| 17:13:05 | <EvanR> | corruption being an independent problem that might not raise anything |
| 17:13:22 | <eldritchcookie[4> | ok annoying but whatever, about my API i can't just expose these dangerous functions but ideally i wouldn't check for if the system is correctly initialized every time a function is called is there some way to make sure the initialization function is called before any API function but not use something like a custom monad? |
| 17:13:35 | <geekosaur> | right. which makes these difficult to diagnose sometimes |
| 17:13:55 | × | werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Remote host closed the connection) |
| 17:14:07 | <EvanR> | yeah sometimes you see a bracket-like API that you have to use to initialize a library, the old java-bridge did that |
| 17:14:15 | <geekosaur> | the usual way is to wrap everything in `bracket` or a variant thereof (see for example `withSocketsDo` in `network`) |
| 17:14:16 | <EvanR> | withJava $ do... |
| 17:14:54 | × | barak quits (~barak@bzq-84-110-161-42.cablep.bezeqint.net) (Ping timeout: 260 seconds) |
| 17:15:08 | × | mizlan quits (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) (Ping timeout: 260 seconds) |
| 17:15:58 | × | cheater quits (~Username@user/cheater) (Ping timeout: 268 seconds) |
| 17:16:03 | cheater_ | is now known as cheater |
| 17:17:53 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 17:20:13 | <eldritchcookie[4> | that seems worse than making my own monad which when ran initializes the library, like if i do the former i constrain the users to the monad i pick as receiving if i do the latter nothing prevents the user from using any monad they want as the base monad |
| 17:20:57 | → | thongpv joins (~thongpv87@2402:9d80:3c5:3279:6838:f48f:3c76:575c) |
| 17:21:56 | × | thongpv87 quits (~thongpv87@2402:9d80:31e:1d9:8ed3:aaf7:616c:caf3) (Read error: Connection reset by peer) |
| 17:22:00 | <geekosaur> | `withSocketsDo` has nothing to do with monads, aside from necessarily needing to be in IO (but you can `liftIO` it) |
| 17:23:28 | <eldritchcookie[4> | withSocketsDo:: (a -> IO b)-> IO b |
| 17:23:52 | <eldritchcookie[4> | what do you do if you want to use another monad which isnt IO as argument? |
| 17:24:14 | × | mizlan quits (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) (Ping timeout: 252 seconds) |
| 17:24:22 | <geekosaur> | withSocketsDo $ runStateT … |
| 17:24:54 | <geekosaur> | generally you'd initialize winsock as the very first thing in your program, so you'd wrap everything else in it |
| 17:25:03 | × | alfonsox quits (~quassel@103.87.57.33) (Read error: Connection reset by peer) |
| 17:27:41 | × | Sauvin quits (~sauvin@user/Sauvin) (Ping timeout: 268 seconds) |
| 17:27:45 | <EvanR> | if you want to overengineer, you could also build the withSocketsDo into your monad as long as it's based on IO |
| 17:28:12 | <glguy> | That'd be more silly than engineering |
| 17:28:12 | <EvanR> | but with that one example it wouldn't gain anything, it basically has to happen once, first |
| 17:28:23 | <EvanR> | oversillyneering |
| 17:29:26 | → | Sauvin joins (~sauvin@user/Sauvin) |
| 17:29:38 | × | kuribas quits (~user@ip-188-118-57-242.reverse.destiny.be) (Quit: ERC (IRC client for Emacs 27.1)) |
| 17:30:41 | → | titibandit1 joins (~titibandi@xdsl-87-78-235-220.nc.de) |
| 17:31:37 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) |
| 17:35:10 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 17:35:30 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:54fb:433:f271:a472) |
| 17:35:46 | <eldritchcookie[4> | actually why would a bracket like API help ? i would either use it to introduce a new value that can only be constructed via the init function or i would use another type which can't be used elsewhere like async |
| 17:36:51 | <glguy> | A bracket-like API means the thing can do something, run your code, do something |
| 17:39:51 | × | Kaiepi quits (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) (Ping timeout: 260 seconds) |
| 17:40:40 | × | razetime quits (~Thunderbi@117.193.3.126) (Remote host closed the connection) |
| 17:42:36 | <EvanR> | if your application takes the form of a monad, you could put the initialization in the run function, runMyApp :: App a -> IO a |
| 17:42:46 | × | dsrt^ quits (~dsrt@76.145.190.81) (Remote host closed the connection) |
| 17:45:48 | <eldritchcookie[4> | the problem with a bracket like api is that i then need a dummy value to be passed around to make the new wrapped functions safe |
| 17:46:03 | × | mizlan quits (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) (Ping timeout: 260 seconds) |
| 17:47:57 | → | Tuplanolla joins (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) |
| 17:48:11 | → | barak joins (~barak@2a02:14f:3:2426:d86c:7262:9cd0:29f7) |
| 17:50:28 | <glguy> | eldritchcookie[4: If you just need to make sure the library initialization function is called first you could do something like network library does with withSocketsDo https://hackage.haskell.org/package/network-3.1.2.7/docs/src/Network.Socket.Internal.html#withSocketsDo |
| 17:50:53 | <glguy> | They've got an unsafePerformIO in a top-level value so that the initializer only gets run once on the first evaluation of the top-level value |
| 17:51:13 | <glguy> | so then you'd be able to guard all your library functions to evaluate that first to make sure the initializer has run |
| 17:51:27 | <glguy> | its less efficient than not doing that, but not very expensive |
| 17:51:33 | <monochrom> | "It is fine to nest calls to withSocketsDo, and to perform networking operations after withSocketsDo has returned." |
| 17:51:50 | <monochrom> | "withSocketsDo is not necessary for the current network library. However, for compatibility with older" |
| 17:52:23 | <geekosaur> | in the current library all functions are already wrapped in `withSocketsDo` |
| 17:52:44 | <monochrom> | With "older" being such a distant past and there is fat chance you actually need to care in this the year 2023 of our Lord, perhaps you really don't need it. |
| 17:53:03 | <glguy> | monochrom: in this case withSocketsDo is an example of something eldritchcookie[4 is making |
| 17:53:05 | <geekosaur> | but the case here is initializing a different foreign library |
| 17:53:20 | <glguy> | for something* |
| 17:53:29 | <monochrom> | Sure. Shall we not XY-problem the whole thing then? |
| 17:53:40 | <glguy> | that's not what XY means |
| 17:54:12 | <monochrom> | Not to mention that even the premise "withSocketsDo:: (a -> IO b)-> IO b" didn't fact-check in the first place. |
| 17:54:41 | <glguy> | in this case it was "check out how withSocketsDo is implemented under the hood, you could reuse that" |
| 17:54:41 | × | laalyn quits (~laalyn@c-73-241-126-7.hsd1.ca.comcast.net) (Quit: Client closed) |
| 17:55:45 | × | mechap2 quits (~mechap@user/mechap) (Quit: WeeChat 3.8) |
| 17:56:06 | → | mechap joins (~mechap@user/mechap) |
| 17:56:32 | <mauke> | https://hackage.haskell.org/package/network-3.1.2.7/docs/src/Network.Socket.Internal.html#line-170 sneaky |
| 17:59:34 | <monochrom> | My "XY" was referring to generalizing (even wrongly, read on) from withSocketDo to "what's the benefit of a bracket API", given that "it's fine to perform networking operations after withSocketsDo has returned" means it is not even a bracket API. |
| 17:59:50 | × | trev quits (~trev@user/trev) (Remote host closed the connection) |
| 18:00:03 | <monochrom> | or perhaps s/generalizing/detouring/ |
| 18:00:22 | × | thegeekinside quits (~thegeekin@189.217.82.244) (Ping timeout: 268 seconds) |
| 18:01:30 | → | thegeekinside joins (~thegeekin@189.217.82.244) |
| 18:02:38 | → | Kaiepi joins (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) |
| 18:03:48 | → | ft joins (~ft@p4fc2a257.dip0.t-ipconnect.de) |
| 18:04:36 | <geekosaur[m]> | You might have read backscroll before making assumptions about the problem |
| 18:05:55 | × | thegeekinside quits (~thegeekin@189.217.82.244) (Ping timeout: 268 seconds) |
| 18:05:59 | <eldritchcookie[4> | context allegro needs allegro init to be called before calling any functions of the library how can i make certain that it is initialized before any function is called without introducing a dummy variable and without creating a new monad transformer |
| 18:06:07 | → | thegeekinside joins (~thegeekin@189.217.82.244) |
| 18:15:20 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 18:16:44 | → | gnalzo joins (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) |
| 18:17:19 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 260 seconds) |
| 18:17:39 | × | opticblast quits (~Thunderbi@secure-165.caltech.edu) (Ping timeout: 260 seconds) |
| 18:17:49 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:54fb:433:f271:a472) (Remote host closed the connection) |
| 18:17:59 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 18:19:23 | × | L29Ah quits (~L29Ah@wikipedia/L29Ah) (Ping timeout: 264 seconds) |
| 18:20:49 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:54fb:433:f271:a472) |
| 18:21:23 | → | opticblast joins (~Thunderbi@secure-165.caltech.edu) |
| 18:21:42 | <geekosaur> | if you need to go through IO anyway (and you almost certainly do; read about FFI safety) then you have every foreign call wrapped in a Haskell call that checks a "global" in IO and calls the initializer if necessary |
| 18:21:55 | <geekosaur> | this is essentially what the modern `network` library does |
| 18:24:05 | → | irrgit_ joins (~irrgit@146.70.27.250) |
| 18:24:35 | × | mizlan quits (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) (Ping timeout: 256 seconds) |
| 18:25:29 | <eldritchcookie[4> | how do i create this global? with unsafePerformIO? |
| 18:25:39 | <geekosaur> | yes |
| 18:26:29 | → | econo joins (uid147250@user/econo) |
| 18:26:30 | <geekosaur> | the usual way: isInitialized = unsafePerformIO (newIORef 0) {-# NOINLINE isInitialized #-} |
| 18:26:41 | <geekosaur> | at top level |
| 18:27:10 | × | irrgit__ quits (~irrgit@86.106.90.226) (Ping timeout: 252 seconds) |
| 18:28:14 | <geekosaur> | well, also a type signature so it doesn't polymorphize it based on the `0` |
| 18:28:28 | <geekosaur> | could also be False/True or Maybe () or etc. |
| 18:28:32 | <eldritchcookie[4> | the library provides al_is_system_installed should prefer that to unsafePerformIO? |
| 18:28:57 | × | titibandit1 quits (~titibandi@xdsl-87-78-235-220.nc.de) (Quit: Leaving.) |
| 18:29:12 | <geekosaur> | if you can check for it directly then yes |
| 18:29:41 | × | barak quits (~barak@2a02:14f:3:2426:d86c:7262:9cd0:29f7) (Ping timeout: 256 seconds) |
| 18:31:27 | <geekosaur> | that said, if it allows you to check, arguably it should have this built into itself so you shouldn't need to care; I'd consider that a bug in liballegro, tbh |
| 18:32:48 | <eldritchcookie[4> | well it is a library written in c what did you expect? |
| 18:34:47 | × | merijn quits (~merijn@c-001-001-015.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds) |
| 18:36:16 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 18:41:59 | → | waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
| 18:46:28 | × | krjst quits (~krjst@2604:a880:800:c1::16b:8001) (Quit: bye) |
| 18:47:51 | → | krjst joins (~krjst@2604:a880:800:c1::16b:8001) |
| 18:49:39 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:54fb:433:f271:a472) (Remote host closed the connection) |
| 18:49:52 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Read error: Connection reset by peer) |
| 18:53:11 | → | elevenkb joins (~elevenkb@105.224.38.20) |
| 19:01:06 | → | merijn joins (~merijn@c-001-001-015.client.esciencecenter.eduvpn.nl) |
| 19:02:22 | × | Kaiepi quits (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) (Ping timeout: 252 seconds) |
| 19:08:18 | → | Kaiepi joins (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) |
| 19:08:36 | × | merijn quits (~merijn@c-001-001-015.client.esciencecenter.eduvpn.nl) (Ping timeout: 272 seconds) |
| 19:12:21 | → | bgs joins (~bgs@212-85-160-171.dynamic.telemach.net) |
| 19:15:03 | → | L29Ah joins (~L29Ah@wikipedia/L29Ah) |
| 19:20:35 | → | rekahsoft joins (~rekahsoft@bras-base-orllon1122w-grc-07-174-95-68-39.dsl.bell.ca) |
| 19:22:38 | × | rekahsoft quits (~rekahsoft@bras-base-orllon1122w-grc-07-174-95-68-39.dsl.bell.ca) (Remote host closed the connection) |
| 19:23:56 | <witcher> | hi :) i'm writing a huffman tree as part of a lecture. the coding table and encoded content should be saved to and read from disk using the Binary type class from Data.Binary. the problem is that a call to `get` seems to get the program stuck in an infinite loop and i cannot figure out why. help would be appreciated! |
| 19:23:58 | <witcher> | https://paste.sr.ht/~witcher/a0194b7029ed2e528d791533f8323f5f2573bb2f |
| 19:24:47 | <witcher> | if more code is needed i can also post the whole repository in here (it's pre cleanup, so forgive me if it looks bad!) |
| 19:25:16 | <dminuoso> | `get = B.get` |
| 19:25:24 | <dminuoso> | witcher: That's a recursive definition, like `f = f` |
| 19:25:39 | <witcher> | hm, my professor said that would be fine... what would the correct definition be? |
| 19:25:40 | <dminuoso> | It's not as obvious, because the right hand side has a qualifier B. while the left hand side does not. |
| 19:26:12 | <witcher> | i *was* thinking that too, but the professor told me otherwise, so i just assumed that's correct |
| 19:26:43 | <dminuoso> | witcher: Two things: |
| 19:27:08 | <geekosaur> | often it's fine because the compiler can work out that they're referring to different types. but just as you had to specify a type for B.put, you need one for B.get |
| 19:27:23 | <dminuoso> | Use getInt64be, and also for putting use `putInt64be` explicitly as well |
| 19:27:26 | → | titibandit1 joins (~titibandi@xdsl-87-78-235-220.nc.de) |
| 19:27:26 | <geekosaur> | otherwise it assumes it's still using type Bit |
| 19:27:31 | <dminuoso> | For the get side, you will then have to pattern match on the result |
| 19:27:35 | → | rekahsoft joins (~rekahsoft@bras-base-orllon1122w-grc-07-174-95-68-39.dsl.bell.ca) |
| 19:28:03 | <witcher> | ooooh, that makes a lot of sense |
| 19:28:15 | × | rekahsoft quits (~rekahsoft@bras-base-orllon1122w-grc-07-174-95-68-39.dsl.bell.ca) (Remote host closed the connection) |
| 19:28:31 | <witcher> | i'll try and see what works for me. thank you for the help! |
| 19:29:00 | → | rekahsoft joins (~rekahsoft@bras-base-orllon1122w-grc-07-174-95-68-39.dsl.bell.ca) |
| 19:30:15 | <dminuoso> | witcher: Note, if the format is up to you, consider using Word8/Int8 instead |
| 19:30:45 | <dminuoso> | While still not ideal, it will greatly reduce wasted space and speed up both loading and writing. |
| 19:30:55 | <dminuoso> | (i.e. using putWord8 and getWord8) |
| 19:33:11 | <witcher> | yup, that's the idea when i get this part working |
| 19:34:05 | <hololeap> | Profpatsch: I'm not 100% sure, but you might be able to use QuantifiedConstraints for that |
| 19:35:28 | <witcher> | so, no matter how i put it, it's still looping... i also just noticed the loop actually occurs in line 13 in the paste... what's the issue here? am i indirectly specifying it's writing a [(Char, [Bit]) but trying to read a BinaryCodingTable, which are different things? |
| 19:35:43 | <dminuoso> | witcher: Yes, that's the same thing. |
| 19:35:45 | <dminuoso> | get = B.get |
| 19:36:21 | <dminuoso> | witcher: I have a more fundamental issue with you using `get` or the Binary typeclass to begin with. |
| 19:36:26 | <dminuoso> | I recommend you avoid using it entirely. |
| 19:36:35 | <dminuoso> | Thing will become clearer and will avoid several other bugs down the line. |
| 19:36:51 | <geekosaur> | sounds like the prof specified Data.Binary though |
| 19:36:59 | <witcher> | it's required that i implement it, sadly :( but out of curiosity, and since i want to learn, what would be a better way? |
| 19:38:46 | <dminuoso> | geekosaur: sure, they can use that |
| 19:38:50 | <witcher> | also it works now, given a tiny bug i have. thanks! |
| 19:38:55 | <dminuoso> | You dont have to use the Binary typeclass though. |
| 19:40:36 | → | zeenk joins (~zeenk@2a02:2f04:a014:8700::7fe) |
| 19:40:53 | <witcher> | ignoring the constraints i have, what is a better way to achieve what i'm trying to do? |
| 19:41:28 | <dminuoso> | witcher: is it required you use the Binary typeclass? |
| 19:41:31 | <dminuoso> | or just the `binary` package? |
| 19:42:03 | <witcher> | oh, the Binary typeclass is required |
| 19:43:27 | × | elevenkb quits (~elevenkb@105.224.38.20) (Quit: Client closed) |
| 19:43:44 | <dminuoso> | I would then personally do something like `putBit = ...`, `getBit = ...`; `putBinaryCodingTable = ...` `getBinaryCodingTable = ...` and use non-typeclass based primitives |
| 19:43:47 | × | crns quits (~netcrns@user/crns) (Quit: gone) |
| 19:43:56 | → | off^ joins (~off@76.145.190.81) |
| 19:43:57 | <dminuoso> | And at the end just define those instances as `instance Binary Bit where get = getBit; put = putBit` |
| 19:44:04 | → | crns joins (~netcrns@79.245.226.195) |
| 19:44:04 | × | crns quits (~netcrns@79.245.226.195) (Changing host) |
| 19:44:04 | → | crns joins (~netcrns@user/crns) |
| 19:44:13 | <dminuoso> | assuming this literal interpretation of "use the Binary typeclass" wont cause a lower grade |
| 19:45:16 | <witcher> | yeah i guess that's one way of doing it. thanks for the suggestion |
| 19:46:55 | <dminuoso> | witcher: It might introduce some extra initial hurdles like you having to think how to serialize a table |
| 19:47:00 | <dminuoso> | but I think its a worthy excursion |
| 19:47:11 | <dminuoso> | And you wont start relying on *some* internal implementation where you dont even know what it does |
| 19:50:09 | → | eggplantade joins (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) |
| 19:50:27 | × | hueso quits (~root@user/hueso) (Quit: hueso) |
| 19:52:19 | <witcher> | how does haskell handle converting a datatype into another one? say i have a `Bit` and a `Word8` in my example and want to go from one to the other. is there anything special i can do or are usual functions the norm? |
| 19:52:40 | <dminuoso> | case-of |
| 19:52:45 | → | cheater_ joins (~Username@user/cheater) |
| 19:52:51 | <dminuoso> | Either explicitly or in form of a function using pattern matching |
| 19:53:11 | <witcher> | got it. thank you |
| 19:54:16 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 19:54:58 | × | eggplantade quits (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 260 seconds) |
| 19:55:40 | × | cheater quits (~Username@user/cheater) (Ping timeout: 252 seconds) |
| 19:55:41 | cheater_ | is now known as cheater |
| 19:55:59 | <sm> | witcher: I like your nick |
| 19:56:07 | <sm> | big fan |
| 19:59:05 | <witcher> | haha thanks! |
| 20:00:06 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 20:00:36 | × | jpds quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection) |
| 20:01:28 | → | jpds joins (~jpds@gateway/tor-sasl/jpds) |
| 20:04:27 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:54fb:433:f271:a472) |
| 20:06:14 | × | Kaiepi quits (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) (Ping timeout: 272 seconds) |
| 20:12:53 | → | hueso joins (~root@user/hueso) |
| 20:15:45 | → | Kaiepi joins (~Kaiepi@nwcsnbsc03w-47-55-159-86.dhcp-dynamic.fibreop.nb.bellaliant.net) |
| 20:20:02 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 20:24:38 | → | trev joins (~trev@user/trev) |
| 20:29:28 | <hololeap> | anyone know of anything close to elm-ui for haskell? something related to threepenny? |
| 20:30:13 | → | beteigeuze joins (~Thunderbi@a79-169-109-107.cpe.netcabo.pt) |
| 20:30:30 | <hololeap> | I haven't used threepenny yet, just curious what I need to know |
| 20:33:47 | × | mestre quits (~mestre@191.177.185.178) (Quit: Lost terminal) |
| 20:34:59 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 260 seconds) |
| 20:36:11 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 20:41:04 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 272 seconds) |
| 20:41:56 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 20:44:35 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:54fb:433:f271:a472) (Remote host closed the connection) |
| 20:46:39 | × | freeside quits (~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 260 seconds) |
| 20:47:12 | <[Leary]> | @tell kuribas That won't happen with `::`, since omitting a required field is a type error. By 'union' do you mean `//`? That will be the same as `::` if the result is annotated or otherwise checked to match a schema, otherwise the field will just be absent. |
| 20:47:12 | <lambdabot> | Consider it noted. |
| 20:47:41 | → | freeside joins (~mengwong@bb115-66-48-84.singnet.com.sg) |
| 20:49:58 | <hololeap> | @hackage monomer -- I just found this |
| 20:49:59 | <lambdabot> | https://hackage.haskell.org/package/monomer -- I just found this |
| 20:54:01 | × | mizlan quits (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) (Ping timeout: 252 seconds) |
| 20:54:38 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 20:56:51 | → | talismanick joins (~talismani@c-73-66-168-202.hsd1.ca.comcast.net) |
| 20:57:53 | <hololeap> | hm, I can't tell if it's like threepenny or uses sdl |
| 20:59:37 | <geekosaur> | threepenny's browser based, no? I see OpenGLRaw in the deps for monomer |
| 21:00:15 | <hololeap> | yeah, I'm just a bit confused to why it claims to be similar to elm, then |
| 21:00:54 | <geekosaur> | presumably in terms of API |
| 21:01:12 | <monochrom> | Um, it has all of {OpenGLRaw, sdl2, {websockets http-client wreq all those webdev stuff}} in the deps. :) |
| 21:01:46 | <monochrom> | So, "all of the above, and probably more". |
| 21:02:00 | × | mizlan quits (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) (Remote host closed the connection) |
| 21:02:32 | <geekosaur> | "You want to write a native, not web based, application." from the readme |
| 21:02:38 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 21:03:57 | × | teo quits (~teo@user/teo) (Ping timeout: 252 seconds) |
| 21:08:19 | × | mizlan quits (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) (Ping timeout: 252 seconds) |
| 21:08:57 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 21:18:43 | × | zeenk quits (~zeenk@2a02:2f04:a014:8700::7fe) (Remote host closed the connection) |
| 21:19:05 | → | zeenk joins (~zeenk@2a02:2f04:a014:8700::fba) |
| 21:26:16 | × | trev quits (~trev@user/trev) (Remote host closed the connection) |
| 21:28:38 | × | phma quits (phma@2001:5b0:210f:51a8:d2f8:1120:28e8:9d5c) (Read error: Connection reset by peer) |
| 21:33:38 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 272 seconds) |
| 21:33:44 | × | Xeroine quits (~Xeroine@user/xeroine) (Ping timeout: 268 seconds) |
| 21:33:49 | → | Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915) |
| 21:34:15 | → | Xeroine joins (~Xeroine@user/xeroine) |
| 21:35:07 | Lord_of_Life_ | is now known as Lord_of_Life |
| 21:36:22 | × | talismanick quits (~talismani@c-73-66-168-202.hsd1.ca.comcast.net) (Ping timeout: 252 seconds) |
| 21:41:19 | → | CiaoSen joins (~Jura@p200300c9574fa4002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
| 21:45:06 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:54fb:433:f271:a472) |
| 21:45:45 | → | fizbin joins (~fizbin@user/fizbin) |
| 21:49:32 | → | phma joins (~phma@host-67-44-208-213.hnremote.net) |
| 21:49:53 | × | cheater quits (~Username@user/cheater) (Ping timeout: 260 seconds) |
| 21:49:59 | → | cheater joins (~Username@user/cheater) |
| 21:50:00 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:54fb:433:f271:a472) (Ping timeout: 260 seconds) |
| 21:52:18 | <eldritchcookie[4> | is c2hs abandoned its github has its last commit marked as from april 2022 |
| 21:52:37 | <mauke> | hahaha |
| 21:56:52 | <eldritchcookie[4> | ?? |
| 21:57:52 | → | oldfashionedcow joins (~Rahul_San@user/oldfashionedcow) |
| 22:00:54 | × | opticblast quits (~Thunderbi@secure-165.caltech.edu) (Read error: Connection reset by peer) |
| 22:01:12 | → | opticblast joins (~Thunderbi@secure-165.caltech.edu) |
| 22:02:25 | × | foul_owl quits (~kerry@157.97.134.62) (Read error: Connection reset by peer) |
| 22:04:27 | × | CAT_S quits (apic@brezn3.muc.ccc.de) (Ping timeout: 256 seconds) |
| 22:04:38 | → | CAT_S joins (apic@brezn3.muc.ccc.de) |
| 22:04:40 | → | talismanick joins (~talismani@campus-110-233.ucdavis.edu) |
| 22:06:34 | × | titibandit1 quits (~titibandi@xdsl-87-78-235-220.nc.de) (Ping timeout: 252 seconds) |
| 22:08:18 | × | paulpaul1076 quits (~textual@95-29-5-111.broadband.corbina.ru) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 22:08:30 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 22:08:43 | × | CiaoSen quits (~Jura@p200300c9574fa4002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 248 seconds) |
| 22:10:43 | × | takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
| 22:11:07 | × | bgs quits (~bgs@212-85-160-171.dynamic.telemach.net) (Remote host closed the connection) |
| 22:12:43 | × | mei quits (~mei@user/mei) (Quit: mei) |
| 22:12:56 | × | jpds quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 255 seconds) |
| 22:13:29 | × | nschoe quits (~q@2a01:e0a:8e:a190:76ab:f87d:ce8:9a0c) (Ping timeout: 246 seconds) |
| 22:13:50 | → | jpds joins (~jpds@gateway/tor-sasl/jpds) |
| 22:17:43 | × | MajorBiscuit quits (~MajorBisc@2001:1c00:2402:2d00:9eeb:34cf:63b3:9e5b) (Quit: WeeChat 3.6) |
| 22:18:06 | ← | jakalx parts (~jakalx@base.jakalx.net) () |
| 22:20:11 | → | foul_owl joins (~kerry@157.97.134.62) |
| 22:21:22 | → | titibandit1 joins (~titibandi@xdsl-81-173-160-143.nc.de) |
| 22:25:05 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 22:26:06 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 22:26:06 | → | Inst joins (~Inst@2601:6c4:4081:54f0:646c:8574:a39d:53d0) |
| 22:27:14 | <eldritchcookie[4> | mauke i like jokes too explain please |
| 22:30:23 | × | rekahsoft quits (~rekahsoft@bras-base-orllon1122w-grc-07-174-95-68-39.dsl.bell.ca) (Ping timeout: 255 seconds) |
| 22:31:51 | <lyxia> | Does anyone know why the ghc-lib project is split into two packages ghc-lib and ghc-lib-parser (a subset), instead of only ghc-lib? |
| 22:32:09 | <eldritchcookie[4> | how can i generate a capturable unique name with template haskell? |
| 22:32:29 | <lyxia> | eldritchcookie[4: newName? |
| 22:33:00 | <jackdk> | lyxia: I think ghc-lib-parser lets you use other ghc's versions of the parser as a regular library, while ghc-lib is the lib bundled with your version. But don't quote me on that |
| 22:33:43 | <monochrom> | lyxia: Although, newName also promises "cannot be captured" :) |
| 22:34:17 | <monochrom> | On second thought, the two "capture"s may be completely related, newName may be appropriate after all. |
| 22:34:25 | <monochrom> | err, completely unrelated! |
| 22:35:52 | × | lbseale quits (~quassel@user/ep1ctetus) (Quit: No Ping reply in 180 seconds.) |
| 22:36:36 | → | Guest6780 joins (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) |
| 22:37:16 | → | lbseale joins (~quassel@user/ep1ctetus) |
| 22:37:38 | <geekosaur> | mkName is a capturable name |
| 22:37:58 | <monochrom> | Hrm I'm reading the newName doc and it describes how its creation can capture a related mkName. This looks like mkName's creations have dynamic scoping heh. |
| 22:37:58 | <eldritchcookie[4> | yeah but how can i make it unique? |
| 22:38:40 | <monochrom> | On third though, I wonder if "capturable but unique" is overspecification. |
| 22:39:00 | × | __monty__ quits (~toonn@user/toonn) (Quit: leaving) |
| 22:39:02 | <monochrom> | even oxymoron but maybe that's too extreme |
| 22:39:44 | <monochrom> | If you have "nm1 <- newName whatever" then everywhere you use nm1 it refers to the same thing already. |
| 22:41:13 | <monochrom> | OK on fourth thought, it sounds like you mean something like this: |
| 22:41:33 | <lyxia> | newName gives you a unique name, the problem is what you mean by capturable |
| 22:42:03 | <monochrom> | You use nm1 <- newName "xxx" to ensure uniqueness and you don't mind it being uncapturable because... |
| 22:42:05 | × | mizlan quits (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) (Ping timeout: 255 seconds) |
| 22:42:31 | <monochrom> | You use nm1 for introduction only, e.g., LamE [VarP nm1]. |
| 22:42:58 | <monochrom> | Inside that scope, whenever you want a capturable xxx, you say mkName "xxx". |
| 22:43:48 | <monochrom> | If you have your scopes set up right, mkName "xxx" is capturable and precisely captured by the closest xxx-derivative, which hopefully is nm1. |
| 22:44:06 | <monochrom> | which is exactly the last example in the doc. |
| 22:46:01 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 22:52:01 | × | biberu quits (~biberu@user/biberu) (Read error: Connection reset by peer) |
| 22:52:03 | × | mizlan quits (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) (Ping timeout: 260 seconds) |
| 22:52:58 | <eldritchcookie[4> | given that c2hs seems abandoned and i hate preprocessors with all their fancy extensions on which HLS does not work. |
| 22:53:23 | <geekosaur> | it's not abandoned |
| 22:53:42 | <geekosaur> | why, other than it not getting updated like npm, makes you think it is? |
| 22:54:31 | <geekosaur> | c2hs rarely needs changes, usually only because either apple of gnu decided to come up with some new thing intended only for system headers (see for example all the Darwin issues) |
| 22:54:33 | <eldritchcookie[4> | ok you make i good point who would i need to ask to know if it is abandoned? |
| 22:54:44 | <geekosaur> | (Apple, naturally, does not document such things because they're internals) |
| 22:55:32 | <lyxia> | eldritchcookie[4: the maintainer |
| 22:55:32 | <geekosaur> | last big change to c2hs was becauswe glibc hadded some unexpected bit of syntax to its internal headers |
| 22:55:43 | <geekosaur> | s/hadded/added |
| 22:56:15 | → | biberu joins (~biberu@user/biberu) |
| 22:56:16 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 23:00:33 | × | mizlan quits (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) (Ping timeout: 255 seconds) |
| 23:03:25 | <eldritchcookie[4> | has anyone here previously used c2hs? |
| 23:03:49 | × | talismanick quits (~talismani@campus-110-233.ucdavis.edu) (Ping timeout: 252 seconds) |
| 23:06:36 | × | Unicorn_Princess quits (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Quit: Leaving) |
| 23:07:56 | <eldritchcookie[4> | if yes have you ever used the fun directive for anything other than 1 marshalling to equivalent haskell 2 using alloca- haskell type peek* |
| 23:08:39 | <geekosaur> | generally it's used in build-depends to generate bindings automatically |
| 23:08:47 | → | mizlan joins (~mizlan@2607:f010:2a7:1005:94e1:194a:53e4:73b4) |
| 23:09:08 | × | cods quits (~fred@82-65-232-44.subs.proxad.net) (Ping timeout: 246 seconds) |
| 23:09:21 | → | cods joins (~fred@82-65-232-44.subs.proxad.net) |
| 23:09:29 | <eldritchcookie[4> | how? |
| 23:12:13 | <eldritchcookie[4> | i may be misunderstanding by automatic i think you are saying that with only c2hs and a c header and minimal or none help from the programmer it generates the haskell code that seems kinda difficult |
| 23:12:50 | <geekosaur> | that's what gtk2hs does |
| 23:13:11 | <geekosaur> | but I forgot it's still using its own modified version that understands how glib onjects are assembled |
| 23:13:16 | <geekosaur> | *objects |
| 23:14:34 | → | panovia joins (~user@user/siracusa) |
| 23:14:46 | <eldritchcookie[4> | how does that work? how do they find which are the relevant functions/values and which are internal? |
| 23:15:02 | × | Guest6780 quits (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 246 seconds) |
| 23:18:24 | <glguy> | internal functions wouldn't be found in the public headers |
| 23:19:15 | <glguy> | for libraries that put internal things in non-internal headers you have to specify |
| 23:19:59 | × | gnalzo quits (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 3.7.1) |
| 23:20:38 | × | machinedgod quits (~machinedg@d198-53-218-113.abhsia.telus.net) (Quit: Lost terminal) |
| 23:20:39 | <geekosaur> | https://hackage.haskell.org/package/gtk2hs-buildtools-0.13.8.3/src/src/Gtk2HsSetup.hs is the gtk2hs setup hook that locates and processes headers |
| 23:21:03 | → | machinedgod joins (~machinedg@d198-53-218-113.abhsia.telus.net) |
| 23:22:21 | <geekosaur> | and writes out a list of which modules to build based on which functions are found on the building system, since it changes based on installed gtk+ version |
| 23:22:39 | <eldritchcookie[4> | sorry it still isn't clear to me are the .chs file autogenerated from the c headers ? |
| 23:23:18 | <glguy> | The .chs files are inputs to the c2hs program which emits auto-generated .hs files |
| 23:23:37 | × | jumper149 quits (~jumper149@base.felixspringer.xyz) (Quit: WeeChat 3.7.1) |
| 23:25:57 | <glguy> | and Cabal knows about .chs files, so it can invoke the preprocessor at build time |
| 23:27:52 | <eldritchcookie[4> | ok know things make sense when you said automatically generated i thought it was the .chs files so i was confused as that seems impossible |
| 23:28:19 | <eldritchcookie[4> | *now |
| 23:35:46 | → | jero98772 joins (~jero98772@2800:484:1d80:d8ce:9815:cfda:3661:17bb) |
| 23:39:27 | × | titibandit1 quits (~titibandi@xdsl-81-173-160-143.nc.de) (Remote host closed the connection) |
| 23:54:26 | → | v0id_ptr joins (~adrift@user/ptr-frac7al/x-0038398) |
| 23:56:23 | oldfashionedcow | is now known as gen43 |
| 23:56:46 | × | ubert quits (~Thunderbi@p548c9ce5.dip0.t-ipconnect.de) (Ping timeout: 272 seconds) |
| 23:59:44 | × | machinedgod quits (~machinedg@d198-53-218-113.abhsia.telus.net) (Quit: Lost terminal) |
| 23:59:55 | → | accord joins (uid568320@id-568320.hampstead.irccloud.com) |
All times are in UTC on 2023-01-12.