2022-11-17 00:03:53 +0100 | detuneattune | (~detuneatt@user/detuneattune) (Quit: Ping timeout (120 seconds)) |
2022-11-17 00:04:18 +0100 | detuneattune | (~detuneatt@user/detuneattune) |
2022-11-17 00:05:24 +0100 | <Profpatsch> | Is there a good way to mark the `m` of a do-block? |
2022-11-17 00:05:37 +0100 | <Profpatsch> | e.g. I’d like to be able to say do @Maybe { … } or something |
2022-11-17 00:06:06 +0100 | <Profpatsch> | Just so it’s easier to read, cause usually do-blocks are in IO/some monad stack and it gets confusing when you switch the instance for some sub-expression |
2022-11-17 00:08:23 +0100 | <geekosaur> | no, although you might be able to abuse https://downloads.haskell.org/ghc/9.4.2/docs/users_guide/exts/qualified_do.html |
2022-11-17 00:08:40 +0100 | <geekosaur> | usually it's enough for me to just assign a type |
2022-11-17 00:09:40 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) |
2022-11-17 00:09:48 +0100 | <Profpatsch> | geekosaur: how do you mean assign a type? |
2022-11-17 00:09:56 +0100 | <Profpatsch> | Just add a type sig to the first statement? |
2022-11-17 00:10:15 +0100 | <geekosaur> | my do blocks are all entire functions, so I just give the function a type signature indicating the m |
2022-11-17 00:11:49 +0100 | <Profpatsch> | It would be cool if you could put type applications after operators |
2022-11-17 00:11:53 +0100 | <geekosaur> | and if I do something internally that could be a do (ignoring if-then-else) I usually just use bind syntax directly |
2022-11-17 00:11:57 +0100 | <Profpatsch> | e.g. a >>= @Maybe fb |
2022-11-17 00:12:07 +0100 | <geekosaur> | which to me is usually an indication that something special's going on |
2022-11-17 00:12:28 +0100 | <Profpatsch> | okay maybe it wouldn’t be that cool :P |
2022-11-17 00:13:00 +0100 | <geekosaur> | % :t ((>>=) @Maybe) |
2022-11-17 00:13:00 +0100 | <yahb2> | ((>>=) @Maybe) :: Maybe a -> (a -> Maybe b) -> Maybe b |
2022-11-17 00:13:17 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2022-11-17 00:13:18 +0100 | <geekosaur> | not real friendly with all the parens though |
2022-11-17 00:13:26 +0100 | <Profpatsch> | is that still infix |
2022-11-17 00:13:31 +0100 | <geekosaur> | no |
2022-11-17 00:13:36 +0100 | <Profpatsch> | yeah |
2022-11-17 00:14:00 +0100 | <geekosaur> | and you can't just wrap it in `` to make it infix again |
2022-11-17 00:14:05 +0100 | <Profpatsch> | haha oh no |
2022-11-17 00:14:20 +0100 | fserucas | (~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7) (Ping timeout: 260 seconds) |
2022-11-17 00:14:23 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-11-17 00:14:50 +0100 | <lyxia> | idf :: forall f a. f a -> f a then you can write idf @Maybe do { ... } |
2022-11-17 00:15:18 +0100 | <Profpatsch> | lyxia: oh this is pretty cool |
2022-11-17 00:15:55 +0100 | <Profpatsch> | mAs @IO $ do |
2022-11-17 00:18:10 +0100 | jumper149 | (~jumper149@base.felixspringer.xyz) (Quit: WeeChat 3.7.1) |
2022-11-17 00:18:59 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 260 seconds) |
2022-11-17 00:19:33 +0100 | zebrag | (~chris@user/zebrag) |
2022-11-17 00:22:54 +0100 | coot | (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
2022-11-17 00:23:01 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:f467:abff:e567:955f) |
2022-11-17 00:27:24 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:f467:abff:e567:955f) (Ping timeout: 256 seconds) |
2022-11-17 00:30:53 +0100 | InstX1 | (~Liam@c-98-208-218-119.hsd1.fl.comcast.net) |
2022-11-17 00:35:47 +0100 | InstX1 | (~Liam@c-98-208-218-119.hsd1.fl.comcast.net) (Ping timeout: 260 seconds) |
2022-11-17 00:38:08 +0100 | Guest75 | (~Guest75@178.141.130.118) (Ping timeout: 260 seconds) |
2022-11-17 00:39:29 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-11-17 00:39:31 +0100 | wonko | (~wjc@2a0e:1c80:2:0:45:15:19:130) |
2022-11-17 00:40:11 +0100 | merijn | (~merijn@86.86.29.250) |
2022-11-17 00:41:11 +0100 | eggplantade | (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) |
2022-11-17 00:41:58 +0100 | <EvanR> | yes mixing a bunch of different monads do blocks, unless it's for short stuff that you'd easily toss a >>= at, sounds like a recipe for write only code |
2022-11-17 00:42:26 +0100 | <EvanR> | maybe that's why everyone wants a single master App monad |
2022-11-17 00:42:40 +0100 | <EvanR> | to rule them all |
2022-11-17 00:42:45 +0100 | <EvanR> | and you know |
2022-11-17 00:43:18 +0100 | shapr | (~user@68.54.166.125) |
2022-11-17 00:43:28 +0100 | <shapr> | Is there a generic introduction to testing in Haskell? |
2022-11-17 00:43:54 +0100 | <shapr> | even just "this is what's most popular right now" would be nice |
2022-11-17 00:45:07 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 260 seconds) |
2022-11-17 00:45:41 +0100 | <dsal> | shapr: are you trying to start a fight? :) |
2022-11-17 00:46:05 +0100 | <dsal> | I think property tests should be used unless you've got a good excuse not to. That's a pretty steep learning curve for a lot of people. |
2022-11-17 00:46:23 +0100 | <dsal> | tasty is nice, but none of the frameworks are significantly better than others. |
2022-11-17 00:46:29 +0100 | <shapr> | dsal: I agree, but I don't see much property testing on hackage |
2022-11-17 00:46:47 +0100 | <shapr> | I am often tempted to go add a zillion property tests to the most popular libraries |
2022-11-17 00:46:49 +0100 | <Rembane> | Is it tasty that has a plugin for using quickcheck too? |
2022-11-17 00:47:06 +0100 | <Rembane> | So you can mix and match property based testing and unit tests |
2022-11-17 00:47:21 +0100 | <shapr> | hspec too, iirc |
2022-11-17 00:47:39 +0100 | <dsal> | Rembane: Yeah, tasty lets you run all kinds of stuff. |
2022-11-17 00:47:47 +0100 | <Rembane> | dsal: Cool. |
2022-11-17 00:47:58 +0100 | <dsal> | I do a bunch of different test things from tasty. It's just a runner + plugin thing. |
2022-11-17 00:47:59 +0100 | <Rembane> | Then I suppose it boils down to syntax. |
2022-11-17 00:48:27 +0100 | <dsal> | Sometimes property tests are kind of hard and a bad test (for some value of bad) is better than no test. |
2022-11-17 00:48:28 +0100 | <Rembane> | The test modules of hspec and tasty look quite different |
2022-11-17 00:48:48 +0100 | <Rembane> | Just getting the bugs out of the generators and properties takes quite a bit of time. |
2022-11-17 00:48:57 +0100 | <dsal> | I don't like the cucumberish syntax, and I find that most people who use it don't have the slightest idea what it exists for or how it's meant to be used. |
2022-11-17 00:48:58 +0100 | <shapr> | I haven't looked at tasty in awhile, do you have a link to one? |
2022-11-17 00:49:16 +0100 | <shapr> | I have *opinions* on property based testing |
2022-11-17 00:49:47 +0100 | <dsal> | I wonder if I have any good ones… |
2022-11-17 00:50:32 +0100 | <dsal> | This one's not too scarY; https://github.com/dustin/aoc/blob/master/test/BitSetTests.hs |
2022-11-17 00:51:08 +0100 | <shapr> | Ah, using discover |
2022-11-17 00:51:09 +0100 | <dsal> | This one has a mix: https://github.com/dustin/aoc/blob/master/test/SearchTests.hs |
2022-11-17 00:51:21 +0100 | <dsal> | Yeah, I started using that at one point. The latter also introduces trees along the way. |
2022-11-17 00:51:36 +0100 | <shapr> | I like explicit test trees, but it's not a strong leaning |
2022-11-17 00:52:05 +0100 | <dsal> | I migrated to this at one point and it was just slightly better. |
2022-11-17 00:52:12 +0100 | <dsal> | I can add a test in one place. |
2022-11-17 00:52:25 +0100 | <shapr> | yeah, that's a benefit |
2022-11-17 00:52:34 +0100 | justache | justGrit |
2022-11-17 01:02:30 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-11-17 01:05:42 +0100 | bilegeek | (~bilegeek@2600:1008:b058:644:36b4:5557:90af:16ca) |
2022-11-17 01:06:42 +0100 | thyriaen | (~thyriaen@2a01:aea0:dd4:470d:6245:cbff:fe9f:48b1) (Remote host closed the connection) |
2022-11-17 01:06:53 +0100 | wonko | (~wjc@2a0e:1c80:2:0:45:15:19:130) (Ping timeout: 256 seconds) |
2022-11-17 01:08:13 +0100 | justsomeguy | (~justsomeg@user/justsomeguy) |
2022-11-17 01:13:30 +0100 | merijn | (~merijn@86.86.29.250) (Ping timeout: 240 seconds) |
2022-11-17 01:16:31 +0100 | zebrag | (~chris@user/zebrag) (Ping timeout: 256 seconds) |
2022-11-17 01:16:33 +0100 | caubert | (~caubert@user/caubert) (Read error: Connection reset by peer) |
2022-11-17 01:21:31 +0100 | aliosablack | (~chomwitt@2a02:587:7a0a:c00:1ac0:4dff:fedb:a3f1) (Ping timeout: 260 seconds) |
2022-11-17 01:22:23 +0100 | caubert | (~caubert@user/caubert) |
2022-11-17 01:22:49 +0100 | bontaq | (~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 260 seconds) |
2022-11-17 01:24:59 +0100 | Techcable | (~Techcable@user/Techcable) |
2022-11-17 01:26:50 +0100 | Kaiepi | (~Kaiepi@108.175.84.104) (Ping timeout: 268 seconds) |
2022-11-17 01:27:50 +0100 | Igloo | (~ian@matrix.chaos.earth.li) (Quit: BIAS) |
2022-11-17 01:27:58 +0100 | Igloo | (~ian@matrix.chaos.earth.li) |
2022-11-17 01:28:12 +0100 | cafkafk | (~cafkafk@fsf/member/cafkafk) |
2022-11-17 01:29:02 +0100 | Igloo | (~ian@matrix.chaos.earth.li) (Client Quit) |
2022-11-17 01:29:13 +0100 | Igloo | (~ian@matrix.chaos.earth.li) |
2022-11-17 01:29:27 +0100 | Kaiepi | (~Kaiepi@108.175.84.104) |
2022-11-17 01:31:32 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds) |
2022-11-17 01:32:11 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
2022-11-17 01:33:06 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-11-17 01:37:13 +0100 | kenaryn | (~aurele@89-88-44-27.abo.bbox.fr) (Quit: leaving) |
2022-11-17 01:40:39 +0100 | wroathe | (~wroathe@207-153-38-140.fttp.usinternet.com) |
2022-11-17 01:40:39 +0100 | wroathe | (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
2022-11-17 01:40:39 +0100 | wroathe | (~wroathe@user/wroathe) |
2022-11-17 01:59:17 +0100 | Tuplanolla | (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) (Quit: Leaving.) |
2022-11-17 02:01:05 +0100 | bobbingbob | (~bobbingbo@2604:3d09:207f:f650::b469) (Ping timeout: 260 seconds) |
2022-11-17 02:02:35 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
2022-11-17 02:05:04 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 268 seconds) |
2022-11-17 02:05:27 +0100 | ubert1 | (~Thunderbi@77.119.167.253.wireless.dyn.drei.com) |
2022-11-17 02:06:30 +0100 | ubert | (~Thunderbi@178.165.179.251.wireless.dyn.drei.com) (Ping timeout: 240 seconds) |
2022-11-17 02:06:32 +0100 | ubert1 | ubert |
2022-11-17 02:06:56 +0100 | <Axman6> | shapr: I usually just reach for tasty, and then add the various runners for quickcheck, hunit, etc. it handles a lot of the more mundane aspects of building a test suite - providing a `main`, handling command line args, letting you specify parameters for the various backends, printing things in a pretty way |
2022-11-17 02:07:28 +0100 | <Axman6> | There's a lot you can add to it: https://hackage.haskell.org/packages/search?terms=tasty |
2022-11-17 02:08:37 +0100 | zeenk | (~zeenk@2a02:2f04:a208:3600::7fe) (Quit: Konversation terminated!) |
2022-11-17 02:11:37 +0100 | perrierjouet | (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) (Quit: WeeChat 3.7.1) |
2022-11-17 02:16:01 +0100 | xff0x | (~xff0x@ai071162.d.east.v6connect.net) (Ping timeout: 256 seconds) |
2022-11-17 02:16:34 +0100 | acidjnk | (~acidjnk@p200300d6e7137a8274644e28d572a0cd.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
2022-11-17 02:16:59 +0100 | ec | (~ec@gateway/tor-sasl/ec) (Ping timeout: 255 seconds) |
2022-11-17 02:17:21 +0100 | perrierjouet | (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) |
2022-11-17 02:18:06 +0100 | ec | (~ec@gateway/tor-sasl/ec) |
2022-11-17 02:21:34 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) |
2022-11-17 02:21:43 +0100 | gurkenglas | (~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
2022-11-17 02:22:54 +0100 | Neuromancer | (~Neuromanc@user/neuromancer) (Ping timeout: 260 seconds) |
2022-11-17 02:24:54 +0100 | wroathe | (~wroathe@user/wroathe) (Quit: leaving) |
2022-11-17 02:25:07 +0100 | wroathe | (~wroathe@207-153-38-140.fttp.usinternet.com) |
2022-11-17 02:25:07 +0100 | wroathe | (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
2022-11-17 02:25:07 +0100 | wroathe | (~wroathe@user/wroathe) |
2022-11-17 02:25:33 +0100 | Chioque | (~mansur@mdh-12-178.tm.net.my) |
2022-11-17 02:26:31 +0100 | Chioque | (~mansur@mdh-12-178.tm.net.my) (Client Quit) |
2022-11-17 02:26:31 +0100 | evanvarvell | (~evanvarve@097-088-181-216.res.spectrum.com) |
2022-11-17 02:31:01 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-11-17 02:34:09 +0100 | <Axman6> | Anyone know of any companies looking for remote Haskell devs? |
2022-11-17 02:35:10 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 240 seconds) |
2022-11-17 02:36:47 +0100 | cafkafk | (~cafkafk@fsf/member/cafkafk) (Ping timeout: 255 seconds) |
2022-11-17 02:40:07 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
2022-11-17 02:41:01 +0100 | mei | (~mei@user/mei) (Remote host closed the connection) |
2022-11-17 02:41:09 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) |
2022-11-17 02:41:26 +0100 | mei | (~mei@user/mei) |
2022-11-17 02:41:50 +0100 | srz | (~srz@179.36.80.14) |
2022-11-17 02:42:33 +0100 | srz | (~srz@179.36.80.14) (Remote host closed the connection) |
2022-11-17 02:42:52 +0100 | srz | (~srz@179.36.80.14) |
2022-11-17 02:48:41 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-11-17 02:48:46 +0100 | poscat | (~poscat@2408:8206:4823:fd6f:98ab:5c38:136c:5932) (Quit: Bye) |
2022-11-17 02:49:07 +0100 | poscat | (~poscat@114.245.106.84) |
2022-11-17 02:56:10 +0100 | Kaiepi | (~Kaiepi@108.175.84.104) (Ping timeout: 240 seconds) |
2022-11-17 02:56:20 +0100 | spaced | (uid572193@user/spaced) (Quit: Connection closed for inactivity) |
2022-11-17 03:01:39 +0100 | razetime | (~quassel@117.193.7.131) |
2022-11-17 03:01:44 +0100 | xff0x | (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) |
2022-11-17 03:10:08 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-11-17 03:14:51 +0100 | mixfix41 | (~sdeny9ee@user/mixfix41) |
2022-11-17 03:18:11 +0100 | mmhat | (~mmh@p200300f1c71a6d71ee086bfffe095315.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
2022-11-17 03:20:13 +0100 | cafkafk | (~cafkafk@fsf/member/cafkafk) |
2022-11-17 03:20:37 +0100 | mixfix41 | (~sdeny9ee@user/mixfix41) (Ping timeout: 256 seconds) |
2022-11-17 03:29:50 +0100 | beteigeuze | (~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 240 seconds) |
2022-11-17 03:31:27 +0100 | mmhat | (~mmh@p200300f1c704c721ee086bfffe095315.dip0.t-ipconnect.de) |
2022-11-17 03:32:13 +0100 | justsomeguy | (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.6) |
2022-11-17 03:32:17 +0100 | tabemann | (~tabemann@2600:1700:7990:24e0:6933:bf5a:ceeb:44f) |
2022-11-17 03:33:47 +0100 | srz | (~srz@179.36.80.14) (Remote host closed the connection) |
2022-11-17 03:34:01 +0100 | srz | (~srz@179.36.80.14) |
2022-11-17 03:35:37 +0100 | srz | (~srz@179.36.80.14) (Remote host closed the connection) |
2022-11-17 03:36:02 +0100 | srz | (~srz@179.36.80.14) |
2022-11-17 03:37:37 +0100 | srz | (~srz@179.36.80.14) (Remote host closed the connection) |
2022-11-17 03:38:00 +0100 | srz | (~srz@179.36.80.14) |
2022-11-17 03:44:36 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 256 seconds) |
2022-11-17 03:45:11 +0100 | <Profpatsch> | no way lol, don’t tell me foo.role is a syntax error because `role` is somehow a reserved keyword |
2022-11-17 03:45:11 +0100 | srz | (~srz@179.36.80.14) (Remote host closed the connection) |
2022-11-17 03:45:30 +0100 | <Profpatsch> | I changed it to say foo.rolename and the syntax error went away |
2022-11-17 03:52:22 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 268 seconds) |
2022-11-17 03:53:33 +0100 | <EvanR> | change it to lol instead |
2022-11-17 03:59:45 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-11-17 04:00:00 +0100 | jero98772 | (~jero98772@2800:484:1d80:d8ce:efcc:cbb3:7f2a:6dff) (Remote host closed the connection) |
2022-11-17 04:09:21 +0100 | td_ | (~td@83.135.9.43) (Ping timeout: 256 seconds) |
2022-11-17 04:11:13 +0100 | td_ | (~td@83.135.9.50) |
2022-11-17 04:14:15 +0100 | [itchyjunk] | (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection) |
2022-11-17 04:16:28 +0100 | marc__ | (~marc@5.83.191.222) |
2022-11-17 04:19:47 +0100 | marc___ | (~marc@5.83.191.221) (Ping timeout: 260 seconds) |
2022-11-17 04:22:41 +0100 | <Axman6> | Profpatsch: see https://gitlab.haskell.org/ghc/ghc/-/wikis/roles |
2022-11-17 04:24:33 +0100 | bilegeek | (~bilegeek@2600:1008:b058:644:36b4:5557:90af:16ca) (Quit: Leaving) |
2022-11-17 04:29:45 +0100 | ddellacosta | (~ddellacos@143.244.47.83) (Ping timeout: 256 seconds) |
2022-11-17 04:41:18 +0100 | perrierjouet | (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) (Quit: WeeChat 3.7.1) |
2022-11-17 04:42:23 +0100 | perrierjouet | (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) |
2022-11-17 04:46:45 +0100 | razetime | (~quassel@117.193.7.131) (Ping timeout: 256 seconds) |
2022-11-17 04:47:12 +0100 | finn_elija | (~finn_elij@user/finn-elija/x-0085643) |
2022-11-17 04:47:12 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija))) |
2022-11-17 04:47:12 +0100 | finn_elija | FinnElija |
2022-11-17 04:48:17 +0100 | mzan | (~quassel@mail.asterisell.com) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
2022-11-17 04:49:26 +0100 | mzan | (~quassel@mail.asterisell.com) |
2022-11-17 05:06:22 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 268 seconds) |
2022-11-17 05:15:29 +0100 | evanvarvell | (~evanvarve@097-088-181-216.res.spectrum.com) (Quit: Leaving) |
2022-11-17 05:15:56 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-11-17 05:21:30 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 256 seconds) |
2022-11-17 05:29:26 +0100 | troydm | (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 256 seconds) |
2022-11-17 05:31:50 +0100 | lechner | (~lechner@debian/lechner) (Ping timeout: 240 seconds) |
2022-11-17 05:32:09 +0100 | razetime | (~quassel@117.193.7.131) |
2022-11-17 05:33:08 +0100 | lechner | (~lechner@debian/lechner) |
2022-11-17 05:36:08 +0100 | lechner | (~lechner@debian/lechner) (Remote host closed the connection) |
2022-11-17 05:38:53 +0100 | zebrag | (~chris@user/zebrag) |
2022-11-17 05:39:54 +0100 | zebrag | (~chris@user/zebrag) (Client Quit) |
2022-11-17 05:41:40 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-11-17 05:50:38 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-11-17 05:56:51 +0100 | lechner | (~lechner@debian/lechner) |
2022-11-17 05:57:46 +0100 | wroathe | (~wroathe@user/wroathe) (Ping timeout: 256 seconds) |
2022-11-17 05:59:47 +0100 | mbuf | (~Shakthi@49.204.115.42) |
2022-11-17 06:06:51 +0100 | phma_ | phma |
2022-11-17 06:07:30 +0100 | shapr` | (~user@2601:7c0:c383:70:87f8:8431:4c:ee0) |
2022-11-17 06:08:50 +0100 | shapr | (~user@68.54.166.125) (Ping timeout: 240 seconds) |
2022-11-17 06:15:26 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 268 seconds) |
2022-11-17 06:21:00 +0100 | lechner | (~lechner@debian/lechner) (Ping timeout: 256 seconds) |
2022-11-17 06:30:22 +0100 | lechner | (~lechner@debian/lechner) |
2022-11-17 06:30:23 +0100 | Unicorn_Princess | (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection) |
2022-11-17 06:31:28 +0100 | Lord_of_Life | (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 268 seconds) |
2022-11-17 06:31:43 +0100 | Lord_of_Life | (~Lord@user/lord-of-life/x-2819915) |
2022-11-17 06:34:02 +0100 | dextaa | (~DV@user/dextaa) |
2022-11-17 06:38:06 +0100 | mmhat | (~mmh@p200300f1c704c721ee086bfffe095315.dip0.t-ipconnect.de) (Quit: WeeChat 3.7.1) |
2022-11-17 06:42:17 +0100 | Guest63 | (~Guest63@rrcs-108-176-74-69.nys.biz.rr.com) |
2022-11-17 06:44:08 +0100 | Guest63 | (~Guest63@rrcs-108-176-74-69.nys.biz.rr.com) (Quit: Client closed) |
2022-11-17 06:48:42 +0100 | chromoblob | (~user@37.113.164.122) |
2022-11-17 06:49:14 +0100 | nate4 | (~nate@98.45.169.16) |
2022-11-17 06:54:15 +0100 | chromoblob | (~user@37.113.164.122) (Ping timeout: 260 seconds) |
2022-11-17 06:54:15 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 260 seconds) |
2022-11-17 06:55:39 +0100 | nate4 | (~nate@98.45.169.16) (Ping timeout: 260 seconds) |
2022-11-17 07:02:45 +0100 | razetime | (~quassel@117.193.7.131) (Ping timeout: 256 seconds) |
2022-11-17 07:03:19 +0100 | razetime | (~quassel@117.254.35.45) |
2022-11-17 07:03:45 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-11-17 07:12:23 +0100 | razetime | (~quassel@117.254.35.45) (Ping timeout: 256 seconds) |
2022-11-17 07:12:30 +0100 | razetime | (~quassel@117.254.35.190) |
2022-11-17 07:17:21 +0100 | pyrex | (~pyrex@user/pyrex) (Read error: Connection reset by peer) |
2022-11-17 07:17:49 +0100 | takuan | (~takuan@178-116-218-225.access.telenet.be) |
2022-11-17 07:19:22 +0100 | Erutuon | (~Erutuon@user/erutuon) (Ping timeout: 256 seconds) |
2022-11-17 07:28:18 +0100 | zaquest | (~notzaques@5.130.79.72) (Remote host closed the connection) |
2022-11-17 07:32:54 +0100 | AyLaa23 | (~KELEBEK@95.70.185.131) |
2022-11-17 07:33:14 +0100 | arkeet | (arkeet@moriya.ca) (Quit: ZNC 1.8.2 - https://znc.in) |
2022-11-17 07:33:25 +0100 | arkeet | (arkeet@moriya.ca) |
2022-11-17 07:33:27 +0100 | zaquest | (~notzaques@5.130.79.72) |
2022-11-17 07:35:30 +0100 | res0nat0r0844909 | (~Fletch@fenrir.whatbox.ca) |
2022-11-17 07:35:32 +0100 | shailangsa | (~shailangs@109.159.108.137) (Read error: Connection reset by peer) |
2022-11-17 07:35:57 +0100 | AyLaa23 | (~KELEBEK@95.70.185.131) (Client Quit) |
2022-11-17 07:36:08 +0100 | oats | (~thomas@user/oats) (Quit: until later, my friends) |
2022-11-17 07:36:43 +0100 | oats | (~thomas@user/oats) |
2022-11-17 07:37:00 +0100 | califax | (~califax@user/califx) (Quit: ZNC 1.8.2 - https://znc.in) |
2022-11-17 07:37:10 +0100 | res0nat0r084490 | (~Fletch@fenrir.whatbox.ca) (Ping timeout: 240 seconds) |
2022-11-17 07:37:40 +0100 | arahael | (~arahael@193-119-109-208.tpgi.com.au) (Ping timeout: 260 seconds) |
2022-11-17 07:38:15 +0100 | heath | (~heath@user/heath) (Ping timeout: 260 seconds) |
2022-11-17 07:38:56 +0100 | heath | (~heath@user/heath) |
2022-11-17 07:39:11 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds) |
2022-11-17 07:41:40 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) |
2022-11-17 07:41:48 +0100 | califax | (~califax@user/califx) |
2022-11-17 07:45:46 +0100 | fockerize | (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) |
2022-11-17 07:46:39 +0100 | bgs | (~bgs@212-85-160-171.dynamic.telemach.net) (Remote host closed the connection) |
2022-11-17 07:49:28 +0100 | arahael | (~arahael@193-119-109-208.tpgi.com.au) |
2022-11-17 07:50:55 +0100 | Neuromancer | (~Neuromanc@user/neuromancer) |
2022-11-17 07:51:55 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-11-17 07:52:46 +0100 | Guest75 | (~Guest75@178.141.130.118) |
2022-11-17 07:54:26 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection) |
2022-11-17 07:55:35 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) |
2022-11-17 08:01:35 +0100 | michalz | (~michalz@185.246.207.221) |
2022-11-17 08:02:59 +0100 | shriekingnoise | (~shrieking@186.137.167.202) (Quit: Quit) |
2022-11-17 08:08:39 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection) |
2022-11-17 08:11:10 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-11-17 08:12:28 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) |
2022-11-17 08:12:52 +0100 | cafkafk | (~cafkafk@fsf/member/cafkafk) (Remote host closed the connection) |
2022-11-17 08:14:01 +0100 | cafkafk | (~cafkafk@fsf/member/cafkafk) |
2022-11-17 08:16:10 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 260 seconds) |
2022-11-17 08:17:02 +0100 | megaTherion | (~therion@unix.io) (Quit: ZNC 1.8.2 - https://znc.in) |
2022-11-17 08:17:24 +0100 | megaTherion | (~therion@unix.io) |
2022-11-17 08:17:30 +0100 | shailangsa | (~shailangs@host109-159-108-137.range109-159.btcentralplus.com) |
2022-11-17 08:18:32 +0100 | cfricke | (~cfricke@user/cfricke) |
2022-11-17 08:21:31 +0100 | jao | (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 256 seconds) |
2022-11-17 08:24:33 +0100 | mvk | (~mvk@2607:fea8:5ce3:8500::4b68) (Quit: Going elsewhere) |
2022-11-17 08:26:12 +0100 | Kaiepi | (~Kaiepi@108.175.84.104) |
2022-11-17 08:28:39 +0100 | xff0x | (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) (Ping timeout: 260 seconds) |
2022-11-17 08:31:07 +0100 | xff0x | (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) |
2022-11-17 08:34:07 +0100 | DDR | (~DDR@2604:3d08:4c7f:8250:843b:f3d0:47c:129e) (Ping timeout: 260 seconds) |
2022-11-17 08:34:58 +0100 | Kaiepi | (~Kaiepi@108.175.84.104) (Quit: Leaving) |
2022-11-17 08:39:05 +0100 | razetime | (~quassel@117.254.35.190) (Ping timeout: 256 seconds) |
2022-11-17 08:39:10 +0100 | razetime_ | (~quassel@117.193.6.245) |
2022-11-17 08:39:44 +0100 | hamster | (~ham@user/ham) |
2022-11-17 08:39:46 +0100 | troydm | (~troydm@host-176-37-124-197.b025.la.net.ua) |
2022-11-17 08:40:13 +0100 | ham | (~ham@user/ham) (Ping timeout: 256 seconds) |
2022-11-17 08:45:19 +0100 | razetime_ | razetime |
2022-11-17 08:45:29 +0100 | razetime | (~quassel@117.193.6.245) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
2022-11-17 08:45:45 +0100 | razetime | (~quassel@117.193.6.245) |
2022-11-17 08:45:54 +0100 | kenran | (~user@user/kenran) |
2022-11-17 08:48:46 +0100 | Kaiepi | (~Kaiepi@108.175.84.104) |
2022-11-17 08:48:57 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2022-11-17 08:51:05 +0100 | Erutuon | (~Erutuon@user/erutuon) |
2022-11-17 08:52:25 +0100 | takuan | (~takuan@178-116-218-225.access.telenet.be) (Read error: Connection reset by peer) |
2022-11-17 08:54:43 +0100 | vglfr | (~vglfr@145.224.100.22) (Quit: Quit) |
2022-11-17 08:54:58 +0100 | vglfr | (~vglfr@145.224.100.22) |
2022-11-17 08:57:02 +0100 | kenran | (~user@user/kenran) (Remote host closed the connection) |
2022-11-17 08:57:36 +0100 | takuan | (~takuan@178-116-218-225.access.telenet.be) |
2022-11-17 08:59:44 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
2022-11-17 09:01:07 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-11-17 09:01:55 +0100 | zeenk | (~zeenk@2a02:2f04:a208:3600::7fe) |
2022-11-17 09:07:20 +0100 | lortabac | (~lortabac@2a01:e0a:541:b8f0:158b:ea0c:943d:cbc4) |
2022-11-17 09:11:47 +0100 | <dminuoso> | lyxia, Profpatsch: Also consider QualifiedDo, which goes into a similar department. |
2022-11-17 09:12:39 +0100 | <dminuoso> | Though I do not know whether it is planned to expose Data.Maybe.>>= |
2022-11-17 09:15:14 +0100 | ub | (~Thunderbi@77.119.167.253.wireless.dyn.drei.com) |
2022-11-17 09:17:18 +0100 | vglfr | (~vglfr@145.224.100.22) (Read error: Connection reset by peer) |
2022-11-17 09:17:27 +0100 | vglfr | (~vglfr@145.224.100.22) |
2022-11-17 09:17:50 +0100 | chele | (~chele@user/chele) |
2022-11-17 09:18:35 +0100 | razetime | (~quassel@117.193.6.245) (Ping timeout: 268 seconds) |
2022-11-17 09:25:27 +0100 | fockerize | (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 260 seconds) |
2022-11-17 09:25:38 +0100 | mncheck | (~mncheck@193.224.205.254) |
2022-11-17 09:27:42 +0100 | megaTherion | (~therion@unix.io) (Max SendQ exceeded) |
2022-11-17 09:29:26 +0100 | zmt01 | (~zmt00@user/zmt00) |
2022-11-17 09:29:56 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-11-17 09:30:51 +0100 | megaTherion | (~therion@unix.io) |
2022-11-17 09:32:21 +0100 | waleee | (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 256 seconds) |
2022-11-17 09:32:43 +0100 | <dminuoso> | https://hackage.haskell.org/package/ghc-prim-0.9.0/docs/GHC-Magic.html |
2022-11-17 09:32:49 +0100 | <dminuoso> | Today we know for sure, GHC uses magic. |
2022-11-17 09:32:55 +0100 | zmt00 | (~zmt00@user/zmt00) (Ping timeout: 260 seconds) |
2022-11-17 09:34:41 +0100 | acidjnk | (~acidjnk@p200300d6e7137a8274644e28d572a0cd.dip0.t-ipconnect.de) |
2022-11-17 09:35:30 +0100 | megaTherion | (~therion@unix.io) (Ping timeout: 260 seconds) |
2022-11-17 09:42:41 +0100 | vpan | (~0@212.117.1.172) |
2022-11-17 09:42:58 +0100 | MajorBiscuit | (~MajorBisc@2a02-a461-129d-1-193d-75d8-745d-e91e.fixed6.kpn.net) |
2022-11-17 09:44:44 +0100 | aliosablack | (~chomwitt@2a02:587:7a0a:c00:1ac0:4dff:fedb:a3f1) |
2022-11-17 09:51:02 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
2022-11-17 09:52:03 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-11-17 09:53:15 +0100 | nschoe | (~q@141.101.51.197) |
2022-11-17 09:56:06 +0100 | chromoblob | (~user@37.113.164.122) |
2022-11-17 09:56:24 +0100 | coot | (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
2022-11-17 09:59:03 +0100 | ft | (~ft@p508dbd59.dip0.t-ipconnect.de) (Quit: leaving) |
2022-11-17 10:01:36 +0100 | tzh | (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz) |
2022-11-17 10:03:11 +0100 | Sgeo | (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
2022-11-17 10:06:50 +0100 | <Profpatsch> | dminuoso: I’m pretty sure there’s a bug in runRW# and ST atm, so much for magic :P |
2022-11-17 10:07:13 +0100 | <Profpatsch> | But I can’t for the hell of me minify the repro case |
2022-11-17 10:07:18 +0100 | cfricke | (~cfricke@user/cfricke) (Quit: WeeChat 3.7.1) |
2022-11-17 10:07:35 +0100 | megaTherion | (~therion@unix.io) |
2022-11-17 10:07:42 +0100 | <Profpatsch> | It depends on a weird combination of out-of-module dependencies & runST |
2022-11-17 10:09:53 +0100 | fserucas | (~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7) |
2022-11-17 10:10:05 +0100 | <Profpatsch> | So if anybody here has experience debugging GHC optimization bugs :) |
2022-11-17 10:10:58 +0100 | <dminuoso> | Profpatsch: Given that Im playing a lot with runRW# right now, keep me apprised. |
2022-11-17 10:11:22 +0100 | <dminuoso> | Profpatsch: Out of curiosity, how are you using runRW#? |
2022-11-17 10:12:02 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
2022-11-17 10:12:10 +0100 | <dminuoso> | You arent by any chance exfiltrating the state token out of runRW# like `let s = runRW# noDuplicate#`, are you? |
2022-11-17 10:12:14 +0100 | kaskal | (~kaskal@89.144.223.95) (Ping timeout: 268 seconds) |
2022-11-17 10:12:33 +0100 | kaskal | (~kaskal@213-225-13-82.nat.highway.a1.net) |
2022-11-17 10:13:09 +0100 | <Profpatsch> | runST |
2022-11-17 10:13:28 +0100 | lambdabot | (~lambdabot@haskell/bot/lambdabot) (Ping timeout: 268 seconds) |
2022-11-17 10:13:52 +0100 | <Profpatsch> | dminuoso: https://github.com/agrafix/superrecord/issues/38 |
2022-11-17 10:15:08 +0100 | dfee | (~dfee@162-227-164-101.lightspeed.sntcca.sbcglobal.net) (Quit: dfee) |
2022-11-17 10:15:13 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) |
2022-11-17 10:15:31 +0100 | lambdabot | (~lambdabot@silicon.int-e.eu) |
2022-11-17 10:15:31 +0100 | lambdabot | (~lambdabot@silicon.int-e.eu) (Changing host) |
2022-11-17 10:15:31 +0100 | lambdabot | (~lambdabot@haskell/bot/lambdabot) |
2022-11-17 10:17:08 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
2022-11-17 10:17:40 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-11-17 10:22:13 +0100 | chromoblob | (~user@37.113.164.122) (Ping timeout: 256 seconds) |
2022-11-17 10:22:58 +0100 | enoq | (~enoq@2a05:1141:1f5:5600:b9c9:721a:599:bfe7) |
2022-11-17 10:25:13 +0100 | <dminuoso> | Profpatsch: It should be trivial to test it |
2022-11-17 10:25:16 +0100 | `2jt | (~jtomas@191.red-88-17-199.dynamicip.rima-tde.net) |
2022-11-17 10:28:48 +0100 | mixfix41 | (~sdeny9ee@user/mixfix41) |
2022-11-17 10:29:54 +0100 | titibandit | (~titibandi@xdsl-78-35-182-184.nc.de) |
2022-11-17 10:30:54 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 256 seconds) |
2022-11-17 10:32:10 +0100 | <Profpatsch> | dminuoso: I’m trying to remove stuff from the code, and the problem vanishes once I remove some stuff that seems unrelated |
2022-11-17 10:33:35 +0100 | mixfix41 | (~sdeny9ee@user/mixfix41) (Ping timeout: 260 seconds) |
2022-11-17 10:34:41 +0100 | CiaoSen | (~Jura@p200300c95701f1002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
2022-11-17 10:35:57 +0100 | <dminuoso> | Im having some troubles understanding the original bug honestly heh |
2022-11-17 10:37:26 +0100 | accord | (uid568320@id-568320.hampstead.irccloud.com) |
2022-11-17 10:39:53 +0100 | <accord> | How does haskell decide whether to reduce or accumulate |
2022-11-17 10:40:22 +0100 | <dminuoso> | accord: A) what do you mean by "haskell decicdes", and what in your mind is the difference between reduce and accumulate? |
2022-11-17 10:40:26 +0100 | mixfix41 | (~sdenynine@user/mixfix41) |
2022-11-17 10:41:30 +0100 | <accord> | dminuoso: accumulate is when basically an expression is accumulated in a thunk. Reduce is when it's partially or fully evaluated |
2022-11-17 10:42:21 +0100 | <dminuoso> | So is your question when GHC haskell might preemptively reduce an expression before it is demanded? |
2022-11-17 10:42:58 +0100 | <accord> | Yup, it's not 100% lazy, it's non-strict, meaning it has some heursitics when to do what |
2022-11-17 10:43:31 +0100 | <dminuoso> | So lets start with a simplified world model, then we progressively get to what happens in GHC. |
2022-11-17 10:44:00 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2022-11-17 10:44:26 +0100 | <dminuoso> | Evaluation is driven by demand, which essentially happens whenever a pattern match occurs like in case-of or a function argument pattern match |
2022-11-17 10:44:35 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2022-11-17 10:44:59 +0100 | <dminuoso> | Observe, case-of or function pattern matching will scrutinize on a *data* constructor, and that is as far as evaluation will occur. |
2022-11-17 10:45:44 +0100 | <dminuoso> | We call that form where the redex is reduced up until the next constructor WHNF (weak head normal form) |
2022-11-17 10:45:47 +0100 | <dminuoso> | accord: so far so good? |
2022-11-17 10:46:45 +0100 | <dminuoso> | So if `case x of Nothing -> ...; Just a -> ...` is demanded, then `x` is evaluated up until the outer constructor (meaning in the Just case, `a` is left as a thunk) |
2022-11-17 10:46:58 +0100 | __monty__ | (~toonn@user/toonn) |
2022-11-17 10:48:08 +0100 | <accord> | dminuoso: sure, I think the problem is this... imagine there's no demand, but the accumulation is so vast, that the thunk that calculates in the end is integer 42, but the state it holds because no one demands this 42 yet, is hundreds of GB of RAM |
2022-11-17 10:48:24 +0100 | <dminuoso> | accord: We'll get there. |
2022-11-17 10:48:47 +0100 | <dminuoso> | That's strike one. Strike two is, we get a primitive called `seq` (or equivalently bang patterns with !, but they are equivalent to seq, and their uses get desugared into uses of seq), which lets you express `let b' = seq a b` which says `when b' is demanded, give b but *also* evaluate a into WHNF` |
2022-11-17 10:49:53 +0100 | <dminuoso> | Note that there is no particular ordering specified, so a may be evaluated in parallel or potentially even after b, but it *will* get evaluated eventually |
2022-11-17 10:50:41 +0100 | <accord> | cool |
2022-11-17 10:50:43 +0100 | <accord> | :) |
2022-11-17 10:50:52 +0100 | <tomsmeding> | dminuoso: will `a` get evaluated before the code that ran `seq` will get to see the results of `b`? |
2022-11-17 10:51:30 +0100 | <tomsmeding> | hm, no such a guarantee can't be there if `a` is potentially evaluated after `b` |
2022-11-17 10:51:31 +0100 | <dminuoso> | tomsmeding: sure, it just means seq wouldnt do anything then. |
2022-11-17 10:51:51 +0100 | <dminuoso> | seq does not mean "not before", its just "try and force when the second argument is demanded" |
2022-11-17 10:51:58 +0100 | <dminuoso> | might already be forced, doesnt matter |
2022-11-17 10:52:07 +0100 | nate4 | (~nate@98.45.169.16) |
2022-11-17 10:52:07 +0100 | <tomsmeding> | yeah sure, forcing an already forced value doesn't do anything |
2022-11-17 10:52:23 +0100 | <dminuoso> | accord: so, we can employ something like: |
2022-11-17 10:52:29 +0100 | <tomsmeding> | but as a user of seq, I would expect `a` to be done evaluating after `seq a b` is done |
2022-11-17 10:52:33 +0100 | <dminuoso> | accord: `let x = 1 + 3 in seq x (f x)` |
2022-11-17 10:52:41 +0100 | <dminuoso> | which might evaluate the argument *before* it enters f. |
2022-11-17 10:52:48 +0100 | <dminuoso> | accord: so far so good? |
2022-11-17 10:52:52 +0100 | <c_wraith> | tomsmeding: yes, that is guaranteed. that's all that's guaranteed. |
2022-11-17 10:53:08 +0100 | <tomsmeding> | c_wraith: yay, otherwise I would need to revisit how I use seq :p |
2022-11-17 10:53:28 +0100 | wonko | (~wjc@2a0e:1c80:2:0:45:15:19:130) |
2022-11-17 10:53:59 +0100 | <accord> | dminuoso: sort of :D |
2022-11-17 10:54:14 +0100 | <accord> | dminuoso: I wonder does ghc evaluate a thunk partially simply if it gets too big |
2022-11-17 10:54:44 +0100 | <dminuoso> | accord: nope |
2022-11-17 10:54:51 +0100 | <dminuoso> | accord: So this is where it gets interesting |
2022-11-17 10:55:02 +0100 | <dminuoso> | If you naively do something like: |
2022-11-17 10:55:58 +0100 | tomsmeding | expects foldl |
2022-11-17 10:55:59 +0100 | <dminuoso> | `foldr (+) 0 [1..1000000000000]` we will have a strange interaction |
2022-11-17 10:56:20 +0100 | <c_wraith> | that never has large thunks |
2022-11-17 10:56:26 +0100 | <dminuoso> | Note, we have to assume some GHC optimizations to be disabled, so if you try this, use -O0 |
2022-11-17 10:56:32 +0100 | <c_wraith> | it uses a huge amount of stack, but the thunks are small |
2022-11-17 10:56:41 +0100 | <dminuoso> | Ah right |
2022-11-17 10:56:46 +0100 | <dminuoso> | foldl indeed. |
2022-11-17 10:56:55 +0100 | <dminuoso> | But we can look into foldr after this too. |
2022-11-17 10:56:59 +0100 | <tomsmeding> | :) |
2022-11-17 10:57:10 +0100 | <dminuoso> | `foldl (+) 0 [1..1000000000000]` will end up producing an expression tree that looks like: |
2022-11-17 10:57:13 +0100 | <c_wraith> | both foldl and foldr are bad there. It's worth looking into what each does badly. :) |
2022-11-17 10:57:21 +0100 | nate4 | (~nate@98.45.169.16) (Ping timeout: 256 seconds) |
2022-11-17 10:57:53 +0100 | <dminuoso> | ....(((0+1)+2)+3)+4.... |
2022-11-17 10:58:26 +0100 | <dminuoso> | accord: and the reason for that is, foldl does not have any strictness annotations, so it will actually exhaust memory with thunks. |
2022-11-17 10:58:31 +0100 | <dminuoso> | Nothing is done to prevent that. |
2022-11-17 10:58:45 +0100 | <tomsmeding> | well, nothing at _runtime_ |
2022-11-17 10:58:48 +0100 | <dminuoso> | well. GHC has some RULEs in place to rewrite some *particular* invocations like that one actually |
2022-11-17 10:58:58 +0100 | <dminuoso> | But for the sake of argument, ignore those. |
2022-11-17 10:59:30 +0100 | EvanR | (~EvanR@user/evanr) (Ping timeout: 260 seconds) |
2022-11-17 10:59:36 +0100 | <dminuoso> | accord: Instead, if you want to accumulate with a strict accumulator, you have to use this primitive: |
2022-11-17 10:59:43 +0100 | EvanR | (~EvanR@user/evanr) |
2022-11-17 11:00:06 +0100 | <dminuoso> | https://hackage.haskell.org/package/base-4.17.0.0/docs/src/Data.Foldable.html#foldl%27 |
2022-11-17 11:00:29 +0100 | <dminuoso> | Gloss over the `oneShot` there, its not relevant to the discussion. What is however relevant, is that `seq` in there. |
2022-11-17 11:01:36 +0100 | <dminuoso> | So we could write it as:" |
2022-11-17 11:02:38 +0100 | fockerize | (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) |
2022-11-17 11:03:25 +0100 | <dminuoso> | foldl' f z0 xs = foldr (\x k z -> z `seq` k (f z x)) id xs z0 |
2022-11-17 11:03:54 +0100 | srk | (~sorki@user/srk) |
2022-11-17 11:03:56 +0100 | <dminuoso> | The way its written is base is done to promote better optimizations, but what I want to get at is that `seq` in there. There's also a change to foldlr. |
2022-11-17 11:04:12 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-11-17 11:04:42 +0100 | <dminuoso> | accord: so it is that `seq` that will evaluate the accumulator each time that function is entered, preventing a thunk build-up. So whats to prevent the thunk buildup? It's the programmer really. |
2022-11-17 11:05:04 +0100 | <dminuoso> | You have to be aware of strictness, and use the right functions. If you want a loop-behavior with a counter, use `foldl'` |
2022-11-17 11:05:40 +0100 | <dminuoso> | https://hackage.haskell.org/package/base-4.17.0.0/docs/src/GHC.List.html#sum |
2022-11-17 11:05:42 +0100 | <dminuoso> | sum = foldl' (+) 0 |
2022-11-17 11:06:11 +0100 | <dminuoso> | (Note this is not the same `sum` as from Prelude, which uses a slightly different definition, but again I want to keep things simple) |
2022-11-17 11:06:50 +0100 | xff0x | (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) (Ping timeout: 240 seconds) |
2022-11-17 11:07:21 +0100 | perrierjouet | (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) (Quit: WeeChat 3.7.1) |
2022-11-17 11:07:35 +0100 | mauke | (~mauke@p54958ca8.dip0.t-ipconnect.de) |
2022-11-17 11:08:06 +0100 | chromoblob | (~user@37.113.164.122) |
2022-11-17 11:10:35 +0100 | <accord> | dminuoso thank you for covering that ground. I'll reread and chew :) |
2022-11-17 11:11:10 +0100 | vglfr | (~vglfr@145.224.100.22) (Ping timeout: 240 seconds) |
2022-11-17 11:11:18 +0100 | perrierjouet | (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) |
2022-11-17 11:11:27 +0100 | <accord> | dminuoso: I honestly wish it was automatic |
2022-11-17 11:11:37 +0100 | <tomsmeding> | There's also the strictness analyser in ghc |
2022-11-17 11:11:38 +0100 | <accord> | optimizing for less cpu/ram use |
2022-11-17 11:11:49 +0100 | <accord> | AI :P |
2022-11-17 11:12:30 +0100 | <tomsmeding> | A compile-time optimisation that attempts to determine if a computation (in your source code) is fully strict anyway; and if it succeeds in that, it adds seq calls in the right places to make sure that computation _is_ evaluated strictly |
2022-11-17 11:12:40 +0100 | <tomsmeding> | But it's easy to defeat the strictness checker |
2022-11-17 11:13:04 +0100 | <tomsmeding> | And easy to do so accidentally, although it is already quite effective as it is |
2022-11-17 11:13:34 +0100 | <dminuoso> | That being said, there's also mechanisms to introduce extra lazyness (that is, making things even more lazy) |
2022-11-17 11:14:54 +0100 | <dminuoso> | Which is lazy patterns, which actually turns off evaluation on a case-of and defers evaluation even further. So that can be useful too |
2022-11-17 11:15:29 +0100 | eggplantade | (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
2022-11-17 11:15:42 +0100 | <accord> | how about tic toc... the runtime alternates between accumulation and reduction and notices which leads to less RAM use and skews it to that direction |
2022-11-17 11:15:54 +0100 | <accord> | for each type of expression |
2022-11-17 11:16:44 +0100 | <accord> | How about stochastically doing one or the other, trying to spot patterns which simplify the entire state |
2022-11-17 11:17:20 +0100 | <tomsmeding> | I would expect that to reduce the expected amount of memory usage, but raise the execution time constant factor significantly |
2022-11-17 11:17:37 +0100 | <tomsmeding> | Doing the same thing over and over is something that computers tend to be good at |
2022-11-17 11:28:05 +0100 | troydm | (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 260 seconds) |
2022-11-17 11:29:32 +0100 | gurkenglas | (~gurkengla@84.138.199.46) |
2022-11-17 11:31:42 +0100 | <accord> | tomsmeding: it's basically about predicting if something is better precalculated or not. |
2022-11-17 11:31:57 +0100 | <accord> | tomsmeding not precalculated bu calculated as early as possible |
2022-11-17 11:32:13 +0100 | <accord> | tomsmeding: in CPU design we more often have speculative execution rather than lazy execution |
2022-11-17 11:33:04 +0100 | <dminuoso> | we could even do speculative execution in haskell |
2022-11-17 11:33:26 +0100 | <dminuoso> | But afaik the runtime system does not allow for it, currently |
2022-11-17 11:36:33 +0100 | gentauro | (~gentauro@user/gentauro) (Read error: Connection reset by peer) |
2022-11-17 11:36:52 +0100 | Guest|78 | (~Guest|78@cpc77553-cwma10-2-0-cust21.7-3.cable.virginm.net) |
2022-11-17 11:37:01 +0100 | <accord> | dminuoso: yup I like the idea of non-strict execution as it permits in theory the runtime to choose when to execute |
2022-11-17 11:37:10 +0100 | Guest|78 | (~Guest|78@cpc77553-cwma10-2-0-cust21.7-3.cable.virginm.net) (Client Quit) |
2022-11-17 11:37:34 +0100 | <dminuoso> | accord: good choice of the term `non-strict` there :) |
2022-11-17 11:37:41 +0100 | <accord> | :D |
2022-11-17 11:38:06 +0100 | vglfr | (~vglfr@145.224.100.22) |
2022-11-17 11:42:27 +0100 | cfricke | (~cfricke@user/cfricke) |
2022-11-17 11:42:32 +0100 | gentauro | (~gentauro@user/gentauro) |
2022-11-17 11:43:00 +0100 | mmhat | (~mmh@p200300f1c704c721ee086bfffe095315.dip0.t-ipconnect.de) |
2022-11-17 11:43:34 +0100 | <dminuoso> | For what its worth, speculative execution is mostly the singular reason for most recent CPU security bugs. :p |
2022-11-17 11:43:52 +0100 | <dminuoso> | Speculative execution with a singular cache is a dangerous proposition |
2022-11-17 11:45:00 +0100 | quintasan | (~quassel@quintasan.pl) () |
2022-11-17 11:45:12 +0100 | quintasan | (~quassel@quintasan.pl) |
2022-11-17 11:52:29 +0100 | econo | (uid147250@user/econo) (Quit: Connection closed for inactivity) |
2022-11-17 11:53:46 +0100 | use-value | (~Thunderbi@2a00:23c6:8a03:2f01:29a1:b64:95d9:d66d) (Remote host closed the connection) |
2022-11-17 11:54:05 +0100 | use-value | (~Thunderbi@2a00:23c6:8a03:2f01:29a1:b64:95d9:d66d) |
2022-11-17 11:54:05 +0100 | <tomsmeding> | Also if you speculatively execute, you have the same issues as cpus, i.e. you must swallow exceptions thrown in speculatively executed code |
2022-11-17 11:54:37 +0100 | <tomsmeding> | And mark certain primops as not suitable for speculation, e.g. write-to-fd :p |
2022-11-17 11:55:03 +0100 | <accord> | dminuoso: it's problematic. But I strongly believe an optimal executor needs to have the ability to do 1) out of order 2) speculative 3) lazy 4) eager 5) transform one code to other code... and combine all these (and more) in order ot be effective |
2022-11-17 11:55:13 +0100 | xilo | (~yourname@84.32.165.17) (Ping timeout: 268 seconds) |
2022-11-17 11:55:19 +0100 | <accord> | dminuoso: it's kinda like people with a todo list, as I think about it |
2022-11-17 11:55:30 +0100 | <accord> | We batch, reorder, skip some things, then do them |
2022-11-17 11:55:33 +0100 | aliosablack | (~chomwitt@2a02:587:7a0a:c00:1ac0:4dff:fedb:a3f1) (Remote host closed the connection) |
2022-11-17 11:55:35 +0100 | <dminuoso> | accord: The reality is, most performance gains happen in aggressive inlining. |
2022-11-17 11:55:41 +0100 | <tomsmeding> | Also cpus have more leeway in speculative execution I think because they have available parallelism to do so without impacting the normal instruction stream |
2022-11-17 11:55:43 +0100 | <dminuoso> | Inlining is what allows for faster code. |
2022-11-17 11:55:50 +0100 | <accord> | dminuoso: that too |
2022-11-17 11:56:19 +0100 | <accord> | dminuoso: but it needs to have fallbacks, so we don't lose late binding semantics |
2022-11-17 11:56:20 +0100 | <tomsmeding> | Ghc doesn't have that luxury of spare execution units |
2022-11-17 11:57:10 +0100 | <accord> | i.e. we can think of inlining as aJIT speculative code transform, with guards that have fallbacks to deoptimize and run the general code if the inlined version guards fail |
2022-11-17 11:57:36 +0100 | <accord> | tomsmeding why not? |
2022-11-17 11:57:41 +0100 | <dminuoso> | accord: fun thing, do you know how HotSpot implements deoptimization guards? |
2022-11-17 11:57:43 +0100 | mei_ | (~mei@user/mei) |
2022-11-17 11:57:52 +0100 | <accord> | dminuoso: not in particular I think |
2022-11-17 11:58:10 +0100 | <accord> | conditional jump :P ? |
2022-11-17 11:58:10 +0100 | <dminuoso> | So doing this with a conditional branch has the problem that branch predictors might be in the way |
2022-11-17 11:58:20 +0100 | <dminuoso> | And mispredicted branches are *very* expensive |
2022-11-17 11:58:26 +0100 | <accord> | yup |
2022-11-17 11:58:36 +0100 | <dminuoso> | No what they do instead, is just issue a read to a special address |
2022-11-17 11:58:47 +0100 | <dminuoso> | when the optimization gets invalidated, the page table mapping will be revoked, causing a cpu page fault |
2022-11-17 11:59:29 +0100 | <dminuoso> | and the handler for that will undo the optimizations, and then resume the code |
2022-11-17 11:59:45 +0100 | <dminuoso> | this works very nicely with speculative execution, no branch prediction necessary |
2022-11-17 11:59:46 +0100 | <accord> | Ah so this is to ensure the CPU ignores that fail mode, as it's rare and expensive anyway |
2022-11-17 11:59:50 +0100 | <dminuoso> | yup |
2022-11-17 11:59:52 +0100 | mei | (~mei@user/mei) (Ping timeout: 256 seconds) |
2022-11-17 11:59:53 +0100 | <accord> | NEat |
2022-11-17 12:00:30 +0100 | <accord> | Compilers are full of this crap, it must be maddening to constantly update yourself on how the hardware reacts to code over time. Subtleties change all the time |
2022-11-17 12:00:45 +0100 | <accord> | In terms of performance |
2022-11-17 12:00:57 +0100 | <accord> | Interesting that this is also happening in high level runtimes like JS |
2022-11-17 12:01:10 +0100 | <accord> | Detects patterns and optimizes/inlines aggressively. With guards |
2022-11-17 12:01:17 +0100 | <dminuoso> | in the end cost of this is a TLB entry |
2022-11-17 12:01:22 +0100 | <dminuoso> | so its not entirely cost-free |
2022-11-17 12:01:55 +0100 | <dminuoso> | and it will keep a singular cache line occupied, so there's that too - but even if it becomes a read from memory, speculative execution can resume entirely because there will be *no* data dependencies |
2022-11-17 12:03:19 +0100 | Erutuon | (~Erutuon@user/erutuon) (Ping timeout: 260 seconds) |
2022-11-17 12:03:39 +0100 | gurkenglas | (~gurkengla@84.138.199.46) (Ping timeout: 260 seconds) |
2022-11-17 12:03:52 +0100 | <tomsmeding> | accord: ghc doesn't have any spare execution units available because it doesn't know the number of execution units in the cpu that are unoccupied, and has no way of communicating to the cpu that certain instructions are unimportant |
2022-11-17 12:04:16 +0100 | <tomsmeding> | It has to put them in the normal instruction stream, that might get precedence over the non-speculative stuff |
2022-11-17 12:04:20 +0100 | mei | (~mei@user/mei) |
2022-11-17 12:04:27 +0100 | <tomsmeding> | Which sounds like a bad idea |
2022-11-17 12:04:40 +0100 | <dminuoso> | Profpatsch: Okay after some hours, no I still dont get it. Maybe AndreasK is around later to give me a pointer. |
2022-11-17 12:04:40 +0100 | mei | (~mei@user/mei) (Client Quit) |
2022-11-17 12:05:36 +0100 | <Profpatsch> | dminuoso: you mean how to reproduce? |
2022-11-17 12:07:04 +0100 | xff0x | (~xff0x@2405:6580:b080:900:43db:c639:c914:6f0d) |
2022-11-17 12:07:06 +0100 | <Profpatsch> | It depends on a weird combination of producing a list of Recs which have been `project`ed, in a different module, then fishing for some fields in each Rec, but in a certain way, without forcing the whole thing |
2022-11-17 12:07:26 +0100 | <Profpatsch> | And oh, it only shows if you depend on another function that can’t be inlined when you do that |
2022-11-17 12:07:39 +0100 | <Profpatsch> | once the extra callback goes away, it’s correct again |
2022-11-17 12:07:39 +0100 | <dminuoso> | Profpatsch: Nah the underlying problem why `lazy` is needed in unsafePerformIO |
2022-11-17 12:07:44 +0100 | <dminuoso> | its.. magic. |
2022-11-17 12:07:50 +0100 | mei_ | (~mei@user/mei) (Ping timeout: 240 seconds) |
2022-11-17 12:08:01 +0100 | <Profpatsch> | dminuoso: thing is, superrecord doesn’t even use unsafePerformIO |
2022-11-17 12:08:03 +0100 | <Profpatsch> | It uses runST |
2022-11-17 12:08:07 +0100 | <dminuoso> | Sure |
2022-11-17 12:08:15 +0100 | <Profpatsch> | https://gitlab.haskell.org/ghc/ghc/-/commit/46720997a0b1fa2971a884adf43de096ce130a7e |
2022-11-17 12:08:22 +0100 | <Profpatsch> | ^ this is the change that caused all this afaik |
2022-11-17 12:08:34 +0100 | <dminuoso> | Profpatsch: But runST and unsafePerformIO do essentially the same thiung. |
2022-11-17 12:08:37 +0100 | <Profpatsch> | It floats more things out of runRW as far as I understand |
2022-11-17 12:08:42 +0100 | <dminuoso> | Its a bit beyond me how runST has not received the `lazy` treatment |
2022-11-17 12:08:56 +0100 | <Profpatsch> | Which is why I get sharing between things that should definitely be separate |
2022-11-17 12:09:58 +0100 | <Profpatsch> | I should probably revert that commit, build GHC without it and confirm that it fixes the problem |
2022-11-17 12:10:10 +0100 | <dminuoso> | Profpatsch: Well you dont need a custom GHC |
2022-11-17 12:10:20 +0100 | <dminuoso> | you can just write your own myRunST function and use that instead |
2022-11-17 12:10:27 +0100 | CiaoSen | (~Jura@p200300c95701f1002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
2022-11-17 12:11:16 +0100 | kritzefitz | (~kritzefit@debian/kritzefitz) (Ping timeout: 248 seconds) |
2022-11-17 12:11:36 +0100 | kritzefitz | (~kritzefit@debian/kritzefitz) |
2022-11-17 12:12:02 +0100 | <Profpatsch> | dminuoso: the thing is I can see how unsafePerformIO is unsafe |
2022-11-17 12:12:05 +0100 | <Profpatsch> | but using runST shouldn’t be |
2022-11-17 12:12:47 +0100 | <Profpatsch> | Or is this about using the `ST` constructor manually |
2022-11-17 12:14:44 +0100 | <Profpatsch> | dminuoso: what about other uses of runST |
2022-11-17 12:14:46 +0100 | <Profpatsch> | libraries/ghc-bignum/src/GHC/Num/WordArray.hs |
2022-11-17 12:14:48 +0100 | <Profpatsch> | 47:withNewWordArray# sz act = case runRW# io of (# _, a #) -> a |
2022-11-17 12:15:04 +0100 | <Profpatsch> | don’t they all need a lazy before thea |
2022-11-17 12:15:27 +0100 | <Profpatsch> | Is there a way to reach Ben Gamari |
2022-11-17 12:15:35 +0100 | beteigeuze | (~Thunderbi@bl14-81-220.dsl.telepac.pt) |
2022-11-17 12:15:58 +0100 | eggplantade | (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) |
2022-11-17 12:17:29 +0100 | <probie> | Raise an issue on the GHC gitlab? |
2022-11-17 12:19:02 +0100 | <Profpatsch> | probie: I’m commenting everywhere I can lol |
2022-11-17 12:19:06 +0100 | <Profpatsch> | But so far no reactions |
2022-11-17 12:19:16 +0100 | raehik | (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
2022-11-17 12:20:16 +0100 | eggplantade | (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 256 seconds) |
2022-11-17 12:20:59 +0100 | machinedgod | (~machinedg@77.241.232.28) |
2022-11-17 12:23:39 +0100 | mei | (~mei@user/mei) |
2022-11-17 12:26:18 +0100 | <Profpatsch> | well, we don’t have a big dependency on superrecord yet, so the solution here was to drop superrecord :C |
2022-11-17 12:26:49 +0100 | <Profpatsch> | but it would be great if the GHC optimizer didn’t shuffle values around |
2022-11-17 12:28:13 +0100 | tcard | (~tcard@2400:4051:5801:7500:19ce:ed82:2ab7:90f9) (Remote host closed the connection) |
2022-11-17 12:28:25 +0100 | tcard | (~tcard@2400:4051:5801:7500:19ce:ed82:2ab7:90f9) |
2022-11-17 12:28:30 +0100 | swamp_ | (~zmt00@user/zmt00) |
2022-11-17 12:31:40 +0100 | zmt01 | (~zmt00@user/zmt00) (Ping timeout: 260 seconds) |
2022-11-17 12:31:45 +0100 | Major_Biscuit | (~MajorBisc@c-001-001-039.client.tudelft.eduvpn.nl) |
2022-11-17 12:33:31 +0100 | <AndreasK> | dminuoso: I'm here now (but haven't followed the discussion) |
2022-11-17 12:35:23 +0100 | MajorBiscuit | (~MajorBisc@2a02-a461-129d-1-193d-75d8-745d-e91e.fixed6.kpn.net) (Ping timeout: 256 seconds) |
2022-11-17 12:35:46 +0100 | mimi1vx[m] | (~osukupmat@2001:470:69fc:105::2:418d) |
2022-11-17 12:40:07 +0100 | szkl | (uid110435@id-110435.uxbridge.irccloud.com) |
2022-11-17 12:40:48 +0100 | CiaoSen | (~Jura@p200300c95701f1002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
2022-11-17 12:43:50 +0100 | jakalx | (~jakalx@base.jakalx.net) () |
2022-11-17 12:45:08 +0100 | <dminuoso> | AndreasK: Hi. Im interested to know the deeper details behind https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4926 |
2022-11-17 12:45:22 +0100 | mmhat | (~mmh@p200300f1c704c721ee086bfffe095315.dip0.t-ipconnect.de) (Quit: WeeChat 3.7.1) |
2022-11-17 12:45:43 +0100 | <dminuoso> | I've read through the related bug report https://gitlab.haskell.org/ghc/ghc/-/issues/19181 - but the descriptions are relatively dense, almost as if it is assumed the other people in the discussion already understand the problem |
2022-11-17 12:46:37 +0100 | <AndreasK> | Curse of knowledge. Always hard to know what others don't |
2022-11-17 12:47:28 +0100 | fserucas | (~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7) (Ping timeout: 256 seconds) |
2022-11-17 12:48:30 +0100 | <dminuoso> | I think my main confusion is about why call-by-value of `f x` (see https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4926/diffs#diff-content-126bdfca3210b211784af5…) would be a problem at all. |
2022-11-17 12:49:03 +0100 | <dminuoso> | (As to why `lazy` prevents that from occuring is clear to me) |
2022-11-17 12:50:23 +0100 | jakalx | (~jakalx@base.jakalx.net) |
2022-11-17 12:52:55 +0100 | <AndreasK> | dminuoso: I see. It's because `f x` contains a call to unsafePerformIO itself iirc which tries to take a lock or something of the sort |
2022-11-17 12:55:29 +0100 | <AndreasK> | dminuoso: For a different example imagine something along the lines of `unsafePerformIO $ do { let r = unsafePerformIO $ (takeLock x >> doStuff >> releaseLock x); releaseLock x; return r}` |
2022-11-17 12:55:54 +0100 | <AndreasK> | dminuoso: If we evaluate `r` early then it will try to take lock x before it's released and we deadlock |
2022-11-17 12:56:36 +0100 | <AndreasK> | dminuoso: It's not really the call-by-value that is the problem here but the order of execution. |
2022-11-17 12:56:41 +0100 | bontaq | (~user@ool-45779fe5.dyn.optonline.net) |
2022-11-17 12:57:39 +0100 | <dminuoso> | Right this makes sense now. So I guess if demand analysis saw `r` as needed from outside, it might do something along the lines of `let r = unsafePerformIO $ (takeLock x >> doStuff >> releaseLock x) in seq r (releaseLock x >> return r)` |
2022-11-17 12:57:47 +0100 | <dminuoso> | And by adding the lazy that is thwarted |
2022-11-17 12:58:51 +0100 | <AndreasK> | Yeah that's semantically what happens |
2022-11-17 12:59:37 +0100 | <AndreasK> | Operationally we get rid of the thunk for r completely but that doesn't change the meaning in this case |
2022-11-17 13:00:02 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds) |
2022-11-17 13:00:08 +0100 | <dminuoso> | Right. So that just leaves me to understand https://gitlab.haskell.org/ghc/ghc/-/issues/19413 in relation to this |
2022-11-17 13:00:39 +0100 | <dminuoso> | At first glance that looks entirely different, as newIORef is pushed out of the lambda (if ben is right) |
2022-11-17 13:04:19 +0100 | kuribas | (~user@ip-188-118-57-242.reverse.destiny.be) |
2022-11-17 13:07:49 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) |
2022-11-17 13:08:36 +0100 | jludwig | (~justin@li657-110.members.linode.com) (Ping timeout: 268 seconds) |
2022-11-17 13:08:43 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) |
2022-11-17 13:09:27 +0100 | jludwig | (~justin@li657-110.members.linode.com) |
2022-11-17 13:09:37 +0100 | fserucas | (~fserucas@2001:8a0:6d00:2500:4717:7619:c4e9:3aa2) |
2022-11-17 13:11:39 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 256 seconds) |
2022-11-17 13:19:12 +0100 | machinedgod | (~machinedg@77.241.232.28) (Ping timeout: 256 seconds) |
2022-11-17 13:19:36 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:3cb4:cd70:33e6:e916) |
2022-11-17 13:22:37 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2022-11-17 13:24:10 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:3cb4:cd70:33e6:e916) (Ping timeout: 260 seconds) |
2022-11-17 13:25:34 +0100 | use-value | (~Thunderbi@2a00:23c6:8a03:2f01:29a1:b64:95d9:d66d) (Remote host closed the connection) |
2022-11-17 13:25:53 +0100 | use-value | (~Thunderbi@2a00:23c6:8a03:2f01:29a1:b64:95d9:d66d) |
2022-11-17 13:29:47 +0100 | jmdaemon | (~jmdaemon@user/jmdaemon) (Ping timeout: 256 seconds) |
2022-11-17 13:30:40 +0100 | InstX1 | (~Liam@c-98-208-218-119.hsd1.fl.comcast.net) |
2022-11-17 13:35:38 +0100 | InstX1 | (~Liam@c-98-208-218-119.hsd1.fl.comcast.net) (Ping timeout: 256 seconds) |
2022-11-17 13:40:26 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-11-17 13:42:22 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2022-11-17 13:45:16 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 256 seconds) |
2022-11-17 13:46:31 +0100 | robbert-vdh | (~robbert@robbertvanderhelm.nl) (Ping timeout: 252 seconds) |
2022-11-17 13:50:22 +0100 | CiaoSen | (~Jura@p200300c95701f1002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
2022-11-17 13:51:36 +0100 | liteyear | (~liteyear@112.118.233.220.static.exetel.com.au) |
2022-11-17 13:51:57 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-11-17 13:52:13 +0100 | <liteyear> | Hi folks. Are you still accepting registrations for https://gitlab.haskell.org/haskell ? |
2022-11-17 13:52:52 +0100 | <liteyear> | I’d like to contribute to an issue with ghcup I’ve been working on, but have been waiting for account registration approval for a week or two now. |
2022-11-17 13:54:43 +0100 | <dminuoso> | liteyear: If available, you can also just signup with github |
2022-11-17 13:54:51 +0100 | <dminuoso> | That works without any registration/activation |
2022-11-17 13:55:17 +0100 | <dminuoso> | Or if in doubt, maybe poke bgamari. He ought to know |
2022-11-17 13:55:22 +0100 | causal | (~user@50.35.83.177) (Quit: WeeChat 3.7.1) |
2022-11-17 13:55:29 +0100 | <probie> | Do you need approval? I'm pretty sure when I wanted to comment on an issue, I signed up within seconds |
2022-11-17 13:56:02 +0100 | <dminuoso> | probie: I recall some bot registration spam issues. |
2022-11-17 13:56:36 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 256 seconds) |
2022-11-17 13:56:49 +0100 | ccapndave | (~ccapndave@xcpe-62-167-164-99.cgn.res.adslplus.ch) |
2022-11-17 14:00:44 +0100 | <liteyear> | Wish I’d done that first @dminuoso. Now if I try it claims my account is already registered! |
2022-11-17 14:01:31 +0100 | <dminuoso> | Heh. |
2022-11-17 14:01:40 +0100 | <dminuoso> | Yeah poke bgamari here or in #ghc |
2022-11-17 14:02:19 +0100 | `2jt | (~jtomas@191.red-88-17-199.dynamicip.rima-tde.net) (Ping timeout: 260 seconds) |
2022-11-17 14:05:20 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-11-17 14:05:40 +0100 | td_ | (~td@83.135.9.50) (Ping timeout: 256 seconds) |
2022-11-17 14:07:19 +0100 | Xeroine | (~Xeroine@user/xeroine) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in) |
2022-11-17 14:08:08 +0100 | Xeroine | (~Xeroine@user/xeroine) |
2022-11-17 14:08:21 +0100 | akegalj | (~akegalj@210-96.dsl.iskon.hr) |
2022-11-17 14:10:54 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2022-11-17 14:11:09 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 256 seconds) |
2022-11-17 14:13:35 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2022-11-17 14:14:01 +0100 | lyle | (~lyle@104.246.145.85) |
2022-11-17 14:19:03 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "") |
2022-11-17 14:21:27 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-11-17 14:21:45 +0100 | ccapndave | (~ccapndave@xcpe-62-167-164-99.cgn.res.adslplus.ch) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
2022-11-17 14:23:48 +0100 | ccapndave | (~ccapndave@xcpe-62-167-164-99.cgn.res.adslplus.ch) |
2022-11-17 14:25:04 +0100 | ccapndave | (~ccapndave@xcpe-62-167-164-99.cgn.res.adslplus.ch) (Client Quit) |
2022-11-17 14:25:30 +0100 | ccapndave | (~ccapndave@xcpe-62-167-164-99.cgn.res.adslplus.ch) |
2022-11-17 14:26:42 +0100 | troydm | (~troydm@host-176-37-124-197.b025.la.net.ua) |
2022-11-17 14:27:16 +0100 | <akegalj> | When I try to run `foldl' (+) 0 . map snd . zip [1..] [1..1000000000]` over Int in ghci - it leaks memory. Seems like there is some sharing going on that I can't figure out. When compiled with ghc, it doesn't leak. Anyway There are 4 versions that I tried here https://paste.tomsmeding.com/vzgJNxQo and woo1 leaks. woo2 is polymorfic and it doesn't leak. woo4 is eta expanded and it doesn't leak. Why woo1, |
2022-11-17 14:27:22 +0100 | <akegalj> | monomorfic eta reduced, version leaks in ghci? Why it doesn't leak when compiled with ghc? |
2022-11-17 14:28:14 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
2022-11-17 14:28:55 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 260 seconds) |
2022-11-17 14:29:21 +0100 | ccapndave | (~ccapndave@xcpe-62-167-164-99.cgn.res.adslplus.ch) (Client Quit) |
2022-11-17 14:31:02 +0100 | <merijn> | akegalj: ghci /= ghc |
2022-11-17 14:31:10 +0100 | youziqi | (~youziqi@103.37.140.25) (Ping timeout: 256 seconds) |
2022-11-17 14:31:23 +0100 | <merijn> | akegalj: ghci compiles to bytecode and a whole slew of optimisations don't apply to bytecode |
2022-11-17 14:31:41 +0100 | <merijn> | In general, ghci's behaviour is not representative of anything |
2022-11-17 14:32:46 +0100 | <merijn> | So I wouldn't waste too much time attempting to reverse engineer it's behaviour |
2022-11-17 14:33:14 +0100 | youziqi | (~youziqi@103.37.140.122) |
2022-11-17 14:33:38 +0100 | cafkafk | (~cafkafk@fsf/member/cafkafk) (Ping timeout: 255 seconds) |
2022-11-17 14:34:22 +0100 | <akegalj> | merijn: can i somehow turn off as much optimisations with ghc to see will it reproduce the behaviour. Is it -O0 ? |
2022-11-17 14:34:36 +0100 | <merijn> | Possibly? Not sure |
2022-11-17 14:35:13 +0100 | <akegalj> | marienz: anyway that makes sense |
2022-11-17 14:35:15 +0100 | <akegalj> | thanks |
2022-11-17 14:35:37 +0100 | <merijn> | for example, I don't think the strictness analyzer applies at all to ghci? |
2022-11-17 14:36:58 +0100 | <akegalj> | merijn: I think that's true. Even with that - without optimisations, I was wondering why would it behave like that. If we compiled directly to stg without any optimisation ... |
2022-11-17 14:37:27 +0100 | <akegalj> | anyway I thought there was a simple hand-wavey answer. If there isn't that's ok |
2022-11-17 14:38:17 +0100 | <chreekat> | liteyear: yeah because of spam you have to get approved to get your account active. Best advice right now for anyone is to ask Ben or me in #ghc . What's the username? |
2022-11-17 14:38:52 +0100 | <liteyear> | Thanks. I’ve poked bgamari and waiting on reply. Username is hraftery |
2022-11-17 14:43:22 +0100 | <chreekat> | liteyear: user approved! bgamari: fyi |
2022-11-17 14:44:32 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-11-17 14:45:05 +0100 | Guest75 | (~Guest75@178.141.130.118) (Quit: Client closed) |
2022-11-17 14:45:22 +0100 | mei | (~mei@user/mei) (Remote host closed the connection) |
2022-11-17 14:45:48 +0100 | mei | (~mei@user/mei) |
2022-11-17 14:46:41 +0100 | beteigeuze1 | (~Thunderbi@bl14-81-220.dsl.telepac.pt) |
2022-11-17 14:46:46 +0100 | <liteyear> | Confirmed! Thanks chreekat |
2022-11-17 14:48:53 +0100 | <chreekat> | np :) |
2022-11-17 14:49:12 +0100 | king_gs | (~Thunderbi@2806:103e:29:bfeb:c988:bbd5:2586:4924) |
2022-11-17 14:49:18 +0100 | beteigeuze | (~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 256 seconds) |
2022-11-17 14:49:18 +0100 | beteigeuze1 | beteigeuze |
2022-11-17 14:51:34 +0100 | vglfr | (~vglfr@145.224.100.22) (Ping timeout: 256 seconds) |
2022-11-17 14:53:13 +0100 | beteigeuze | (~Thunderbi@bl14-81-220.dsl.telepac.pt) (Remote host closed the connection) |
2022-11-17 14:53:48 +0100 | nate4 | (~nate@98.45.169.16) |
2022-11-17 14:55:01 +0100 | beteigeuze | (~Thunderbi@bl14-81-220.dsl.telepac.pt) |
2022-11-17 14:56:40 +0100 | xff0x | (~xff0x@2405:6580:b080:900:43db:c639:c914:6f0d) (Ping timeout: 252 seconds) |
2022-11-17 14:57:53 +0100 | ccapndave | (~ccapndave@mob-194-230-146-150.cgn.sunrise.net) |
2022-11-17 14:58:52 +0100 | nate4 | (~nate@98.45.169.16) (Ping timeout: 252 seconds) |
2022-11-17 15:02:43 +0100 | lortabac | (~lortabac@2a01:e0a:541:b8f0:158b:ea0c:943d:cbc4) (Ping timeout: 252 seconds) |
2022-11-17 15:03:04 +0100 | <merijn> | hmm, I love when packages break backwards compat and it's completely unclear how to fix your code to work with the latest version |
2022-11-17 15:09:36 +0100 | irrgit_ | (~irrgit@86.106.90.226) |
2022-11-17 15:10:05 +0100 | youziqi | (~youziqi@103.37.140.122) (Ping timeout: 268 seconds) |
2022-11-17 15:10:07 +0100 | xff0x | (~xff0x@2405:6580:b080:900:43db:c639:c914:6f0d) |
2022-11-17 15:10:53 +0100 | shriekingnoise | (~shrieking@186.137.167.202) |
2022-11-17 15:12:00 +0100 | ccapndave | (~ccapndave@mob-194-230-146-150.cgn.sunrise.net) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
2022-11-17 15:12:52 +0100 | youziqi | (~youziqi@103.37.140.45) |
2022-11-17 15:15:04 +0100 | ccapndave | (~ccapndave@mob-194-230-146-150.cgn.sunrise.net) |
2022-11-17 15:17:07 +0100 | [Leary] | (~Leary]@user/Leary/x-0910699) (Remote host closed the connection) |
2022-11-17 15:17:36 +0100 | [Leary] | (~Leary]@user/Leary/x-0910699) |
2022-11-17 15:20:06 +0100 | __monty__ | (~toonn@user/toonn) (Quit: leaving) |
2022-11-17 15:27:27 +0100 | ec | (~ec@gateway/tor-sasl/ec) (Remote host closed the connection) |
2022-11-17 15:28:03 +0100 | ccapndave | (~ccapndave@mob-194-230-146-150.cgn.sunrise.net) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
2022-11-17 15:28:49 +0100 | ccapndave | (~ccapndave@mob-194-230-146-150.cgn.sunrise.net) |
2022-11-17 15:32:22 +0100 | acidjnk | (~acidjnk@p200300d6e7137a8274644e28d572a0cd.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
2022-11-17 15:32:36 +0100 | InstX1 | (~Liam@c-98-208-218-119.hsd1.fl.comcast.net) |
2022-11-17 15:32:59 +0100 | ec | (~ec@gateway/tor-sasl/ec) |
2022-11-17 15:33:41 +0100 | ccapndave | (~ccapndave@mob-194-230-146-150.cgn.sunrise.net) (Quit: Textual IRC Client: www.textualapp.com) |
2022-11-17 15:34:08 +0100 | liteyear | (~liteyear@112.118.233.220.static.exetel.com.au) (Quit: liteyear) |
2022-11-17 15:34:51 +0100 | lortabac | (~lortabac@2a01:e0a:541:b8f0:77ea:1b0a:488a:bce4) |
2022-11-17 15:40:47 +0100 | CiaoSen | (~Jura@p200300c95701f1002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
2022-11-17 15:46:43 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 252 seconds) |
2022-11-17 15:51:23 +0100 | money | polo |
2022-11-17 15:52:15 +0100 | jao | (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
2022-11-17 15:59:57 +0100 | werneta | (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 256 seconds) |
2022-11-17 16:01:48 +0100 | hiredman | (~hiredman@frontier1.downey.family) (Remote host closed the connection) |
2022-11-17 16:02:31 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) (Ping timeout: 268 seconds) |
2022-11-17 16:09:33 +0100 | bobbingbob | (~bobbingbo@2604:3d09:207f:f650::b469) |
2022-11-17 16:15:05 +0100 | robbert-vdh | (~robbert@robbertvanderhelm.nl) |
2022-11-17 16:16:00 +0100 | InstX1 | (~Liam@c-98-208-218-119.hsd1.fl.comcast.net) (Ping timeout: 256 seconds) |
2022-11-17 16:17:11 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-11-17 16:18:55 +0100 | cstml | (~cstml@user/cstml) |
2022-11-17 16:20:20 +0100 | Sgeo | (~Sgeo@user/sgeo) |
2022-11-17 16:22:05 +0100 | califax | (~califax@user/califx) (Ping timeout: 255 seconds) |
2022-11-17 16:23:50 +0100 | bobbingbob | (~bobbingbo@2604:3d09:207f:f650::b469) (Ping timeout: 260 seconds) |
2022-11-17 16:25:13 +0100 | califax | (~califax@user/califx) |
2022-11-17 16:26:20 +0100 | ddellacosta | (~ddellacos@143.244.47.83) |
2022-11-17 16:27:56 +0100 | ec | (~ec@gateway/tor-sasl/ec) (Ping timeout: 255 seconds) |
2022-11-17 16:29:38 +0100 | king_gs | (~Thunderbi@2806:103e:29:bfeb:c988:bbd5:2586:4924) (Remote host closed the connection) |
2022-11-17 16:30:32 +0100 | ec | (~ec@gateway/tor-sasl/ec) |
2022-11-17 16:31:49 +0100 | acidjnk | (~acidjnk@p200300d6e7137a338cbf33f376421589.dip0.t-ipconnect.de) |
2022-11-17 16:33:36 +0100 | razetime | (~quassel@117.193.6.245) |
2022-11-17 16:42:04 +0100 | kenran | (~user@user/kenran) |
2022-11-17 16:46:50 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2022-11-17 16:54:09 +0100 | king_gs | (~Thunderbi@2806:103e:29:bfeb:c988:bbd5:2586:4924) |
2022-11-17 16:55:22 +0100 | cfricke | (~cfricke@user/cfricke) (Quit: WeeChat 3.7.1) |
2022-11-17 16:56:09 +0100 | Techcable | (~Techcable@user/Techcable) (Ping timeout: 260 seconds) |
2022-11-17 17:07:40 +0100 | cowboy8625 | (~cowboy@96-2-208-2-static.midco.net) |
2022-11-17 17:12:25 +0100 | cheater | (~Username@user/cheater) |
2022-11-17 17:16:32 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2022-11-17 17:16:33 +0100 | pavonia | (~user@user/siracusa) (Quit: Bye!) |
2022-11-17 17:20:20 +0100 | shapr` | shapr |
2022-11-17 17:21:10 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 240 seconds) |
2022-11-17 17:22:44 +0100 | razetime | (~quassel@117.193.6.245) (Remote host closed the connection) |
2022-11-17 17:23:37 +0100 | razetime | (~quassel@117.193.6.245) |
2022-11-17 17:25:08 +0100 | chromoblob | (~user@37.113.164.122) (Ping timeout: 268 seconds) |
2022-11-17 17:25:59 +0100 | eggplantade | (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) |
2022-11-17 17:26:22 +0100 | jespada | (~jespada@nmal-24-b2-v4wan-166357-cust1764.vm24.cable.virginm.net) (Quit: Textual IRC Client: www.textualapp.com) |
2022-11-17 17:27:39 +0100 | use-value | (~Thunderbi@2a00:23c6:8a03:2f01:29a1:b64:95d9:d66d) (Remote host closed the connection) |
2022-11-17 17:27:58 +0100 | use-value | (~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf) |
2022-11-17 17:29:05 +0100 | dfee | (~dfee@cpe-66-75-25-89.san.res.rr.com) |
2022-11-17 17:30:30 +0100 | son0p | (~ff@181.136.122.143) (Read error: Connection reset by peer) |
2022-11-17 17:31:09 +0100 | zeenk | (~zeenk@2a02:2f04:a208:3600::7fe) (Quit: Konversation terminated!) |
2022-11-17 17:33:34 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-11-17 17:34:10 +0100 | CiaoSen | (~Jura@p200300c95701f1002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 240 seconds) |
2022-11-17 17:35:52 +0100 | CiaoSen | (~Jura@p200300c95701f1002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
2022-11-17 17:39:58 +0100 | dfee | (~dfee@cpe-66-75-25-89.san.res.rr.com) (Quit: dfee) |
2022-11-17 17:40:26 +0100 | CiaoSen | (~Jura@p200300c95701f1002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
2022-11-17 17:41:55 +0100 | coot | (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
2022-11-17 17:43:23 +0100 | troydm | (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 260 seconds) |
2022-11-17 17:43:51 +0100 | king_gs | (~Thunderbi@2806:103e:29:bfeb:c988:bbd5:2586:4924) (Ping timeout: 260 seconds) |
2022-11-17 17:46:14 +0100 | king_gs | (~Thunderbi@187.201.139.206) |
2022-11-17 17:47:11 +0100 | `2jt | (~jtomas@191.red-88-17-199.dynamicip.rima-tde.net) |
2022-11-17 17:47:20 +0100 | bgs | (~bgs@212-85-160-171.dynamic.telemach.net) |
2022-11-17 17:48:20 +0100 | <Xeroine> | I want to make sure I understand the terminology, for example, in 'data Food = Con String Int' I'm creating a new data type which contains two fields, one can accept a string and the other an integer. Also if I afterwards do 'apple = Con "Apple" 3' I'm creating a new variable with Food type by using the constructor Con. Is this so far correct? |
2022-11-17 17:48:46 +0100 | <merijn> | Xeroine: Correct |
2022-11-17 17:48:48 +0100 | chromoblob | (~user@37.113.164.122) |
2022-11-17 17:49:05 +0100 | <Xeroine> | okay great |
2022-11-17 17:49:11 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) |
2022-11-17 17:49:31 +0100 | <c_wraith> | I know what you mean, but I think "can accept" is a bit loose. It's more like "must be" |
2022-11-17 17:49:56 +0100 | <merijn> | Well, if you wanna be pedantic you could say 'Con "Apple" 3' creates a value that you assign to the 'apple' variable |
2022-11-17 17:51:20 +0100 | <merijn> | c_wraith: It depends, you can interpret "can accept" as exclusive or not (i.e. it can accept a string -> it can only accept a string), which is how I read it initially |
2022-11-17 17:52:03 +0100 | <monochrom> | "must" = "can" plus implicit closed-world assumption :) |
2022-11-17 17:52:07 +0100 | <c_wraith> | I think if you're describing them as fields, "must be" is accurate |
2022-11-17 17:52:10 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-11-17 17:52:25 +0100 | <c_wraith> | on the other hand, if you're describing Con as a function, then yes, it can accept parameters |
2022-11-17 17:52:30 +0100 | <Xeroine> | I knew they "must be" just misworded it I guess |
2022-11-17 17:52:41 +0100 | <monochrom> | (A fine point that people who complain "people confuse 'if' with 'iff'" haven't thought of.) |
2022-11-17 17:53:09 +0100 | <c_wraith> | Xeroine: yeah, I didn't think you were wrong. Just that the terminology was a bit loose. |
2022-11-17 17:53:24 +0100 | <Xeroine> | in that Food type example Con is a type constructor, right? |
2022-11-17 17:53:35 +0100 | <monochrom> | No. Data constructor. |
2022-11-17 17:53:44 +0100 | <monochrom> | The type constructor is Foo. |
2022-11-17 17:53:48 +0100 | <monochrom> | err, Food. |
2022-11-17 17:54:01 +0100 | tzh | (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) |
2022-11-17 17:54:04 +0100 | <Xeroine> | Food is also a constructor? I thought it's just a new type I'm creating |
2022-11-17 17:54:08 +0100 | <merijn> | Xeroine: A type constructor is, well, a constructor of types (consider Maybe) |
2022-11-17 17:54:10 +0100 | <monochrom> | IOW, Con is not a type. |
2022-11-17 17:54:21 +0100 | <monochrom> | type constructor |
2022-11-17 17:54:27 +0100 | <merijn> | Xeroine: As opposed to a data constructor which constructs data (i.e. values) |
2022-11-17 17:54:41 +0100 | <monochrom> | You have created a type, so you have a type constructor, no? :) |
2022-11-17 17:54:55 +0100 | <merijn> | Xeroine: Maybe is a type constructor because it constructs types, consider "Maybe Int" |
2022-11-17 17:55:24 +0100 | <monochrom> | See, if you merely said "Con is a constructor", I would not have brought this up. |
2022-11-17 17:55:49 +0100 | <monochrom> | But you brought up "type constructor" very verbosely, so let's do that. |
2022-11-17 17:56:42 +0100 | <merijn> | Xeroine: The type level mirrors the value level to a large extent. So you can apply types to types and have (type) constructors, the same way you can apply values to values and have (value) constructors |
2022-11-17 17:57:10 +0100 | <Xeroine> | I don't really know about Maybe yet |
2022-11-17 17:57:21 +0100 | <merijn> | Unfortunate choice by me, then ;) |
2022-11-17 17:57:54 +0100 | <monochrom> | Bool and Int, then. |
2022-11-17 17:58:05 +0100 | <merijn> | Xeroine: If we have "data Bool = False | True" we have define 2 (value) constructors that have zero arguments |
2022-11-17 17:58:20 +0100 | <merijn> | but we have *also* defined a (type) constructor (Bool) that has zero arguments |
2022-11-17 17:58:49 +0100 | <merijn> | Xeroine: But Haskell has parameterised types to (think generics, if you know other languages like C#/java/whatever) |
2022-11-17 17:59:12 +0100 | <monochrom> | Since these are values/data, not types: False, True, Con "hi" 3 |
2022-11-17 17:59:33 +0100 | <monochrom> | therefore, you make data/values using False, True, Con. |
2022-11-17 17:59:39 +0100 | <monochrom> | Therefore, they are data constructors. |
2022-11-17 17:59:44 +0100 | <merijn> | So you have "data Maybe a = Nothing | Just a" which defines 1 (value) constructor with 0 arguments (Nothing), 1 (value) constructor with 1 argument (Just) and 1 (type) constructor with 1 argument (Maybe) |
2022-11-17 17:59:50 +0100 | <monochrom> | They don't make types. They make values, data. |
2022-11-17 18:03:30 +0100 | <monochrom> | Now, I fully understand that people prefer obviously wrong terminologies. |
2022-11-17 18:03:56 +0100 | hiredman | (~hiredman@frontier1.downey.family) |
2022-11-17 18:04:14 +0100 | <monochrom> | Like, you are the person who edit your code, so you should be called the editor. But no, people prefer to call a certain stupid program the editor, even though you are the one doing all the work! |
2022-11-17 18:05:33 +0100 | <Xeroine> | monochrom: you said that False, True are values which I understand but then "therefore, you make data/values using False, True, Con." so I can use True, False, etc. to create new values? What do you mean by that? |
2022-11-17 18:06:03 +0100 | <merijn> | Xeroine: True is both a constructor and a value |
2022-11-17 18:06:15 +0100 | <monochrom> | Con makes values, no? But I wouldn't commit about "new". |
2022-11-17 18:06:19 +0100 | <merijn> | actually, we're all being sloppy now, since functions are also values |
2022-11-17 18:07:04 +0100 | <monochrom> | And if you don't insist on "new", then "True is a value already" is also a special case of "True makes values too, just in the most trivial way". |
2022-11-17 18:07:21 +0100 | <Xeroine> | merijn: I get how it's a value but how is it used to construct values? |
2022-11-17 18:07:46 +0100 | <monochrom> | In fact, Con is also a value already. You can use it as a String->Int->Food function. |
2022-11-17 18:08:11 +0100 | <merijn> | We need a word for non-function values ;) |
2022-11-17 18:08:30 +0100 | <monochrom> | If some other function says "I want you to give me a String->Int->Food parameter", you can give Con. |
2022-11-17 18:08:40 +0100 | <merijn> | Xeroine: Being a value and constructing a value are pretty interchangeable in Haskell |
2022-11-17 18:08:56 +0100 | <Xeroine> | oh |
2022-11-17 18:09:08 +0100 | <merijn> | Does 'Con "Apple" 3' *construct* a value or *is* it a value? |
2022-11-17 18:09:30 +0100 | <merijn> | Xeroine: The distinction is pretty moot and unimportant in Haskell, since values are immutable and don't have a "location" or anything like that |
2022-11-17 18:09:30 +0100 | <Xeroine> | both then? |
2022-11-17 18:09:34 +0100 | <monochrom> | Bah I say that we don't need words for non-function values, non-zero numbers, non-square rectanges, non-radius-zero circles, non-function-type types, non-higher-order functions, ... |
2022-11-17 18:09:40 +0100 | <merijn> | Xeroine: Both, neither, whatever you like :) |
2022-11-17 18:09:50 +0100 | <monochrom> | non-empty lists... |
2022-11-17 18:10:40 +0100 | akegalj | (~akegalj@210-96.dsl.iskon.hr) (Quit: leaving) |
2022-11-17 18:11:26 +0100 | <monochrom> | If you are obsessed with detailed steps of running a program, then you think "construct". "It didn't exist a moment ago, oh suddenly it exists now, so there must have been construction work". |
2022-11-17 18:11:50 +0100 | <monochrom> | But if you accept that functional programming is about leveraging algebra skills, then you think "is". |
2022-11-17 18:12:07 +0100 | <monochrom> | and "equals". |
2022-11-17 18:12:44 +0100 | <Xeroine> | alright thanks |
2022-11-17 18:19:04 +0100 | eggplantade | (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
2022-11-17 18:20:24 +0100 | werneta | (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
2022-11-17 18:20:52 +0100 | razetime | (~quassel@117.193.6.245) (Remote host closed the connection) |
2022-11-17 18:21:23 +0100 | kenran | (~user@user/kenran) (Remote host closed the connection) |
2022-11-17 18:22:09 +0100 | shelby | (~thomas_sh@115.96.219.9) |
2022-11-17 18:23:25 +0100 | <shelby> | hi.. is there a detailed web development tutorial for beginners using haskell.. ? I have seen a few which are either very old or jump through a lot of steps which i dont understand |
2022-11-17 18:24:28 +0100 | <geekosaur> | sadly I'd have to say webdev is not a good place to start; all the webdev stuff is pretty heavily into type level programming |
2022-11-17 18:25:07 +0100 | <c_wraith> | there are lots of web libraries that don't do type-level stuff. But they all assume you know how the web works. |
2022-11-17 18:25:54 +0100 | <c_wraith> | They all assume you know how HTTP works |
2022-11-17 18:25:58 +0100 | <Rembane> | Scotty is quite alright for small things imo, but it takes about fifteen minutes before a monad transformer stack is needed. |
2022-11-17 18:26:11 +0100 | <shelby> | :) |
2022-11-17 18:26:19 +0100 | coldtom | (~coldtom@coldrick.cc) (Quit: Well, that's got rid of me) |
2022-11-17 18:26:26 +0100 | <shelby> | how about anything related to data science in haskell? |
2022-11-17 18:26:33 +0100 | jespada | (~jespada@nmal-24-b2-v4wan-166357-cust1764.vm24.cable.virginm.net) |
2022-11-17 18:26:37 +0100 | <shelby> | what are the normal projects beginners start with.. ? |
2022-11-17 18:26:43 +0100 | <shelby> | I am using lyah |
2022-11-17 18:27:02 +0100 | <shelby> | i also have Prof graham huttons book .. tic tac toe examples.. |
2022-11-17 18:27:03 +0100 | <Rembane> | I like building interpreters in Haskell, it can be kinda well contained. Parsers are also nice, but a bit more fiddly. |
2022-11-17 18:27:08 +0100 | coldtom | (~coldtom@coldrick.cc) |
2022-11-17 18:27:11 +0100 | kuribas | (~user@ip-188-118-57-242.reverse.destiny.be) (Quit: ERC (IRC client for Emacs 27.1)) |
2022-11-17 18:27:52 +0100 | <shelby> | nothing against it but not able to use it anywhere.. eg a simple web form for data collection.. comes across as too difficult in haskell |
2022-11-17 18:28:10 +0100 | <merijn> | shelby: The visualisation side of data science-y stuff is a bit messy, but the *processing* side is really nice |
2022-11-17 18:28:33 +0100 | <shelby> | taking iris data set and coming up with any kind of viz - again an issue.. |
2022-11-17 18:28:45 +0100 | <merijn> | shelby: In my own code I have completely trivial and dumb gnuplot/matplotlib scripts that I call from Haskell with all the data processing in Haskell |
2022-11-17 18:28:57 +0100 | <shelby> | what do people use it for? small simple use cases? |
2022-11-17 18:29:39 +0100 | <merijn> | shelby: about 70-80% of the code for the experiments in my phd thesis was Haskell, including all the data management, job scheduling, analysis, etc. |
2022-11-17 18:29:44 +0100 | chromoblob | (~user@37.113.164.122) (Ping timeout: 256 seconds) |
2022-11-17 18:29:55 +0100 | kenran | (~user@user/kenran) |
2022-11-17 18:30:01 +0100 | <shelby> | ok.. i know a bit of R.. not matplot lib.. |
2022-11-17 18:30:16 +0100 | jakalx | (~jakalx@base.jakalx.net) (Error from remote client) |
2022-11-17 18:30:17 +0100 | <merijn> | matplotlib is absolutely awful anyway |
2022-11-17 18:30:31 +0100 | <merijn> | Shouldn't be too hard to feed data into an R script instead |
2022-11-17 18:30:35 +0100 | <shelby> | somewhere i am not able to cross from text book to practical projects in haskell.. any one else feel the same? |
2022-11-17 18:30:50 +0100 | Major_Biscuit | (~MajorBisc@c-001-001-039.client.tudelft.eduvpn.nl) (Ping timeout: 240 seconds) |
2022-11-17 18:30:58 +0100 | jakalx | (~jakalx@base.jakalx.net) |
2022-11-17 18:31:15 +0100 | <merijn> | shelby: tbh, if you're reading LYAH that's pretty understandable it's not a great book, in the sense that it shows lots of neat things, but doesn't really teach you how to *do* things |
2022-11-17 18:31:28 +0100 | <shelby> | yes |
2022-11-17 18:31:36 +0100 | <merijn> | Hutton's book should be much better |
2022-11-17 18:31:56 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:3cb4:cd70:33e6:e916) |
2022-11-17 18:32:00 +0100 | <shelby> | so i took up huttons book.. it is definitely better.. but still academic.. most of it is in the interactive mode.. |
2022-11-17 18:32:14 +0100 | <shelby> | does not get into a project mode.. |
2022-11-17 18:32:46 +0100 | <shelby> | multiple files / modules.. DB interaction.. etc.. |
2022-11-17 18:32:55 +0100 | chromoblob | (~user@37.113.164.122) |
2022-11-17 18:33:39 +0100 | <merijn> | shelby: Do you know any other languages or is Haskell the first? |
2022-11-17 18:33:42 +0100 | nschoe | (~q@141.101.51.197) (Ping timeout: 256 seconds) |
2022-11-17 18:34:35 +0100 | <shelby> | R |
2022-11-17 18:34:40 +0100 | <shelby> | a bit of ruby |
2022-11-17 18:35:46 +0100 | <merijn> | a lot of the module organisation, etc. is mostly the same as any other language, tbh |
2022-11-17 18:36:24 +0100 | <shelby> | i understand.. but things break far too often and then you end up going down a different rabbit hole :) |
2022-11-17 18:36:26 +0100 | <merijn> | as for database interaction, the simplest things to get started with are things like sqlite-simple and postgres-simple which are fairly self-explanatory compared to database bindings in imperative languages |
2022-11-17 18:37:08 +0100 | <Franciman> | is it possible to have a pure language perform SQL queries? Or is the monad necessary in any case? |
2022-11-17 18:37:10 +0100 | <merijn> | There's stuff like Selda for higher level database stuff, but I'm not completely sold on that whole approach |
2022-11-17 18:37:24 +0100 | <Franciman> | ah probably to handle failures of the connection :/ |
2022-11-17 18:37:30 +0100 | <Franciman> | and opening the connection too |
2022-11-17 18:38:16 +0100 | irrgit__ | (~irrgit@146.70.27.250) |
2022-11-17 18:41:04 +0100 | irrgit_ | (~irrgit@86.106.90.226) (Ping timeout: 256 seconds) |
2022-11-17 18:41:24 +0100 | Tuplanolla | (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) |
2022-11-17 18:42:34 +0100 | wagle | (~wagle@quassel.wagle.io) (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
2022-11-17 18:42:46 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 256 seconds) |
2022-11-17 18:42:50 +0100 | kenran | (~user@user/kenran) (Remote host closed the connection) |
2022-11-17 18:42:58 +0100 | econo | (uid147250@user/econo) |
2022-11-17 18:43:03 +0100 | wagle | (~wagle@quassel.wagle.io) |
2022-11-17 18:44:05 +0100 | titibandit | (~titibandi@xdsl-78-35-182-184.nc.de) (Remote host closed the connection) |
2022-11-17 18:45:34 +0100 | lortabac | (~lortabac@2a01:e0a:541:b8f0:77ea:1b0a:488a:bce4) (Quit: WeeChat 2.8) |
2022-11-17 18:52:24 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2022-11-17 18:55:03 +0100 | zaquest | (~notzaques@5.130.79.72) (Ping timeout: 256 seconds) |
2022-11-17 18:55:14 +0100 | <vpan> | shelby: I understand you very well. I started with LYAH myself and only realised halfway through it that it's not considered great by the community. Finished it anyway and I'm now reading https://www.manning.com/books/haskell-in-depth . Don't really have much to compare it against, but it covers many practical aspects and walks through some small sample projects (code is on GitHub), so I'm happy with it so far. |
2022-11-17 18:55:18 +0100 | nate4 | (~nate@98.45.169.16) |
2022-11-17 18:56:09 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2022-11-17 18:57:59 +0100 | mvk | (~mvk@2607:fea8:5ce3:8500::4b68) |
2022-11-17 18:59:26 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-11-17 19:00:23 +0100 | nate4 | (~nate@98.45.169.16) (Ping timeout: 260 seconds) |
2022-11-17 19:00:31 +0100 | shelby | (~thomas_sh@115.96.219.9) (Remote host closed the connection) |
2022-11-17 19:04:07 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 256 seconds) |
2022-11-17 19:05:16 +0100 | ft | (~ft@p508dbd59.dip0.t-ipconnect.de) |
2022-11-17 19:06:59 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2022-11-17 19:10:57 +0100 | enoq | (~enoq@2a05:1141:1f5:5600:b9c9:721a:599:bfe7) (Quit: enoq) |
2022-11-17 19:11:12 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-11-17 19:14:32 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2022-11-17 19:14:38 +0100 | zaquest | (~notzaques@5.130.79.72) |
2022-11-17 19:16:05 +0100 | polo | money |
2022-11-17 19:16:11 +0100 | king_gs | (~Thunderbi@187.201.139.206) (Read error: Connection reset by peer) |
2022-11-17 19:16:12 +0100 | fserucas | (~fserucas@2001:8a0:6d00:2500:4717:7619:c4e9:3aa2) (Quit: Leaving) |
2022-11-17 19:16:58 +0100 | king_gs | (~Thunderbi@2806:103e:29:bfeb:c988:bbd5:2586:4924) |
2022-11-17 19:17:06 +0100 | coot | (~coot@213.134.171.3) |
2022-11-17 19:18:41 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection) |
2022-11-17 19:20:01 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) |
2022-11-17 19:21:10 +0100 | irrgit__ | (~irrgit@146.70.27.250) (Ping timeout: 240 seconds) |
2022-11-17 19:22:42 +0100 | emcee50 | (~emcee@rrcs-24-43-123-72.west.biz.rr.com) |
2022-11-17 19:24:10 +0100 | <emcee50> | is there a recommendation for which package to use between cmdargs and optparse-applicative for parsing cli arguments? |
2022-11-17 19:24:21 +0100 | srz | (~srz@181.228.49.93) |
2022-11-17 19:25:58 +0100 | <sm> | I like cmdargs; o-a is more popular |
2022-11-17 19:26:21 +0100 | <geekosaur> | each has its proponents |
2022-11-17 19:26:40 +0100 | <geekosaur> | I suggest playing with both and using the one you like more |
2022-11-17 19:27:31 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2022-11-17 19:28:07 +0100 | <emcee50> | sm: is there a single reason why you prefer cmdargs? |
2022-11-17 19:28:25 +0100 | <sm> | no, several |
2022-11-17 19:29:23 +0100 | irrgit_ | (~irrgit@89.47.234.74) |
2022-11-17 19:29:32 +0100 | <emcee50> | hmmm i suppose i'll just pick one and see how i like it. my use case is pretty simple. thanks for the input, all. |
2022-11-17 19:29:33 +0100 | mbuf | (~Shakthi@49.204.115.42) (Quit: Leaving) |
2022-11-17 19:29:46 +0100 | <sm> | the name, the docs, easier to figure out, monolithic vs a confusing ecosystem, accepts partial flags, inertia |
2022-11-17 19:30:27 +0100 | <emcee50> | lol yeah optparse-applicative is truly a Haskell Name |
2022-11-17 19:32:13 +0100 | <emcee50> | I suppose I'll give cmdargs a try then, thanks for the summary. |
2022-11-17 19:33:02 +0100 | <sm> | maybe an o-a user who has tried cmdargs can give their reasons |
2022-11-17 19:34:58 +0100 | beteigeuze | (~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 252 seconds) |
2022-11-17 19:37:17 +0100 | vpan | (~0@212.117.1.172) (Quit: Leaving.) |
2022-11-17 19:43:25 +0100 | beteigeuze | (~Thunderbi@bl14-81-220.dsl.telepac.pt) |
2022-11-17 19:47:30 +0100 | beteigeuze | (~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 240 seconds) |
2022-11-17 19:49:43 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2022-11-17 19:50:21 +0100 | <merijn> | emcee50: Counter point, I wildly prefer optparse-applicative :p |
2022-11-17 19:51:06 +0100 | <merijn> | I haven't used cmdargs, but did look into it. And overally the most important factor in not using cmdargs is: too much magic |
2022-11-17 19:51:10 +0100 | caryhartline | (~caryhartl@2600:1700:2d0:8d30:3193:f3f8:77d4:386c) |
2022-11-17 19:52:56 +0100 | <merijn> | Since it was basically all the implicit interface. The explicit interface is better, but otoh the explicit interface isn't super different from optparse |
2022-11-17 19:54:01 +0100 | <emcee50> | i can see what you're saying, comparing the docs |
2022-11-17 19:54:13 +0100 | <dsal> | I used optparse-generic once, but generally prefer optparse-applicative. |
2022-11-17 19:54:30 +0100 | <merijn> | optparse also "scales better" in the sense that "writing a very simple parser" is easy enough, maybe a bit verboser than cmdargs and other alternatives, but you can go as big as you complex as you want |
2022-11-17 19:55:50 +0100 | <dsal> | Yeah, optparse-applicative lets you do cool stuff like this, and will do neat things with bash like generation completions and junk. https://www.irccloud.com/pastebin/qgFfWhku/optparse.txt |
2022-11-17 19:56:01 +0100 | <merijn> | I have a (well, several, I suppose) pretty giant CLI parser(s) in it including stuff like dynamic bash completion and what not |
2022-11-17 19:56:24 +0100 | <dsal> | That wasn't the best example, but it'll try to get pretty close if you make a spelling error or something. |
2022-11-17 19:56:30 +0100 | <merijn> | custom completion, customizable help rendering, etc. is all pretty nice |
2022-11-17 19:56:54 +0100 | <dsal> | Like this: https://www.irccloud.com/pastebin/BDXeqzed/list.txt |
2022-11-17 19:56:55 +0100 | <merijn> | And it's nice that you can start super basic and "grow into it" in terms of complicated features |
2022-11-17 19:57:14 +0100 | jmdaemon | (~jmdaemon@user/jmdaemon) |
2022-11-17 19:58:12 +0100 | <monochrom> | optparse-applicative does need better explanations and probably should not have been so abstract in the first place. |
2022-11-17 19:58:30 +0100 | <dsal> | Are you advocating for optparse-functor? |
2022-11-17 19:58:41 +0100 | <merijn> | dsal: Naah, that'd syck |
2022-11-17 19:58:43 +0100 | <monochrom> | No. |
2022-11-17 19:58:44 +0100 | <merijn> | *suck |
2022-11-17 19:58:46 +0100 | <emcee50> | Thanks for the input merijn and dsal regarding optparse-applicative! I suppose like was suggested before that I'll check both out |
2022-11-17 19:58:51 +0100 | <merijn> | monochrom: Abstract in what sense? |
2022-11-17 19:59:34 +0100 | <dsal> | optparse-generic looks kind of neat, but it's not super flexible. It's good at doing the things it's good at doing and if you're just doing those things, you're good. |
2022-11-17 19:59:41 +0100 | <sm> | at the other end of the spectrum, docopt is very handy if you can deal with its limitations |
2022-11-17 19:59:55 +0100 | <emcee50> | i think they should adopt optparse-zyghistomorphicprepromorphism myself |
2022-11-17 20:01:07 +0100 | <monochrom> | In the same sense as, though not as severe as, regex-base in going so overboard with type classes. |
2022-11-17 20:01:19 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2022-11-17 20:01:33 +0100 | <monochrom> | I do not mean that the applicative idea is too abstract. |
2022-11-17 20:02:17 +0100 | DDR | (~DDR@2604:3d08:4c7f:8250:7257:f6a:ab73:6e5d) |
2022-11-17 20:02:59 +0100 | <merijn> | monochrom: The classes are almost never really something you have to deal with in the API, though |
2022-11-17 20:03:25 +0100 | <monochrom> | https://hackage.haskell.org/package/options shows that you can have the applicative way and still not going overboard with so many, um, options. |
2022-11-17 20:03:51 +0100 | c0c0 | (~coco@85.195.206.136) (Quit: WeeChat 3.5) |
2022-11-17 20:04:21 +0100 | <monochrom> | That's not how I experienced optparse-applicative. |
2022-11-17 20:04:32 +0100 | <cstml> | fwiw. optparse-applicative is my no-brainer choice. Simple, and easy to scale. |
2022-11-17 20:05:23 +0100 | <merijn> | My main complaint is the default "style" used by the author in examples is much more verbose and complicated looking than using "mconcat on lists" |
2022-11-17 20:05:56 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:3cb4:cd70:33e6:e916) (Remote host closed the connection) |
2022-11-17 20:05:59 +0100 | td_ | (~td@83.135.9.50) |
2022-11-17 20:06:35 +0100 | <cstml> | imo. better to have comprehensive examples - rather than trivial ones. Best is both. |
2022-11-17 20:06:54 +0100 | <monochrom> | Either that or you could argue that the highly generalized type classes are a really good idea but it's the docs that are obtuse. |
2022-11-17 20:08:33 +0100 | <merijn> | tbh, the classes should just not be listed in the docs, since they're mostly internal |
2022-11-17 20:08:39 +0100 | <monochrom> | I mean, I figured them out quickly, sure. (I even figured out regex-base.) But I am also a teacher, and I see that from that angle it totally fails. |
2022-11-17 20:13:49 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 256 seconds) |
2022-11-17 20:14:11 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Read error: Connection reset by peer) |
2022-11-17 20:15:21 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
2022-11-17 20:17:54 +0100 | <merijn> | cstml: My point was more that the same example could be written cleaner and less intimidating looking with some use of mconcat :p |
2022-11-17 20:18:19 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:3cb4:cd70:33e6:e916) |
2022-11-17 20:19:10 +0100 | Guest47 | (~Guest47@110.226.84.78) |
2022-11-17 20:19:25 +0100 | Guest47 | (~Guest47@110.226.84.78) (Client Quit) |
2022-11-17 20:19:43 +0100 | <monochrom> | And just now I'm coming across https://hackage.haskell.org/package/optparse-declarative so you write your option specification at the type-level... :) |
2022-11-17 20:19:59 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2022-11-17 20:20:50 +0100 | `2jt | (~jtomas@191.red-88-17-199.dynamicip.rima-tde.net) (Ping timeout: 240 seconds) |
2022-11-17 20:20:54 +0100 | <merijn> | monochrom: That...sounds like a nightmare |
2022-11-17 20:21:35 +0100 | <monochrom> | The example use cases look alright. |
2022-11-17 20:22:11 +0100 | <monochrom> | The type looks long but if you use other libraries you have long values instead. Same length. |
2022-11-17 20:22:40 +0100 | <monochrom> | Analogous structure too. |
2022-11-17 20:22:44 +0100 | <cstml> | merijn: If you consider it would make a big difference, it's worth opening a PR against the documentation and proposing a change to it. Personally I like the look of (<>) ~ reminiscent of "lens'ing". |
2022-11-17 20:24:08 +0100 | <monochrom> | OK, I see that the type-level way requires remembering parameter order, the applicative way doesn't. |
2022-11-17 20:25:28 +0100 | ubert | (~Thunderbi@77.119.167.253.wireless.dyn.drei.com) (Read error: Connection reset by peer) |
2022-11-17 20:25:28 +0100 | ub | ubert |
2022-11-17 20:25:47 +0100 | ubert1 | (~Thunderbi@77.119.167.253.wireless.dyn.drei.com) |
2022-11-17 20:26:07 +0100 | <mauke> | how do I spec cat(1) with this? |
2022-11-17 20:26:40 +0100 | Guest12 | (~Guest12@110.226.84.78) |
2022-11-17 20:26:49 +0100 | <monochrom> | I am too lazy to find out. :) |
2022-11-17 20:27:29 +0100 | <mauke> | it doesn't look possible |
2022-11-17 20:29:55 +0100 | <cstml> | mauke: wdym? - you think it's impossible to spec https://man7.org/linux/man-pages/man1/cat.1.html with `optparse-applicative`? |
2022-11-17 20:30:21 +0100 | <mauke> | no, optparse-declarative |
2022-11-17 20:30:38 +0100 | <mauke> | "If the input is [], it indicates the option does not have an argument; otherwise the input is a list of a single String." <- ??? |
2022-11-17 20:32:10 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2022-11-17 20:32:33 +0100 | <cstml> | mauke: oh, ok. No idea. |
2022-11-17 20:33:12 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:3cb4:cd70:33e6:e916) (Remote host closed the connection) |
2022-11-17 20:34:08 +0100 | <merijn> | :O |
2022-11-17 20:36:18 +0100 | Guest12 | (~Guest12@110.226.84.78) (Ping timeout: 260 seconds) |
2022-11-17 20:36:24 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-11-17 20:36:47 +0100 | emcee50 | (~emcee@rrcs-24-43-123-72.west.biz.rr.com) (Quit: Client closed) |
2022-11-17 20:38:03 +0100 | <mauke> | the main problems I see: cat takes valueless options like -n; o-d doesn't support that (maybe? documentation is unclear) |
2022-11-17 20:38:36 +0100 | <mauke> | cat takes an arbitrary list of non-option arguments; also not supported |
2022-11-17 20:39:05 +0100 | dfee | (~dfee@cpe-70-95-143-62.san.res.rr.com) |
2022-11-17 20:39:16 +0100 | <mauke> | finally, cat has a -v option but o-d insists on predefining a "verbose" option with shorthand -v |
2022-11-17 20:41:09 +0100 | <sm> | there are a lot of variations in command line parsing behaviour and I think no one lib supports them all |
2022-11-17 20:41:14 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 268 seconds) |
2022-11-17 20:41:39 +0100 | <sm> | cmdargs can't easily support flags with an optional argument, eg |
2022-11-17 20:42:24 +0100 | troydm | (~troydm@host-176-37-124-197.b025.la.net.ua) |
2022-11-17 20:45:57 +0100 | mei | (~mei@user/mei) (Remote host closed the connection) |
2022-11-17 20:47:22 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2022-11-17 20:47:23 +0100 | Vajb | (~Vajb@2001:999:504:3ad6:52a4:a3b5:32d8:e74d) (Read error: Connection reset by peer) |
2022-11-17 20:48:00 +0100 | Vajb | (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) |
2022-11-17 20:50:08 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:3cb4:cd70:33e6:e916) |
2022-11-17 20:51:55 +0100 | raehik | (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 260 seconds) |
2022-11-17 20:54:22 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-11-17 21:00:25 +0100 | mei | (~mei@user/mei) |
2022-11-17 21:03:07 +0100 | cstml | (~cstml@user/cstml) (Ping timeout: 256 seconds) |
2022-11-17 21:07:50 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2022-11-17 21:07:57 +0100 | remedan_ | (~remedan@octo.cafe) |
2022-11-17 21:08:30 +0100 | remedan | (~remedan@octo.cafe) (Ping timeout: 260 seconds) |
2022-11-17 21:08:37 +0100 | Philonous_ | (~Philonous@user/philonous) |
2022-11-17 21:09:05 +0100 | Philonous | (~Philonous@user/philonous) (Ping timeout: 260 seconds) |
2022-11-17 21:11:32 +0100 | Vajb | (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) (Read error: Connection reset by peer) |
2022-11-17 21:12:21 +0100 | Vajb | (~Vajb@2001:999:504:3ad6:52a4:a3b5:32d8:e74d) |
2022-11-17 21:15:37 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Quit: ZNC - https://znc.in) |
2022-11-17 21:16:17 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-11-17 21:16:20 +0100 | shapr | (~user@2601:7c0:c383:70:87f8:8431:4c:ee0) (Ping timeout: 256 seconds) |
2022-11-17 21:16:24 +0100 | Erutuon | (~Erutuon@user/erutuon) |
2022-11-17 21:19:02 +0100 | gmg | (~user@user/gehmehgeh) |
2022-11-17 21:20:37 +0100 | cstml | (~cstml@cpc151611-shef16-2-0-cust313.17-1.cable.virginm.net) |
2022-11-17 21:22:10 +0100 | cheater | (~Username@user/cheater) (Remote host closed the connection) |
2022-11-17 21:22:50 +0100 | cstml | (~cstml@cpc151611-shef16-2-0-cust313.17-1.cable.virginm.net) (Client Quit) |
2022-11-17 21:23:58 +0100 | cheater | (~Username@user/cheater) |
2022-11-17 21:24:10 +0100 | king_gs | (~Thunderbi@2806:103e:29:bfeb:c988:bbd5:2586:4924) (Ping timeout: 240 seconds) |
2022-11-17 21:30:02 +0100 | lyle | (~lyle@104.246.145.85) (Quit: WeeChat 3.7.1) |
2022-11-17 21:32:01 +0100 | cstml | (cstml@user/cstml) |
2022-11-17 21:34:55 +0100 | InstX1 | (~Liam@c-98-208-218-119.hsd1.fl.comcast.net) |
2022-11-17 21:36:11 +0100 | gmg | (~user@user/gehmehgeh) (Ping timeout: 255 seconds) |
2022-11-17 21:36:17 +0100 | pavonia | (~user@user/siracusa) |
2022-11-17 21:37:07 +0100 | gmg | (~user@user/gehmehgeh) |
2022-11-17 21:38:01 +0100 | <Xeroine> | I don't really understand what that problem is when installing with cabal. Here's the error messages I'm getting https://bpa.st/C3QQ |
2022-11-17 21:38:40 +0100 | <Xeroine> | This is in a fresh ~/.cabal, I only ran "cabal update" in it |
2022-11-17 21:38:41 +0100 | <geekosaur> | "conflict: pkg-config |
2022-11-17 21:38:41 +0100 | <geekosaur> | package librsvg-2.0==2.16.0 || >2.16.0, not found in the pkg-config database" |
2022-11-17 21:39:00 +0100 | <geekosaur> | you need to install the OS librsvg-2.0 package |
2022-11-17 21:39:21 +0100 | <geekosaur> | (pkg-config is a package tracker for C/C++ libraries) |
2022-11-17 21:39:43 +0100 | akegalj | (~akegalj@210-96.dsl.iskon.hr) |
2022-11-17 21:39:49 +0100 | InstX1 | (~Liam@c-98-208-218-119.hsd1.fl.comcast.net) (Ping timeout: 268 seconds) |
2022-11-17 21:39:55 +0100 | <Xeroine> | oh, I was about to ask if it's complaining that it's missing or because it's installed and it's causing some kind of conflict |
2022-11-17 21:39:55 +0100 | <geekosaur> | you also need the devel library, if your OS makes that distinction (debian and fedora do, arch doesn't) |
2022-11-17 21:40:55 +0100 | Bish | (~arne@ip-078-094-082-081.um19.pools.vodafone-ip.de) (Quit: leaving) |
2022-11-17 21:41:35 +0100 | <geekosaur> | on my ubuntu system, this meands "sudo apt install librsvg2-dev" |
2022-11-17 21:42:24 +0100 | <Xeroine> | yeah I got it and looks like it's instaling ghc-vis now |
2022-11-17 21:42:51 +0100 | <Xeroine> | thanks |
2022-11-17 21:43:18 +0100 | king_gs | (~Thunderbi@187.201.139.206) |
2022-11-17 21:45:49 +0100 | dequbed | (~dequbed@banana-new.kilobyte22.de) (Quit: bye!) |
2022-11-17 21:50:15 +0100 | srz | (~srz@181.228.49.93) (Ping timeout: 260 seconds) |
2022-11-17 21:53:05 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2022-11-17 21:53:21 +0100 | shapr | (~user@68.54.166.125) |
2022-11-17 21:53:48 +0100 | titibandit | (~titibandi@xdsl-78-35-182-184.nc.de) |
2022-11-17 21:56:53 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
2022-11-17 21:58:19 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 268 seconds) |
2022-11-17 22:03:10 +0100 | king_gs1 | (~Thunderbi@2806:103e:29:bfeb:c988:bbd5:2586:4924) |
2022-11-17 22:03:11 +0100 | king_gs | (~Thunderbi@187.201.139.206) (Read error: Connection reset by peer) |
2022-11-17 22:03:11 +0100 | king_gs1 | king_gs |
2022-11-17 22:05:14 +0100 | polo_ | (~polo@pool-100-11-18-203.phlapa.fios.verizon.net) |
2022-11-17 22:05:24 +0100 | fockerize | (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 248 seconds) |
2022-11-17 22:06:20 +0100 | califax | (~califax@user/califx) (Remote host closed the connection) |
2022-11-17 22:06:45 +0100 | coot | (~coot@213.134.171.3) (Quit: coot) |
2022-11-17 22:08:29 +0100 | califax | (~califax@user/califx) |
2022-11-17 22:11:22 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-11-17 22:12:59 +0100 | stef204 | (~stef204@user/stef204) |
2022-11-17 22:15:05 +0100 | polo_ | (~polo@pool-100-11-18-203.phlapa.fios.verizon.net) (Ping timeout: 256 seconds) |
2022-11-17 22:15:44 +0100 | polo_ | (~polo@pool-100-11-18-203.phlapa.fios.verizon.net) |
2022-11-17 22:15:55 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 260 seconds) |
2022-11-17 22:16:45 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:3cb4:cd70:33e6:e916) (Remote host closed the connection) |
2022-11-17 22:19:29 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer) |
2022-11-17 22:20:22 +0100 | polo_ | (~polo@pool-100-11-18-203.phlapa.fios.verizon.net) (Changing host) |
2022-11-17 22:20:22 +0100 | polo_ | (~polo@user/polo) |
2022-11-17 22:20:27 +0100 | money | Guest5270 |
2022-11-17 22:20:27 +0100 | polo_ | money |
2022-11-17 22:20:42 +0100 | jakalx | (~jakalx@base.jakalx.net) () |
2022-11-17 22:21:07 +0100 | Techcable | (~Techcable@user/Techcable) |
2022-11-17 22:21:32 +0100 | gqplox | (~textual@2a02:c7c:941d:fd00:c91:4591:f163:6ae7) |
2022-11-17 22:23:25 +0100 | money | (~polo@user/polo) (Quit: Late) |
2022-11-17 22:23:36 +0100 | <gqplox> | hi guys |
2022-11-17 22:24:02 +0100 | king_gs | (~Thunderbi@2806:103e:29:bfeb:c988:bbd5:2586:4924) (Remote host closed the connection) |
2022-11-17 22:24:21 +0100 | king_gs | (~Thunderbi@2806:103e:29:bfeb:c988:bbd5:2586:4924) |
2022-11-17 22:24:22 +0100 | <gqplox> | http://sprunge.us/wgU8sP |
2022-11-17 22:25:53 +0100 | bobbingbob | (~bobbingbo@2604:3d09:207f:f650::b469) |
2022-11-17 22:26:42 +0100 | fockerize | (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) |
2022-11-17 22:26:55 +0100 | <geekosaur> | yes? |
2022-11-17 22:27:46 +0100 | jakalx | (~jakalx@base.jakalx.net) |
2022-11-17 22:28:14 +0100 | <geekosaur> | (I do wonder if you'd have problems because "Main" is a special module name; might need some extra foo to prevent ghc from misreading it as a qualified name) |
2022-11-17 22:28:19 +0100 | polo | (~polo@user/polo) |
2022-11-17 22:29:54 +0100 | <gqplox> | im having some trouble with this maxBound |
2022-11-17 22:29:57 +0100 | <gqplox> | minBound sorry |
2022-11-17 22:30:34 +0100 | <gqplox> | I want to make a function that will say print all the items in teh data class for any given Data which has bounded show and enum |
2022-11-17 22:30:56 +0100 | beteigeuze | (~Thunderbi@a79-169-109-107.cpe.netcabo.pt) |
2022-11-17 22:32:32 +0100 | <geekosaur> | sounds like you pretty much described such a function |
2022-11-17 22:32:45 +0100 | <geekosaur> | start with the type signature |
2022-11-17 22:33:44 +0100 | <gqplox> | printAllMembers :: (Bounded a, Show a, Enum a) => a -> String |
2022-11-17 22:37:24 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 248 seconds) |
2022-11-17 22:37:34 +0100 | califax | (~califax@user/califx) (Remote host closed the connection) |
2022-11-17 22:38:00 +0100 | <geekosaur> | okay, with one caveat: `a` is a value, you can't specify the data type there unlike with an OO language |
2022-11-17 22:38:08 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-11-17 22:38:18 +0100 | noodstudent | (~AdminUser@137.220.72.94) |
2022-11-17 22:38:21 +0100 | <geekosaur> | also it'd only be used to specify the type. there are ways around that but they're all advanced topics |
2022-11-17 22:38:33 +0100 | califax | (~califax@user/califx) |
2022-11-17 22:40:56 +0100 | jlgw | (~jw@83-233-104-81.cust.bredband2.com) (Remote host closed the connection) |
2022-11-17 22:41:11 +0100 | <gqplox> | minBound is Bounded a => a |
2022-11-17 22:41:59 +0100 | <geekosaur> | yes. so you have to specify its type, not pass it a parameter |
2022-11-17 22:42:14 +0100 | <geekosaur> | have you been introduced to asTypeOf yet? |
2022-11-17 22:42:22 +0100 | cowboy8625 | (~cowboy@96-2-208-2-static.midco.net) (Quit: WeeChat 3.5) |
2022-11-17 22:42:45 +0100 | geekosaur | is trying to figure out what solution is intended |
2022-11-17 22:43:11 +0100 | <gqplox> | no I haven't |
2022-11-17 22:43:19 +0100 | <geekosaur> | perhaps you can provide the original wording of the problem. yours wasn't it, since "data class" isn't a thing |
2022-11-17 22:44:27 +0100 | <gqplox> | ok sorry i tried to make up my own problem |
2022-11-17 22:45:14 +0100 | <gqplox> | so I can do allDrinks:: [Drink] and then allDrinks = [mindBound ..] is fine, and then showAllDrinks = map show allDrinks |
2022-11-17 22:45:31 +0100 | <gqplox> | but if i want to do it all in one function im struggling with that |
2022-11-17 22:45:48 +0100 | <gqplox> | what do you mean by specify its type |
2022-11-17 22:45:48 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 268 seconds) |
2022-11-17 22:46:14 +0100 | <mauke> | map show [(minBound :: Drink) ..] |
2022-11-17 22:46:15 +0100 | <gqplox> | like showAllDrinks' Drink -> String |
2022-11-17 22:46:24 +0100 | dfee | (~dfee@cpe-70-95-143-62.san.res.rr.com) (Read error: Connection reset by peer) |
2022-11-17 22:46:29 +0100 | polo | (~polo@user/polo) (Quit: resegt) |
2022-11-17 22:47:24 +0100 | <geekosaur> | here's one way to write a function that can do it for any type that has Bounded, Enum, and Show instances |
2022-11-17 22:47:33 +0100 | <geekosaur> | allOf x = intercalate ", " (map show [minBound `asTypeOf` x .. maxBound]) |
2022-11-17 22:47:43 +0100 | <geekosaur> | (intercalate is in Data.List) |
2022-11-17 22:48:12 +0100 | <geekosaur> | but you have to give it a value of the type; you can't (currently) give it a type directly |
2022-11-17 22:48:23 +0100 | <gqplox> | okay right |
2022-11-17 22:48:37 +0100 | <gqplox> | yeah I think I was thinking about it wrong |
2022-11-17 22:48:40 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-11-17 22:48:58 +0100 | <geekosaur> | there are other ways to do it, like using Proxy or a type application, but those are more advanced techniques |
2022-11-17 22:49:21 +0100 | <geekosaur> | and a proxy would still require asTypeOf to "extract" the type |
2022-11-17 22:50:02 +0100 | <geekosaur> | hm, no it wouldn't |
2022-11-17 22:50:29 +0100 | hgolden | (~hgolden@cpe-172-251-233-141.socal.res.rr.com) (Remote host closed the connection) |
2022-11-17 22:50:43 +0100 | polo | (~polo@user/polo) |
2022-11-17 22:50:43 +0100 | <geekosaur> | allOfP :: (Bounded a, Enum a, Show a) => Proxy a -> String, then use minBound :: a |
2022-11-17 22:51:00 +0100 | <gqplox> | http://sprunge.us/rFq8XL |
2022-11-17 22:51:04 +0100 | <gqplox> | this was the original thing |
2022-11-17 22:51:06 +0100 | <mauke> | are you mixing up scoped type variables and proxy? |
2022-11-17 22:51:10 +0100 | <geekosaur> | and invoke it as allOfP (Proxy Drinks) or similar |
2022-11-17 22:51:26 +0100 | <geekosaur> | probably |
2022-11-17 22:51:36 +0100 | <geekosaur> | in any case it's probably not beginner-level fare |
2022-11-17 22:51:37 +0100 | <gqplox> | i saw this example about data and i thought how to show all possible saver menus |
2022-11-17 22:51:53 +0100 | <mauke> | > [False ..] |
2022-11-17 22:51:55 +0100 | <lambdabot> | [False,True] |
2022-11-17 22:52:02 +0100 | hgolden | (~hgolden@cpe-172-251-233-141.socal.res.rr.com) |
2022-11-17 22:52:25 +0100 | geekosaur | is kinda having a poor day |
2022-11-17 22:52:45 +0100 | <gqplox> | and then at the end i saw i repeated allMains, all Drinks and thought how can i reduce that and make it more general thts why i was asking |
2022-11-17 22:52:53 +0100 | <gqplox> | how do you do that |
2022-11-17 22:53:08 +0100 | <mauke> | printList xs = concatMap (\x -> show x ++ "\n") |
2022-11-17 22:53:09 +0100 | <gqplox> | in my irc i see * geeosaur is kinda having a poor day |
2022-11-17 22:53:11 +0100 | <gqplox> | instead of the test |
2022-11-17 22:53:16 +0100 | <mauke> | er, without xs |
2022-11-17 22:53:23 +0100 | <gqplox> | <geekosaur> is how it normally shows |
2022-11-17 22:53:27 +0100 | <gqplox> | ah thanks mauke |
2022-11-17 22:53:33 +0100 | <geekosaur> | that was a /action |
2022-11-17 22:53:35 +0100 | <gqplox> | as you can see im quite a beginner haha |
2022-11-17 22:53:41 +0100 | <geekosaur> | aka /me |
2022-11-17 22:53:42 +0100 | <mauke> | gqplox: /me is kinda having a poor day |
2022-11-17 22:53:46 +0100 | <gqplox> | oh |
2022-11-17 22:53:50 +0100 | gqplox | is tired |
2022-11-17 22:53:54 +0100 | <gqplox> | ah |
2022-11-17 22:53:55 +0100 | <gqplox> | haha nice |
2022-11-17 22:54:38 +0100 | <bobbingbob> | /me is the bestest ever and nobody can dispute it |
2022-11-17 22:56:17 +0100 | <mauke> | > let allX :: (Bounded a, Enum a) => [a]; allX = [minBound .. maxBound in (allX :: [Bool], allX :: [Char]) |
2022-11-17 22:56:18 +0100 | <lambdabot> | <hint>:1:70: error: parse error on input ‘in’ |
2022-11-17 22:56:49 +0100 | nate4 | (~nate@98.45.169.16) |
2022-11-17 22:56:51 +0100 | <mauke> | > let allX :: (Bounded a, Enum a) => [a]; allX = [minBound .. maxBound] in (allX :: [Bool], allX :: [Char]) |
2022-11-17 22:56:53 +0100 | <lambdabot> | ([False,True],"\NUL\SOH\STX\ETX\EOT\ENQ\ACK\a\b\t\n\v\f\r\SO\SI\DLE\DC1\DC2\... |
2022-11-17 22:58:01 +0100 | <gqplox> | geekosaur im confused what this asTypeOf does in the example you gave for allOf |
2022-11-17 22:58:48 +0100 | <mauke> | forces two types to align |
2022-11-17 22:59:35 +0100 | <gqplox> | so what would the two types be here? |
2022-11-17 22:59:43 +0100 | <gqplox> | minBound and x |
2022-11-17 23:00:01 +0100 | <mauke> | minBound :: (Bounded a) => a |
2022-11-17 23:00:32 +0100 | <mauke> | x is the function parameter whose value is unused, but we treat it as a proxy for the type |
2022-11-17 23:00:55 +0100 | <mauke> | because we can't pass types in directly, but we can pass in dummy values of a type |
2022-11-17 23:01:29 +0100 | <mauke> | minBound `asTypeOf` x forces the types to align, so we get the minimum value of the type of x |
2022-11-17 23:01:39 +0100 | nate4 | (~nate@98.45.169.16) (Ping timeout: 260 seconds) |
2022-11-17 23:01:44 +0100 | <gqplox> | hmm ok, so its like doing minBound :: Type |
2022-11-17 23:01:50 +0100 | <mauke> | yeah |
2022-11-17 23:01:54 +0100 | <gqplox> | but because you dont know what to put for the type |
2022-11-17 23:01:58 +0100 | <gqplox> | alright thank you |
2022-11-17 23:02:14 +0100 | <mauke> | the implementation of asTypeOf is funny, too |
2022-11-17 23:02:29 +0100 | <mauke> | asTypeOf :: a -> a -> a; x `asTypeOf` _ = x |
2022-11-17 23:03:57 +0100 | stef204 | (~stef204@user/stef204) (Quit: WeeChat 3.7.1) |
2022-11-17 23:04:25 +0100 | merijn | (~merijn@c-001-001-012.client.esciencecenter.eduvpn.nl) |
2022-11-17 23:05:27 +0100 | <gqplox> | also thanks for the tip about concatMap, it's useful |
2022-11-17 23:05:30 +0100 | raehik | (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
2022-11-17 23:07:12 +0100 | <mauke> | > let showMinOf :: (Bounded a, Show a) => proxy a -> String; showMinOf px = show (minBound `asProxyTypeOf` px) where { asProxyTypeOf :: a -> proxy a -> a; asProxyTypeOf x _ = x } in showMinOf ([] :: [Bool]) |
2022-11-17 23:07:14 +0100 | <lambdabot> | "False" |
2022-11-17 23:07:34 +0100 | takuan | (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
2022-11-17 23:07:36 +0100 | <mauke> | > let showMinOf :: (Bounded a, Show a) => proxy a -> String; showMinOf px = show (minBound `asProxyTypeOf` px) where { asProxyTypeOf :: a -> proxy a -> a; asProxyTypeOf x _ = x } in showMinOf ([] :: [Int]) |
2022-11-17 23:07:38 +0100 | <lambdabot> | "-9223372036854775808" |
2022-11-17 23:09:15 +0100 | fockerize | (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 260 seconds) |
2022-11-17 23:10:18 +0100 | polo | (~polo@user/polo) (Quit: resegt) |
2022-11-17 23:12:10 +0100 | beteigeuze | (~Thunderbi@a79-169-109-107.cpe.netcabo.pt) (Remote host closed the connection) |
2022-11-17 23:12:19 +0100 | iteratee | (~kyle@162.218.222.107) (Read error: Connection reset by peer) |
2022-11-17 23:12:26 +0100 | iteratee | (~kyle@162.218.222.107) |
2022-11-17 23:12:34 +0100 | noodstudent | (~AdminUser@137.220.72.94) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
2022-11-17 23:12:35 +0100 | polo | (~polo@user/polo) |
2022-11-17 23:13:24 +0100 | bobbingbob | (~bobbingbo@2604:3d09:207f:f650::b469) (Quit: Leaving) |
2022-11-17 23:16:57 +0100 | beteigeuze | (~Thunderbi@a79-169-109-107.cpe.netcabo.pt) |
2022-11-17 23:17:16 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:3cb4:cd70:33e6:e916) |
2022-11-17 23:22:05 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:3cb4:cd70:33e6:e916) (Ping timeout: 260 seconds) |
2022-11-17 23:22:58 +0100 | fockerize | (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) |
2022-11-17 23:27:14 +0100 | gmg | (~user@user/gehmehgeh) (Quit: Leaving) |
2022-11-17 23:27:44 +0100 | merijn | (~merijn@c-001-001-012.client.esciencecenter.eduvpn.nl) (Ping timeout: 268 seconds) |
2022-11-17 23:29:17 +0100 | <EvanR> | has anyone heard of this game Infinite Turtles. I just made a circuit for addition which uses a miniature version of itself in the implementation. I'm finding a lot of solutions end up being the Haskell code in circuit form xD |
2022-11-17 23:32:23 +0100 | polo | (~polo@user/polo) (Quit: resegt) |
2022-11-17 23:32:37 +0100 | evanvarvell | (~evanvarve@097-088-181-216.res.spectrum.com) |
2022-11-17 23:32:39 +0100 | chele | (~chele@user/chele) (Remote host closed the connection) |
2022-11-17 23:34:05 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2022-11-17 23:34:46 +0100 | troydm | (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 252 seconds) |
2022-11-17 23:46:03 +0100 | bgs | (~bgs@212-85-160-171.dynamic.telemach.net) (Remote host closed the connection) |
2022-11-17 23:47:04 +0100 | <akegalj> | When I have defined function that does pattern matching with bang patterns like `fun (!a, !b) = something` , is this semantically/operationally the same as `fun (a, b) = a `seq` b `seq` something` ? |
2022-11-17 23:47:40 +0100 | <monochrom> | Yes. |
2022-11-17 23:47:57 +0100 | <akegalj> | monochrom: thanks |
2022-11-17 23:48:29 +0100 | <monochrom> | It might not be clear how this generalizes to more complex examples. But see the GHC User's Guide for the full story. |
2022-11-17 23:48:53 +0100 | <akegalj> | monochrom: ok, will have a look |
2022-11-17 23:50:03 +0100 | cowboy8625 | (~cowboy@96-2-208-2-static.midco.net) |
2022-11-17 23:50:58 +0100 | <cowboy8625> | Hey Hey! |
2022-11-17 23:52:02 +0100 | <cowboy8625> | I have been working on my own functional language lately. Havent gotten very far but it has been fun. |
2022-11-17 23:52:29 +0100 | <cowboy8625> | parseing haskell like syntax is a bit of a challange. |
2022-11-17 23:52:44 +0100 | <cowboy8625> | for me at lest with my tiny brain./ |
2022-11-17 23:53:07 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 256 seconds) |
2022-11-17 23:53:38 +0100 | <juri_> | cowboy8625: writing languages is fun. handling other people's language decisions is.. more fun. :) |
2022-11-17 23:54:10 +0100 | king_gs | (~Thunderbi@2806:103e:29:bfeb:c988:bbd5:2586:4924) (Ping timeout: 260 seconds) |
2022-11-17 23:54:53 +0100 | <cowboy8625> | what do you mean? |
2022-11-17 23:55:19 +0100 | coot | (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
2022-11-17 23:55:53 +0100 | <cowboy8625> | i find the ocaml syntax to be a bit easier to parse. Although I am not useing nether but more ocamls. |
2022-11-17 23:56:50 +0100 | <monochrom> | If you don't implement Haskell's layout-sensitive part, it should be pretty comparable to OCaml. |
2022-11-17 23:57:26 +0100 | <monochrom> | If you want to include the layout part, it needs to be its own stage, sitting between the lexer stage and the CFG stage. |
2022-11-17 23:58:10 +0100 | <monochrom> | (And it converts layout to layout-free {;} thingies so you have a simple CFG again.) |
2022-11-17 23:59:20 +0100 | use-value | (~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf) (Remote host closed the connection) |
2022-11-17 23:59:39 +0100 | use-value | (~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf) |