2022-12-13 00:04:44 +0100 | WarzoneCommand | (~Frank@77-162-168-71.fixed.kpn.net) (Ping timeout: 260 seconds) |
2022-12-13 00:12:01 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-12-13 00:16:50 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 268 seconds) |
2022-12-13 00:16:50 +0100 | nut | (~nut@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 268 seconds) |
2022-12-13 00:17:16 +0100 | fizbin | (~fizbin@user/fizbin) |
2022-12-13 00:24:48 +0100 | fizbin | (~fizbin@user/fizbin) (Ping timeout: 256 seconds) |
2022-12-13 00:26:30 +0100 | burnsidesLlama | (~burnsides@138.199.22.99) (Ping timeout: 256 seconds) |
2022-12-13 00:28:35 +0100 | son0p | (~ff@2604:3d08:5b7f:5540:98a9:2169:15a1:4c7f) (Ping timeout: 256 seconds) |
2022-12-13 00:35:57 +0100 | motherfsck | (~motherfsc@user/motherfsck) (Ping timeout: 268 seconds) |
2022-12-13 00:41:14 +0100 | <davean> | geekosaur: I think you're packing a lot of heuristics into "short fields", and while its an ok resultant heuristic, its not quite right. |
2022-12-13 00:41:42 +0100 | <davean> | Like you're probably backing that in based on the overall records updated properties and copying, which only applies sometimes. |
2022-12-13 00:42:14 +0100 | <geekosaur> | I was oversimplifying a fairly complicated description, actually |
2022-12-13 00:42:19 +0100 | <davean> | and access time constant factors not being as relivent to large pieces of data which doesn't apply to fixed size O(1) access members |
2022-12-13 00:42:29 +0100 | <geekosaur> | I considered expanding on it but decided it'd just cause confusion |
2022-12-13 00:42:33 +0100 | <davean> | There are a lot of times its good to unpack a very, very large field. |
2022-12-13 00:43:06 +0100 | <geekosaur> | (although tbh I thought packing should simply have been left out of it) |
2022-12-13 00:43:49 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2022-12-13 00:43:56 +0100 | <davean> | Thats possible in this specific case, though it is very relevent generally. |
2022-12-13 00:44:01 +0100 | <davean> | Depends on the point you're making! |
2022-12-13 00:44:29 +0100 | <davean> | Also, I'm going to go back to being angry at JuicyPixels for using unboxed values and thus ruining my performance. |
2022-12-13 00:47:05 +0100 | burnsidesLlama | (~burnsides@119247164140.ctinets.com) |
2022-12-13 00:47:43 +0100 | burnsidesLlama | (~burnsides@119247164140.ctinets.com) (Remote host closed the connection) |
2022-12-13 00:52:15 +0100 | __monty__ | (~toonn@user/toonn) (Quit: leaving) |
2022-12-13 00:54:11 +0100 | fizbin | (~fizbin@user/fizbin) |
2022-12-13 00:54:58 +0100 | <dminuoso> | davean: Curious, how is that ruining your performance? |
2022-12-13 00:57:11 +0100 | motherfsck | (~motherfsc@user/motherfsck) |
2022-12-13 01:00:06 +0100 | jargon | (~jargon@174-22-192-24.phnx.qwest.net) (*.net *.split) |
2022-12-13 01:00:06 +0100 | gwern | (~gwern@user/gwern) (*.net *.split) |
2022-12-13 01:00:06 +0100 | bontaq | (~user@ool-45779fe5.dyn.optonline.net) (*.net *.split) |
2022-12-13 01:00:06 +0100 | AlexZenon | (~alzenon@178.34.161.14) (*.net *.split) |
2022-12-13 01:00:06 +0100 | jonathanx | (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (*.net *.split) |
2022-12-13 01:00:06 +0100 | Maeda | (~Maeda@91-161-10-149.subs.proxad.net) (*.net *.split) |
2022-12-13 01:00:06 +0100 | tomku|two | (~tomku@user/tomku) (*.net *.split) |
2022-12-13 01:00:06 +0100 | hrberg_ | (~quassel@171.79-160-161.customer.lyse.net) (*.net *.split) |
2022-12-13 01:00:06 +0100 | coderpat- | (~coderpath@d66-183-126-83.bchsia.telus.net) (*.net *.split) |
2022-12-13 01:00:06 +0100 | jrm | (~jrm@user/jrm) (*.net *.split) |
2022-12-13 01:00:06 +0100 | pflanze | (~pflanze@159.100.249.232) (*.net *.split) |
2022-12-13 01:00:06 +0100 | tessier | (~treed@98.171.210.130) (*.net *.split) |
2022-12-13 01:00:06 +0100 | brettgilio | (~brettgili@x-irc.gq) (*.net *.split) |
2022-12-13 01:00:06 +0100 | haasn | (~nand@haasn.dev) (*.net *.split) |
2022-12-13 01:00:06 +0100 | mniip | (mniip@libera/staff/mniip) (*.net *.split) |
2022-12-13 01:00:06 +0100 | geekosaur | (~geekosaur@xmonad/geekosaur) (*.net *.split) |
2022-12-13 01:00:06 +0100 | cjay | (cjay@nerdbox.nerd2nerd.org) (*.net *.split) |
2022-12-13 01:00:06 +0100 | ridcully | (~ridcully@p508acd69.dip0.t-ipconnect.de) (*.net *.split) |
2022-12-13 01:00:06 +0100 | cstml_ | (cstml@tilde.club) (*.net *.split) |
2022-12-13 01:00:06 +0100 | bollu | (~bollu@159.65.151.13) (*.net *.split) |
2022-12-13 01:00:06 +0100 | ystael | (~ystael@user/ystael) (*.net *.split) |
2022-12-13 01:00:06 +0100 | texasmynsted | (~texasmyns@99.96.221.112) (*.net *.split) |
2022-12-13 01:00:06 +0100 | crns | (~netcrns@user/crns) (*.net *.split) |
2022-12-13 01:00:06 +0100 | haskl | (~haskl@user/haskl) (*.net *.split) |
2022-12-13 01:00:07 +0100 | reda | (~reda@user/reda) (*.net *.split) |
2022-12-13 01:00:07 +0100 | Hecate | (~mariposa@user/hecate) (*.net *.split) |
2022-12-13 01:00:07 +0100 | koala_man | (~vidar@157.146.251.23.bc.googleusercontent.com) (*.net *.split) |
2022-12-13 01:00:07 +0100 | drlkf | (~drlkf@chat.drlkf.net) (*.net *.split) |
2022-12-13 01:00:07 +0100 | mht-wtf | (~mht@mht.wtf) (*.net *.split) |
2022-12-13 01:00:07 +0100 | sgarcia | (sgarcia@swarm.znchost.com) (*.net *.split) |
2022-12-13 01:00:07 +0100 | bcoppens | (~bartcopp@vpn2.bartcoppens.be) (*.net *.split) |
2022-12-13 01:00:07 +0100 | LambdaDuck | (~anka@ksit.fixme.fi) (*.net *.split) |
2022-12-13 01:00:08 +0100 | markasoftware | (~quassel@107.161.26.124) (*.net *.split) |
2022-12-13 01:00:08 +0100 | kora9 | (~kora@user/Kora9) (*.net *.split) |
2022-12-13 01:00:08 +0100 | orcus | (~orcus@user/brprice) (*.net *.split) |
2022-12-13 01:00:08 +0100 | int-e | (~noone@int-e.eu) (*.net *.split) |
2022-12-13 01:00:08 +0100 | opqdonut | (opqdonut@pseudo.fixme.fi) (*.net *.split) |
2022-12-13 01:00:08 +0100 | Profpatsch | (~Profpatsc@static.88-198-193-255.clients.your-server.de) (*.net *.split) |
2022-12-13 01:00:08 +0100 | mesaoptimizer2 | (apotheosis@user/PapuaHardyNet) (*.net *.split) |
2022-12-13 01:00:08 +0100 | dka | (~code-is-a@ns3059207.ip-193-70-33.eu) (*.net *.split) |
2022-12-13 01:00:08 +0100 | brprice | (~brprice@user/brprice) (*.net *.split) |
2022-12-13 01:00:08 +0100 | dunj3 | (~dunj3@kingdread.de) (*.net *.split) |
2022-12-13 01:00:08 +0100 | djanatyn | (~djanatyn@vps-7f49a6b0.vps.ovh.ca) (*.net *.split) |
2022-12-13 01:00:08 +0100 | hltk | (~hltk@hltk.fi) (*.net *.split) |
2022-12-13 01:00:12 +0100 | opqdonut | (opqdonut@pseudo.fixme.fi) |
2022-12-13 01:00:12 +0100 | LambdaDuck | (~anka@ksit.fixme.fi) |
2022-12-13 01:00:14 +0100 | dka | (~code-is-a@ns3059207.ip-193-70-33.eu) |
2022-12-13 01:00:16 +0100 | hltk | (~hltk@hltk.fi) |
2022-12-13 01:00:16 +0100 | hrberg | (~quassel@171.79-160-161.customer.lyse.net) |
2022-12-13 01:00:17 +0100 | mniip | (mniip@libera/staff/mniip) |
2022-12-13 01:00:18 +0100 | bcoppens | (~bartcopp@vpn2.bartcoppens.be) |
2022-12-13 01:00:19 +0100 | tomku | (~tomku@068-112-105-122.res.spectrum.com) |
2022-12-13 01:00:20 +0100 | bontaq | (~user@ool-45779fe5.dyn.optonline.net) |
2022-12-13 01:00:21 +0100 | crns | (~netcrns@p4ff5e521.dip0.t-ipconnect.de) |
2022-12-13 01:00:21 +0100 | ridcully | (~ridcully@p508acd69.dip0.t-ipconnect.de) |
2022-12-13 01:00:21 +0100 | AlexZenon | (~alzenon@178.34.161.14) |
2022-12-13 01:00:21 +0100 | coderpath | (~coderpath@d66-183-126-83.bchsia.telus.net) |
2022-12-13 01:00:22 +0100 | int-e | (~noone@int-e.eu) |
2022-12-13 01:00:22 +0100 | Hecate | (~mariposa@user/hecate) |
2022-12-13 01:00:22 +0100 | marienz | (~marienz@libera/staff/marienz) |
2022-12-13 01:00:23 +0100 | tessier | (~treed@98.171.210.130) |
2022-12-13 01:00:25 +0100 | cstml_ | (cstml@tilde.club) |
2022-12-13 01:00:25 +0100 | tomku | (~tomku@068-112-105-122.res.spectrum.com) (Changing host) |
2022-12-13 01:00:25 +0100 | tomku | (~tomku@user/tomku) |
2022-12-13 01:00:26 +0100 | texasmynsted | (~texasmyns@99.96.221.112) |
2022-12-13 01:00:26 +0100 | jonathanx | (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) |
2022-12-13 01:00:36 +0100 | mestre | (~mestre@191.177.185.178) (Quit: Lost terminal) |
2022-12-13 01:00:42 +0100 | Profpatsch | (~Profpatsc@static.88-198-193-255.clients.your-server.de) |
2022-12-13 01:00:43 +0100 | jrm | (~jrm@user/jrm) |
2022-12-13 01:00:45 +0100 | tolt | (~weechat-h@li219-154.members.linode.com) |
2022-12-13 01:00:52 +0100 | crns | (~netcrns@p4ff5e521.dip0.t-ipconnect.de) (Changing host) |
2022-12-13 01:00:52 +0100 | crns | (~netcrns@user/crns) |
2022-12-13 01:01:15 +0100 | sgarcia | (sgarcia@swarm.znchost.com) |
2022-12-13 01:01:16 +0100 | djanatyn | (~djanatyn@vps-7f49a6b0.vps.ovh.ca) |
2022-12-13 01:01:45 +0100 | dunj3 | (~dunj3@kingdread.de) |
2022-12-13 01:01:54 +0100 | pflanze | (~pflanze@159.100.249.232) |
2022-12-13 01:02:03 +0100 | geekosaur | (~geekosaur@xmonad/geekosaur) |
2022-12-13 01:02:14 +0100 | jargon | (~jargon@174-22-192-24.phnx.qwest.net) |
2022-12-13 01:02:16 +0100 | markasoftware | (~quassel@107.161.26.124) |
2022-12-13 01:02:19 +0100 | haskl | (~haskl@user/haskl) |
2022-12-13 01:02:20 +0100 | mht-wtf | (~mht@2a03:b0c0:3:e0::1e2:c001) |
2022-12-13 01:02:23 +0100 | orcus | (~orcus@user/brprice) |
2022-12-13 01:02:40 +0100 | brprice | (~brprice@user/brprice) |
2022-12-13 01:02:40 +0100 | biberu\ | (~biberu@user/biberu) |
2022-12-13 01:02:47 +0100 | haasn | (~nand@haasn.dev) |
2022-12-13 01:02:53 +0100 | burnsidesLlama | (~burnsides@210006168186.ctinets.com) |
2022-12-13 01:03:05 +0100 | bollu | (~bollu@159.65.151.13) |
2022-12-13 01:03:17 +0100 | stef204 | (~stef204@user/stef204) |
2022-12-13 01:03:52 +0100 | drlkf | (~drlkf@chat.drlkf.net) |
2022-12-13 01:04:01 +0100 | kora9 | (~kora@user/Kora9) |
2022-12-13 01:05:15 +0100 | koala_man | (~vidar@157.146.251.23.bc.googleusercontent.com) |
2022-12-13 01:05:16 +0100 | cjay | (cjay@nerdbox.nerd2nerd.org) |
2022-12-13 01:05:24 +0100 | Maeda | (~Maeda@91-161-10-149.subs.proxad.net) |
2022-12-13 01:05:24 +0100 | reda | (~reda@user/reda) |
2022-12-13 01:05:29 +0100 | ystael | (~ystael@user/ystael) |
2022-12-13 01:05:33 +0100 | biberu | (~biberu@user/biberu) (Ping timeout: 268 seconds) |
2022-12-13 01:05:34 +0100 | gwern | (~gwern@user/gwern) |
2022-12-13 01:05:34 +0100 | biberu\ | biberu |
2022-12-13 01:05:44 +0100 | burnsidesLlama | (~burnsides@210006168186.ctinets.com) (Remote host closed the connection) |
2022-12-13 01:06:21 +0100 | burnsidesLlama | (~burnsides@210006168186.ctinets.com) |
2022-12-13 01:10:20 +0100 | <intelligent_boat> | hm. still learning new things about how to think about performance in Haskell. let's say I have: let s = "5", let op = (* (read s)), map op [1, 2, 3, 4]. I was actually wondering whether it would try to parse the string multiple times, which would seem to me like unnecessary work |
2022-12-13 01:10:56 +0100 | <intelligent_boat> | but, if I change that to let op = (* (trace "read it" $ read s)), "read it" was only printed once, so it suggests the read was only done once (I hope) |
2022-12-13 01:11:43 +0100 | <intelligent_boat> | how do I know these things in advance so I don't have to wonder "is this thing going to be performed multiple times or just once" ? |
2022-12-13 01:12:00 +0100 | <dsal> | On one level, thinking about performance in haskell is like thinking about performance in any other language. "Is my program fast enough? If yes, great. If not, measure it and see what part's slow." |
2022-12-13 01:12:24 +0100 | <dsal> | It's not impossible for trace to mislead you. |
2022-12-13 01:12:38 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-12-13 01:12:47 +0100 | <dsal> | But if you really want to know, compile to core and see what happens to your code after rules and optimizer passes. |
2022-12-13 01:13:32 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds) |
2022-12-13 01:16:15 +0100 | jargon | (~jargon@174-22-192-24.phnx.qwest.net) (Ping timeout: 260 seconds) |
2022-12-13 01:17:56 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) |
2022-12-13 01:19:42 +0100 | <dminuoso> | intelligent_boat: As a very rough guideline, if you put it onto a let binding, there's a fair chance it will be shared. |
2022-12-13 01:20:20 +0100 | <dminuoso> | But if GHC determines it to be very cheap/small, it will inline it regardless |
2022-12-13 01:20:34 +0100 | <dminuoso> | We do have pragmas like NOINLINE to prevent that, however. |
2022-12-13 01:21:28 +0100 | waleee | (~waleee@h-176-10-137-138.NA.cust.bahnhof.se) (Ping timeout: 256 seconds) |
2022-12-13 01:23:28 +0100 | <dsal> | I did something like the above and it spat out this: https://www.irccloud.com/pastebin/z95TStPM/coredump.txt |
2022-12-13 01:24:06 +0100 | lisbeths | (uid135845@id-135845.lymington.irccloud.com) |
2022-12-13 01:24:52 +0100 | <dminuoso> | monomorphism restriction to the rescue. |
2022-12-13 01:25:10 +0100 | <dsal> | That's happening inside the map, though… |
2022-12-13 01:25:18 +0100 | <dminuoso> | oh hah |
2022-12-13 01:25:26 +0100 | <dminuoso> | You're right |
2022-12-13 01:26:00 +0100 | <dminuoso> | Im not entirely sure why it was floated inwards |
2022-12-13 01:26:04 +0100 | waleee | (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
2022-12-13 01:26:49 +0100 | <geekosaur> | what -O level? |
2022-12-13 01:28:16 +0100 | acidjnk | (~acidjnk@p200300d6e7137a279cde44451dfff9db.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
2022-12-13 01:28:20 +0100 | <dsal> | I guess it didn't pick that up in my ghci venture. Otherwise, with -O2 it blows it all over the place. |
2022-12-13 01:28:40 +0100 | <dsal> | https://www.irccloud.com/pastebin/euO9O1VL/ohtwo.hs |
2022-12-13 01:29:12 +0100 | Tuplanolla | (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) (Quit: Leaving.) |
2022-12-13 01:30:03 +0100 | <dminuoso> | intelligent_boat: Also note that doing these attempts in ghci can be misleading due to MMR and optimization levels. |
2022-12-13 01:30:40 +0100 | <dsal> | Man, this core thing is worse at naming stuff than I am. |
2022-12-13 01:30:41 +0100 | <intelligent_boat> | dang. yup I did that exerpiment in GHC |
2022-12-13 01:31:10 +0100 | <geekosaur> | ghci usually disables optimization |
2022-12-13 01:31:39 +0100 | <geekosaur> | for a long time one of the non-disableable optimizations was unboxing tuples, which caused ghci to crash |
2022-12-13 01:35:38 +0100 | fizbin | (~fizbin@user/fizbin) (Ping timeout: 256 seconds) |
2022-12-13 01:36:00 +0100 | <dminuoso> | Mmm, even for lists of unknown size this will float the read in. |
2022-12-13 01:37:21 +0100 | <dminuoso> | Ah it may be just with optimizations turned off |
2022-12-13 01:39:33 +0100 | <dsal> | Yeah, the large one is -O2. `ints5 :: Int` does the read. |
2022-12-13 01:40:47 +0100 | azimut_ | (~azimut@gateway/tor-sasl/azimut) (Quit: ZNC - https://znc.in) |
2022-12-13 01:41:14 +0100 | <dsal> | But I stand by my first statement. Is it fast enough? If not, measure. |
2022-12-13 01:41:20 +0100 | <dsal> | Real code wouldn't have a `read` in it anyway. :) |
2022-12-13 01:41:35 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-12-13 01:42:39 +0100 | <dsal> | Haskell has all kinds of weird things that sounds like "how long is a string?" |
2022-12-13 01:43:02 +0100 | <dsal> | How long does it take to compute the length of a list of 2^31 elements? Depends on whether you want to know the length or not. |
2022-12-13 01:44:50 +0100 | <dsal> | > asum [Just 3, Just (length (replicate (2^31) 'a'))] |
2022-12-13 01:44:52 +0100 | <lambdabot> | Just 3 |
2022-12-13 01:46:03 +0100 | <dsal> | One of my AoC solutions from a year or two ago finished in nanoseconds. (compilation was a bit slower on that one) |
2022-12-13 01:46:14 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 260 seconds) |
2022-12-13 01:49:45 +0100 | [itchyjunk] | (~itchyjunk@user/itchyjunk/x-7353470) |
2022-12-13 01:49:48 +0100 | gurkenglas | (~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
2022-12-13 01:53:43 +0100 | fizbin | (~fizbin@user/fizbin) |
2022-12-13 02:03:10 +0100 | Lycurgus | (~juan@user/Lycurgus) |
2022-12-13 02:07:14 +0100 | bontaq | (~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 260 seconds) |
2022-12-13 02:07:56 +0100 | sadmax | (~user@209.205.174.253) (Ping timeout: 256 seconds) |
2022-12-13 02:08:31 +0100 | mikoto-chan | (~mikoto-ch@2001:999:700:6f41:84a3:b322:d26d:702e) |
2022-12-13 02:13:04 +0100 | troydm | (~troydm@host-176-37-124-197.b025.la.net.ua) |
2022-12-13 02:15:28 +0100 | mvk | (~mvk@2607:fea8:5ce3:8500::efb) |
2022-12-13 02:18:11 +0100 | xff0x_ | (~xff0x@ai071162.d.east.v6connect.net) (Ping timeout: 246 seconds) |
2022-12-13 02:18:29 +0100 | Lycurgus | (~juan@user/Lycurgus) (Quit: Exeunt: personae.ai-integration.biz) |
2022-12-13 02:26:56 +0100 | Unicorn_Princess | (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Quit: Leaving) |
2022-12-13 02:30:26 +0100 | ddellacosta | (~ddellacos@143.244.47.89) |
2022-12-13 02:35:44 +0100 | ddellacosta | (~ddellacos@143.244.47.89) (Ping timeout: 246 seconds) |
2022-12-13 02:37:34 +0100 | WarzoneCommand | (~Frank@77-162-168-71.fixed.kpn.net) |
2022-12-13 02:37:54 +0100 | son0p | (~ff@2604:3d08:5b7f:5540::4026) |
2022-12-13 02:40:30 +0100 | wroathe | (~wroathe@207-153-38-140.fttp.usinternet.com) |
2022-12-13 02:40:30 +0100 | wroathe | (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
2022-12-13 02:40:30 +0100 | wroathe | (~wroathe@user/wroathe) |
2022-12-13 02:42:20 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-12-13 02:42:30 +0100 | Kaiepi | (~Kaiepi@108.175.84.104) (Ping timeout: 256 seconds) |
2022-12-13 02:44:01 +0100 | ddellacosta | (~ddellacos@89.45.224.168) |
2022-12-13 02:54:44 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:a84a:2d35:f948:fe07) |
2022-12-13 02:57:11 +0100 | brettgilio | (~brettgili@x-irc.gq) |
2022-12-13 02:58:44 +0100 | ddellacosta | (~ddellacos@89.45.224.168) (Ping timeout: 265 seconds) |
2022-12-13 02:59:07 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:a84a:2d35:f948:fe07) (Ping timeout: 248 seconds) |
2022-12-13 03:01:40 +0100 | xff0x_ | (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) |
2022-12-13 03:05:48 +0100 | tvandinther | (~tvandinth@111.69.34.210) (Ping timeout: 260 seconds) |
2022-12-13 03:07:50 +0100 | motherfsck | (~motherfsc@user/motherfsck) (Quit: quit) |
2022-12-13 03:11:58 +0100 | wroathe | (~wroathe@user/wroathe) (Ping timeout: 268 seconds) |
2022-12-13 03:14:38 +0100 | <EvanR> | dsal's flowchart: 10 is it fast enough? No -> optimize it >> goto 10; Yes -> no it isn't >> goto to |
2022-12-13 03:14:50 +0100 | <EvanR> | 10 |
2022-12-13 03:16:59 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 264 seconds) |
2022-12-13 03:20:39 +0100 | ddellacosta | (~ddellacos@89.45.224.51) |
2022-12-13 03:22:38 +0100 | king_gs1 | (~Thunderbi@187.201.150.200) |
2022-12-13 03:24:55 +0100 | king_gs1 | king_gs |
2022-12-13 03:27:35 +0100 | motherfsck | (~motherfsc@user/motherfsck) |
2022-12-13 03:28:40 +0100 | <jackdk> | optimises to 10: optimise it; 20: goto 10 |
2022-12-13 03:28:54 +0100 | jao | (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 260 seconds) |
2022-12-13 03:29:30 +0100 | burnsidesLlama | (~burnsides@210006168186.ctinets.com) (Remote host closed the connection) |
2022-12-13 03:29:48 +0100 | <EvanR> | fix optimize |
2022-12-13 03:30:38 +0100 | dsrt^ | (~dsrt@76.145.185.103) |
2022-12-13 03:30:40 +0100 | burnsidesLlama | (~burnsides@210006168186.ctinets.com) |
2022-12-13 03:32:18 +0100 | <jackdk> | `fix error` results in a program that never returns an incorrect value :-) |
2022-12-13 03:35:59 +0100 | lisbeths | (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
2022-12-13 03:39:20 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
2022-12-13 03:40:14 +0100 | califax | (~califax@user/califx) (Ping timeout: 255 seconds) |
2022-12-13 03:40:19 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-12-13 03:40:50 +0100 | mvk | (~mvk@2607:fea8:5ce3:8500::efb) (Quit: Going elsewhere) |
2022-12-13 03:48:26 +0100 | califax | (~califax@user/califx) |
2022-12-13 03:52:21 +0100 | <dsal> | If it's good enough, I try to do something more complicated. |
2022-12-13 03:54:29 +0100 | incertia | (~incertia@209.122.71.127) (Ping timeout: 246 seconds) |
2022-12-13 03:54:52 +0100 | burnsidesLlama | (~burnsides@210006168186.ctinets.com) (Remote host closed the connection) |
2022-12-13 03:55:34 +0100 | incertia | (~incertia@209.122.71.127) |
2022-12-13 03:56:05 +0100 | foul_owl | (~kerry@193.29.61.77) (Ping timeout: 260 seconds) |
2022-12-13 03:56:21 +0100 | burnsidesLlama | (~burnsides@210006168186.ctinets.com) |
2022-12-13 03:57:42 +0100 | razetime | (~quassel@49.207.203.213) |
2022-12-13 04:01:00 +0100 | king_gs1 | (~Thunderbi@2806:103e:29:cdd2:b2dd:cddc:5884:d05c) |
2022-12-13 04:01:15 +0100 | king_gs | (~Thunderbi@187.201.150.200) (Read error: Connection reset by peer) |
2022-12-13 04:01:16 +0100 | king_gs1 | king_gs |
2022-12-13 04:07:32 +0100 | ddellacosta | (~ddellacos@89.45.224.51) (Ping timeout: 272 seconds) |
2022-12-13 04:08:58 +0100 | ddellacosta | (~ddellacos@143.244.47.75) |
2022-12-13 04:09:14 +0100 | burnsidesLlama | (~burnsides@210006168186.ctinets.com) (Remote host closed the connection) |
2022-12-13 04:10:23 +0100 | ensyde | (~ensyde@2600:1700:2050:1040:e518:6f99:8537:355c) |
2022-12-13 04:10:34 +0100 | burnsidesLlama | (~burnsides@210006168186.ctinets.com) |
2022-12-13 04:10:45 +0100 | foul_owl | (~kerry@193.29.61.234) |
2022-12-13 04:12:53 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-12-13 04:14:18 +0100 | instantaphex | (~jb@c-73-171-252-84.hsd1.fl.comcast.net) |
2022-12-13 04:19:58 +0100 | JordiGH | (~jordi@user/jordigh) (Ping timeout: 256 seconds) |
2022-12-13 04:23:31 +0100 | [itchyjunk] | (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection) |
2022-12-13 04:26:57 +0100 | king_gs | (~Thunderbi@2806:103e:29:cdd2:b2dd:cddc:5884:d05c) (Quit: king_gs) |
2022-12-13 04:35:05 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:a84a:2d35:f948:fe07) |
2022-12-13 04:39:16 +0100 | td_ | (~td@83.135.9.32) (Ping timeout: 265 seconds) |
2022-12-13 04:39:50 +0100 | ddellacosta | (~ddellacos@143.244.47.75) (Ping timeout: 272 seconds) |
2022-12-13 04:41:04 +0100 | td_ | (~td@83.135.9.49) |
2022-12-13 04:47:33 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 268 seconds) |
2022-12-13 04:48:11 +0100 | ec | (~ec@gateway/tor-sasl/ec) (Ping timeout: 255 seconds) |
2022-12-13 04:48:12 +0100 | ec_ | (~ec@gateway/tor-sasl/ec) |
2022-12-13 04:49:11 +0100 | burnsidesLlama | (~burnsides@210006168186.ctinets.com) (Remote host closed the connection) |
2022-12-13 05:00:46 +0100 | stef204 | (~stef204@user/stef204) (Ping timeout: 256 seconds) |
2022-12-13 05:03:36 +0100 | mncheckm | (~mncheck@193.224.205.254) (Ping timeout: 256 seconds) |
2022-12-13 05:06:38 +0100 | ec_ | (~ec@gateway/tor-sasl/ec) (Ping timeout: 255 seconds) |
2022-12-13 05:08:09 +0100 | ec_ | (~ec@gateway/tor-sasl/ec) |
2022-12-13 05:08:25 +0100 | Erutuon_ | (~Erutuon@user/erutuon) (Ping timeout: 260 seconds) |
2022-12-13 05:12:25 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-12-13 05:17:02 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 246 seconds) |
2022-12-13 05:18:52 +0100 | img | (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in) |
2022-12-13 05:19:09 +0100 | img | (~img@user/img) |
2022-12-13 05:19:54 +0100 | burnsidesLlama | (~burnsides@119247164140.ctinets.com) |
2022-12-13 05:20:49 +0100 | money | polo |
2022-12-13 05:25:11 +0100 | polo | money |
2022-12-13 05:29:14 +0100 | mbuf | (~Shakthi@49.204.142.15) |
2022-12-13 05:32:13 +0100 | mikoto-chan | (~mikoto-ch@2001:999:700:6f41:84a3:b322:d26d:702e) (Quit: WeeChat 3.6) |
2022-12-13 05:34:27 +0100 | Kaiepi | (~Kaiepi@108.175.84.104) |
2022-12-13 05:35:55 +0100 | <iqubic> | :t (>>=) (>>=) |
2022-12-13 05:35:55 +0100 | <lambdabot> | Monad m => (((a -> m b1) -> m b1) -> m a -> b2) -> m a -> b2 |
2022-12-13 05:36:02 +0100 | <iqubic> | What?!?!?! |
2022-12-13 05:39:50 +0100 | <c_wraith> | > (+1) >>= (*) $ 4 |
2022-12-13 05:39:52 +0100 | <lambdabot> | 20 |
2022-12-13 05:40:02 +0100 | <int-e> | Yeah any (a ->) b is a monadic value. |
2022-12-13 05:44:28 +0100 | <c_wraith> | :t (>>=) `asAppliedTo` (>>=) |
2022-12-13 05:44:29 +0100 | <lambdabot> | Monad m => (m a -> (a -> m b1) -> m b1) -> (((a -> m b1) -> m b1) -> m a -> b2) -> m a -> b2 |
2022-12-13 05:44:47 +0100 | <c_wraith> | that's pretty awful. |
2022-12-13 05:45:46 +0100 | <int-e> | :t (>>=) |
2022-12-13 05:45:47 +0100 | <lambdabot> | Monad m => m a -> (a -> m b) -> m b |
2022-12-13 05:46:00 +0100 | <int-e> | (that's not a small type at all) |
2022-12-13 05:46:24 +0100 | <xerox> | :t (=<<) (>>=) |
2022-12-13 05:46:25 +0100 | <lambdabot> | Monad m => ((a -> m b) -> m a) -> (a -> m b) -> m b |
2022-12-13 05:47:03 +0100 | <xerox> | :t (=<<) (=<<) (=<<) |
2022-12-13 05:47:04 +0100 | <lambdabot> | (a -> a -> a) -> a -> a |
2022-12-13 05:47:31 +0100 | <int-e> | > (=<<) (=<<) (=<<) (+) 3 |
2022-12-13 05:47:32 +0100 | <lambdabot> | 9 |
2022-12-13 05:47:42 +0100 | <int-e> | > (=<<) (=<<) (=<<) (-) 3 |
2022-12-13 05:47:43 +0100 | <lambdabot> | -3 |
2022-12-13 05:48:10 +0100 | <xerox> | (: |
2022-12-13 05:49:21 +0100 | <int-e> | negate = (=<<) (=<<) (=<<) (-) -- don't use for floating point numbers |
2022-12-13 05:49:38 +0100 | <xerox> | haha |
2022-12-13 05:50:26 +0100 | <int-e> | This about as sane as the xor-swap trick is in C. |
2022-12-13 05:51:30 +0100 | <EvanR> | in most dynamic languages you can do anything, but using a function on itself probably results in nonsense. |
2022-12-13 05:51:52 +0100 | <EvanR> | in haskell the type system usually stops you from doing anything, but using a function on itself probably works |
2022-12-13 05:52:30 +0100 | <EvanR> | *with different specializations |
2022-12-13 05:52:58 +0100 | <int-e> | :t foldl foldl |
2022-12-13 05:52:59 +0100 | <lambdabot> | error: |
2022-12-13 05:53:00 +0100 | <lambdabot> | • Occurs check: cannot construct the infinite type: a ~ a -> a |
2022-12-13 05:53:00 +0100 | <lambdabot> | Expected type: ((a -> a) -> a -> a) |
2022-12-13 05:53:18 +0100 | <EvanR> | :t (+) (+) |
2022-12-13 05:53:18 +0100 | <int-e> | (it often doesn't work, even for polymorphic functions) |
2022-12-13 05:53:19 +0100 | <lambdabot> | (Num a, Num (a -> a -> a)) => (a -> a -> a) -> a -> a -> a |
2022-12-13 05:53:36 +0100 | <int-e> | :t fmap fmap fmap fmap fmap fmap fmap fmap |
2022-12-13 05:53:37 +0100 | <lambdabot> | (Functor f1, Functor f2, Functor f3) => (a -> b) -> f1 (f2 (f3 a)) -> f1 (f2 (f3 b)) |
2022-12-13 05:54:04 +0100 | <int-e> | (this runs into a cycle if you keep adding more `fmap`s) |
2022-12-13 05:54:18 +0100 | <int-e> | (don't ask me how I know, I was bored) |
2022-12-13 05:54:54 +0100 | andreas303 | (andreas303@ip227.orange.bnc4free.com) (Quit: fBNC - https://bnc4free.com) |
2022-12-13 05:54:55 +0100 | xacktm | (~xacktm@user/xacktm) (Quit: fBNC - https://bnc4free.com) |
2022-12-13 05:55:56 +0100 | <EvanR> | wait... |
2022-12-13 05:56:04 +0100 | <EvanR> | a cycle always with three functors? |
2022-12-13 05:56:41 +0100 | lisbeths | (uid135845@id-135845.lymington.irccloud.com) |
2022-12-13 05:57:14 +0100 | <int-e> | > fmap fmap fmap (+) (*) 1 2 x |
2022-12-13 05:57:15 +0100 | <lambdabot> | 1 * 2 + x |
2022-12-13 05:58:03 +0100 | <int-e> | EvanR: I mean you have fmap^k = fmap^l for some natural k < l. I forgot the numbers. |
2022-12-13 05:59:23 +0100 | <int-e> | (one thing that happens is that the functors get force-instantiated as (a ->) for various a) |
2022-12-13 05:59:40 +0100 | <int-e> | (but that doesn't explain why the type remains small-ish... it could grow forever) |
2022-12-13 06:01:43 +0100 | waleee | (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 260 seconds) |
2022-12-13 06:02:27 +0100 | burnsidesLlama | (~burnsides@119247164140.ctinets.com) (Remote host closed the connection) |
2022-12-13 06:02:40 +0100 | burnsidesLlama | (~burnsides@119247164140.ctinets.com) |
2022-12-13 06:02:47 +0100 | burnsidesLlama | (~burnsides@119247164140.ctinets.com) (Remote host closed the connection) |
2022-12-13 06:02:48 +0100 | <EvanR> | right |
2022-12-13 06:09:11 +0100 | freeside | (~mengwong@pd907d273.dip0.t-ipconnect.de) |
2022-12-13 06:14:51 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-12-13 06:21:49 +0100 | shriekingnoise | (~shrieking@186.137.167.202) (Quit: Quit) |
2022-12-13 06:23:29 +0100 | chomwitt | (~chomwitt@2a02:587:7a0d:e800:1ac0:4dff:fedb:a3f1) |
2022-12-13 06:24:18 +0100 | RemiYuko | AkechiShiro |
2022-12-13 06:27:49 +0100 | xacktm | (~xacktm@user/xacktm) |
2022-12-13 06:30:50 +0100 | <iqubic> | Is there a good way to write a parser "tryOr :: Parser a -> a -> Parser a" with the semantics that if the first parser fails then the whole thing succeeds with the given default value? |
2022-12-13 06:32:35 +0100 | <geekosaur> | `tryOr p def = try p <|> pure def` ? (`try` depends on which parser lib) |
2022-12-13 06:33:24 +0100 | <iqubic> | Yeah... that should work. |
2022-12-13 06:33:30 +0100 | <iqubic> | It's megaparsec |
2022-12-13 06:33:35 +0100 | <int-e> | but this kind of alternative is a basic building block of any parsing library |
2022-12-13 06:35:10 +0100 | sudden | (~cat@user/sudden) (Ping timeout: 252 seconds) |
2022-12-13 06:37:01 +0100 | <iqubic> | Is it? I can't seem to find a default thing for it in megaparsec |
2022-12-13 06:39:33 +0100 | <int-e> | I mean <|>... `tryOr p def = try p <|> pure def` doesn't pass the https://wiki.haskell.org/Fairbairn_threshold to my mind |
2022-12-13 06:39:37 +0100 | <geekosaur> | optional is from Control.Applicative, megaparsec reuses it |
2022-12-13 06:39:59 +0100 | <int-e> | :t Control.Applicative.optional |
2022-12-13 06:40:00 +0100 | <lambdabot> | Alternative f => f a -> f (Maybe a) |
2022-12-13 06:40:14 +0100 | <geekosaur> | this is a downside of the refactoring, you have to look in 3 or 4 places for things now |
2022-12-13 06:40:35 +0100 | Vajb | (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) |
2022-12-13 06:41:17 +0100 | <c_wraith> | also, all those things that were exported to parser-combinators... |
2022-12-13 06:41:49 +0100 | <geekosaur> | right that was one of the other places I was referring to |
2022-12-13 06:42:34 +0100 | andreas303 | (andreas303@ip227.orange.bnc4free.com) |
2022-12-13 06:45:12 +0100 | Vajb | (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) (Read error: Connection reset by peer) |
2022-12-13 06:46:07 +0100 | Vajb | (~Vajb@2001:999:504:3ad6:52a4:a3b5:32d8:e74d) |
2022-12-13 06:47:18 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 256 seconds) |
2022-12-13 06:50:42 +0100 | Vajb | (~Vajb@2001:999:504:3ad6:52a4:a3b5:32d8:e74d) (Ping timeout: 256 seconds) |
2022-12-13 06:51:53 +0100 | use-value | (~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf) (Remote host closed the connection) |
2022-12-13 06:52:11 +0100 | use-value | (~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf) |
2022-12-13 06:53:53 +0100 | Lycurgus | (~juan@user/Lycurgus) |
2022-12-13 07:01:59 +0100 | instantaphex | (~jb@c-73-171-252-84.hsd1.fl.comcast.net) (Ping timeout: 268 seconds) |
2022-12-13 07:03:47 +0100 | machinedgod | (~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 264 seconds) |
2022-12-13 07:08:40 +0100 | freeside | (~mengwong@pd907d273.dip0.t-ipconnect.de) (Ping timeout: 272 seconds) |
2022-12-13 07:14:45 +0100 | takuan | (~takuan@178-116-218-225.access.telenet.be) |
2022-12-13 07:15:21 +0100 | jakalx | (~jakalx@base.jakalx.net) () |
2022-12-13 07:18:06 +0100 | bahamas | (~lucian@86.127.154.189) |
2022-12-13 07:18:30 +0100 | bahamas | elbear |
2022-12-13 07:20:49 +0100 | elbear | (~lucian@86.127.154.189) (Client Quit) |
2022-12-13 07:24:29 +0100 | elbear | (~lucian@86.127.154.189) |
2022-12-13 07:26:31 +0100 | burnsidesLlama | (~burnsides@119247164140.ctinets.com) |
2022-12-13 07:27:02 +0100 | Lycurgus | (~juan@user/Lycurgus) (Quit: Exeunt: personae.ai-integration.biz) |
2022-12-13 07:28:31 +0100 | thegeekinside | (~thegeekin@189.217.82.244) (Read error: Connection reset by peer) |
2022-12-13 07:29:33 +0100 | burnsidesLlama | (~burnsides@119247164140.ctinets.com) (Client Quit) |
2022-12-13 07:30:34 +0100 | burnsidesLlama | (~burnsides@119247164140.ctinets.com) |
2022-12-13 07:33:16 +0100 | kenran | (~user@user/kenran) |
2022-12-13 07:33:23 +0100 | kenran | (~user@user/kenran) (Remote host closed the connection) |
2022-12-13 07:33:37 +0100 | elbear | (~lucian@86.127.154.189) (Quit: leaving) |
2022-12-13 07:35:35 +0100 | Xeroine | (~Xeroine@user/xeroine) (Ping timeout: 264 seconds) |
2022-12-13 07:37:31 +0100 | <DigitalKiwi> | my paste client used to fit in one file and i could run it with nix-shell/cabal shebangs but then i refactored it into lots of files and that doesn't work anymore sad day |
2022-12-13 07:38:09 +0100 | <DigitalKiwi> | https://gist.github.com/Kiwi/92415b46d58bfce34f7773944b6dcc67 |
2022-12-13 07:38:44 +0100 | <DigitalKiwi> | https://github.com/Kiwi/absurd-paste-client |
2022-12-13 07:39:02 +0100 | <DigitalKiwi> | it also got more features etc. lol but still |
2022-12-13 07:39:28 +0100 | Xeroine | (~Xeroine@user/xeroine) |
2022-12-13 07:42:06 +0100 | freeside | (~mengwong@217.7.210.115) |
2022-12-13 07:44:18 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-12-13 07:44:58 +0100 | jakalx | (~jakalx@base.jakalx.net) |
2022-12-13 07:49:07 +0100 | bgs | (~bgs@212-85-160-171.dynamic.telemach.net) |
2022-12-13 07:49:57 +0100 | burnsidesLlama | (~burnsides@119247164140.ctinets.com) () |
2022-12-13 07:57:00 +0100 | Xeroine | (~Xeroine@user/xeroine) (Ping timeout: 256 seconds) |
2022-12-13 07:59:55 +0100 | Xeroine | (~Xeroine@user/xeroine) |
2022-12-13 08:01:59 +0100 | nut | (~nut@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) |
2022-12-13 08:02:07 +0100 | coot | (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
2022-12-13 08:16:26 +0100 | freeside | (~mengwong@217.7.210.115) (Ping timeout: 272 seconds) |
2022-12-13 08:17:47 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 256 seconds) |
2022-12-13 08:21:30 +0100 | Xeroine | (~Xeroine@user/xeroine) (Ping timeout: 272 seconds) |
2022-12-13 08:23:01 +0100 | Xeroine | (~Xeroine@user/xeroine) |
2022-12-13 08:23:36 +0100 | bgs | (~bgs@212-85-160-171.dynamic.telemach.net) (Remote host closed the connection) |
2022-12-13 08:31:31 +0100 | chomwitt | (~chomwitt@2a02:587:7a0d:e800:1ac0:4dff:fedb:a3f1) (Ping timeout: 252 seconds) |
2022-12-13 08:35:22 +0100 | goober | (~goober@90-231-13-185-no3430.tbcn.telia.com) |
2022-12-13 08:40:11 +0100 | jakalx | (~jakalx@base.jakalx.net) () |
2022-12-13 08:44:27 +0100 | <iqubic> | What sorting algorithm does Data.List.Sort use? |
2022-12-13 08:44:50 +0100 | trev | (~trev@user/trev) |
2022-12-13 08:45:01 +0100 | jakalx | (~jakalx@base.jakalx.net) |
2022-12-13 08:46:10 +0100 | Xeroine | (~Xeroine@user/xeroine) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in) |
2022-12-13 08:46:54 +0100 | <iqubic> | Looks like it uses a mergesort. |
2022-12-13 08:47:00 +0100 | Xeroine | (~Xeroine@user/xeroine) |
2022-12-13 08:48:56 +0100 | ec_ | (~ec@gateway/tor-sasl/ec) (Ping timeout: 255 seconds) |
2022-12-13 08:49:26 +0100 | <DigitalKiwi> | surely it would use the 4 line quicksort |
2022-12-13 08:49:57 +0100 | ec_ | (~ec@gateway/tor-sasl/ec) |
2022-12-13 08:55:58 +0100 | Lycurgus | (~juan@user/Lycurgus) |
2022-12-13 08:56:27 +0100 | michalz | (~michalz@185.246.204.65) |
2022-12-13 09:05:05 +0100 | MajorBiscuit | (~MajorBisc@217-63-245-103.cable.dynamic.v4.ziggo.nl) |
2022-12-13 09:05:18 +0100 | freeside | (~mengwong@pd907d273.dip0.t-ipconnect.de) |
2022-12-13 09:09:06 +0100 | ec_ | (~ec@gateway/tor-sasl/ec) (Remote host closed the connection) |
2022-12-13 09:09:19 +0100 | mmhat | (~mmh@p200300f1c7390125ee086bfffe095315.dip0.t-ipconnect.de) |
2022-12-13 09:09:44 +0100 | ec_ | (~ec@gateway/tor-sasl/ec) |
2022-12-13 09:10:12 +0100 | Lycurgus | (~juan@user/Lycurgus) (Quit: Exeunt: personae.ai-integration.biz) |
2022-12-13 09:14:03 +0100 | <EvanR> | @src sort |
2022-12-13 09:14:03 +0100 | <lambdabot> | sort = sortBy compare |
2022-12-13 09:14:10 +0100 | <EvanR> | *nod* |
2022-12-13 09:14:17 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-12-13 09:19:46 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 272 seconds) |
2022-12-13 09:20:22 +0100 | anpad | (~pandeyan@user/anpad) (Quit: ZNC 1.8.2 - https://znc.in) |
2022-12-13 09:20:47 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2022-12-13 09:21:28 +0100 | <DigitalKiwi> | nice |
2022-12-13 09:22:22 +0100 | anpad | (~pandeyan@user/anpad) |
2022-12-13 09:23:01 +0100 | ft | (~ft@p4fc2a257.dip0.t-ipconnect.de) (Quit: leaving) |
2022-12-13 09:24:43 +0100 | gurkenglas | (~gurkengla@p548ac72e.dip0.t-ipconnect.de) |
2022-12-13 09:29:24 +0100 | kaol | (~kaol@94-237-42-30.nl-ams1.upcloud.host) (Ping timeout: 260 seconds) |
2022-12-13 09:29:58 +0100 | oldsk00l | (~znc@ec2-3-10-59-201.eu-west-2.compute.amazonaws.com) |
2022-12-13 09:33:22 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-12-13 09:35:59 +0100 | kaol | (~kaol@94-237-42-30.nl-ams1.upcloud.host) |
2022-12-13 09:36:13 +0100 | lortabac | (~lortabac@2a01:e0a:541:b8f0:47dd:78b3:3134:94a) |
2022-12-13 09:36:37 +0100 | cfricke | (~cfricke@user/cfricke) |
2022-12-13 09:39:28 +0100 | acidjnk | (~acidjnk@p200300d6e7137a279cde44451dfff9db.dip0.t-ipconnect.de) |
2022-12-13 09:39:30 +0100 | nschoe | (~q@2a01:e0a:8e:a190:befe:db92:c07:c717) |
2022-12-13 09:42:27 +0100 | dolio | (~dolio@130.44.134.54) (Ping timeout: 260 seconds) |
2022-12-13 09:42:39 +0100 | hsw_ | (~hsw@112-104-142-182.adsl.dynamic.seed.net.tw) (Quit: Leaving) |
2022-12-13 09:42:52 +0100 | hsw | (~hsw@2001-b030-2303-0104-0172-0025-0012-0132.hinet-ip6.hinet.net) |
2022-12-13 09:44:40 +0100 | dolio | (~dolio@130.44.134.54) |
2022-12-13 09:46:03 +0100 | Sgeo | (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
2022-12-13 09:46:11 +0100 | tzh | (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz) |
2022-12-13 09:47:28 +0100 | avicenzi | (~avicenzi@2a00:ca8:a1f:b004::c32) |
2022-12-13 09:52:38 +0100 | xsarnik | (xsarnik@lounge.fi.muni.cz) |
2022-12-13 09:54:13 +0100 | xstill_ | (xstill@fimu/xstill) |
2022-12-13 10:00:05 +0100 | adziahel[m] | (~adziahelm@2001:470:69fc:105::b4d) (Quit: You have been kicked for being idle) |
2022-12-13 10:03:22 +0100 | freeside | (~mengwong@pd907d273.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
2022-12-13 10:06:41 +0100 | cfricke | (~cfricke@user/cfricke) (Quit: WeeChat 3.7.1) |
2022-12-13 10:08:44 +0100 | cfricke | (~cfricke@user/cfricke) |
2022-12-13 10:10:46 +0100 | ensyde | (~ensyde@2600:1700:2050:1040:e518:6f99:8537:355c) (Quit: Leaving) |
2022-12-13 10:11:11 +0100 | Guest23 | (~Guest23@27.57.46.219) |
2022-12-13 10:15:05 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2022-12-13 10:15:26 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:a84a:2d35:f948:fe07) (Remote host closed the connection) |
2022-12-13 10:22:32 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
2022-12-13 10:29:59 +0100 | iqubic | (~avi@2601:602:9502:c70:6c06:b297:7404:329f) (Ping timeout: 246 seconds) |
2022-12-13 10:39:44 +0100 | Guest23 | (~Guest23@27.57.46.219) (Ping timeout: 252 seconds) |
2022-12-13 10:49:04 +0100 | MajorBiscuit | (~MajorBisc@217-63-245-103.cable.dynamic.v4.ziggo.nl) (Ping timeout: 272 seconds) |
2022-12-13 10:50:19 +0100 | k | (~k@fork.wtf) |
2022-12-13 10:54:26 +0100 | econo | (uid147250@user/econo) (Quit: Connection closed for inactivity) |
2022-12-13 10:57:11 +0100 | ubert1 | (~Thunderbi@p200300ecdf264e2f50477ceb302d227f.dip0.t-ipconnect.de) |
2022-12-13 10:59:55 +0100 | coot | (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
2022-12-13 11:15:02 +0100 | zer0bitz_ | (~zer0bitz@196.244.192.60) |
2022-12-13 11:15:55 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:a84a:2d35:f948:fe07) |
2022-12-13 11:16:28 +0100 | zer0bitz | (~zer0bitz@196.244.192.56) (Ping timeout: 256 seconds) |
2022-12-13 11:17:15 +0100 | xff0x_ | (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) (Ping timeout: 248 seconds) |
2022-12-13 11:19:18 +0100 | Lord_of_Life | (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 256 seconds) |
2022-12-13 11:20:20 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:a84a:2d35:f948:fe07) (Ping timeout: 246 seconds) |
2022-12-13 11:21:15 +0100 | Lord_of_Life | (~Lord@user/lord-of-life/x-2819915) |
2022-12-13 11:21:25 +0100 | coot | (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
2022-12-13 11:32:19 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2022-12-13 11:33:12 +0100 | MajorBiscuit | (~MajorBisc@2001:1c00:2404:ed00:28e1:ad14:ec67:539e) |
2022-12-13 11:34:21 +0100 | use-value | (~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf) (Quit: use-value) |
2022-12-13 11:37:17 +0100 | __monty__ | (~toonn@user/toonn) |
2022-12-13 11:51:13 +0100 | Unicorn_Princess | (~Unicorn_P@user/Unicorn-Princess/x-3540542) |
2022-12-13 11:52:27 +0100 | gurkenglas | (~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 255 seconds) |
2022-12-13 11:53:35 +0100 | Guest3840 | (~Guest38@181.214.107.214) |
2022-12-13 11:54:07 +0100 | Guest3840 | (~Guest38@181.214.107.214) (Client Quit) |
2022-12-13 11:54:59 +0100 | zer0bitz_ | (~zer0bitz@196.244.192.60) (Read error: Connection reset by peer) |
2022-12-13 11:59:04 +0100 | zer0bitz | (~zer0bitz@196.244.192.60) |
2022-12-13 12:07:56 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-12-13 12:09:16 +0100 | xff0x_ | (~xff0x@ai071162.d.east.v6connect.net) |
2022-12-13 12:12:20 +0100 | Guest|66 | (~Guest|66@77.209.198.178.dynamic.wline.res.cust.swisscom.ch) |
2022-12-13 12:13:00 +0100 | Guest|66 | (~Guest|66@77.209.198.178.dynamic.wline.res.cust.swisscom.ch) (Client Quit) |
2022-12-13 12:38:26 +0100 | iqubic | (~avi@2601:602:9502:c70:6988:8eb0:bd8c:3233) |
2022-12-13 12:41:35 +0100 | teo | (~teo@user/teo) |
2022-12-13 12:42:02 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
2022-12-13 12:43:54 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-12-13 12:55:29 +0100 | rburkholder | (~blurb@96.45.2.121) |
2022-12-13 13:00:11 +0100 | darkstardevx | (~darkstard@50.53.3.186) (Remote host closed the connection) |
2022-12-13 13:01:35 +0100 | darkstardevx | (~darkstard@50.53.3.186) |
2022-12-13 13:03:33 +0100 | mixfix41 | (~sdenynine@user/mixfix41) |
2022-12-13 13:04:41 +0100 | Maxdamantus | (~Maxdamant@user/maxdamantus) (Ping timeout: 246 seconds) |
2022-12-13 13:08:51 +0100 | Maxdamantus | (~Maxdamant@user/maxdamantus) |
2022-12-13 13:09:32 +0100 | dextaa2 | (~DV@user/dextaa) |
2022-12-13 13:11:36 +0100 | mbuf | (~Shakthi@49.204.142.15) (Ping timeout: 265 seconds) |
2022-12-13 13:11:59 +0100 | dextaa | (~DV@user/dextaa) (Ping timeout: 268 seconds) |
2022-12-13 13:11:59 +0100 | dextaa2 | dextaa |
2022-12-13 13:12:25 +0100 | mbuf | (~Shakthi@49.204.117.211) |
2022-12-13 13:17:53 +0100 | mbuf | (~Shakthi@49.204.117.211) (Ping timeout: 265 seconds) |
2022-12-13 13:18:43 +0100 | jakalx | (~jakalx@base.jakalx.net) () |
2022-12-13 13:18:44 +0100 | mbuf | (~Shakthi@49.205.80.144) |
2022-12-13 13:19:49 +0100 | mmhat | (~mmh@p200300f1c7390125ee086bfffe095315.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
2022-12-13 13:20:11 +0100 | mmhat | (~mmh@p200300f1c73901b0ee086bfffe095315.dip0.t-ipconnect.de) |
2022-12-13 13:23:17 +0100 | kalj | (~kalj@78-71-20-170-no193.tbcn.telia.com) |
2022-12-13 13:26:41 +0100 | jakalx | (~jakalx@base.jakalx.net) |
2022-12-13 13:28:07 +0100 | pavonia | (~user@user/siracusa) (Quit: Bye!) |
2022-12-13 13:28:48 +0100 | [Leary] | (~Leary]@user/Leary/x-0910699) (Remote host closed the connection) |
2022-12-13 13:29:01 +0100 | [Leary] | (~Leary]@user/Leary/x-0910699) |
2022-12-13 13:30:40 +0100 | razetime | (~quassel@49.207.203.213) (Remote host closed the connection) |
2022-12-13 13:33:54 +0100 | Guest23 | (~Guest23@27.57.46.219) |
2022-12-13 13:37:55 +0100 | <dminuoso> | `show <$> [1, "foo", 'a']` |
2022-12-13 13:38:01 +0100 | <dminuoso> | I so want to be albe to write this. :( |
2022-12-13 13:39:06 +0100 | <_________> | you just wrote this ;) |
2022-12-13 13:39:08 +0100 | <dminuoso> | Heh. |
2022-12-13 13:39:10 +0100 | <dminuoso> | Is this in principle even possible? |
2022-12-13 13:39:21 +0100 | <dminuoso> | fmap show (1:"foo":a:[]) |
2022-12-13 13:39:43 +0100 | <dminuoso> | This would at minimum require impredicativity |
2022-12-13 13:40:24 +0100 | jmdaemon | (~jmdaemon@user/jmdaemon) (Ping timeout: 256 seconds) |
2022-12-13 13:40:26 +0100 | <geekosaur> | not in Haskell. you could use an existential wrapper so the list items would all be the same type, but at that point it's just as easy to simply wrap all items in `show` and solve the problem |
2022-12-13 13:40:54 +0100 | <dminuoso> | % :set -XExistentialQuantification |
2022-12-13 13:40:54 +0100 | <yahb2> | <no output> |
2022-12-13 13:40:57 +0100 | <dminuoso> | data AList = forall a. ACons a AList | ANil |
2022-12-13 13:41:00 +0100 | <dminuoso> | % data AList = forall a. ACons a AList | ANil |
2022-12-13 13:41:00 +0100 | <yahb2> | <no output> |
2022-12-13 13:41:16 +0100 | <dminuoso> | geekosaur: The thing is, the show wont push the Show constraint into that existential list |
2022-12-13 13:41:32 +0100 | <dminuoso> | fmap is not capable of doing that |
2022-12-13 13:41:37 +0100 | <geekosaur> | nope, you would need the Show constraint on the existential |
2022-12-13 13:42:02 +0100 | <geekosaur> | which is why it's easier to just wrap everything in show manually: it's more work to do the existential |
2022-12-13 13:42:09 +0100 | <dminuoso> | Maybe with `constraints` and GADTs I could do this? |
2022-12-13 13:42:50 +0100 | <dminuoso> | geekosaur: Sure, Im just trying to come up with a way that requires neither a constraint on an existential newtype, nor float the show into |
2022-12-13 13:43:10 +0100 | geekosaur | is wondering about some clever quasiquoter or something |
2022-12-13 13:43:13 +0100 | <dminuoso> | I *think* it could be done with an alteration of `fmap` |
2022-12-13 13:43:20 +0100 | <dminuoso> | Something that communicates constraints |
2022-12-13 13:43:27 +0100 | <geekosaur> | [fmap|1, "oo", 'a'] |
2022-12-13 13:43:39 +0100 | <geekosaur> | s/oo/foo/ |
2022-12-13 13:43:45 +0100 | <dminuoso> | TH feels like cheating here |
2022-12-13 13:43:59 +0100 | mbuf | (~Shakthi@49.205.80.144) (Ping timeout: 265 seconds) |
2022-12-13 13:44:34 +0100 | mbuf | (~Shakthi@49.204.114.77) |
2022-12-13 13:45:32 +0100 | <dminuoso> | % :set -XImpredicativeTypes |
2022-12-13 13:45:33 +0100 | <yahb2> | <no output> |
2022-12-13 13:45:40 +0100 | <dminuoso> | % :t (1:"foo":a:[]) |
2022-12-13 13:45:40 +0100 | <yahb2> | <interactive>:1:10: error: Variable not in scope: a :: String |
2022-12-13 13:45:43 +0100 | <dminuoso> | % :t (1:"foo":'a':[]) |
2022-12-13 13:45:43 +0100 | <yahb2> | <interactive>:1:10: error: ; • Couldn't match type ‘Char’ with ‘[Char]’ ; Expected: String ; Actual: Char ; • In the first argument of ‘(:)’, namely ‘'a'’ ; In the secon... |
2022-12-13 13:45:56 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
2022-12-13 13:46:13 +0100 | <dminuoso> | I guess we lack a typing rule to generalize here? |
2022-12-13 13:47:15 +0100 | <Clint> | what would the type of that list be? |
2022-12-13 13:47:31 +0100 | <dminuoso> | [exist a. a] |
2022-12-13 13:47:59 +0100 | <geekosaur> | that can't exist in Haskell, it has to be wrapped in a newtype |
2022-12-13 13:48:08 +0100 | <geekosaur> | ImpredicativeTypes doesn't help |
2022-12-13 13:49:03 +0100 | <dminuoso> | Why cant it exist, though? |
2022-12-13 13:49:16 +0100 | <geekosaur> | and even if it could, you wouldn't know the types of the items coming out, so the newtype wrapper also has to include a constrant that gives you some handle on the types coming out (here, Show) |
2022-12-13 13:49:39 +0100 | <geekosaur> | but at that point you;re doing mroe work than manually writing [show 1, show "foo", show 'a'] |
2022-12-13 13:49:53 +0100 | <mniip> | clearly, when I write 'x' I actually mean `'x' :: exists a. (all instances that Char satifies) *> a` |
2022-12-13 13:51:12 +0100 | <geekosaur> | dminuoso, you could write a typing rule that let you create such a list. you can't write a typing rule that lets you deconstruct it |
2022-12-13 13:51:36 +0100 | <dminuoso> | geekosaur: I think mniip captured my thought well enough mmm. |
2022-12-13 13:51:55 +0100 | <mniip> | that makes a closed world assumption |
2022-12-13 13:52:01 +0100 | <dminuoso> | My initial instinct that by using fmap, perhaps one could conjure a typing rule that would flow the constraint into the existential |
2022-12-13 13:52:04 +0100 | <dminuoso> | Right |
2022-12-13 13:52:20 +0100 | <_________> | are you rediscovering HList? |
2022-12-13 13:52:21 +0100 | <dminuoso> | Or perhaps not necessarily, if we had some obscure magic `AnySatisfy Char` constraint resolvable later. |
2022-12-13 13:53:03 +0100 | <mniip> | well if you didn't want [1, "foo", 'a'] to have the weird type on its own, you would have to give `fmap show` a weird type |
2022-12-13 13:53:50 +0100 | <mniip> | rewriting `show :: forall a. Show a => a -> String` as `show :: (exists a. Show a *> a) -> String` |
2022-12-13 13:54:02 +0100 | <lortabac> | dminuoso: you can create your own list type, something like this: https://paste.tomsmeding.com/FjPlR3jb |
2022-12-13 13:55:30 +0100 | Reinhilde | (ellenor@callbox.trd.is) (Quit: Bye Open Projects!) |
2022-12-13 13:55:51 +0100 | <dminuoso> | lortabac: Mmm thats interesting. |
2022-12-13 13:56:16 +0100 | <[Leary]> | That's the same as a list of existentials though. You can instead preserve the type information with an HList and write something like: |
2022-12-13 13:56:22 +0100 | <[Leary]> | `monomap :: (forall x. c x => x -> a) -> HList c xs -> [a]` |
2022-12-13 13:56:23 +0100 | <mniip> | % fmap (\x -> x show) ([\k -> k 1, \k -> k "foo", \k -> k 'a'] :: [forall r. (forall a. Show a => a -> r) -> r]) |
2022-12-13 13:56:23 +0100 | <yahb2> | ["1","\"foo\"","'a'"] |
2022-12-13 13:57:12 +0100 | <mniip> | unforunately $ is not magical enough for ($ show) or ($ 1) to work here |
2022-12-13 13:58:45 +0100 | <dminuoso> | % :set -XDeepSubsumption |
2022-12-13 13:58:45 +0100 | <yahb2> | <no output> |
2022-12-13 13:58:49 +0100 | <lortabac> | [Leary]: that's the same minus the need to wrap every single item with an existential constructor |
2022-12-13 13:59:00 +0100 | <dminuoso> | % fmap ($ show) ([\k -> k 1, \k -> k "foo", \k -> k 'a'] :: [forall r. (forall a. Show a => a -> r) -> r]) |
2022-12-13 13:59:00 +0100 | <yahb2> | <interactive>:38:15: error: ; • Couldn't match type: forall r. (forall a. Show a => a -> r) -> r ; with: (a0 -> String) -> b ; Expected: [(a0 -> String) -> b] ; ... |
2022-12-13 13:59:14 +0100 | <mniip> | nothing to do with deep subsumption |
2022-12-13 14:00:25 +0100 | <_________> | % fmap (`$` show) ([\k -> k 1, \k -> k "foo", \k -> k 'a'] :: [forall r. (forall a. Show a => a -> r) -> r]) |
2022-12-13 14:00:25 +0100 | <yahb2> | Oops, something went wrong |
2022-12-13 14:00:29 +0100 | <dminuoso> | [Leary]: I may have to revisit HList, its not entirely clear how that would type check |
2022-12-13 14:00:43 +0100 | acidjnk | (~acidjnk@p200300d6e7137a279cde44451dfff9db.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
2022-12-13 14:00:44 +0100 | <mniip> | oh actually |
2022-12-13 14:00:48 +0100 | <mniip> | this may be a bug in QuickLook |
2022-12-13 14:01:07 +0100 | <mniip> | that for some reason makes operator sections inequvalent to their expanded form |
2022-12-13 14:02:05 +0100 | <mniip> | \k -> k `id` 1 typechecks, but (`id` 1) does not |
2022-12-13 14:03:20 +0100 | <[Leary]> | dminuoso: Here, the definition would be like `data HList c xs where Nil :: HList c '[]; Cons :: c x => x -> HList c xs -> HList c (x:xs)`, then `monomap f Nil = Nil; monomap f (Cons x xs) = f x : monomap f xs`. |
2022-12-13 14:07:02 +0100 | perrierjouet | (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) (Quit: WeeChat 3.7.1) |
2022-12-13 14:11:20 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Quit: Reconnecting) |
2022-12-13 14:11:26 +0100 | merijn | (~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) |
2022-12-13 14:13:50 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 255 seconds) |
2022-12-13 14:15:09 +0100 | mesaoptimizer_ | (apotheosis@tilde.institute) |
2022-12-13 14:15:49 +0100 | mesaoptimizer_ | (apotheosis@tilde.institute) (Client Quit) |
2022-12-13 14:17:00 +0100 | mesaoptimizer2 | (apotheosis@tilde.institute) |
2022-12-13 14:17:07 +0100 | mesaoptimizer2 | (apotheosis@tilde.institute) (Client Quit) |
2022-12-13 14:18:42 +0100 | PapuaHardyNet | (apotheosis@user/PapuaHardyNet) |
2022-12-13 14:19:43 +0100 | PapuaHardyNet | (apotheosis@user/PapuaHardyNet) (Client Quit) |
2022-12-13 14:20:18 +0100 | mesaoptimizer_ | (apotheosis@tilde.institute) |
2022-12-13 14:20:44 +0100 | mesaoptimizer_ | (apotheosis@tilde.institute) (Client Quit) |
2022-12-13 14:21:05 +0100 | PapuaHardyNet | (apotheosis@user/PapuaHardyNet) |
2022-12-13 14:21:39 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) |
2022-12-13 14:22:07 +0100 | PapuaHardyNet | (apotheosis@user/PapuaHardyNet) (Client Quit) |
2022-12-13 14:22:31 +0100 | mesaoptimizer_ | (apotheosis@tilde.institute) |
2022-12-13 14:22:42 +0100 | mesaoptimizer_ | (apotheosis@tilde.institute) (Client Quit) |
2022-12-13 14:23:03 +0100 | Ellenor | (ellenor@callbox.trd.is) |
2022-12-13 14:23:06 +0100 | PapuaHardyNet | (apotheosis@user/PapuaHardyNet) |
2022-12-13 14:23:45 +0100 | PapuaHardyNet | mesaoptimizer |
2022-12-13 14:23:55 +0100 | mesaoptimizer | (apotheosis@user/PapuaHardyNet) (Client Quit) |
2022-12-13 14:24:16 +0100 | mesaoptimizer | (apotheosis@user/PapuaHardyNet) |
2022-12-13 14:24:27 +0100 | JordiGH | (~jordi@user/jordigh) |
2022-12-13 14:25:31 +0100 | <merijn> | Is there a quick and dirty way to get a DAG of imports within a component? |
2022-12-13 14:25:54 +0100 | <merijn> | I'm trying to minimise a reproducer and wanna see which leaf modules I can trim |
2022-12-13 14:28:59 +0100 | use-value | (~Thunderbi@2a00:23c6:8a03:2f01:40bc:fcc3:815f:f6e9) |
2022-12-13 14:32:58 +0100 | JordiGH | (~jordi@user/jordigh) (Ping timeout: 260 seconds) |
2022-12-13 14:33:16 +0100 | Guest23 | (~Guest23@27.57.46.219) (Ping timeout: 272 seconds) |
2022-12-13 14:36:26 +0100 | son0p | (~ff@2604:3d08:5b7f:5540::4026) (Read error: Connection reset by peer) |
2022-12-13 14:36:41 +0100 | <_________> | not sure if it will help you, but ghc has -ddump-minimal-imports option which creates .imports files with minimal number of imports for each module |
2022-12-13 14:37:10 +0100 | <merijn> | That doesn't really help, no |
2022-12-13 14:37:24 +0100 | <merijn> | I need to know which modules in the package aren't imported by anything else |
2022-12-13 14:37:38 +0100 | mmhat | (~mmh@p200300f1c73901b0ee086bfffe095315.dip0.t-ipconnect.de) (Ping timeout: 265 seconds) |
2022-12-13 14:37:39 +0100 | <merijn> | so I can start trimming stuff until only a (hopefully handful) of modules remain for the reproducer |
2022-12-13 14:38:12 +0100 | <jean-paul[m]> | I remember a couple projects for doing visualizations - maybe https://hackage.haskell.org/package/haskell-import-graph was one, not sure. a module that isn't imported by anything will have no edges pointing in to it, or something |
2022-12-13 14:38:44 +0100 | <dminuoso> | That looks stunningly simple, since it just works on the .hi files |
2022-12-13 14:38:53 +0100 | <[Leary]> | merijn: My quick-and-dirty: the leaf modules should form a final run when compiled, so just kill them in the opposite order cabal builds them? |
2022-12-13 14:38:59 +0100 | <merijn> | dminuoso: Well, that won't work, then xD |
2022-12-13 14:39:22 +0100 | <merijn> | [Leary]: Well, the seems to assume the build actually, you know, finishes |
2022-12-13 14:39:27 +0100 | <merijn> | s/the/that |
2022-12-13 14:39:37 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "") |
2022-12-13 14:39:40 +0100 | <merijn> | My entire problem is that GHC is crashing :p |
2022-12-13 14:39:45 +0100 | <dminuoso> | merijn: Mmm, why not? |
2022-12-13 14:39:48 +0100 | <[Leary]> | True. Old build logs should suffice though. |
2022-12-13 14:39:53 +0100 | rburkholder | (~blurb@96.45.2.121) (Remote host closed the connection) |
2022-12-13 14:40:06 +0100 | <merijn> | And I'm trying to get a reproducer for GHC HQ that is not "here's 200 modules, template haskell, and foreign code, good luck!" |
2022-12-13 14:40:50 +0100 | ChaiTRex | (~ChaiTRex@user/chaitrex) (Ping timeout: 255 seconds) |
2022-12-13 14:40:57 +0100 | <[Leary]> | Maybe there's some sort of cabal --dry-run that would simulate it. |
2022-12-13 14:42:05 +0100 | <dminuoso> | That would not produce the full import graph, though. |
2022-12-13 14:42:12 +0100 | ChaiTRex | (~ChaiTRex@user/chaitrex) |
2022-12-13 14:46:14 +0100 | Ellenor | Reinhilde |
2022-12-13 14:47:17 +0100 | JordiGH | (~jordi@user/jordigh) |
2022-12-13 14:47:26 +0100 | <dminuoso> | merijn: Using Cabal-syntax and just quick heuristic parsing (or using `ghc`) should be relatively easy though |
2022-12-13 14:48:29 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2022-12-13 14:49:48 +0100 | <dminuoso> | Hah this is a cool use of BlockArguments and LambdaCase https://github.com/ocharles/weeder/blob/master/src/Weeder.hs#L367-L373 |
2022-12-13 14:50:44 +0100 | SIben | (~SIben@ns3106586.ip-5-135-191.eu) (Ping timeout: 246 seconds) |
2022-12-13 14:51:05 +0100 | mmhat | (~mmh@p200300f1c715781aee086bfffe095315.dip0.t-ipconnect.de) |
2022-12-13 14:51:30 +0100 | <dminuoso> | mniip: I just thought deep subsumption because my brains pattern matching recalls equivalence to eta expanded forms in some situations is one of the things you give up with simple subsumption. |
2022-12-13 14:51:43 +0100 | <dminuoso> | It looked like the same pattern :) |
2022-12-13 14:51:53 +0100 | <merijn> | dminuoso: I mean, 90% of that is LambdaCase? |
2022-12-13 14:52:11 +0100 | <merijn> | BlockArguments just eliminates the $ |
2022-12-13 14:52:38 +0100 | <dminuoso> | merijn: Sure, but all-in-all this looks very elegant. |
2022-12-13 14:52:55 +0100 | kalj | (~kalj@78-71-20-170-no193.tbcn.telia.com) (Quit: Client closed) |
2022-12-13 14:53:19 +0100 | <[Leary]> | $ would also break the composition |
2022-12-13 14:53:32 +0100 | <merijn> | oh, right |
2022-12-13 14:53:45 +0100 | <merijn> | Trivially solved by making it a list and using Endo :p |
2022-12-13 14:53:58 +0100 | <merijn> | or something :p |
2022-12-13 14:55:38 +0100 | JordiGH | (~jordi@user/jordigh) (Ping timeout: 246 seconds) |
2022-12-13 14:55:53 +0100 | <mauke> | I wish lambdabot had BlockArguments turned on |
2022-12-13 14:56:09 +0100 | <maerwald> | it would win every argument... |
2022-12-13 14:56:32 +0100 | <merijn> | I find BlockArguments kinda meh |
2022-12-13 14:56:43 +0100 | <mauke> | > do negate do sqrt do 2 |
2022-12-13 14:56:44 +0100 | <lambdabot> | error: |
2022-12-13 14:56:44 +0100 | <lambdabot> | Unexpected do block in function application: |
2022-12-13 14:56:44 +0100 | <lambdabot> | do sqrt do 2 |
2022-12-13 14:56:51 +0100 | <mauke> | then that would work |
2022-12-13 14:57:01 +0100 | <merijn> | I'm not sure the benefits outway the effort my brain has to invest to solve them |
2022-12-13 14:57:24 +0100 | <mauke> | you're braining it wrong |
2022-12-13 14:57:33 +0100 | <merijn> | I don't wanna brain at all |
2022-12-13 14:57:56 +0100 | <mauke> | hard to achieve while staying alive |
2022-12-13 14:58:00 +0100 | <maerwald> | let's promote do-blocks to type level... you can only pass a monadic block that was defined via a do |
2022-12-13 14:59:43 +0100 | JordiGH | (~jordi@user/jordigh) |
2022-12-13 15:00:57 +0100 | califax | (~califax@user/califx) (Remote host closed the connection) |
2022-12-13 15:01:06 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2022-12-13 15:01:23 +0100 | califax | (~califax@user/califx) |
2022-12-13 15:09:28 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) (Quit: No Ping reply in 180 seconds.) |
2022-12-13 15:10:58 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) |
2022-12-13 15:10:59 +0100 | ChaiTRex | (~ChaiTRex@user/chaitrex) (Ping timeout: 255 seconds) |
2022-12-13 15:12:07 +0100 | ChaiTRex | (~ChaiTRex@user/chaitrex) |
2022-12-13 15:16:16 +0100 | thegeekinside | (~thegeekin@189.217.82.244) |
2022-12-13 15:19:15 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:a84a:2d35:f948:fe07) |
2022-12-13 15:20:10 +0100 | fizbin | (~fizbin@user/fizbin) (Ping timeout: 265 seconds) |
2022-12-13 15:20:48 +0100 | hpc | (~juzz@ip98-169-35-163.dc.dc.cox.net) (Ping timeout: 255 seconds) |
2022-12-13 15:23:38 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:a84a:2d35:f948:fe07) (Ping timeout: 246 seconds) |
2022-12-13 15:25:45 +0100 | gurkenglas | (~gurkengla@p548ac72e.dip0.t-ipconnect.de) |
2022-12-13 15:29:36 +0100 | Guest23 | (~Guest23@27.57.46.219) |
2022-12-13 15:31:15 +0100 | <mniip> | merijn, I'm actually writing a thing for that right now |
2022-12-13 15:31:45 +0100 | <merijn> | mniip: Rendering imports? Or minimising reproducers? |
2022-12-13 15:32:04 +0100 | <mniip> | well, a lot more general, but module import graph is one of the things it can do |
2022-12-13 15:32:08 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 255 seconds) |
2022-12-13 15:32:16 +0100 | <merijn> | mniip: Even on code that doesn't compile? ;) |
2022-12-13 15:32:21 +0100 | festive_kurbus | (~festive_k@user/kurbus) |
2022-12-13 15:32:26 +0100 | <mniip> | that's harder |
2022-12-13 15:33:10 +0100 | <mniip> | anyway there's a ModuleGraph in a HscEnv |
2022-12-13 15:33:38 +0100 | <mniip> | via GHC plugins, earliest you can get your hands on one seems to be in a parsedResultAction |
2022-12-13 15:35:03 +0100 | hpc | (~juzz@ip98-169-35-163.dc.dc.cox.net) |
2022-12-13 15:35:48 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-12-13 15:39:38 +0100 | tabemann_ | (~tabemann@2600:1700:7990:24e0:61f0:ea0e:b3a2:c286) (Remote host closed the connection) |
2022-12-13 15:39:55 +0100 | tabemann_ | (~tabemann@2600:1700:7990:24e0:a525:f2f6:8a3c:81c2) |
2022-12-13 15:42:08 +0100 | shriekingnoise | (~shrieking@186.137.167.202) |
2022-12-13 15:43:31 +0100 | festive_kurbus | (~festive_k@user/kurbus) (Quit: Client closed) |
2022-12-13 15:43:46 +0100 | ec | (~ec@gateway/tor-sasl/ec) |
2022-12-13 15:45:41 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) |
2022-12-13 15:47:26 +0100 | ec_ | (~ec@gateway/tor-sasl/ec) (Ping timeout: 255 seconds) |
2022-12-13 15:48:18 +0100 | <mniip> | merijn, https://bpa.st/VCXA |
2022-12-13 15:49:01 +0100 | <merijn> | I'm down to about 30 modules the hard way |
2022-12-13 15:49:09 +0100 | <merijn> | So the end is in sight |
2022-12-13 15:49:34 +0100 | bontaq | (~user@ool-45779fe5.dyn.optonline.net) |
2022-12-13 15:58:49 +0100 | Reinhilde | (ellenor@callbox.trd.is) (Remote host closed the connection) |
2022-12-13 16:02:26 +0100 | machinedgod | (~machinedg@d198-53-218-113.abhsia.telus.net) |
2022-12-13 16:11:24 +0100 | Ellenor | (ellenor@callbox.trd.is) |
2022-12-13 16:19:24 +0100 | cfricke | (~cfricke@user/cfricke) (Quit: WeeChat 3.7.1) |
2022-12-13 16:20:49 +0100 | notzmv | (~zmv@user/notzmv) |
2022-12-13 16:22:28 +0100 | acidjnk | (~acidjnk@p200300d6e7137a81910d6d9ee28ee6f1.dip0.t-ipconnect.de) |
2022-12-13 16:23:40 +0100 | j4cc3b | (~jeffreybe@pool-74-105-2-138.nwrknj.fios.verizon.net) |
2022-12-13 16:23:43 +0100 | Ellenor | Reinhilde |
2022-12-13 16:25:41 +0100 | Sgeo | (~Sgeo@user/sgeo) |
2022-12-13 16:36:27 +0100 | Guest23 | (~Guest23@27.57.46.219) (Ping timeout: 256 seconds) |
2022-12-13 16:37:23 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 255 seconds) |
2022-12-13 16:38:38 +0100 | Erutuon_ | (~Erutuon@user/erutuon) |
2022-12-13 16:39:28 +0100 | jao | (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
2022-12-13 16:45:45 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) |
2022-12-13 16:47:03 +0100 | sudden | (~cat@user/sudden) |
2022-12-13 16:50:33 +0100 | notzmv | (~zmv@user/notzmv) (Ping timeout: 265 seconds) |
2022-12-13 16:54:09 +0100 | lortabac | (~lortabac@2a01:e0a:541:b8f0:47dd:78b3:3134:94a) (Quit: WeeChat 2.8) |
2022-12-13 16:54:22 +0100 | doyougnu | (~doyougnu@cpe-74-69-132-225.stny.res.rr.com) |
2022-12-13 17:00:49 +0100 | JordiGH | (~jordi@user/jordigh) (Ping timeout: 256 seconds) |
2022-12-13 17:05:51 +0100 | <merijn> | Anyone with GHC 8.10 willing to donate a few minutes to see if I can crash your GHC? :p |
2022-12-13 17:06:32 +0100 | j4cc3b | (~jeffreybe@pool-74-105-2-138.nwrknj.fios.verizon.net) (Ping timeout: 272 seconds) |
2022-12-13 17:07:18 +0100 | dsrt^ | (~dsrt@76.145.185.103) (Remote host closed the connection) |
2022-12-13 17:07:29 +0100 | <mauke> | I only have 8.8.4 |
2022-12-13 17:07:37 +0100 | geekosaur | has ghcup installed ghc back to 8.10; what's up? |
2022-12-13 17:08:14 +0100 | <merijn> | geekosaur: If you clone this and run "cabal build", does GHC blow up? https://github.com/merijn/ghc-crash-reproducer |
2022-12-13 17:08:48 +0100 | <merijn> | It's now sufficiently minimal that I wanna be sure it blows up on other machines too, before I spend effort making it even smaller :p |
2022-12-13 17:10:17 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2022-12-13 17:10:44 +0100 | <geekosaur> | will take a while as I'd forgotten that I hadn't used 8.10.7 since moving to cabal HEAD so it's installing half the universe now |
2022-12-13 17:11:22 +0100 | <VOID[m]> | Fellas I think I want to implement affine traversal optics, but I think I am missing a lot of theory to do that...... (full message at <https://libera.ems.host/_matrix/media/v3/download/libera.chat/e51c52a118253656ec17b7c82cbca65a8084…>) |
2022-12-13 17:12:11 +0100 | <merijn> | geekosaur: Sure, no rush :) |
2022-12-13 17:14:16 +0100 | nut | (~nut@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 252 seconds) |
2022-12-13 17:14:48 +0100 | festive_kurbus | (~festive_k@user/kurbus) |
2022-12-13 17:19:05 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2022-12-13 17:19:23 +0100 | terrorjack | (~terrorjac@2a01:4f8:1c1e:509a::1) (Ping timeout: 264 seconds) |
2022-12-13 17:20:35 +0100 | terrorjack | (~terrorjac@2a01:4f8:1c1e:509a::1) |
2022-12-13 17:21:23 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:a84a:2d35:f948:fe07) |
2022-12-13 17:23:38 +0100 | jao | (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 272 seconds) |
2022-12-13 17:24:39 +0100 | <geekosaur> | merijn, https://paste.tomsmeding.com/sGSzqp1R |
2022-12-13 17:25:05 +0100 | <merijn> | ok, thanks! |
2022-12-13 17:25:14 +0100 | <merijn> | Different symbol, but same basic blow up |
2022-12-13 17:25:51 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:a84a:2d35:f948:fe07) (Ping timeout: 260 seconds) |
2022-12-13 17:35:14 +0100 | mmhat | (~mmh@p200300f1c715781aee086bfffe095315.dip0.t-ipconnect.de) (Ping timeout: 246 seconds) |
2022-12-13 17:40:43 +0100 | leeb | (~leeb@tk2-243-31079.vs.sakura.ne.jp) |
2022-12-13 17:48:48 +0100 | mmhat | (~mmh@p200300f1c7179fc3ee086bfffe095315.dip0.t-ipconnect.de) |
2022-12-13 17:52:55 +0100 | Guest75 | (Guest75@2a01:7e01::f03c:92ff:fe5d:7b18) |
2022-12-13 18:00:39 +0100 | rburkholder | (~blurb@96.45.2.121) |
2022-12-13 18:05:20 +0100 | festive_kurbus | (~festive_k@user/kurbus) (Quit: Client closed) |
2022-12-13 18:08:45 +0100 | festive_kurbus | (~festive_k@user/kurbus) |
2022-12-13 18:10:53 +0100 | mmhat | (~mmh@p200300f1c7179fc3ee086bfffe095315.dip0.t-ipconnect.de) (Ping timeout: 246 seconds) |
2022-12-13 18:16:30 +0100 | JordiGH | (~jordi@user/jordigh) |
2022-12-13 18:22:16 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:a84a:2d35:f948:fe07) |
2022-12-13 18:26:36 +0100 | mmhat | (~mmh@p200300f1c718063cee086bfffe095315.dip0.t-ipconnect.de) |
2022-12-13 18:26:55 +0100 | jpds2 | (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection) |
2022-12-13 18:26:58 +0100 | Alex_test_ | (~al_test@178.34.161.14) |
2022-12-13 18:27:29 +0100 | jpds2 | (~jpds@gateway/tor-sasl/jpds) |
2022-12-13 18:29:35 +0100 | [exa] | (~exa@user/exa/x-3587197) (Quit: leaving) |
2022-12-13 18:30:13 +0100 | [exa] | (~exa@user/exa/x-3587197) |
2022-12-13 18:31:05 +0100 | gaff | (~gaff@49.207.199.216) |
2022-12-13 18:31:06 +0100 | Guest75 | (Guest75@2a01:7e01::f03c:92ff:fe5d:7b18) (Quit: Client closed) |
2022-12-13 18:31:14 +0100 | gaff | (~gaff@49.207.199.216) (Client Quit) |
2022-12-13 18:31:31 +0100 | festive_kurbus | (~festive_k@user/kurbus) (Quit: Client closed) |
2022-12-13 18:31:39 +0100 | Alex_test_ | (~al_test@178.34.161.14) (Client Quit) |
2022-12-13 18:39:36 +0100 | nut | (~nut@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) |
2022-12-13 18:40:46 +0100 | son0p | (~ff@2604:3d08:5b7f:5540::64ea) |
2022-12-13 18:47:12 +0100 | festive_kurbus | (~festive_k@user/kurbus) |
2022-12-13 18:48:28 +0100 | incertia_ | (~incertia@209.122.71.127) |
2022-12-13 18:48:40 +0100 | pepeiborra_ | (sid443799@id-443799.ilkley.irccloud.com) |
2022-12-13 18:48:55 +0100 | jespada_ | (~jespada@nmal-24-b2-v4wan-166357-cust1764.vm24.cable.virginm.net) |
2022-12-13 18:49:39 +0100 | jmtd | (jon@dow.land) |
2022-12-13 18:49:44 +0100 | CodeKiwi | (~kiwi@137.184.156.191) |
2022-12-13 18:49:44 +0100 | aristid_ | (sid1599@id-1599.uxbridge.irccloud.com) |
2022-12-13 18:49:51 +0100 | festive_kurbus | (~festive_k@user/kurbus) (Client Quit) |
2022-12-13 18:49:59 +0100 | jbggs[m]1 | (~jbggsmatr@2001:470:69fc:105::2:995f) |
2022-12-13 18:50:13 +0100 | incertia | (~incertia@209.122.71.127) (Ping timeout: 252 seconds) |
2022-12-13 18:50:13 +0100 | incertia_ | incertia |
2022-12-13 18:50:23 +0100 | pepeiborra | (sid443799@id-443799.ilkley.irccloud.com) (Ping timeout: 252 seconds) |
2022-12-13 18:50:24 +0100 | pepeiborra_ | pepeiborra |
2022-12-13 18:50:59 +0100 | jackhill_ | (~jackhill@kalessin.dragonsnail.net) |
2022-12-13 18:51:13 +0100 | elkcl_ | (~elkcl@broadband-188-255-19-11.ip.moscow.rt.ru) |
2022-12-13 18:51:41 +0100 | bonz060_ | (~quassel@2001:bc8:47a4:a23::1) |
2022-12-13 18:52:07 +0100 | sm1 | (~sm@plaintextaccounting/sm) |
2022-12-13 18:52:09 +0100 | tzh | (~tzh@c-24-21-73-154.hsd1.or.comcast.net) |
2022-12-13 18:52:52 +0100 | kitzman_ | (~kitzman@user/dekenevs) |
2022-12-13 18:52:57 +0100 | sunarch_ | (sid526836@user/sunarch) |
2022-12-13 18:53:01 +0100 | tristanC_ | (~tristanC@user/tristanc) |
2022-12-13 18:53:08 +0100 | gmc_ | (sid58314@id-58314.ilkley.irccloud.com) |
2022-12-13 18:53:09 +0100 | urdh_ | (~urdh@user/urdh) |
2022-12-13 18:53:21 +0100 | kmein_ | (~weechat@user/kmein) |
2022-12-13 18:53:45 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2022-12-13 18:53:48 +0100 | melonai- | (~mel@rnrd.eu) |
2022-12-13 18:54:05 +0100 | Momentum_ | (momentum@tilde.team) |
2022-12-13 18:54:20 +0100 | sunarch | (sid526836@user/sunarch) (Ping timeout: 252 seconds) |
2022-12-13 18:54:21 +0100 | Cadey | (~cadey@tailscale/xe) |
2022-12-13 18:54:21 +0100 | sunarch_ | sunarch |
2022-12-13 18:54:27 +0100 | ncf_ | (~n@monade.li) |
2022-12-13 18:54:34 +0100 | jbggs[m] | (~jbggsmatr@2001:470:69fc:105::2:995f) (Ping timeout: 252 seconds) |
2022-12-13 18:54:34 +0100 | jackhill | (~jackhill@kalessin.dragonsnail.net) (Ping timeout: 252 seconds) |
2022-12-13 18:55:26 +0100 | peutri_ | (~peutri@bobo.desast.re) |
2022-12-13 18:55:28 +0100 | elkcl | (~elkcl@broadband-188-255-19-11.ip.moscow.rt.ru) (Ping timeout: 252 seconds) |
2022-12-13 18:55:28 +0100 | aristid | (sid1599@id-1599.uxbridge.irccloud.com) (Ping timeout: 252 seconds) |
2022-12-13 18:55:28 +0100 | DigitalKiwi | (~kiwi@137.184.156.191) (Ping timeout: 252 seconds) |
2022-12-13 18:55:28 +0100 | kitzman | (~kitzman@user/dekenevs) (Ping timeout: 252 seconds) |
2022-12-13 18:55:29 +0100 | Momentum | (momentum@tilde.team) (Ping timeout: 252 seconds) |
2022-12-13 18:55:29 +0100 | sus | (zero@user/zeromomentum) (Ping timeout: 252 seconds) |
2022-12-13 18:55:29 +0100 | sm | (~sm@plaintextaccounting/sm) (Ping timeout: 252 seconds) |
2022-12-13 18:55:29 +0100 | bonz060 | (~quassel@2001:bc8:47a4:a23::1) (Ping timeout: 252 seconds) |
2022-12-13 18:55:29 +0100 | gmc | (sid58314@id-58314.ilkley.irccloud.com) (Ping timeout: 252 seconds) |
2022-12-13 18:55:29 +0100 | Jon | (jon@dow.land) (Ping timeout: 252 seconds) |
2022-12-13 18:55:29 +0100 | geekosaur[m] | (~geekosaur@xmonad/geekosaur) (Ping timeout: 252 seconds) |
2022-12-13 18:55:30 +0100 | dsal | (sid13060@id-13060.lymington.irccloud.com) (Ping timeout: 252 seconds) |
2022-12-13 18:55:30 +0100 | tristanC | (~tristanC@user/tristanc) (Ping timeout: 252 seconds) |
2022-12-13 18:55:30 +0100 | Xe | (~cadey@tailscale/xe) (Ping timeout: 252 seconds) |
2022-12-13 18:55:30 +0100 | jespada | (~jespada@nmal-24-b2-v4wan-166357-cust1764.vm24.cable.virginm.net) (Ping timeout: 252 seconds) |
2022-12-13 18:55:30 +0100 | urdh | (~urdh@user/urdh) (Ping timeout: 252 seconds) |
2022-12-13 18:55:30 +0100 | kmein | (~weechat@user/kmein) (Ping timeout: 252 seconds) |
2022-12-13 18:55:30 +0100 | ozkutuk[m] | (~ozkutuk@2001:470:69fc:105::2:9af8) (Ping timeout: 252 seconds) |
2022-12-13 18:55:30 +0100 | kadoban | (~kadoban@user/kadoban) (Ping timeout: 252 seconds) |
2022-12-13 18:55:30 +0100 | ncf | (~n@monade.li) (Ping timeout: 252 seconds) |
2022-12-13 18:55:30 +0100 | elevenkb[m] | (~elevenkb@2001:470:69fc:105::2:cb89) (Ping timeout: 252 seconds) |
2022-12-13 18:55:30 +0100 | liskin | (~liskin@xmonad/liskin) (Ping timeout: 252 seconds) |
2022-12-13 18:55:30 +0100 | melonai | (~mel@rnrd.eu) (Ping timeout: 252 seconds) |
2022-12-13 18:55:30 +0100 | peutri | (~peutri@bobo.desast.re) (Ping timeout: 252 seconds) |
2022-12-13 18:55:31 +0100 | elkcl_ | elkcl |
2022-12-13 18:55:31 +0100 | aristid_ | aristid |
2022-12-13 18:55:31 +0100 | jmtd | Jon |
2022-12-13 18:55:31 +0100 | lisk1n | (~liskin@xmonad/liskin) |
2022-12-13 18:55:32 +0100 | urdh_ | urdh |
2022-12-13 18:55:38 +0100 | dsal | (sid13060@id-13060.lymington.irccloud.com) |
2022-12-13 18:55:57 +0100 | sus | (zero@user/zeromomentum) |
2022-12-13 18:56:10 +0100 | Xeroine_ | (~Xeroine@user/xeroine) |
2022-12-13 18:56:13 +0100 | Xeroine | (~Xeroine@user/xeroine) (Read error: Connection reset by peer) |
2022-12-13 18:56:20 +0100 | geekosaur[m] | (~geekosaur@xmonad/geekosaur) |
2022-12-13 18:56:25 +0100 | ozkutuk[m] | (~ozkutuk@2001:470:69fc:105::2:9af8) |
2022-12-13 18:57:35 +0100 | ncf_ | ncf |
2022-12-13 18:58:41 +0100 | califax | (~califax@user/califx) (Ping timeout: 255 seconds) |
2022-12-13 18:59:45 +0100 | califax | (~califax@user/califx) |
2022-12-13 19:01:54 +0100 | Momentum_ | Momentum |
2022-12-13 19:02:17 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:a84a:2d35:f948:fe07) (Remote host closed the connection) |
2022-12-13 19:02:38 +0100 | notzmv | (~zmv@user/notzmv) |
2022-12-13 19:03:24 +0100 | califax | (~califax@user/califx) (Remote host closed the connection) |
2022-12-13 19:03:33 +0100 | Cadey | Xe |
2022-12-13 19:04:40 +0100 | califax | (~califax@user/califx) |
2022-12-13 19:07:29 +0100 | kadoban | (~kadoban@user/kadoban) |
2022-12-13 19:08:01 +0100 | mestre | (~mestre@191.177.185.178) |
2022-12-13 19:08:30 +0100 | elevenkb[m] | (~elevenkb@2001:470:69fc:105::2:cb89) |
2022-12-13 19:10:12 +0100 | MajorBiscuit | (~MajorBisc@2001:1c00:2404:ed00:28e1:ad14:ec67:539e) (Ping timeout: 256 seconds) |
2022-12-13 19:19:48 +0100 | jakalx | (~jakalx@base.jakalx.net) () |
2022-12-13 19:21:08 +0100 | thyriaen | (~thyriaen@2a01:aea0:dd4:4bae:6245:cbff:fe9f:48b1) |
2022-12-13 19:22:57 +0100 | econo | (uid147250@user/econo) |
2022-12-13 19:23:02 +0100 | festive_kurbus | (~festive_k@user/kurbus) |
2022-12-13 19:24:42 +0100 | jakalx | (~jakalx@base.jakalx.net) |
2022-12-13 19:26:33 +0100 | mbuf | (~Shakthi@49.204.114.77) (Quit: Leaving) |
2022-12-13 19:34:06 +0100 | teo | (~teo@user/teo) (Ping timeout: 272 seconds) |
2022-12-13 19:39:36 +0100 | <dminuoso> | VOID[m]: Affine traversals arent really "needed" for anything. There's nothing that you can do with an affine traversal that you couldnt also do with a general traversal. |
2022-12-13 19:40:04 +0100 | festive_kurbus | (~festive_k@user/kurbus) (Quit: Client closed) |
2022-12-13 19:40:13 +0100 | <dminuoso> | They are just useful in expressing some property (namely that the traversal or fold) could at most target only one element, denoting that something like `preview` couldnt possibly throw away information |
2022-12-13 19:40:23 +0100 | <dminuoso> | But that's the extend of it |
2022-12-13 19:41:03 +0100 | <VOID[m]> | dminuoso: I figured I am missing basic knowledge around composition (Functors, Applicatives and such). Am reading Learn You a Haskell for Great Good |
2022-12-13 19:41:26 +0100 | <dminuoso> | Well there's is some easy ways to gain intutions about how lenses and traversals work. |
2022-12-13 19:42:38 +0100 | <dminuoso> | The main problem in building affine traversals in `lens` is that you would need a class `Pointed`, which you could make. However, they wouldn't cleanly degrade to traversals unless we made it a superclass of Applicative, which is not something you are likely to make happen ever. |
2022-12-13 19:43:06 +0100 | <dminuoso> | (Especially since the use of a typeclass `Pointed` would pretty much be limited to just that, affine traversals. There isnt any other conceivable use for them in the entire Haskell world) |
2022-12-13 19:43:17 +0100 | <mauke> | is Pointed = Applicative - Functor? |
2022-12-13 19:43:31 +0100 | <dminuoso> | Pointed is just `pure` |
2022-12-13 19:43:33 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2022-12-13 19:43:46 +0100 | <dminuoso> | So its Applicative sans <*> |
2022-12-13 19:43:53 +0100 | <mauke> | oh, so Applicative - Functor - (<*>) |
2022-12-13 19:44:03 +0100 | <dminuoso> | Well, - Functor doesnt make sense |
2022-12-13 19:44:10 +0100 | <dminuoso> | The ideal lattice you would ahve is: |
2022-12-13 19:44:35 +0100 | <dminuoso> | class Apply f where (<*>) :: f (a -> b) -> f a -> f b |
2022-12-13 19:44:37 +0100 | festive_kurbus | (~festive_k@user/kurbus) |
2022-12-13 19:44:46 +0100 | <dminuoso> | class Pointed f where pure :: a -> f a |
2022-12-13 19:44:56 +0100 | <dminuoso> | class (Apply f, Pointed f) => Applicative f |
2022-12-13 19:45:26 +0100 | <dminuoso> | This way you would get automatic degradations to `traversals` in all scenarios |
2022-12-13 19:47:12 +0100 | <dminuoso> | However, this introduces a different set of problems |
2022-12-13 19:48:10 +0100 | <VOID[m]> | <dminuoso> "The main problem in building..." <- Te thing is I don't understand this sentence, which leads me to believe that I am attempting something above my understanding of Haskell XD |
2022-12-13 19:48:28 +0100 | <VOID[m]> | s/Te/The/ |
2022-12-13 19:49:02 +0100 | <dminuoso> | VOID[m]: For what its worth, I did build what you're asking for myself recently |
2022-12-13 19:49:45 +0100 | <dminuoso> | VOID[m]: However, you are absolutely correct that an affine traversal would concisely describe that accessor, so you seem to have a fairly good basic understanding of lens already. |
2022-12-13 19:50:01 +0100 | <VOID[m]> | I just want an optic made from some path object that works for my tree, that lets me return Maybe when getting and either insert into tree or replace a node with setter (or ignore, if path makes no sence) |
2022-12-13 19:50:09 +0100 | <dminuoso> | VOID[m]: But it wouldnt be needed, such an accessor could easily just be a Traversal with the implicit understanding it will only touch one element at most. |
2022-12-13 19:50:46 +0100 | <dminuoso> | Or maybe a `Lense even |
2022-12-13 19:50:54 +0100 | <dminuoso> | Which is less powerful, but would suffice |
2022-12-13 19:50:55 +0100 | <VOID[m]> | dminuoso: I have okish basic understanding, but each tutorial I found has a place where it says "Now squit a bit - it's a Foldable with Applicative!" and suddenly code turns into hieroglyphs XD |
2022-12-13 19:50:56 +0100 | <dminuoso> | Consider: |
2022-12-13 19:50:58 +0100 | <dminuoso> | at :: Index m -> Lens' m (Maybe (IxValue m)) |
2022-12-13 19:51:04 +0100 | <dminuoso> | ix :: Index m -> Traversal' m (IxValue m) |
2022-12-13 19:51:14 +0100 | <dminuoso> | (The difference here is that `at` gets to delete an element, `ix` does not) |
2022-12-13 19:51:29 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:a84a:2d35:f948:fe07) |
2022-12-13 19:51:57 +0100 | ft | (~ft@p4fc2a257.dip0.t-ipconnect.de) |
2022-12-13 19:52:06 +0100 | <VOID[m]> | dminuoso: god damn it |
2022-12-13 19:52:06 +0100 | <VOID[m]> | I read somewhere, that Lens has to succeed |
2022-12-13 19:52:06 +0100 | <VOID[m]> | I don't get how that works with `Maybe` ;_; |
2022-12-13 19:52:31 +0100 | <dminuoso> | VOID[m]: Imagine something like: |
2022-12-13 19:52:42 +0100 | <VOID[m]> | Also when I tried doing Lens with Maybe it told me that I have to accept Maybe as input to setter (probably because I was using simplified helpers somewhere?) |
2022-12-13 19:52:45 +0100 | <dminuoso> | data User = User { _name :: Maybe Textt } |
2022-12-13 19:52:49 +0100 | <VOID[m]> | dminuoso: Is it open source by any chance? |
2022-12-13 19:52:56 +0100 | <dminuoso> | With a TH generated lens of `name :: Lens' User (Maybe Text)` |
2022-12-13 19:53:12 +0100 | <dminuoso> | VOID[m]: And no, thats absolutely right. |
2022-12-13 19:53:55 +0100 | VOID[m] | sent a hs code block: https://libera.ems.host/_matrix/media/v3/download/libera.chat/88715e5af4c7aef14cc2044c63c6da47ddb4… |
2022-12-13 19:54:07 +0100 | <dminuoso> | foo & someMaybeLens .~ Just 1 |
2022-12-13 19:54:09 +0100 | <dminuoso> | foo & someMaybeLens .~ Nothing |
2022-12-13 19:54:13 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2022-12-13 19:54:22 +0100 | <dminuoso> | However, yuou can use the ?~ shorthand (which will automaically introduce the Just) |
2022-12-13 19:55:19 +0100 | mauke | is impressed by the Matrix->IRC bridge |
2022-12-13 19:56:17 +0100 | <VOID[m]> | mauke: As a Matrix user - the bridge is GREAT. Persistent history, many devices, modern UI. I just hope you IRC fellas see all of my messages correctly :P |
2022-12-13 19:56:30 +0100 | <dminuoso> | Looks perfectly fine |
2022-12-13 19:56:47 +0100 | <dminuoso> | Even with you writing more than libera allows, which automatically gets send into a paste snippet |
2022-12-13 19:57:23 +0100 | <mauke> | it seems to translate targeted replies and self corrections in a perfectly natural fashion |
2022-12-13 19:57:40 +0100 | <monochrom> | Nice. |
2022-12-13 19:57:48 +0100 | <VOID[m]> | Damn |
2022-12-13 19:57:48 +0100 | <VOID[m]> | That's nice |
2022-12-13 19:57:48 +0100 | <VOID[m]> | One day I'll have to check out what I am actually sending XD |
2022-12-13 19:58:00 +0100 | <dminuoso> | VOID[m]: Ill let you know what I do for my tree |
2022-12-13 19:58:22 +0100 | <dminuoso> | data Tree k a = Node { treeNode :: a, treeChildren :: M.HashMap k (Tree k a) } deriving (Eq, Ord, Show, Foldable, Functor) |
2022-12-13 19:58:25 +0100 | <VOID[m]> | dminuoso: your maybe example *seems* simple, but I don't know how to do the thing for my `getTree` |
2022-12-13 19:58:50 +0100 | <dminuoso> | https://gist.github.com/dminuoso/f14ddbbc95a5978bed8bcff594cbf1fe |
2022-12-13 19:59:04 +0100 | <dminuoso> | VOID[m]: ^- and this is the alterF that allows you to edit the tree |
2022-12-13 19:59:20 +0100 | <dminuoso> | With some extra hooks for diagnostics that I require |
2022-12-13 19:59:29 +0100 | <mauke> | VOID[m]: here's what I see: https://paste.tomsmeding.com/7yiOoIXk |
2022-12-13 19:59:55 +0100 | <dminuoso> | That being said |
2022-12-13 20:00:07 +0100 | <dminuoso> | There's some cool expression you could do with lens |
2022-12-13 20:00:42 +0100 | <dminuoso> | All you need is just an Ixed (or even At) instance |
2022-12-13 20:00:55 +0100 | <dminuoso> | Then you can just fold some [Key] into a Traversal |
2022-12-13 20:01:28 +0100 | <dminuoso> | VOID[m]: Take my Tree as an immediate example (simply because it already works for that) |
2022-12-13 20:01:46 +0100 | <dminuoso> | We already have an `(Eq k, Hashable k) => Ixed (HashMap k a)` instance |
2022-12-13 20:02:08 +0100 | <VOID[m]> | mauke: I have mixed feelings about that code block... |
2022-12-13 20:02:22 +0100 | <dminuoso> | Modulo the newtype, we can already write `ix "key"` to get a traversal one level deep. |
2022-12-13 20:02:40 +0100 | AlexZenon | (~alzenon@178.34.161.14) (Ping timeout: 260 seconds) |
2022-12-13 20:02:42 +0100 | <dminuoso> | Now with [Text] you can just fold, `at` each element, and compose them together |
2022-12-13 20:02:44 +0100 | <dminuoso> | Done! |
2022-12-13 20:03:08 +0100 | <dminuoso> | Does that make any sense to you? |
2022-12-13 20:03:18 +0100 | Alex_test | (~al_test@178.34.161.14) (Ping timeout: 268 seconds) |
2022-12-13 20:03:40 +0100 | <VOID[m]> | dminuoso: "fold some [Key] into a Traversal" I like your funny words magic man XD I'll have to return to this conversation after I read about composition more, for now folding, at, ixed are quite hard to comprehend... I used them, I managed to implement them a few times, but I don't really "get" them |
2022-12-13 20:03:52 +0100 | <VOID[m]> | And when they get composed with each other it becomes VERY hard to follow for me |
2022-12-13 20:03:52 +0100 | <dminuoso> | Okay let me slow down for a moment |
2022-12-13 20:04:02 +0100 | <dminuoso> | % import qualified Data.Map as M |
2022-12-13 20:04:02 +0100 | <yahb2> | <no output> |
2022-12-13 20:04:28 +0100 | <dminuoso> | % let m = M.fromList [("foo", 1), ("bar", 2), ("quux", 3)] |
2022-12-13 20:04:28 +0100 | <yahb2> | <no output> |
2022-12-13 20:04:32 +0100 | <dminuoso> | :t m |
2022-12-13 20:04:33 +0100 | <lambdabot> | Expr |
2022-12-13 20:04:34 +0100 | <dminuoso> | % :t m |
2022-12-13 20:04:34 +0100 | <yahb2> | m :: Num a => M.Map String a |
2022-12-13 20:04:38 +0100 | <dminuoso> | VOID[m]: So far so good? |
2022-12-13 20:04:40 +0100 | nschoe | (~q@2a01:e0a:8e:a190:befe:db92:c07:c717) (Remote host closed the connection) |
2022-12-13 20:04:41 +0100 | <dminuoso> | % let m = M.fromList [("foo", 1), ("bar", 2), ("quux", 3 :: Int)] |
2022-12-13 20:04:41 +0100 | <yahb2> | <no output> |
2022-12-13 20:04:43 +0100 | <dminuoso> | % :t m |
2022-12-13 20:04:43 +0100 | <yahb2> | m :: M.Map String Int |
2022-12-13 20:04:48 +0100 | <dminuoso> | TO make it monomorphic, less confusion |
2022-12-13 20:05:28 +0100 | <VOID[m]> | sure |
2022-12-13 20:05:29 +0100 | <VOID[m]> | I get it so far |
2022-12-13 20:05:41 +0100 | <dminuoso> | Now, because we have an `instance Ord k => Ixed (Map k a)` that means we can use `ix :: String -> Traversal' (M.Map String Int) Int` |
2022-12-13 20:05:51 +0100 | <dminuoso> | Let's look at how that works |
2022-12-13 20:05:52 +0100 | nschoe | (~q@2a01:e0a:8e:a190:7d4a:1795:de80:8cc7) |
2022-12-13 20:06:13 +0100 | <dminuoso> | % m ^.. ix "foo" |
2022-12-13 20:06:13 +0100 | <yahb2> | <interactive>:16:3: error: ; Variable not in scope: (^..) :: M.Map String Int -> t0 -> t ; ; <interactive>:16:7: error: ; • Variable not in scope: ix :: String -> t0 ; • Perhaps you me... |
2022-12-13 20:06:20 +0100 | <dminuoso> | % import Control.Lens.Fold |
2022-12-13 20:06:20 +0100 | <yahb2> | <no location info>: error: ; Could not find module ‘Control.Lens.Fold’ ; It is not a module in the current program, or in any known package. |
2022-12-13 20:06:22 +0100 | <dminuoso> | Uh |
2022-12-13 20:06:30 +0100 | <dminuoso> | :t (^..) |
2022-12-13 20:06:31 +0100 | <lambdabot> | s -> Getting (Endo [a]) s a -> [a] |
2022-12-13 20:06:36 +0100 | <dminuoso> | Okay let me repeat it with lambdabot |
2022-12-13 20:06:41 +0100 | <dminuoso> | @let import qualified Data.Map as M |
2022-12-13 20:06:42 +0100 | <lambdabot> | Defined. |
2022-12-13 20:06:47 +0100 | <dminuoso> | @let m = M.fromList [("foo", 1), ("bar", 2), ("quux", 3 :: Int)] |
2022-12-13 20:06:48 +0100 | <lambdabot> | Defined. |
2022-12-13 20:06:51 +0100 | <dminuoso> | @let myMap = M.fromList [("foo", 1), ("bar", 2), ("quux", 3 :: Int)] |
2022-12-13 20:06:52 +0100 | <lambdabot> | Defined. |
2022-12-13 20:06:58 +0100 | <dminuoso> | > myMap ^.. ix "foo" |
2022-12-13 20:07:00 +0100 | <lambdabot> | [1] |
2022-12-13 20:07:03 +0100 | <dminuoso> | VOID[m]: So far so good? |
2022-12-13 20:07:29 +0100 | <VOID[m]> | list as output |
2022-12-13 20:07:31 +0100 | <VOID[m]> | ? |
2022-12-13 20:07:37 +0100 | <dminuoso> | That's fine, we'll talk about that later |
2022-12-13 20:07:45 +0100 | <VOID[m]> | Then yes |
2022-12-13 20:07:48 +0100 | <dminuoso> | This is because `ix` is a traversal, and (^..) is just toListOf |
2022-12-13 20:07:54 +0100 | <dminuoso> | (or ix produces a traversal, rather) |
2022-12-13 20:07:59 +0100 | <dsal> | ^? would also be fine here. |
2022-12-13 20:08:24 +0100 | <VOID[m]> | Ok ok, makes sense |
2022-12-13 20:08:34 +0100 | <dminuoso> | VOID[m]: Now what we'll do instead, is make a nested map |
2022-12-13 20:09:21 +0100 | <dminuoso> | @let newtype Tree k a = Node { nodeValue :: a, children :: Map k (Tree k a) } |
2022-12-13 20:09:21 +0100 | <lambdabot> | Parse failed: newtype declaration constructor must have exactly one parameter. |
2022-12-13 20:09:26 +0100 | <dminuoso> | @let data Tree k a = Node { nodeValue :: a, children :: Map k (Tree k a) } |
2022-12-13 20:09:27 +0100 | <lambdabot> | /sandbox/tmp/.L.hs:164:50: error: |
2022-12-13 20:09:27 +0100 | <lambdabot> | Not in scope: type constructor or class ‘Map’ |
2022-12-13 20:09:27 +0100 | <lambdabot> | Perhaps you meant ‘M.Map’ (imported from Data.Map) |
2022-12-13 20:09:31 +0100 | <dminuoso> | @let data Tree k a = Node { nodeValue :: a, children :: M.Map k (Tree k a) } |
2022-12-13 20:09:32 +0100 | <lambdabot> | /sandbox/tmp/.L.hs:165:43: error: |
2022-12-13 20:09:32 +0100 | <lambdabot> | Ambiguous occurrence ‘Tree’ |
2022-12-13 20:09:32 +0100 | <lambdabot> | It could refer to |
2022-12-13 20:09:40 +0100 | <dminuoso> | @let data MyTree k a = Node { nodeValue :: a, children :: M.Map k (MyTree k a) } |
2022-12-13 20:09:41 +0100 | <lambdabot> | Defined. |
2022-12-13 20:09:46 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2022-12-13 20:09:51 +0100 | <dminuoso> | VOID[m]: So you see how this is a tree? |
2022-12-13 20:10:06 +0100 | Alex_test | (~al_test@178.34.161.14) |
2022-12-13 20:10:19 +0100 | <VOID[m]> | Yes |
2022-12-13 20:10:38 +0100 | <VOID[m]> | And keys in DB would be the same as crumbs in my tree, right? |
2022-12-13 20:10:44 +0100 | <dminuoso> | Yes |
2022-12-13 20:10:46 +0100 | <VOID[m]> | *keys in map |
2022-12-13 20:10:50 +0100 | AlexZenon | (~alzenon@178.34.161.14) |
2022-12-13 20:10:53 +0100 | <VOID[m]> | great |
2022-12-13 20:11:58 +0100 | <dminuoso> | @let type instance IxValue (MyTree k a) = a |
2022-12-13 20:12:00 +0100 | <lambdabot> | Defined. |
2022-12-13 20:12:23 +0100 | <dminuoso> | @let type instance Index (MyTree k a) = k |
2022-12-13 20:12:24 +0100 | <lambdabot> | Defined. |
2022-12-13 20:12:42 +0100 | <dminuoso> | These are just type family instances, think of them as just definitions for a type level function. This type family is used in Ixed. |
2022-12-13 20:13:07 +0100 | <dminuoso> | Feel free to gloss over it (they just help Ixed understand what the Key and Value types of `MyTree k a` are |
2022-12-13 20:13:38 +0100 | freeside | (~mengwong@pd907d273.dip0.t-ipconnect.de) |
2022-12-13 20:13:39 +0100 | biberu | (~biberu@user/biberu) (Read error: Connection reset by peer) |
2022-12-13 20:14:00 +0100 | biberu | (~biberu@user/biberu) |
2022-12-13 20:14:08 +0100 | <VOID[m]> | I won't say that I could write something like this myself, but I get the idea |
2022-12-13 20:16:50 +0100 | <dminuoso> | gah I need to redo the above type due to more conflicts |
2022-12-13 20:17:03 +0100 | <dminuoso> | @let data MyTree k a = Node { myTreeValue :: a, myTreeChildren :: M.Map k (MyTree k a) } |
2022-12-13 20:17:04 +0100 | <lambdabot> | /sandbox/tmp/.L.hs:171:1: error: |
2022-12-13 20:17:04 +0100 | <lambdabot> | Multiple declarations of ‘MyTree’ |
2022-12-13 20:17:04 +0100 | <lambdabot> | Declared at: /sandbox/tmp/.L.hs:164:1 |
2022-12-13 20:17:07 +0100 | <dminuoso> | @undef |
2022-12-13 20:17:07 +0100 | <lambdabot> | Undefined. |
2022-12-13 20:17:09 +0100 | <dminuoso> | @let data MyTree k a = Node { myTreeValue :: a, myTreeChildren :: M.Map k (MyTree k a) } |
2022-12-13 20:17:10 +0100 | <lambdabot> | Defined. |
2022-12-13 20:17:12 +0100 | <dminuoso> | @let type instance IxValue (MyTree k a) = a |
2022-12-13 20:17:13 +0100 | <lambdabot> | Defined. |
2022-12-13 20:17:15 +0100 | <dsal> | Yeah, blow it all up. |
2022-12-13 20:17:16 +0100 | <dminuoso> | @let type instance Index (MyTree k a) = k |
2022-12-13 20:17:17 +0100 | <lambdabot> | Defined. |
2022-12-13 20:17:25 +0100 | <dsal> | (we all share the same lambdabot) |
2022-12-13 20:17:41 +0100 | <dminuoso> | @let childrenLens = lens (\m -> myTreeChildren m) (\m v -> m{myTreeChildren = v} |
2022-12-13 20:17:41 +0100 | <lambdabot> | Parse failed: Parse error: EOF |
2022-12-13 20:17:46 +0100 | <dminuoso> | @let childrenLens = lens (\m -> myTreeChildren m) (\m v -> m{myTreeChildren = v} |
2022-12-13 20:17:46 +0100 | <lambdabot> | Parse failed: Parse error: EOF |
2022-12-13 20:17:47 +0100 | zer0bitz | (~zer0bitz@196.244.192.60) (Read error: Connection reset by peer) |
2022-12-13 20:17:49 +0100 | <dminuoso> | @let childrenLens = lens (\m -> myTreeChildren m) (\m v -> m{myTreeChildren = v}) |
2022-12-13 20:17:50 +0100 | <lambdabot> | Defined. |
2022-12-13 20:18:03 +0100 | <dminuoso> | VOID[m]: ^- here, can be TH generated, I just made it by hand. a lens for the children side. |
2022-12-13 20:18:11 +0100 | merijn | (~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) (Ping timeout: 264 seconds) |
2022-12-13 20:18:24 +0100 | <dsal> | lambdabot can't TH |
2022-12-13 20:18:31 +0100 | zer0bitz | (~zer0bitz@196.244.192.60) |
2022-12-13 20:19:14 +0100 | <dminuoso> | @let instance Ord k => Ixed (MyTree k a) where ix i = childrenLens . at i |
2022-12-13 20:19:15 +0100 | <lambdabot> | /sandbox/tmp/.L.hs:168:16: error: |
2022-12-13 20:19:15 +0100 | <lambdabot> | • Occurs check: cannot construct the infinite type: |
2022-12-13 20:19:15 +0100 | <lambdabot> | a ~ Maybe (MyTree k a) |
2022-12-13 20:19:21 +0100 | <dminuoso> | Ah huh. |
2022-12-13 20:19:36 +0100 | <dminuoso> | Maybe we do need to go through Plated here |
2022-12-13 20:20:10 +0100 | freeside | (~mengwong@pd907d273.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
2022-12-13 20:20:18 +0100 | <dminuoso> | Ah no, this is incompatible with the above type instance heh |
2022-12-13 20:20:29 +0100 | <dminuoso> | @let type instance Index (MyTree k a) = MyTree k a |
2022-12-13 20:20:30 +0100 | <lambdabot> | /sandbox/tmp/.L.hs:161:15: error: |
2022-12-13 20:20:30 +0100 | <lambdabot> | Conflicting family instance declarations: |
2022-12-13 20:20:30 +0100 | <lambdabot> | Index (MyTree k a) = k -- Defined at /sandbox/tmp/.L.hs:161:15 |
2022-12-13 20:21:11 +0100 | freeside | (~mengwong@pd907d273.dip0.t-ipconnect.de) |
2022-12-13 20:21:36 +0100 | <monochrom> | Yikes you may have to @undefine and define everything all over again :( :) |
2022-12-13 20:21:52 +0100 | <dminuoso> | lambdabot is getting spammed in query :) |
2022-12-13 20:22:36 +0100 | <dminuoso> | @let instance Ord k => Ixed (MyTree1 k a) where ix i = childrenLens1 . at i |
2022-12-13 20:22:37 +0100 | <lambdabot> | /sandbox/tmp/.L.hs:175:16: error: |
2022-12-13 20:22:37 +0100 | <lambdabot> | • Couldn't match type ‘MyTree k a0’ with ‘MyTree1 k a’ |
2022-12-13 20:22:37 +0100 | <lambdabot> | Expected type: (IxValue (MyTree1 k a) -> f (IxValue (MyTree1 k a))) |
2022-12-13 20:23:18 +0100 | <monochrom> | I wonder if you could merge into a looong single line @let { data MyTree = ... ; instance Foo ... ; type Bar = ... } |
2022-12-13 20:23:18 +0100 | <VOID[m]> | I'll try to do it myself, I think I saw enough? |
2022-12-13 20:23:18 +0100 | <VOID[m]> | I have some questions about the process though |
2022-12-13 20:23:46 +0100 | <geekosaur> | just leave off the braces |
2022-12-13 20:23:47 +0100 | <dsal> | Normal process is doing it in a file and :r -- but lambda bot doesn't support :r |
2022-12-13 20:24:03 +0100 | <dminuoso> | @let instance Ord k => Ixed (MyTree1 k a) where ix i = __childrenLens1 . at i |
2022-12-13 20:24:04 +0100 | <lambdabot> | /sandbox/tmp/.L.hs:177:16: error: |
2022-12-13 20:24:04 +0100 | <lambdabot> | • Couldn't match type ‘MyTree1 k a’ with ‘Maybe (MyTree k a)’ |
2022-12-13 20:24:04 +0100 | <lambdabot> | Expected type: (IxValue (MyTree1 k a) -> f (IxValue (MyTree1 k a))) |
2022-12-13 20:24:16 +0100 | <dminuoso> | Oh hah. Not again. |
2022-12-13 20:24:21 +0100 | <monochrom> | @where playground |
2022-12-13 20:24:21 +0100 | <lambdabot> | I know nothing about playground. |
2022-12-13 20:24:44 +0100 | <geekosaur> | https://play-haskell.tomsmeding.com/ |
2022-12-13 20:24:52 +0100 | <VOID[m]> | I miss knowledge about composition |
2022-12-13 20:24:52 +0100 | <VOID[m]> | I couldn't come up with using Ixed by myself |
2022-12-13 20:25:01 +0100 | <VOID[m]> | I have to learn composition stuff |
2022-12-13 20:25:06 +0100 | <dminuoso> | VOID[m]: Sorry Im messing up with slight typos. Im almost there. Hang tight |
2022-12-13 20:25:09 +0100 | <dsal> | Oh wow. This is cool. I needed this yesterday. |
2022-12-13 20:25:25 +0100 | <dminuoso> | @let data MyTree2 k a = Node { myTree2Value :: a, myTree1Children :: M.Map k (MyTree2 k a) |
2022-12-13 20:25:25 +0100 | <lambdabot> | Parse failed: Parse error: EOF |
2022-12-13 20:25:27 +0100 | <dminuoso> | @let data MyTree2 k a = Node { myTree2Value :: a, myTree1Children :: M.Map k (MyTree2 k a) } |
2022-12-13 20:25:28 +0100 | <lambdabot> | /sandbox/tmp/.L.hs:176:20: error: |
2022-12-13 20:25:28 +0100 | <lambdabot> | Multiple declarations of ‘Node’ |
2022-12-13 20:25:28 +0100 | <lambdabot> | Declared at: /sandbox/tmp/.L.hs:156:19 |
2022-12-13 20:25:30 +0100 | <monochrom> | Thanks. That. You may find it more usable when you need so many lines of definitions. |
2022-12-13 20:25:34 +0100 | <dminuoso> | Heh |
2022-12-13 20:25:39 +0100 | <dminuoso> | monochrom: does it have lens, though? |
2022-12-13 20:25:56 +0100 | <dsal> | Could not find module ‘Control.Lens’ |
2022-12-13 20:26:02 +0100 | freeside | (~mengwong@pd907d273.dip0.t-ipconnect.de) (Ping timeout: 272 seconds) |
2022-12-13 20:26:12 +0100 | <monochrom> | Hrm probably not. |
2022-12-13 20:26:42 +0100 | <geekosaur> | figured. neither does yahb2 as far as I can tell |
2022-12-13 20:27:18 +0100 | <monochrom> | I might just copy-paste the content of lens >:) |
2022-12-13 20:27:38 +0100 | k8yun | (~k8yun@user/k8yun) |
2022-12-13 20:27:50 +0100 | <VOID[m]> | I don't get type instance Index (MyTree k a) = MyTree k a |
2022-12-13 20:27:51 +0100 | <VOID[m]> | Isn't Index just the k? |
2022-12-13 20:28:01 +0100 | <VOID[m]> | Or is this not what that means |
2022-12-13 20:28:43 +0100 | <dminuoso> | VOID[m]: https://gist.github.com/dminuoso/45d3126e303ff90b111232320022b022 success, finally |
2022-12-13 20:29:08 +0100 | <dminuoso> | So now we have a Tree, and we can build a traversal that looks one level using `at` |
2022-12-13 20:29:11 +0100 | <geekosaur> | @where+ playground https://play-haskell.tomsmeding.com/ |
2022-12-13 20:29:11 +0100 | <lambdabot> | Good to know. |
2022-12-13 20:29:55 +0100 | <monochrom> | Yeah should be type instance Index (MyTree4 k a) = k |
2022-12-13 20:30:02 +0100 | <dsal> | @playground+ lens |
2022-12-13 20:30:02 +0100 | <lambdabot> | Unknown command, try @list |
2022-12-13 20:30:34 +0100 | <monochrom> | Ugh MyTree4 haha. "This is the 4th attempt" |
2022-12-13 20:30:35 +0100 | <geekosaur> | wrong bot anyway, it'd be yahb2 if it worked at all |
2022-12-13 20:31:11 +0100 | ballast | (~ballast@cpe-104-32-238-223.socal.res.rr.com) |
2022-12-13 20:31:11 +0100 | <dminuoso> | @let ats = appEndo . foldMap (Endo . at) |
2022-12-13 20:31:12 +0100 | <lambdabot> | Defined. |
2022-12-13 20:31:15 +0100 | <dminuoso> | :t ats |
2022-12-13 20:31:16 +0100 | <dsal> | That's an awesome site anyway. I like the core button. |
2022-12-13 20:31:16 +0100 | <lambdabot> | (Foldable t1, Functor f) => t1 () -> (Maybe t2 -> f (Maybe t2)) -> Maybe t2 -> f (Maybe t2) |
2022-12-13 20:31:23 +0100 | <[exa]> | actuellement, can we put the playground into the topic? |
2022-12-13 20:31:41 +0100 | <dminuoso> | Uh, where did that () come from? |
2022-12-13 20:32:02 +0100 | <[exa]> | dminuoso: looks like default () |
2022-12-13 20:32:10 +0100 | <mauke> | :t foldMap |
2022-12-13 20:32:11 +0100 | <lambdabot> | (Foldable t, Monoid m) => (a -> m) -> t a -> m |
2022-12-13 20:33:10 +0100 | <mauke> | :t let ats x = (appEndo . foldMap (Endo . at)) x in ats |
2022-12-13 20:33:11 +0100 | <monochrom> | I'm going to put it right after the downloads.haskell.org link. |
2022-12-13 20:33:11 +0100 | <lambdabot> | (Foldable t1, Functor f) => t1 () -> (Maybe t2 -> f (Maybe t2)) -> Maybe t2 -> f (Maybe t2) |
2022-12-13 20:33:14 +0100 | ChanServ | +o monochrom |
2022-12-13 20:33:37 +0100 | <dminuoso> | Ah at is wrong anyway here |
2022-12-13 20:33:39 +0100 | <dminuoso> | @let ixes''' = appEndo . foldMap (Endo . ix) :: At m => [Index m] -> Traversal' m (IxValue m) |
2022-12-13 20:33:40 +0100 | <lambdabot> | /sandbox/tmp/.L.hs:202:31: error: |
2022-12-13 20:33:40 +0100 | <lambdabot> | • Couldn't match type ‘m1’ with ‘IxValue m1’ |
2022-12-13 20:33:40 +0100 | <lambdabot> | ‘m1’ is a rigid type variable bound by |
2022-12-13 20:33:57 +0100 | | https://www.reddit.com/r/haskell | Admin: #haskell-ops | Offtopic: #haskell-offtopic | https://downloads.haskell.org https://play-haskell.tomsmeding.com/ | Paste code/errors: https://paste.tomsmeding.com | Logs: https://ircbrowse.tomsmeding.com/browse/lchaskell | AoC Leaderboard: 43100-84040706 |
2022-12-13 20:34:07 +0100 | zer0bitz | (~zer0bitz@196.244.192.60) (Read error: Connection reset by peer) |
2022-12-13 20:34:33 +0100 | monochrom | -o monochrom |
2022-12-13 20:34:39 +0100 | <dminuoso> | I gotta run, though |
2022-12-13 20:34:46 +0100 | <monochrom> | Feel free to optimize it though, heh. |
2022-12-13 20:34:51 +0100 | <dminuoso> | VOID[m]: Anyway, you can do it along this way |
2022-12-13 20:35:11 +0100 | <dminuoso> | And you can upgrade to `At`, which expresses modifying whatever the optic points at. |
2022-12-13 20:35:45 +0100 | zer0bitz | (~zer0bitz@196.244.192.60) |
2022-12-13 20:36:00 +0100 | <VOID[m]> | Do the docs have a tree with short descriptions maybe? |
2022-12-13 20:36:12 +0100 | <dminuoso> | (Or you can just use `unsafeSingular` with whatever this produces and be done with it) |
2022-12-13 20:36:14 +0100 | <VOID[m]> | How does one gain knowledge about stuff like "Ixed", "At" etc |
2022-12-13 20:36:21 +0100 | zer0bitz | (~zer0bitz@196.244.192.60) (Read error: Connection reset by peer) |
2022-12-13 20:36:33 +0100 | <dminuoso> | No, you are expected to just magically understand from the type signatures and the short examples |
2022-12-13 20:36:46 +0100 | <monochrom> | I think the lens front page has a huge UML class hierarchy. |
2022-12-13 20:36:57 +0100 | zer0bitz | (~zer0bitz@196.244.192.60) |
2022-12-13 20:37:22 +0100 | <ballast> | I've reached a point in my application where I've put an auxiliary function into my state data type that isn't meaningfully a part of the state, i.e. it never changes. Is it time to use a ReaderT or is it OK to just let it kick around as part of the state? |
2022-12-13 20:38:08 +0100 | califax | (~califax@user/califx) (Ping timeout: 255 seconds) |
2022-12-13 20:38:18 +0100 | <monochrom> | https://hackage.haskell.org/package/lens and scroll down |
2022-12-13 20:38:51 +0100 | <monochrom> | Oh, https://hackage.haskell.org/package/lens#readme |
2022-12-13 20:39:10 +0100 | malte | (~malte@mal.tc) (Ping timeout: 256 seconds) |
2022-12-13 20:39:44 +0100 | melonai- | (~mel@rnrd.eu) (Ping timeout: 256 seconds) |
2022-12-13 20:39:49 +0100 | melonai | (~mel@rnrd.eu) |
2022-12-13 20:39:52 +0100 | <VOID[m]> | And you se Ixed on that graph? |
2022-12-13 20:39:59 +0100 | <monochrom> | No. |
2022-12-13 20:39:59 +0100 | [exa]_ | (~exa@srv3n.blesmrt.net) |
2022-12-13 20:40:06 +0100 | [exa]_ | (~exa@srv3n.blesmrt.net) (Changing host) |
2022-12-13 20:40:06 +0100 | [exa]_ | (~exa@user/exa/x-3587197) |
2022-12-13 20:40:18 +0100 | [exa] | (~exa@user/exa/x-3587197) (Ping timeout: 256 seconds) |
2022-12-13 20:40:18 +0100 | crns | (~netcrns@user/crns) (Ping timeout: 256 seconds) |
2022-12-13 20:40:24 +0100 | [exa]_ | [exa] |
2022-12-13 20:40:49 +0100 | <VOID[m]> | I am trying to get Ixed for my type, but how am I supposed to implement something that has "Minimal complete definition: Nothing" |
2022-12-13 20:40:49 +0100 | <VOID[m]> | I know enough to copy and modify, not enough to actually implement |
2022-12-13 20:40:49 +0100 | <VOID[m]> | Gotta get back to books... |
2022-12-13 20:40:52 +0100 | hrberg | (~quassel@171.79-160-161.customer.lyse.net) (Ping timeout: 256 seconds) |
2022-12-13 20:40:52 +0100 | adium | (adium@user/adium) (Ping timeout: 256 seconds) |
2022-12-13 20:41:27 +0100 | califax | (~califax@user/califx) |
2022-12-13 20:41:27 +0100 | hrberg | (~quassel@171.79-160-161.customer.lyse.net) |
2022-12-13 20:41:56 +0100 | crns | (~netcrns@p4ff5e521.dip0.t-ipconnect.de) |
2022-12-13 20:41:56 +0100 | crns | (~netcrns@p4ff5e521.dip0.t-ipconnect.de) (Changing host) |
2022-12-13 20:41:56 +0100 | crns | (~netcrns@user/crns) |
2022-12-13 20:42:18 +0100 | malte | (~malte@mal.tc) |
2022-12-13 20:42:27 +0100 | <[exa]> | VOID[m]: sadly the common advanced lens tutorials simply let you reinvent the whole thing and then obviously you kinda get it |
2022-12-13 20:43:17 +0100 | adium | (adium@user/adium) |
2022-12-13 20:43:59 +0100 | <monochrom> | Egomaniac opinion: The lens world suffers poor doc because I haven't become interested. >:) |
2022-12-13 20:44:00 +0100 | zer0bitz | (~zer0bitz@196.244.192.60) (Read error: Connection reset by peer) |
2022-12-13 20:44:16 +0100 | <dminuoso> | VOID[m]: Well, Ixed is not a part of that hierarchy |
2022-12-13 20:44:25 +0100 | <dminuoso> | Ixed is a class of traversals |
2022-12-13 20:44:30 +0100 | merijn | (~merijn@c-001-002-026.client.esciencecenter.eduvpn.nl) |
2022-12-13 20:44:43 +0100 | <dminuoso> | The hierarchy denotes relationships of types of optics and how they can degrade |
2022-12-13 20:44:49 +0100 | califax | (~califax@user/califx) (Remote host closed the connection) |
2022-12-13 20:44:49 +0100 | <dminuoso> | And how they can be composed |
2022-12-13 20:44:54 +0100 | <dminuoso> | optics is a lot stronger in that respect |
2022-12-13 20:45:13 +0100 | califax | (~califax@user/califx) |
2022-12-13 20:45:29 +0100 | <[exa]> | VOID[m]: but the type of `ix` should be kinda guiding: `Index m -> Traversal' m (IxValue m)`... you just take the index and convert it to a traversal through the corresponding value (if it's there) |
2022-12-13 20:45:52 +0100 | zer0bitz | (~zer0bitz@196.244.192.60) |
2022-12-13 20:47:34 +0100 | <EvanR> | ballast, there's nothing fundamentally wrong with having something in your state that never changes. If it's already like a big record of stuff |
2022-12-13 20:48:16 +0100 | <[exa]> | VOID[m]: and the traversal you can make using the normal lens machinery, e.g. https://hackage.haskell.org/package/lens-5.2/docs/Control-Lens-Combinators.html#v:traversal which is just a slightly more generic version of the usual `lens` that makes a lens from a getter and a setter |
2022-12-13 20:48:22 +0100 | <EvanR> | if there is something that really really will never change you could do ReaderT and access it easier though |
2022-12-13 20:48:33 +0100 | <[exa]> | oh noes I used "is just a", apologies. |
2022-12-13 20:48:49 +0100 | <EvanR> | [exa], what's the problem?!?! |
2022-12-13 20:49:10 +0100 | gmg | (~user@user/gehmehgeh) |
2022-12-13 20:49:14 +0100 | <ballast> | EvanR: yeah it is a big record. |
2022-12-13 20:49:18 +0100 | <[exa]> | I hate tutorials that say "you see, this is just a [insert a term from page 9478 of author's fav category theory book here]" |
2022-12-13 20:49:47 +0100 | <[exa]> | the just is plain out condescending if you read it as a newbie |
2022-12-13 20:50:37 +0100 | <ballast> | I realize though that since I have `MyState a` and my function is `a -> Foo` I could also make a typeclass `HasFoo` but not sure if that's better or worse than the other options. |
2022-12-13 20:50:58 +0100 | festive_kurbus | (~festive_k@user/kurbus) (Ping timeout: 260 seconds) |
2022-12-13 20:51:14 +0100 | <VOID[m]> | I just want an Optic made from `(a -> Maybe b)` and `(b -> a)` ;_; |
2022-12-13 20:51:23 +0100 | <ballast> | Then I'd write `statefulFn :: HasFoo a => MyState a -> MyState a` |
2022-12-13 20:51:34 +0100 | <[exa]> | VOID[m]: that sounds like a prism |
2022-12-13 20:51:52 +0100 | <VOID[m]> | Prism has to do the re-smth that creates a Tree, no? |
2022-12-13 20:51:58 +0100 | <EvanR> | ballast, that just seems suspiciously like overengineering or "not gonna need it" territory. But who knows |
2022-12-13 20:52:27 +0100 | <monochrom> | I am OK with "just a $FOO", when the audience is familar with $FOO. |
2022-12-13 20:52:29 +0100 | <[exa]> | VOID[m]: prism is a lens for 1 element that might be missing (I'd say precisely your case) |
2022-12-13 20:52:41 +0100 | <EvanR> | I try to keep things at a basic level of language features until a critical 13.7 eV necessity appears to require something more fancy |
2022-12-13 20:52:51 +0100 | <[exa]> | VOID[m]: oh look, there's your function: https://hackage.haskell.org/package/lens-5.2/docs/Control-Lens-Combinators.html#v:prism-39- |
2022-12-13 20:52:52 +0100 | <ballast> | EvanR: Yeah I mean I've already resisted using a state monad to KISS... |
2022-12-13 20:53:19 +0100 | <VOID[m]> | > A Prism l is a Traversal that can also be turned around with re to obtain a Getter in the opposite direction |
2022-12-13 20:53:21 +0100 | <lambdabot> | <hint>:1:84: error: parse error on input ‘in’ |
2022-12-13 20:53:33 +0100 | <VOID[m]> | This sounds like traversal should be easier, and I don't want the re |
2022-12-13 20:53:43 +0100 | <[exa]> | VOID[m]: (you may assume the `b` and `a` in the signature there ^ are the same) |
2022-12-13 20:54:10 +0100 | <ballast> | EvanR: Not sure what "critical 13.7 eV necessity" means though |
2022-12-13 20:54:25 +0100 | <EvanR> | ground state haskell vs excited state haskell |
2022-12-13 20:54:30 +0100 | <[exa]> | VOID[m]: that's a fancy way of saying that the prism points to a single thing (to invert it, you need uniqueness) |
2022-12-13 20:54:51 +0100 | <EvanR> | nevermind |
2022-12-13 20:54:56 +0100 | <VOID[m]> | As I understand it, a Prism requires the re, no? |
2022-12-13 20:55:04 +0100 | <monochrom> | Heh EvanR I get your joke, no worries! |
2022-12-13 20:55:06 +0100 | <ballast> | Ah... I missed that joke |
2022-12-13 20:55:41 +0100 | <EvanR> | ballast, HasFoo is apparently a popular way to make "real" apps with many monads coexisting but that share some features |
2022-12-13 20:55:41 +0100 | <monochrom> | Although I think you want 13.7 MeV or even GeV. Right? 13.7 eV is very small. |
2022-12-13 20:56:00 +0100 | <[exa]> | VOID[m]: not really, `re` is derived from the 2 functions (partial getter and setter) that you give to `prism` |
2022-12-13 20:56:54 +0100 | <ballast> | Also looking at the linked comment about prisms, I must admit that I don't know how to feel about `isn't` being a function name |
2022-12-13 20:57:09 +0100 | <[exa]> | VOID[m]: there's a lens tutorial that uses prisms as a kinda generalized first-class patternmatches. You get for example `left_` that you can use to check if the Either is `Left something`, and if you reverse it with `re`, you can actually construct the `Left something` from a value |
2022-12-13 20:57:26 +0100 | <EvanR> | it's also wrong, 13.7 eV is how much it costs to totally break up hydrogen as opposed to go up 1 energy level |
2022-12-13 20:57:42 +0100 | <VOID[m]> | Thank you all very much |
2022-12-13 20:57:42 +0100 | <VOID[m]> | I got a lot of great advice |
2022-12-13 20:57:42 +0100 | <VOID[m]> | I'll read more into Ixed stuff, and will try the prism' solution |
2022-12-13 20:57:42 +0100 | <VOID[m]> | Y'all were great <3 |
2022-12-13 20:58:10 +0100 | <EvanR> | ballast, acme-don't package is great |
2022-12-13 20:58:18 +0100 | <EvanR> | it enables don't notation |
2022-12-13 20:58:51 +0100 | <[exa]> | VOID[m]: btw for practical software engineering reasons, you might want to start with writing some trivial Ixed instance (like an ix for a list or Identity or so) |
2022-12-13 20:59:03 +0100 | <ballast> | haha, I like that though |
2022-12-13 20:59:16 +0100 | <[exa]> | VOID[m]: getting custom types into the mix right from the start tends to generate headache |
2022-12-13 20:59:40 +0100 | <[exa]> | anyway yeah, good luck. :] |
2022-12-13 21:00:00 +0100 | <VOID[m]> | So I should try implementing Ixed for something like a list, got it |
2022-12-13 21:00:00 +0100 | <VOID[m]> | Thank you very much for tips <3 |
2022-12-13 21:00:54 +0100 | <mauke> | use Acme::Don't; don't { print "hi\n"; } while (1 == 1); # I think it works better in perl |
2022-12-13 21:02:29 +0100 | <EvanR> | I find the asymmetry a bit annoying though |
2022-12-13 21:02:34 +0100 | <EvanR> | in the haskell version |
2022-12-13 21:02:52 +0100 | <EvanR> | returns () instead of a |
2022-12-13 21:06:59 +0100 | ub | (~Thunderbi@p200300ecdf264e2fdb144bfb5fa7f064.dip0.t-ipconnect.de) |
2022-12-13 21:07:04 +0100 | ubert | (~Thunderbi@p548c9ce5.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
2022-12-13 21:07:04 +0100 | ub | ubert |
2022-12-13 21:10:06 +0100 | <jackdk> | It's the best we can do, but at least it now supports `-XApplicativeDo` (`-XApplicativeDont`?) |
2022-12-13 21:11:45 +0100 | johnw | (~johnw@2600:1700:cf00:db0:d426:be2d:331:cdc5) (Quit: ZNC - http://znc.in) |
2022-12-13 21:14:00 +0100 | <dsal> | At least there's no `-XApplicativeTry` |
2022-12-13 21:14:52 +0100 | <mauke> | don't do something you'll regret -- potentially valid haskell code |
2022-12-13 21:18:50 +0100 | merijn | (~merijn@c-001-002-026.client.esciencecenter.eduvpn.nl) (Ping timeout: 252 seconds) |
2022-12-13 21:24:56 +0100 | <mniip> | is there a way to enable a ghc plugin using only the --ghc-options interface of stack/cabal? |
2022-12-13 21:25:13 +0100 | <mniip> | the problem is of course that the plugin resides in a package that is not in the dependencies list |
2022-12-13 21:30:38 +0100 | doyougnu | (~doyougnu@cpe-74-69-132-225.stny.res.rr.com) (Ping timeout: 272 seconds) |
2022-12-13 21:30:43 +0100 | merijn | (~merijn@c-001-002-026.client.esciencecenter.eduvpn.nl) |
2022-12-13 21:31:38 +0100 | freeside | (~mengwong@pd907d273.dip0.t-ipconnect.de) |
2022-12-13 21:32:18 +0100 | <mniip> | apparently not |
2022-12-13 21:33:17 +0100 | <geekosaur> | does -package not work? |
2022-12-13 21:33:39 +0100 | <geekosaur> | hm, probably not because cabal/stack won't expose it |
2022-12-13 21:34:21 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:a84a:2d35:f948:fe07) (Remote host closed the connection) |
2022-12-13 21:34:58 +0100 | merijn | (~merijn@c-001-002-026.client.esciencecenter.eduvpn.nl) (Ping timeout: 252 seconds) |
2022-12-13 21:35:20 +0100 | Tuplanolla | (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) |
2022-12-13 21:35:59 +0100 | <mniip> | yup |
2022-12-13 21:36:32 +0100 | <mniip> | https://downloads.haskell.org/~ghc/9.4.2/docs/users_guide/extending_ghc.html#:~:text=At%20the%20mo… |
2022-12-13 21:37:39 +0100 | <EvanR> | unsprisingly a dumbass recursive descent version of the day 13 parser is slightly bigger than a megaparsec parser. Surprisingly a dumbass tokenizer + parser on tokens is smaller than both xD |
2022-12-13 21:39:46 +0100 | kenran | (~user@user/kenran) |
2022-12-13 21:41:04 +0100 | kenran | (~user@user/kenran) (Remote host closed the connection) |
2022-12-13 21:42:11 +0100 | <mniip> | with 50-odd packages manually editing cabal files does not seem fun |
2022-12-13 21:46:14 +0100 | jmdaemon | (~jmdaemon@user/jmdaemon) |
2022-12-13 21:48:29 +0100 | <EvanR> | https://paste.tomsmeding.com/HlaE2uLj 😎 |
2022-12-13 21:51:28 +0100 | zer0bitz | (~zer0bitz@196.244.192.60) (Ping timeout: 252 seconds) |
2022-12-13 21:52:19 +0100 | <SrPx> | Hello! Is anyone here familiar with Cardano? I'm trying to compile and run a "Hello, world" offline using Plutus, but I can't find how. Is that possible? |
2022-12-13 22:05:05 +0100 | fserucas | (~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7) (Ping timeout: 246 seconds) |
2022-12-13 22:06:22 +0100 | Katarushisu | (~Katarushi@cpc147790-finc20-2-0-cust502.4-2.cable.virginm.net) (Quit: The Lounge - https://thelounge.chat) |
2022-12-13 22:09:42 +0100 | zer0bitz | (~zer0bitz@196.244.192.57) |
2022-12-13 22:09:52 +0100 | pavonia | (~user@user/siracusa) |
2022-12-13 22:15:16 +0100 | nut | (~nut@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 268 seconds) |
2022-12-13 22:15:55 +0100 | son0p | (~ff@2604:3d08:5b7f:5540::64ea) (Ping timeout: 248 seconds) |
2022-12-13 22:18:22 +0100 | <SrPx> | hmm in case anyone does: https://cardano.stackexchange.com/questions/9625/how-to-run-a-simple-fib-function-offline |
2022-12-13 22:22:53 +0100 | merijn | (~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) |
2022-12-13 22:28:06 +0100 | jargon | (~jargon@174-22-192-24.phnx.qwest.net) |
2022-12-13 22:31:18 +0100 | freeside | (~mengwong@pd907d273.dip0.t-ipconnect.de) (Ping timeout: 268 seconds) |
2022-12-13 22:34:53 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:a84a:2d35:f948:fe07) |
2022-12-13 22:37:43 +0100 | <xerox> | is it possible to use OverloadedLists through read, or is it just for source contents |
2022-12-13 22:37:49 +0100 | trev | (~trev@user/trev) (Remote host closed the connection) |
2022-12-13 22:38:05 +0100 | <mniip> | that's a weird question. What do you mean? |
2022-12-13 22:38:39 +0100 | <geekosaur> | source contents. read can't know about extensions and its behavior is fixed when the base library os built |
2022-12-13 22:38:40 +0100 | <xerox> | just had a strange idea to parse today's aoc input |
2022-12-13 22:38:41 +0100 | <geekosaur> | *is |
2022-12-13 22:39:32 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:a84a:2d35:f948:fe07) (Ping timeout: 255 seconds) |
2022-12-13 22:39:39 +0100 | <xerox> | data P = N Int | L [P] deriving (Read,Show); instance Num P where fromInteger = N . fromInteger; instance IsList P where type Item P = P; fromList = L |
2022-12-13 22:39:44 +0100 | <geekosaur> | this does not preclude running the result through fromList |
2022-12-13 22:40:16 +0100 | <geekosaur> | it just means the runtime won't do so automatically |
2022-12-13 22:40:43 +0100 | <xerox> | geekosaur: how do you do it, I'm at a loss |
2022-12-13 22:40:56 +0100 | <geekosaur> | eh? fromList . read |
2022-12-13 22:41:43 +0100 | <geekosaur> | if it's more complex than that then IsList is probably the wrong answer anyway |
2022-12-13 22:43:46 +0100 | <xerox> | geekosaur: https://pastebin.com/raw/1jmxEEwy |
2022-12-13 22:44:08 +0100 | freeside | (~mengwong@pd907d273.dip0.t-ipconnect.de) |
2022-12-13 22:44:37 +0100 | <geekosaur> | that wasn't going to work even with IsList, the list still has to have the same type |
2022-12-13 22:45:12 +0100 | <xerox> | but it does work with IsList, it's the first example |
2022-12-13 22:45:15 +0100 | <geekosaur> | hm, I guess you were hoping the inner lists would get promoted to Ps. no, read will never do that oribably |
2022-12-13 22:45:24 +0100 | <geekosaur> | *probably |
2022-12-13 22:45:36 +0100 | <geekosaur> | for the same reason we're unlikely to get a Unicode Show instance |
2022-12-13 22:46:01 +0100 | <geekosaur> | changing the behavior of those at runtime would cause all sorts of problems |
2022-12-13 22:46:46 +0100 | lisbeths | (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
2022-12-13 22:48:40 +0100 | freeside | (~mengwong@pd907d273.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
2022-12-13 22:48:57 +0100 | MajorBiscuit | (~MajorBisc@2001:1c00:2404:ed00:28e1:ad14:ec67:539e) |
2022-12-13 22:49:27 +0100 | <mauke> | just run your input through perl -pe 's/\b(?=\d)/N /g; s/\[/L [/g' |
2022-12-13 22:50:50 +0100 | <xerox> | yeah :) |
2022-12-13 22:50:59 +0100 | <mauke> | alternatively, define a custom Read instance |
2022-12-13 22:51:07 +0100 | nschoe | (~q@2a01:e0a:8e:a190:7d4a:1795:de80:8cc7) (Ping timeout: 265 seconds) |
2022-12-13 22:51:16 +0100 | <mauke> | but IsList won't help here |
2022-12-13 22:52:09 +0100 | merijn | (~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds) |
2022-12-13 22:53:02 +0100 | <EvanR> | "just use json lol" |
2022-12-13 22:54:21 +0100 | hsw_ | (~hsw@112-104-142-182.adsl.dynamic.seed.net.tw) |
2022-12-13 22:54:32 +0100 | <mauke> | hmm. this happens to be PDN (perl data notation) |
2022-12-13 22:54:43 +0100 | <mauke> | my $input = do "./input"; # literally run it as perl code, lol |
2022-12-13 22:55:27 +0100 | <mauke> | that suggests you might be able to to shenanigans with CPP and #include |
2022-12-13 22:55:35 +0100 | <mauke> | s/to to/to do/ |
2022-12-13 22:55:49 +0100 | califax | (~califax@user/califx) (Remote host closed the connection) |
2022-12-13 22:55:52 +0100 | hsw | (~hsw@2001-b030-2303-0104-0172-0025-0012-0132.hinet-ip6.hinet.net) (Ping timeout: 252 seconds) |
2022-12-13 22:56:52 +0100 | califax | (~califax@user/califx) |
2022-12-13 22:57:30 +0100 | takuan | (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
2022-12-13 22:59:30 +0100 | <xerox> | interesting idea |
2022-12-13 23:01:58 +0100 | freeside | (~mengwong@pd907d273.dip0.t-ipconnect.de) |
2022-12-13 23:02:09 +0100 | <ballast> | getting this error when I try to use `lens` from microlens: https://paste.tomsmeding.com/3FKZuSbY . Am I missing an extension? I'm confused why it's asking for a specific `f` when the type of `Lens` is `forall f.`. |
2022-12-13 23:02:37 +0100 | <ballast> | (error message has been edited to slim down the definitions/types) |
2022-12-13 23:03:22 +0100 | <jackdk> | Can you paste a bit more context? |
2022-12-13 23:04:05 +0100 | <mauke> | does myState have a type signature in your code? |
2022-12-13 23:04:28 +0100 | <ballast> | mauke: no, I'll add ScopedTypeVariables and try adding one |
2022-12-13 23:04:52 +0100 | <ballast> | jackdk: it's a bit messy with the context but I can do that if adding a signature doesn't work |
2022-12-13 23:05:21 +0100 | <jackdk> | Yeah you'll need a type signature |
2022-12-13 23:06:15 +0100 | <ballast> | I'm passing it to a function that expects a `Lens' s (CalendarState a)` , how come it won't unify? |
2022-12-13 23:06:31 +0100 | <ballast> | Adding the signature though and checking |
2022-12-13 23:07:03 +0100 | nut | (~nut@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) |
2022-12-13 23:07:33 +0100 | Unhammer | (~Unhammer@user/unhammer) (ERC (IRC client for Emacs) with WeeChat) |
2022-12-13 23:07:38 +0100 | <ballast> | OK I've learned my lesson. I won't put my lens definitions in where clauses. Thanks mauke and jackdk |
2022-12-13 23:07:57 +0100 | <[exa]> | ballast: the let-bindings can't unify "back" from the uses |
2022-12-13 23:08:15 +0100 | <[exa]> | (there's the forall in the way that prevents it) |
2022-12-13 23:08:57 +0100 | <ballast> | [exa]: bet it would make sense if I looked at the unification rules, I assume I'm asking for something undecidable |
2022-12-13 23:09:01 +0100 | waleee | (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
2022-12-13 23:09:24 +0100 | <ballast> | Also it's curious that GHC suggests to add RankNTypes instead of Rank2Types when I use the type `type Lens s t a b = forall f. -- etc.` |
2022-12-13 23:09:40 +0100 | <ballast> | Ah. I see Rank2Types is obsolete, never mind. |
2022-12-13 23:09:42 +0100 | <jackdk> | Rank2Types is obsolete |
2022-12-13 23:09:43 +0100 | <jackdk> | yeah |
2022-12-13 23:09:55 +0100 | <ballast> | So many of my questions are answered by just typing the name of the thing into google ha |
2022-12-13 23:09:57 +0100 | <mauke> | would 'myState x = lens getMy setMy x' fix it? |
2022-12-13 23:09:58 +0100 | <dsal> | Rank3Types ought to be enough for anybody. |
2022-12-13 23:10:02 +0100 | <mauke> | or is the forall the issue? |
2022-12-13 23:10:03 +0100 | <[exa]> | ballast: actually not undecidable, but the hindley-milner and all similar systems precisely aim to prevent the "use" types from leaking to let-definitions |
2022-12-13 23:10:47 +0100 | <[exa]> | ballast: if you didn't read about that, consider someone happily defining `id x = x` and going `id "asd"` and `id 5` in 2 parts of the program. |
2022-12-13 23:11:29 +0100 | <ballast> | [exa]: my intuition for type inference when it comes to polymorphism is lacking to say the least. I usually need to write the judgements out by hands to be sure I understand what's going on. |
2022-12-13 23:11:52 +0100 | emmanuelux | (~emmanuelu@user/emmanuelux) |
2022-12-13 23:12:39 +0100 | <ballast> | mauke: that works it seems |
2022-12-13 23:12:40 +0100 | <[exa]> | btw what you got there looked a bit like monomorphism restriction to me, but hard to say without seeing the rest of the program |
2022-12-13 23:13:02 +0100 | <[exa]> | ah yes, mauke confirmed. :] |
2022-12-13 23:13:04 +0100 | <mauke> | ballast: if it works with an explicit parameter but not without, then you got bitten by the monomorphism restriction |
2022-12-13 23:13:07 +0100 | <ballast> | mauke: Then HLS says to eta reduce and it fails to type check haha |
2022-12-13 23:13:22 +0100 | <mauke> | which is turnoffable |
2022-12-13 23:13:39 +0100 | <ballast> | is this a like "here be dragons" kind of disable-able feature? |
2022-12-13 23:13:50 +0100 | <mauke> | not really dragons, no |
2022-12-13 23:14:27 +0100 | <mauke> | it just might make some "constants" more polymorphic than you expect, so it might result in less efficient code |
2022-12-13 23:15:25 +0100 | <[exa]> | ballast: in very specific cases it can do very specific ugly things with thunks, iirc something like that you'd expect the value `x=something` to be memoized but it can't be memoized because it's lacking the invisible typeclass argument |
2022-12-13 23:15:56 +0100 | Lycurgus | (~juan@user/Lycurgus) |
2022-12-13 23:16:04 +0100 | <monochrom> | I am still blissfully ignorant about how HLS gives hlint recommendations, and hlint recommendations are of questionable applicability. |
2022-12-13 23:16:05 +0100 | MajorBiscuit | (~MajorBisc@2001:1c00:2404:ed00:28e1:ad14:ec67:539e) (Ping timeout: 246 seconds) |
2022-12-13 23:16:36 +0100 | <monochrom> | Or more pointedly, how most beginners don't know that legacy. |
2022-12-13 23:16:42 +0100 | <ballast> | I think I'll stick to keeping it on then, especially since it's not too ugly to just inline my use of `lens` |
2022-12-13 23:16:57 +0100 | <Lycurgus> | applicability or worth? |
2022-12-13 23:17:06 +0100 | <monochrom> | perhaps both |
2022-12-13 23:17:30 +0100 | <monochrom> | perhaps value too |
2022-12-13 23:17:45 +0100 | <monochrom> | perhaps benefit too |
2022-12-13 23:17:48 +0100 | <monochrom> | should I go on? |
2022-12-13 23:18:23 +0100 | <Lycurgus> | prolly not |
2022-12-13 23:18:26 +0100 | <mauke> | https://www.haskell.org/onlinereport/haskell2010/haskellch4.html#x10-930004.5.5 |
2022-12-13 23:18:28 +0100 | <monochrom> | figured |
2022-12-13 23:19:28 +0100 | fizbin | (~fizbin@user/fizbin) |
2022-12-13 23:21:32 +0100 | szkl | (uid110435@id-110435.uxbridge.irccloud.com) |
2022-12-13 23:24:39 +0100 | biberu | (~biberu@user/biberu) (Read error: Connection reset by peer) |
2022-12-13 23:24:40 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2022-12-13 23:26:08 +0100 | CodeKiwi | DigitalKiwi |
2022-12-13 23:27:23 +0100 | michalz | (~michalz@185.246.204.65) (Remote host closed the connection) |
2022-12-13 23:28:00 +0100 | opqdonut | (opqdonut@pseudo.fixme.fi) (Ping timeout: 260 seconds) |
2022-12-13 23:28:10 +0100 | opqdonut | (opqdonut@pseudo.fixme.fi) |
2022-12-13 23:31:56 +0100 | biberu | (~biberu@user/biberu) |
2022-12-13 23:32:11 +0100 | gmg | (~user@user/gehmehgeh) (Quit: Leaving) |
2022-12-13 23:36:06 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2022-12-13 23:39:19 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
2022-12-13 23:43:38 +0100 | fizbin | (~fizbin@user/fizbin) (Ping timeout: 272 seconds) |
2022-12-13 23:44:10 +0100 | Lycurgus | (~juan@user/Lycurgus) (Quit: Exeunt: personae.ai-integration.biz) |
2022-12-13 23:45:45 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) |
2022-12-13 23:46:47 +0100 | __monty__ | (~toonn@user/toonn) (Quit: leaving) |
2022-12-13 23:47:58 +0100 | k8yun | (~k8yun@user/k8yun) (Quit: Leaving) |
2022-12-13 23:48:48 +0100 | merijn | (~merijn@c-001-001-007.client.esciencecenter.eduvpn.nl) |
2022-12-13 23:50:42 +0100 | euandreh | (~Thunderbi@179.214.113.107) (Ping timeout: 256 seconds) |
2022-12-13 23:53:54 +0100 | ubert | (~Thunderbi@p200300ecdf264e2fdb144bfb5fa7f064.dip0.t-ipconnect.de) (Quit: ubert) |
2022-12-13 23:53:55 +0100 | ubert1 | ubert |
2022-12-13 23:56:17 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2022-12-13 23:59:05 +0100 | euandreh | (~Thunderbi@179.214.113.107) |