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