2021-12-23 00:00:17 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) |
2021-12-23 00:00:43 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) |
2021-12-23 00:04:02 +0100 | coolnickname | (uid531864@user/coolnickname) (Quit: Connection closed for inactivity) |
2021-12-23 00:04:50 +0100 | ProfSimm | (~ProfSimm@87.227.196.109) (Remote host closed the connection) |
2021-12-23 00:05:29 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) (Ping timeout: 252 seconds) |
2021-12-23 00:06:45 +0100 | <dan-so> | is there a canonical way to get an element out of a HashMap, without caring which it is? |
2021-12-23 00:06:57 +0100 | max22- | (~maxime@2a01cb0883359800bfc539327e2fa08b.ipv6.abo.wanadoo.fr) (Quit: Leaving) |
2021-12-23 00:07:05 +0100 | <dan-so> | something like get_any :: HashMap k v -> Maybe (k,v) |
2021-12-23 00:08:18 +0100 | ProfSimm | (~ProfSimm@87.227.196.109) |
2021-12-23 00:08:21 +0100 | <dan-so> | lookupMin or lookupMax would be fine, if i were using a tree-based Map |
2021-12-23 00:08:45 +0100 | ProfSimm | (~ProfSimm@87.227.196.109) (Remote host closed the connection) |
2021-12-23 00:08:48 +0100 | <jackdk> | `headMay . HashMap.toList`? |
2021-12-23 00:09:57 +0100 | <dan-so> | yes, that would do fine. so there's not really a "right" way then? |
2021-12-23 00:10:11 +0100 | <jackdk> | If you don't want to add the `safe` dep or similar, use something like `Map.foldrWithKey (\k v _ -> Just (k, v)) Nothing` |
2021-12-23 00:10:20 +0100 | <jackdk> | I'm not aware of a canonical name for this function |
2021-12-23 00:10:47 +0100 | <dan-so> | okay, thank you! |
2021-12-23 00:13:57 +0100 | kmein | (~weechat@user/kmein) (Quit: ciao kakao) |
2021-12-23 00:14:35 +0100 | kmein | (~weechat@user/kmein) |
2021-12-23 00:16:11 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: closed) |
2021-12-23 00:16:28 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 00:16:39 +0100 | random-jellyfish | (~random-je@user/random-jellyfish) (Ping timeout: 256 seconds) |
2021-12-23 00:17:40 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) |
2021-12-23 00:21:57 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) (Ping timeout: 240 seconds) |
2021-12-23 00:23:55 +0100 | <dsal> | :t maybeToList |
2021-12-23 00:23:57 +0100 | <lambdabot> | Maybe a -> [a] |
2021-12-23 00:24:05 +0100 | <dsal> | :t listToMaybe |
2021-12-23 00:24:06 +0100 | <lambdabot> | [a] -> Maybe a |
2021-12-23 00:24:41 +0100 | <dsal> | @src listToMaybe |
2021-12-23 00:24:42 +0100 | <lambdabot> | listToMaybe [] = Nothing |
2021-12-23 00:24:42 +0100 | <lambdabot> | listToMaybe (a:_) = Just a |
2021-12-23 00:24:51 +0100 | <dsal> | It's kind of weird those aren't defined for Foldable in general. |
2021-12-23 00:25:25 +0100 | __monty__ | (~toonn@user/toonn) (Quit: leaving) |
2021-12-23 00:25:46 +0100 | darkstardevx | (~darkstard@50.39.115.145) (Remote host closed the connection) |
2021-12-23 00:26:57 +0100 | eggplantade | (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4) (Remote host closed the connection) |
2021-12-23 00:26:59 +0100 | <dan-so> | hah, i wrote about that exact topic |
2021-12-23 00:27:08 +0100 | <dan-so> | https://danso.ca/blog/frommaybe-is-just-a-fold/ |
2021-12-23 00:33:57 +0100 | cosimone | (~user@93-47-230-208.ip115.fastwebnet.it) (Ping timeout: 240 seconds) |
2021-12-23 00:35:59 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) |
2021-12-23 00:36:37 +0100 | machinedgod | (~machinedg@24.105.81.50) (Ping timeout: 240 seconds) |
2021-12-23 00:40:17 +0100 | mimmy | (~mimmy@69.174.8.146) (Ping timeout: 240 seconds) |
2021-12-23 00:40:58 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) (Ping timeout: 268 seconds) |
2021-12-23 00:41:01 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2021-12-23 00:41:57 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection) |
2021-12-23 00:41:58 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 00:47:22 +0100 | <space_llama> | unable to find module 'Graphics.Gloss' |
2021-12-23 00:47:45 +0100 | <space_llama> | trying to follow https://mmhaskell.com/blog/2019/3/25/making-a-glossy-game-part-1 |
2021-12-23 00:48:09 +0100 | mimmy | (~mimmy@38.142.1.26) |
2021-12-23 00:51:02 +0100 | <space_llama> | first I `cabal repl -b gloss`, then once downloaded. I 'mkdir newProject' -> 'cd newProject' -> 'cabal init' |
2021-12-23 00:51:24 +0100 | <sm> | fixing-the-internet: tell the author their example is hard to follow |
2021-12-23 00:52:11 +0100 | <space_llama> | am I the author or do you mean the author of mmhaskell? |
2021-12-23 00:52:21 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) |
2021-12-23 00:52:30 +0100 | <sm> | likely-fix-for-you: add the gloss package to build-depends in your .cabal file |
2021-12-23 00:52:51 +0100 | mimmy | (~mimmy@38.142.1.26) (Client Quit) |
2021-12-23 00:53:06 +0100 | <sm> | author = author of the blog post |
2021-12-23 00:54:02 +0100 | falafel | (~falafel@2603-8000-d800-688c-6093-c6e0-4810-959c.res6.spectrum.com) |
2021-12-23 00:54:59 +0100 | Gurkenglas | (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) (Ping timeout: 252 seconds) |
2021-12-23 00:56:57 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) (Ping timeout: 240 seconds) |
2021-12-23 00:57:49 +0100 | <space_llama> | currently I have: |
2021-12-23 00:57:50 +0100 | <space_llama> | build-depends: base ^>=4.14.3.0 |
2021-12-23 00:57:50 +0100 | <space_llama> | gloss >= 1.33 && < 1.14 |
2021-12-23 00:59:00 +0100 | <space_llama> | I was given this code, so I'm not really sure how to decipher if it is correct (I do not know what "base ^>= #'s means |
2021-12-23 00:59:06 +0100 | johnw | (~johnw@76-234-69-149.lightspeed.frokca.sbcglobal.net) (Quit: ZNC - http://znc.in) |
2021-12-23 01:02:57 +0100 | falafel | (~falafel@2603-8000-d800-688c-6093-c6e0-4810-959c.res6.spectrum.com) (Ping timeout: 240 seconds) |
2021-12-23 01:09:22 +0100 | kayvank | (~user@52-119-115-185.PUBLIC.monkeybrains.net) |
2021-12-23 01:10:07 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:21ba:a382:6b6:54c4) |
2021-12-23 01:11:39 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: closed) |
2021-12-23 01:11:45 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 01:14:53 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:21ba:a382:6b6:54c4) (Ping timeout: 268 seconds) |
2021-12-23 01:15:02 +0100 | bu5hyt0p_ | (~rmsare@2601:281:c780:a510:6d40:63c6:3a27:e5b8) |
2021-12-23 01:15:09 +0100 | zer0bitz | (~zer0bitz@2001:2003:f444:a000:e954:6a22:3202:5b23) (Ping timeout: 250 seconds) |
2021-12-23 01:15:14 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection) |
2021-12-23 01:15:15 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 01:15:47 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: closed) |
2021-12-23 01:15:57 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 01:17:39 +0100 | fizbin | (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) |
2021-12-23 01:18:45 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) |
2021-12-23 01:19:32 +0100 | <jackdk> | I think you're meant to have a comma in between |
2021-12-23 01:20:24 +0100 | <space_llama> | you mean just before gloss? |
2021-12-23 01:21:57 +0100 | fizbin | (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Ping timeout: 256 seconds) |
2021-12-23 01:22:21 +0100 | <sm> | space_llama: there's a problem with your gloss line. the number on left should be the lowest allowed version, number on right is the highest |
2021-12-23 01:22:21 +0100 | <g> | ^>= x.y.z.u == >= x.y.z.u && < x.(y+1) |
2021-12-23 01:22:47 +0100 | <g> | https://cabal.readthedocs.io/en/3.6/cabal-package.html#pkg-field-build-depends |
2021-12-23 01:25:02 +0100 | vicfred | (~vicfred@user/vicfred) (Quit: Leaving) |
2021-12-23 01:27:21 +0100 | eggplantade | (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4) |
2021-12-23 01:29:07 +0100 | doyougnu | (~doyougnu@c-73-25-202-122.hsd1.or.comcast.net) (Remote host closed the connection) |
2021-12-23 01:31:37 +0100 | eggplantade | (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4) (Ping timeout: 240 seconds) |
2021-12-23 01:34:05 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection) |
2021-12-23 01:34:06 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 01:34:35 +0100 | jgeerds | (~jgeerds@55d4ac73.access.ecotel.net) (Ping timeout: 252 seconds) |
2021-12-23 01:34:35 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: closed) |
2021-12-23 01:34:41 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 01:43:09 +0100 | pretty_dumm_guy | (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.4) |
2021-12-23 01:43:26 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) |
2021-12-23 01:46:39 +0100 | Midjak | (~Midjak@may53-1-78-226-116-92.fbx.proxad.net) (Quit: Leaving) |
2021-12-23 01:48:06 +0100 | lavaman | (~lavaman@98.38.249.169) |
2021-12-23 01:48:13 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) (Ping timeout: 240 seconds) |
2021-12-23 01:48:15 +0100 | yin | (~yin@user/zero) |
2021-12-23 01:48:51 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
2021-12-23 01:48:51 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
2021-12-23 01:48:51 +0100 | wroathe | (~wroathe@user/wroathe) |
2021-12-23 01:49:05 +0100 | <jackdk> | space_llama: yes |
2021-12-23 01:51:46 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) |
2021-12-23 01:52:37 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
2021-12-23 01:52:38 +0100 | lavaman | (~lavaman@98.38.249.169) (Ping timeout: 260 seconds) |
2021-12-23 01:56:12 +0100 | <yin> | i don't understand why my solution hangs for aoc 15.2 |
2021-12-23 01:57:12 +0100 | <yin> | can anyone help me? this should be straightforward |
2021-12-23 01:57:15 +0100 | <yin> | https://paste.jrvieira.com/1640221005314 |
2021-12-23 01:58:02 +0100 | acidjnk | (~acidjnk@p200300d0c7271e77d154eb1f1200bcdb.dip0.t-ipconnect.de) (Ping timeout: 268 seconds) |
2021-12-23 01:58:47 +0100 | <yin> | runs fine for part1 and all tests, including part2 test |
2021-12-23 02:01:43 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) |
2021-12-23 02:02:26 +0100 | timCF | (~timCF@m91-129-100-224.cust.tele2.ee) (Quit: leaving) |
2021-12-23 02:03:00 +0100 | xkuru | (~xkuru@user/xkuru) (Read error: Connection reset by peer) |
2021-12-23 02:06:29 +0100 | space_llama | (~Guest|47@c-73-221-44-172.hsd1.wa.comcast.net) (Quit: Connection closed) |
2021-12-23 02:06:41 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) (Ping timeout: 268 seconds) |
2021-12-23 02:06:48 +0100 | eggplantade | (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4) |
2021-12-23 02:10:59 +0100 | [itchyjunk] | (~itchyjunk@user/itchyjunk/x-7353470) |
2021-12-23 02:13:05 +0100 | machinedgod | (~machinedg@24.105.81.50) |
2021-12-23 02:13:31 +0100 | wroathe | (~wroathe@user/wroathe) (Ping timeout: 256 seconds) |
2021-12-23 02:18:05 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection) |
2021-12-23 02:18:06 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 02:18:16 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) |
2021-12-23 02:18:35 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: closed) |
2021-12-23 02:18:43 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 02:18:59 +0100 | Morrow | (~quassel@bzq-110-168-31-106.red.bezeqint.net) (Remote host closed the connection) |
2021-12-23 02:22:37 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) (Ping timeout: 240 seconds) |
2021-12-23 02:23:14 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
2021-12-23 02:23:14 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
2021-12-23 02:23:14 +0100 | wroathe | (~wroathe@user/wroathe) |
2021-12-23 02:28:16 +0100 | wroathe_ | (~wroathe@206-55-188-8.fttp.usinternet.com) |
2021-12-23 02:28:49 +0100 | wroathe | (~wroathe@user/wroathe) (Ping timeout: 256 seconds) |
2021-12-23 02:29:29 +0100 | CiaoSen | (~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 268 seconds) |
2021-12-23 02:29:58 +0100 | wroathe_ | (~wroathe@206-55-188-8.fttp.usinternet.com) (Read error: Connection reset by peer) |
2021-12-23 02:33:16 +0100 | wroathe | (~wroathe@206-55-188-8.fttp.usinternet.com) |
2021-12-23 02:33:16 +0100 | wroathe | (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host) |
2021-12-23 02:33:16 +0100 | wroathe | (~wroathe@user/wroathe) |
2021-12-23 02:34:38 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
2021-12-23 02:35:04 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2021-12-23 02:36:46 +0100 | johnw | (~johnw@2607:f6f0:3004:1:c8b4:50ff:fef8:6bf0) |
2021-12-23 02:39:24 +0100 | Tuplanolla | (~Tuplanoll@91-159-69-214.elisa-laajakaista.fi) (Quit: Leaving.) |
2021-12-23 02:41:57 +0100 | rekahsoft | (~rekahsoft@cpe0008a20f982f-cm64777d666260.cpe.net.cable.rogers.com) |
2021-12-23 02:43:12 +0100 | nikkc | (~nikkc@2603-7080-0103-7aa9-35ff-3499-0703-1f10.res6.spectrum.com) |
2021-12-23 02:45:04 +0100 | wroathe_ | (~wroathe@206-55-188-8.fttp.usinternet.com) |
2021-12-23 02:45:23 +0100 | <EvanR> | yin, are you building a Data.Map from an infinite list of pairs |
2021-12-23 02:45:24 +0100 | jay-invariant | (~jay@c-24-4-6-169.hsd1.ca.comcast.net) |
2021-12-23 02:45:31 +0100 | jay-invariant | (~jay@c-24-4-6-169.hsd1.ca.comcast.net) (Client Quit) |
2021-12-23 02:45:50 +0100 | kaph | (~kaph@net-2-47-236-216.cust.vodafonedsl.it) (Ping timeout: 260 seconds) |
2021-12-23 02:46:39 +0100 | wroathe_ | (~wroathe@206-55-188-8.fttp.usinternet.com) (Client Quit) |
2021-12-23 02:46:56 +0100 | wroathe_ | (~wroathe@206-55-188-8.fttp.usinternet.com) |
2021-12-23 02:48:05 +0100 | wroathe | (~wroathe@user/wroathe) (Ping timeout: 256 seconds) |
2021-12-23 02:49:26 +0100 | nuh^ | (~nuh@64.253.22.77) |
2021-12-23 02:51:26 +0100 | chomwitt | (~chomwitt@2a02:587:dc1c:a00:12c3:7bff:fe6d:d374) (Ping timeout: 260 seconds) |
2021-12-23 02:54:09 +0100 | burnsidesLlama | (~burnsides@dhcp168-011.wadham.ox.ac.uk) (Remote host closed the connection) |
2021-12-23 02:54:47 +0100 | falafel | (~falafel@2603-8000-d800-688c-eced-9d48-e094-4d30.res6.spectrum.com) |
2021-12-23 02:58:03 +0100 | justsomeguy | (~justsomeg@user/justsomeguy) |
2021-12-23 02:58:07 +0100 | wroathe_ | (~wroathe@206-55-188-8.fttp.usinternet.com) (Quit: leaving) |
2021-12-23 02:58:20 +0100 | wroathe | (~wroathe@206-55-188-8.fttp.usinternet.com) |
2021-12-23 02:58:20 +0100 | wroathe | (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host) |
2021-12-23 02:58:20 +0100 | wroathe | (~wroathe@user/wroathe) |
2021-12-23 02:58:31 +0100 | falafel_ | (~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com) |
2021-12-23 02:58:36 +0100 | Inst | (~delicacie@2601:6c4:4080:3f80:e482:21a8:3024:fee0) |
2021-12-23 03:00:57 +0100 | falafel | (~falafel@2603-8000-d800-688c-eced-9d48-e094-4d30.res6.spectrum.com) (Ping timeout: 240 seconds) |
2021-12-23 03:07:39 +0100 | machinedgod | (~machinedg@24.105.81.50) (Read error: Connection reset by peer) |
2021-12-23 03:08:01 +0100 | machinedgod | (~machinedg@24.105.81.50) |
2021-12-23 03:09:34 +0100 | jz99 | (~jz99@150.203.2.50) |
2021-12-23 03:18:36 +0100 | <iphy> | https://github.com/TokTok/hs-cimple/blob/master/src/Language/Cimple/TraverseAst.hs#L53 is there any way to generalise this to arbitrary types for "text", not just Text? |
2021-12-23 03:19:49 +0100 | nuh^ | (~nuh@64.253.22.77) (Ping timeout: 256 seconds) |
2021-12-23 03:20:10 +0100 | nuh^ | (~nuh@64.253.22.77) |
2021-12-23 03:21:14 +0100 | <iphy> | this one: https://github.com/TokTok/hs-cimple/blob/master/src/Language/Cimple/TraverseAst.hs#L19 |
2021-12-23 03:21:41 +0100 | <iphy> | I want to make that "Text" a type parameter |
2021-12-23 03:25:16 +0100 | <iphy> | MultiParamTypeClasses works, cool |
2021-12-23 03:25:29 +0100 | wroathe | (~wroathe@user/wroathe) (Ping timeout: 256 seconds) |
2021-12-23 03:26:12 +0100 | shapr | (~user@pool-100-36-247-68.washdc.fios.verizon.net) (Remote host closed the connection) |
2021-12-23 03:26:18 +0100 | phma_ | phma |
2021-12-23 03:26:29 +0100 | shapr | (~user@pool-100-36-247-68.washdc.fios.verizon.net) |
2021-12-23 03:27:32 +0100 | burnsidesLlama | (~burnsides@dhcp168-011.wadham.ox.ac.uk) |
2021-12-23 03:31:23 +0100 | zmt01 | (~zmt00@user/zmt00) |
2021-12-23 03:31:49 +0100 | burnsidesLlama | (~burnsides@dhcp168-011.wadham.ox.ac.uk) (Ping timeout: 240 seconds) |
2021-12-23 03:32:16 +0100 | wroathe | (~wroathe@206-55-188-8.fttp.usinternet.com) |
2021-12-23 03:32:16 +0100 | wroathe | (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host) |
2021-12-23 03:32:16 +0100 | wroathe | (~wroathe@user/wroathe) |
2021-12-23 03:35:17 +0100 | zmt00 | (~zmt00@user/zmt00) (Ping timeout: 240 seconds) |
2021-12-23 03:36:57 +0100 | neurocyte0132889 | (~neurocyte@user/neurocyte) (Ping timeout: 240 seconds) |
2021-12-23 03:37:37 +0100 | whatsupdoc | (uid509081@id-509081.hampstead.irccloud.com) (Quit: Connection closed for inactivity) |
2021-12-23 03:38:08 +0100 | nikkc | (~nikkc@2603-7080-0103-7aa9-35ff-3499-0703-1f10.res6.spectrum.com) (Quit: Client closed) |
2021-12-23 03:39:50 +0100 | justsomeguy | (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.3) |
2021-12-23 03:43:17 +0100 | raehik | (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 240 seconds) |
2021-12-23 03:43:33 +0100 | isovector1 | (~isovector@172.103.216.166) |
2021-12-23 03:49:28 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) |
2021-12-23 03:53:20 +0100 | thaumavorio | (~thaumavor@thaumavor.io) (Quit: ZNC 1.8.2 - https://znc.in) |
2021-12-23 03:53:24 +0100 | Guest|47 | (~Guest|47@c-73-221-44-172.hsd1.wa.comcast.net) |
2021-12-23 03:54:06 +0100 | xff0x | (~xff0x@2001:1a81:5290:1c00:84df:602d:a0a9:8535) (Ping timeout: 245 seconds) |
2021-12-23 03:55:17 +0100 | Guest|47 | frumple_Doop |
2021-12-23 03:56:10 +0100 | xff0x | (~xff0x@2001:1a81:52d0:e400:204:565d:57ea:f23d) |
2021-12-23 04:00:42 +0100 | burnsidesLlama | (~burnsides@dhcp168-011.wadham.ox.ac.uk) |
2021-12-23 04:03:43 +0100 | jackson99 | (~bc8147f2@83.167.180.121) (Quit: CGI:IRC (Session timeout)) |
2021-12-23 04:05:41 +0100 | burnsidesLlama | (~burnsides@dhcp168-011.wadham.ox.ac.uk) (Ping timeout: 268 seconds) |
2021-12-23 04:05:52 +0100 | dustee | (~dustee@2601:244:4400:eb2:41c1:aef3:8d9c:ccf0) |
2021-12-23 04:10:32 +0100 | xff0x | (~xff0x@2001:1a81:52d0:e400:204:565d:57ea:f23d) (Ping timeout: 240 seconds) |
2021-12-23 04:11:23 +0100 | xff0x | (~xff0x@2001:1a81:52d0:e400:5fba:65e0:daae:59c3) |
2021-12-23 04:12:09 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection) |
2021-12-23 04:12:10 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 04:12:39 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: closed) |
2021-12-23 04:12:45 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 04:13:57 +0100 | sim590 | (~simon@modemcable090.207-203-24.mc.videotron.ca) |
2021-12-23 04:16:23 +0100 | deadmarshal | (~deadmarsh@95.38.231.102) |
2021-12-23 04:17:46 +0100 | td_ | (~td@94.134.91.68) (Ping timeout: 260 seconds) |
2021-12-23 04:19:30 +0100 | dustee | (~dustee@2601:244:4400:eb2:41c1:aef3:8d9c:ccf0) (Quit: Client closed) |
2021-12-23 04:19:39 +0100 | td_ | (~td@94.134.91.61) |
2021-12-23 04:20:32 +0100 | deadmarshal | (~deadmarsh@95.38.231.102) (Ping timeout: 240 seconds) |
2021-12-23 04:22:27 +0100 | <sim590> | I'm trying to find out reciprocal cycles in a number's digits. Let's say I have the fraction 1/7 which gives 0.1428571..., then I find the digits [1,4,2,8,5,7,1,4,2,8,5,7,...]. I want to detect the repeating cycle in the digits which should be [1,4,2,8,5,7]. This cycle should be detected as starting at some point in the digits list and never ending at infinity. My approach is to reverse the list |
2021-12-23 04:22:29 +0100 | <sim590> | of digits and call the following function on it ( head . head . dropWhile ((==1) . length) . group . groupBy (/=)) in order to find the cycle. Does that approach make sense to you ? |
2021-12-23 04:23:17 +0100 | Erutuon | (~Erutuon@user/erutuon) (Ping timeout: 240 seconds) |
2021-12-23 04:23:34 +0100 | machinedgod | (~machinedg@24.105.81.50) (Ping timeout: 268 seconds) |
2021-12-23 04:23:51 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds) |
2021-12-23 04:25:55 +0100 | Erutuon | (~Erutuon@user/erutuon) |
2021-12-23 04:27:18 +0100 | <sim590> | I'm asking because this is part of a problem on projecteuler and when I call my code to look for the longest cycle in the 1000 first numbers in the sequence 1/1, 1/2, ... 1/1000, then I don't get the right answer. I thought my approach should work, but I'm not sure what's missing |
2021-12-23 04:29:27 +0100 | <sm> | https://www.volunteeramnestyday.net . Thanks joeyh |
2021-12-23 04:31:53 +0100 | deadmarshal | (~deadmarsh@95.38.231.102) |
2021-12-23 04:33:54 +0100 | <sim590> | Here's the whole code I'm trying to run: http://ix.io/3Jcb |
2021-12-23 04:35:58 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) |
2021-12-23 04:36:53 +0100 | <juhp> | hm, does converting a product type to a record doesn't require a PVP major version bump, right? |
2021-12-23 04:40:37 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) (Ping timeout: 240 seconds) |
2021-12-23 04:41:17 +0100 | kaph_ | (~kaph@net-2-47-236-216.cust.vodafonedsl.it) |
2021-12-23 04:43:55 +0100 | rekahsoft | (~rekahsoft@cpe0008a20f982f-cm64777d666260.cpe.net.cable.rogers.com) (Ping timeout: 268 seconds) |
2021-12-23 04:44:03 +0100 | thaumavorio | (~thaumavor@thaumavor.io) |
2021-12-23 04:47:56 +0100 | isovector1 | (~isovector@172.103.216.166) (Quit: Leaving) |
2021-12-23 04:53:07 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Remote host closed the connection) |
2021-12-23 04:54:51 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) |
2021-12-23 04:59:17 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Ping timeout: 240 seconds) |
2021-12-23 05:03:02 +0100 | notzmv | (~zmv@user/notzmv) (Ping timeout: 240 seconds) |
2021-12-23 05:07:54 +0100 | <mniip> | sim590, what you should be looking for is when you hit the same remainder in long division |
2021-12-23 05:08:08 +0100 | <mniip> | you can't tell if it's a cycle or not from just the digits |
2021-12-23 05:08:39 +0100 | <sim590> | But I thought that using a big enough precision would do, no? |
2021-12-23 05:08:45 +0100 | <sim590> | I have like 100 digits numbers. |
2021-12-23 05:08:56 +0100 | <mniip> | what you're doing is finding the first digit that repeats, no? |
2021-12-23 05:09:09 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection) |
2021-12-23 05:09:09 +0100 | <monochrom> | Consider 0.1213141512131415... |
2021-12-23 05:09:10 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 05:09:18 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) |
2021-12-23 05:09:27 +0100 | <sim590> | Yes, in the first groupBy, but the second call of group clears everything about |
2021-12-23 05:09:32 +0100 | <sim590> | clears everything out* |
2021-12-23 05:09:40 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: closed) |
2021-12-23 05:09:53 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 05:09:59 +0100 | <mniip> | clears... what out? |
2021-12-23 05:09:59 +0100 | <sim590> | Because then I can see which lists in the list [[[Integer]]] that is only of length 1. |
2021-12-23 05:10:13 +0100 | <sim590> | Because it lets me know about the repeating cycles |
2021-12-23 05:10:32 +0100 | <sim590> | If it's repeating, some list [[Integer]] will have length > 1 |
2021-12-23 05:10:34 +0100 | <mniip> | see monochrom's example |
2021-12-23 05:11:29 +0100 | <mniip> | (in case you're uncertain, it *is* a rational number) |
2021-12-23 05:11:31 +0100 | <mniip> | > 1347935/11111111 :: CReal |
2021-12-23 05:11:33 +0100 | <lambdabot> | 0.1213141512131415121314151213141512131415 |
2021-12-23 05:11:44 +0100 | <sim590> | Yeah. Let me run my code on that. |
2021-12-23 05:11:54 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection) |
2021-12-23 05:11:56 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 05:12:21 +0100 | <monochrom> | To be fair, if it's just 1/n and n<=1000, there may be a nice lower bound on how bad it gets. |
2021-12-23 05:12:23 +0100 | <mniip> | as I said digits are really not the information you should be looking for |
2021-12-23 05:12:24 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: closed) |
2021-12-23 05:12:34 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 05:12:50 +0100 | <mniip> | when you do long division, you eventually run out of digits in the dividend. That's where the repeating pattern starts |
2021-12-23 05:13:12 +0100 | <monochrom> | But by the time you find out that bound by hand, you have already solved the original problem by hand, too. |
2021-12-23 05:13:13 +0100 | <mniip> | each digit is dictated by the value of the remainder you currently have, so it will loop precisely when the remainder loops |
2021-12-23 05:13:24 +0100 | kayvank | (~user@52-119-115-185.PUBLIC.monkeybrains.net) (Remote host closed the connection) |
2021-12-23 05:13:38 +0100 | <mniip> | digits may repeat but remainders will not |
2021-12-23 05:13:45 +0100 | <monochrom> | The reason why PE is not for exercises in coding up brute-forcing. |
2021-12-23 05:14:45 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) (Ping timeout: 268 seconds) |
2021-12-23 05:15:05 +0100 | <sim590> | My code will give that: [[[5,1,4,1,3,1,2,1], [5,1,4,1,3,1,2,1], [5,1,4,1,3,1,2,1], [5,1,4,1,3,1,2,1]]] on the input you mentioned. |
2021-12-23 05:15:29 +0100 | <mniip> | ok now try 1/10th of the number |
2021-12-23 05:15:38 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Ping timeout: 260 seconds) |
2021-12-23 05:15:52 +0100 | <monochrom> | And the reason why I mock people with "If one day PE poses 'count how many even primes are in the range 1 to 2^(2^n), people will actually code up a loop of 2^(2^n) iterations". |
2021-12-23 05:16:00 +0100 | <mniip> | your algorithm depends on where you cut the number off |
2021-12-23 05:16:11 +0100 | <mniip> | oh PE is project euler |
2021-12-23 05:16:59 +0100 | <mniip> | advent of cope tends to be exercises in brute forcing :( |
2021-12-23 05:18:10 +0100 | <int-e> | PE tends to require brute force on top of a shortcut |
2021-12-23 05:18:10 +0100 | <sim590> | My code also removes leading zeroes. |
2021-12-23 05:18:18 +0100 | <sim590> | mniip: ^ |
2021-12-23 05:18:23 +0100 | <sim590> | So It doesn't change. |
2021-12-23 05:18:39 +0100 | <mniip> | ok then |
2021-12-23 05:18:57 +0100 | <mniip> | 5690349/11111111 |
2021-12-23 05:19:54 +0100 | <sim590> | mniip: http://ix.io/3Jco |
2021-12-23 05:20:07 +0100 | <mniip> | yeah |
2021-12-23 05:20:20 +0100 | fizbin | (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) |
2021-12-23 05:20:22 +0100 | <mniip> | so head.head is [1,2]? |
2021-12-23 05:20:36 +0100 | <sim590> | Yeah.... |
2021-12-23 05:20:40 +0100 | <sim590> | Hmmmmmmmmmmmmmmmm |
2021-12-23 05:20:44 +0100 | <int-e> | . o O ( Oh no, why are there floating point numbers... ) |
2021-12-23 05:21:39 +0100 | <monochrom> | 1/(the largest prime below 1000) may be the winner. |
2021-12-23 05:22:27 +0100 | <sim590> | OK, so there's some mathematical insight I don't see right now which needs to be used to resolve this? I can't fix my approach in order to get it? |
2021-12-23 05:22:37 +0100 | <sim590> | And why does my approach breka. |
2021-12-23 05:22:39 +0100 | <sim590> | break* |
2021-12-23 05:22:54 +0100 | <sim590> | Because groupBy (/=) doesn't really do what I want, right? |
2021-12-23 05:22:55 +0100 | <mniip> | I said from the start, the digits are not a good medium |
2021-12-23 05:23:08 +0100 | <mniip> | you should not be looking at the digits to tell where they loop |
2021-12-23 05:23:14 +0100 | <mniip> | you should be looking at what produced the digits |
2021-12-23 05:23:31 +0100 | <sim590> | So there's a relation between the nature of the number and the looping of its digits? |
2021-12-23 05:23:31 +0100 | <mniip> | from the digits themselves it would be impossible |
2021-12-23 05:23:37 +0100 | <sim590> | That's some math theorem I guess. |
2021-12-23 05:23:50 +0100 | <mniip> | it doesn't really have a name |
2021-12-23 05:24:03 +0100 | <EvanR> | this talk of repeating digits screams "continued fractions" for some reason |
2021-12-23 05:24:12 +0100 | <mniip> | but yeah, long division by X is a state machine with X states |
2021-12-23 05:24:39 +0100 | <EvanR> | i guess in a continued fraction, nothing repeats in any base |
2021-12-23 05:24:53 +0100 | <EvanR> | for rationals |
2021-12-23 05:25:04 +0100 | <mniip> | once the dividend digits run out, all the output depends on is the remainder |
2021-12-23 05:25:14 +0100 | fizbin | (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Ping timeout: 268 seconds) |
2021-12-23 05:25:34 +0100 | <mniip> | every time you have some remainder R, you compute the next digit with (R * 10 `div` D) and the next remainder with (R * 10 `mod` D) |
2021-12-23 05:26:01 +0100 | <mniip> | the latter process obviously keeps you between [0..D-1] |
2021-12-23 05:26:09 +0100 | <mniip> | so eventually you're bound to repeat the R |
2021-12-23 05:26:26 +0100 | mbuf | (~Shakthi@223.178.76.172) |
2021-12-23 05:26:39 +0100 | <mniip> | after no longer than D iterations (and actually the number of iterations will divide into D) |
2021-12-23 05:26:51 +0100 | <int-e> | monochrom: Amazingly some of the winners (when varying the upper bound N) are not prime: 289 and 361 (and /maybe/ more, though it's heuristically unlikely.) |
2021-12-23 05:26:52 +0100 | <mniip> | er |
2021-12-23 05:26:58 +0100 | <mniip> | D-1 and D-1 respectively |
2021-12-23 05:27:41 +0100 | <int-e> | > 1/101 |
2021-12-23 05:27:42 +0100 | <lambdabot> | 9.900990099009901e-3 |
2021-12-23 05:27:47 +0100 | <int-e> | and not all primes are good |
2021-12-23 05:28:08 +0100 | fizbin | (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) |
2021-12-23 05:30:54 +0100 | <monochrom> | Yeah the true story involves some primitive root, 10, and the denominator. |
2021-12-23 05:30:57 +0100 | Henson | (~kvirc@107-179-133-201.cpe.teksavvy.com) (Ping timeout: 240 seconds) |
2021-12-23 05:32:13 +0100 | <int-e> | monochrom: yeah I'm using znorder in pari/gp |
2021-12-23 05:32:58 +0100 | <monochrom> | pari/gp is the preferred programming language for PE >:) |
2021-12-23 05:33:05 +0100 | <sim590> | OK, so when you compute the remainder of some 1/d division and try to figure out the digits one by one, you have to count the number of iterations before you get on the same remainder. And then, you know the length of the cyle, right ? mniip |
2021-12-23 05:33:14 +0100 | alfonsox | (~quassel@103.92.42.192) |
2021-12-23 05:33:17 +0100 | <mniip> | yeah |
2021-12-23 05:36:16 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 05:38:37 +0100 | deadmarshal | (~deadmarsh@95.38.231.102) (Ping timeout: 240 seconds) |
2021-12-23 05:38:57 +0100 | deadmarshal | (~deadmarsh@95.38.231.102) |
2021-12-23 05:41:37 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) |
2021-12-23 05:42:38 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Ping timeout: 252 seconds) |
2021-12-23 05:43:28 +0100 | <sim590> | hmmmmmmmmmmm OK. Figuring out the digits with (r*10 `div` d) and (r*10 `mod` d) is something I didn't know. So if I understand correctly, at first you do (1*10 `div` d) to get the first digit. Then you can find the remainder r0 = (r0*10 `mod` d). This gives the second digit: r0*10 `div` d. |
2021-12-23 05:43:38 +0100 | deadmarshal | (~deadmarsh@95.38.231.102) (Ping timeout: 260 seconds) |
2021-12-23 05:44:04 +0100 | <sim590> | And so on... |
2021-12-23 05:44:34 +0100 | <sim590> | But is it equivalent to look for a cycle in the digit or am I obligated to look at the remainder? |
2021-12-23 05:45:33 +0100 | <EvanR> | also divMod to do it in one step |
2021-12-23 05:45:43 +0100 | <sim590> | Because I could have the same digit but not have a cycle. Why does the remainder looping gives us a true cycle for sure? |
2021-12-23 05:45:44 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 05:45:51 +0100 | <EvanR> | you can't just look at digits, I think people explained why |
2021-12-23 05:45:58 +0100 | <sim590> | EvanR: oh nice! |
2021-12-23 05:46:13 +0100 | wroathe | (~wroathe@user/wroathe) (Ping timeout: 240 seconds) |
2021-12-23 05:46:17 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) (Ping timeout: 240 seconds) |
2021-12-23 05:46:20 +0100 | <EvanR> | also they explained why the remainder being bounded results in a loop |
2021-12-23 05:46:33 +0100 | <EvanR> | which explains why doing a "long square root" of 2 does not loop |
2021-12-23 05:46:36 +0100 | <sim590> | OK, I'll read again |
2021-12-23 05:46:52 +0100 | <EvanR> | or doesn't necessarily loop, anyway |
2021-12-23 05:48:25 +0100 | justsomeguy | (~justsomeg@user/justsomeguy) |
2021-12-23 05:49:25 +0100 | <monochrom> | The suffix of the digit sequence is controlled by the remainder only. Seeing the same remainder for the second time means seeing the same suffix again. |
2021-12-23 05:49:52 +0100 | lavaman | (~lavaman@98.38.249.169) |
2021-12-23 05:50:01 +0100 | <monochrom> | A finite-state Moore or Mealey machine that doesn't need input. I forgot which. |
2021-12-23 05:50:32 +0100 | <monochrom> | An unfoldr of a state-transition function of finitely many states. |
2021-12-23 05:52:47 +0100 | <EvanR> | a moore machine's next state only depends on the current state (no input) |
2021-12-23 05:53:17 +0100 | <EvanR> | finite numbers of states = necessarily loops (proof left as exercise!) |
2021-12-23 05:54:50 +0100 | <int-e> | EvanR: Uh, you're wrong. |
2021-12-23 05:54:50 +0100 | lavaman | (~lavaman@98.38.249.169) (Ping timeout: 268 seconds) |
2021-12-23 05:55:27 +0100 | <int-e> | The state transition function is the same in both models, it's just about the output. And no, I can't remember which is which :P |
2021-12-23 05:55:38 +0100 | <int-e> | It hardly ever comes up. |
2021-12-23 05:55:50 +0100 | deadmarshal | (~deadmarsh@95.38.231.102) |
2021-12-23 05:56:06 +0100 | <EvanR> | damn |
2021-12-23 05:57:12 +0100 | <int-e> | (and when there's no input, the difference disappears. maybe monochrom was joking about not remembering) |
2021-12-23 05:58:08 +0100 | <monochrom> | Oh haha accidental pun. |
2021-12-23 05:58:20 +0100 | <monochrom> | But I really don't remember and too lazy to find out. |
2021-12-23 05:58:32 +0100 | <EvanR> | now it feels like we're arguing over if bamboo "really is" "a grass" xD. But yeah if I remember a second time, mealy machine also includes an output that depends on state and input |
2021-12-23 05:58:42 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) |
2021-12-23 05:59:20 +0100 | <EvanR> | the finite states resulting in a loop doesn't depend on science culture jargon though |
2021-12-23 05:59:20 +0100 | jz99 | (~jz99@150.203.2.50) (Quit: Client closed) |
2021-12-23 06:00:48 +0100 | <EvanR> | mealy machine's output is relevant in the package `machines' |
2021-12-23 06:10:37 +0100 | falafel_ | (~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com) (Ping timeout: 240 seconds) |
2021-12-23 06:15:06 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) |
2021-12-23 06:17:40 +0100 | hololeap | (~hololeap@user/hololeap) |
2021-12-23 06:19:59 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) |
2021-12-23 06:26:29 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 06:26:47 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 06:28:32 +0100 | bitmapper | (uid464869@id-464869.lymington.irccloud.com) |
2021-12-23 06:29:57 +0100 | rembo10 | (~rembo10@remulis.com) (Ping timeout: 250 seconds) |
2021-12-23 06:30:57 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Ping timeout: 240 seconds) |
2021-12-23 06:36:09 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 06:40:37 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Ping timeout: 240 seconds) |
2021-12-23 06:42:49 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 06:43:20 +0100 | rembo10 | (~rembo10@static.133.56.108.65.clients.your-server.de) |
2021-12-23 06:47:52 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Ping timeout: 268 seconds) |
2021-12-23 06:50:30 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection) |
2021-12-23 06:50:31 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 06:52:48 +0100 | slowButPresent | (~slowButPr@user/slowbutpresent) (Quit: leaving) |
2021-12-23 06:53:57 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
2021-12-23 06:57:07 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Read error: Connection reset by peer) |
2021-12-23 06:58:10 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) |
2021-12-23 06:58:30 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 06:59:30 +0100 | [itchyjunk] | (~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer) |
2021-12-23 07:02:44 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 07:03:02 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 07:04:58 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 07:05:15 +0100 | darkstardevx | (~darkstard@50.39.115.145) |
2021-12-23 07:06:03 +0100 | deadmarshal | (~deadmarsh@95.38.231.102) (Quit: ZNC 1.8.2 - https://znc.in) |
2021-12-23 07:06:16 +0100 | darkstardevx | (~darkstard@50.39.115.145) (Remote host closed the connection) |
2021-12-23 07:06:27 +0100 | deadmarshal | (~deadmarsh@95.38.231.102) |
2021-12-23 07:06:40 +0100 | darkstardevx | (~darkstard@50.39.115.145) |
2021-12-23 07:08:34 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) (Ping timeout: 260 seconds) |
2021-12-23 07:14:59 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 07:14:59 +0100 | notzmv | (~zmv@user/notzmv) |
2021-12-23 07:15:14 +0100 | rembo10 | (~rembo10@static.133.56.108.65.clients.your-server.de) (Quit: ZNC 1.8.2 - https://znc.in) |
2021-12-23 07:16:17 +0100 | rembo10 | (~rembo10@2a01:4f9:c010:b5b9::1) |
2021-12-23 07:17:53 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 07:18:11 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 07:19:17 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 07:21:17 +0100 | Inst | (~delicacie@2601:6c4:4080:3f80:e482:21a8:3024:fee0) (Ping timeout: 240 seconds) |
2021-12-23 07:21:59 +0100 | geekosaur | (~geekosaur@xmonad/geekosaur) (Remote host closed the connection) |
2021-12-23 07:22:03 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 07:22:25 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) |
2021-12-23 07:23:29 +0100 | chomwitt | (~chomwitt@ppp-2-85-245-134.home.otenet.gr) |
2021-12-23 07:23:47 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 07:24:05 +0100 | geekosaur | (~geekosaur@xmonad/geekosaur) |
2021-12-23 07:25:11 +0100 | aliosablack | (~chomwitt@ppp-2-85-245-134.home.otenet.gr) |
2021-12-23 07:25:46 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 07:27:21 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) (Ping timeout: 268 seconds) |
2021-12-23 07:30:26 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Ping timeout: 268 seconds) |
2021-12-23 07:32:39 +0100 | takuan | (~takuan@178-116-218-225.access.telenet.be) |
2021-12-23 07:34:15 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 07:35:47 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 07:36:33 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 07:37:54 +0100 | <sim590> | Here's the resulting solution for my problem http://ix.io/3JcO. I'm wondering if I could have done it as efficiently without a Map? |
2021-12-23 07:38:22 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) |
2021-12-23 07:38:23 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 07:38:27 +0100 | jonathanx | (~jonathan@94.234.52.89) |
2021-12-23 07:38:41 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 07:42:32 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) (Ping timeout: 252 seconds) |
2021-12-23 07:42:37 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Ping timeout: 240 seconds) |
2021-12-23 07:44:41 +0100 | <frumple_Doop> | Haskell seems math centric, does it have ways of taking integrals, derivatives, and partial integrals/derivatives (calculus)? |
2021-12-23 07:45:21 +0100 | <frumple_Doop> | Or do those operations need to be user defined in a general way? |
2021-12-23 07:46:35 +0100 | <frumple_Doop> | ulterior motive to the question is, "is haskell a choice programming language for solving engineering problems, from Statics or for solving differential equations?" |
2021-12-23 07:47:23 +0100 | sprout | (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) |
2021-12-23 07:48:14 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 07:48:18 +0100 | xff0x | (~xff0x@2001:1a81:52d0:e400:5fba:65e0:daae:59c3) (Ping timeout: 268 seconds) |
2021-12-23 07:49:04 +0100 | xff0x | (~xff0x@2001:1a81:52d0:e400:55eb:e48f:480a:9ef0) |
2021-12-23 07:49:04 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 07:50:47 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 07:52:01 +0100 | <jackdk> | frumple_Doop: I know about https://hackage.haskell.org/package/ad but haven't used it, dunno about integration |
2021-12-23 07:52:21 +0100 | <jackdk> | https://hackage.haskell.org/package/integration oh Ed's done that too |
2021-12-23 07:53:34 +0100 | <frumple_Doop> | oh I see, thanks. |
2021-12-23 07:55:32 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Ping timeout: 240 seconds) |
2021-12-23 08:02:14 +0100 | _ht | (~quassel@82-169-194-8.biz.kpn.net) |
2021-12-23 08:02:43 +0100 | Morrow | (~quassel@bzq-110-168-31-106.red.bezeqint.net) |
2021-12-23 08:05:37 +0100 | bu5hyt0p_ | (~rmsare@2601:281:c780:a510:6d40:63c6:3a27:e5b8) (Ping timeout: 240 seconds) |
2021-12-23 08:05:51 +0100 | <yin> | cc |
2021-12-23 08:05:55 +0100 | <yin> | cc |
2021-12-23 08:05:57 +0100 | <yin> | OB |
2021-12-23 08:05:59 +0100 | dhouthoo | (~dhouthoo@178-117-36-167.access.telenet.be) |
2021-12-23 08:05:59 +0100 | <yin> | OB |
2021-12-23 08:06:49 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 08:07:56 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 08:08:17 +0100 | frumple_Doop | space_llama |
2021-12-23 08:17:41 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 08:20:29 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 08:22:53 +0100 | <space_llama> | > ('h':('a':['m'])) |
2021-12-23 08:22:55 +0100 | <lambdabot> | "ham" |
2021-12-23 08:23:06 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 08:23:18 +0100 | <space_llama> | is "ham" syntactic sugar for: ('h':('a':['m'])) ? |
2021-12-23 08:24:50 +0100 | <yin> | ccººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººº++ççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççç |
2021-12-23 08:24:54 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 08:24:56 +0100 | <yin> | çççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççç |
2021-12-23 08:25:02 +0100 | <yin> | çççççççççççççççççççççççççççççççççççççççççççç++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2021-12-23 08:25:08 +0100 | <yin> | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2021-12-23 08:25:14 +0100 | <yin> | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2021-12-23 08:25:20 +0100 | <yin> | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2021-12-23 08:25:26 +0100 | <yin> | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2021-12-23 08:25:32 +0100 | <yin> | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2021-12-23 08:25:38 +0100 | <yin> | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2021-12-23 08:25:44 +0100 | <yin> | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2021-12-23 08:25:50 +0100 | <yin> | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2021-12-23 08:25:53 +0100 | <space_llama> | > length' [] = 0; length' (_:xs) = 1 + length' xs |
2021-12-23 08:25:54 +0100 | <lambdabot> | <hint>:1:12: error: parse error on input ‘=’ |
2021-12-23 08:25:56 +0100 | <yin> | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2021-12-23 08:26:02 +0100 | <yin> | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2021-12-23 08:26:08 +0100 | <yin> | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2021-12-23 08:26:14 +0100 | <yin> | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2021-12-23 08:26:20 +0100 | <yin> | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2021-12-23 08:26:25 +0100 | <space_llama> | yin fell asleep on keyboard; or cat... |
2021-12-23 08:26:26 +0100 | <yin> | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2021-12-23 08:26:32 +0100 | <yin> | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2021-12-23 08:26:38 +0100 | <yin> | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2021-12-23 08:26:42 +0100 | <xerox> | @ops |
2021-12-23 08:26:43 +0100 | <lambdabot> | Maybe you meant: pl oeis docs |
2021-12-23 08:26:44 +0100 | <yin> | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2021-12-23 08:26:46 +0100 | <xerox> | @where ops |
2021-12-23 08:26:46 +0100 | <lambdabot> | byorgey Cale conal copumpkin dcoutts dibblego dolio edwardk geekosaur glguy jmcarthur johnw mniip monochrom quicksilver shachaf shapr ski |
2021-12-23 08:26:47 +0100 | synthmeat | (~synthmeat@user/synthmeat) |
2021-12-23 08:26:50 +0100 | <yin> | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2021-12-23 08:26:56 +0100 | <yin> | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++çççç++ |
2021-12-23 08:28:10 +0100 | ChanServ | +o mniip |
2021-12-23 08:28:10 +0100 | mniip | +q-o *!*@user/zero mniip |
2021-12-23 08:32:27 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 08:32:37 +0100 | jonathanx | (~jonathan@94.234.52.89) (Ping timeout: 256 seconds) |
2021-12-23 08:35:59 +0100 | <space_llama> | head (1,2,4) |
2021-12-23 08:36:05 +0100 | <space_llama> | > head (1,2,4) |
2021-12-23 08:36:06 +0100 | <lambdabot> | error: |
2021-12-23 08:36:06 +0100 | <lambdabot> | • Couldn't match expected type ‘[a]’ |
2021-12-23 08:36:06 +0100 | <lambdabot> | with actual type ‘(a0, b0, c0)’ |
2021-12-23 08:36:20 +0100 | <space_llama> | > head "1 2 3 4" |
2021-12-23 08:36:22 +0100 | <lambdabot> | '1' |
2021-12-23 08:36:29 +0100 | <space_llama> | > tail "1 2 3 4" |
2021-12-23 08:36:31 +0100 | <lambdabot> | " 2 3 4" |
2021-12-23 08:36:46 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Ping timeout: 260 seconds) |
2021-12-23 08:39:24 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 08:40:36 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) |
2021-12-23 08:43:45 +0100 | <Cale> | space_llama: Yes, it is, and ['m'] is syntactic sugar for 'm':[] |
2021-12-23 08:44:14 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Ping timeout: 260 seconds) |
2021-12-23 08:46:26 +0100 | <space_llama> | > ['m'] == "m" |
2021-12-23 08:46:27 +0100 | <lambdabot> | True |
2021-12-23 08:46:58 +0100 | <space_llama> | llama == space |
2021-12-23 08:47:03 +0100 | <space_llama> | > llama == space |
2021-12-23 08:47:04 +0100 | <lambdabot> | error: Variable not in scope: llama :: Doc |
2021-12-23 08:47:12 +0100 | <space_llama> | :( |
2021-12-23 08:49:11 +0100 | <space_llama> | > "word" == 'w':('o':('r':"d")) |
2021-12-23 08:49:12 +0100 | <lambdabot> | True |
2021-12-23 08:50:36 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) |
2021-12-23 08:51:09 +0100 | ChanServ | +o mniip |
2021-12-23 08:51:10 +0100 | mniip | -q *!*@user/zero |
2021-12-23 08:51:49 +0100 | mniip | -o mniip |
2021-12-23 08:52:11 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 08:53:42 +0100 | albet70 | (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
2021-12-23 08:56:47 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Ping timeout: 252 seconds) |
2021-12-23 08:59:49 +0100 | albet70 | (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
2021-12-23 09:01:19 +0100 | Tuplanolla | (~Tuplanoll@91-159-69-214.elisa-laajakaista.fi) |
2021-12-23 09:03:47 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 09:04:11 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 09:06:11 +0100 | <EvanR> | interesting |
2021-12-23 09:06:28 +0100 | <EvanR> | I have a datatype with 11 fields |
2021-12-23 09:06:41 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 09:06:42 +0100 | <EvanR> | the more of them I make strict, the longer compiling -O2 takes |
2021-12-23 09:06:57 +0100 | <EvanR> | I noticed because if they are all strict, compiling seems to take forever |
2021-12-23 09:07:04 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 09:10:22 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 09:13:53 +0100 | mattil | (~mattil@helsinki.portalify.com) |
2021-12-23 09:15:46 +0100 | xkuru | (~xkuru@user/xkuru) |
2021-12-23 09:16:37 +0100 | deadmarshal | (~deadmarsh@95.38.231.102) (Ping timeout: 240 seconds) |
2021-12-23 09:16:49 +0100 | econo | (uid147250@user/econo) (Quit: Connection closed for inactivity) |
2021-12-23 09:17:09 +0100 | Sobhan | (~Sobhan@modemcable039.128-131-66.mc.videotron.ca) |
2021-12-23 09:18:16 +0100 | <Sobhan> | Hi, what would be my best best evaluating a function like map (\i -> sum $ map (\j -> sum $ map (\k -> bool 0 1 (pred i j k)) [0..1000]) [0.1000]) [0..1000] |
2021-12-23 09:18:32 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 09:18:48 +0100 | thebnq | (~bnq@herrokitty.com) |
2021-12-23 09:18:50 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 09:18:50 +0100 | <Sobhan> | it fills up my ram, i'm guessing i'm not using lazy evaluation properly |
2021-12-23 09:21:33 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 09:21:50 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 09:22:49 +0100 | <pavonia> | I think sum is too lazy here |
2021-12-23 09:22:58 +0100 | <pavonia> | @src sum |
2021-12-23 09:22:58 +0100 | <lambdabot> | sum = foldl (+) 0 |
2021-12-23 09:23:03 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 09:23:09 +0100 | <Sobhan> | so foldl'? |
2021-12-23 09:23:16 +0100 | deadmarshal | (~deadmarsh@95.38.231.102) |
2021-12-23 09:23:28 +0100 | <pavonia> | Yeah, try sum' = foldl' (+) 0 |
2021-12-23 09:24:22 +0100 | waleee | (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 260 seconds) |
2021-12-23 09:24:27 +0100 | <xsperry> | I believe when you're compiling with (with -O2 at least) sum shouldn't create unnecessary thunks |
2021-12-23 09:24:35 +0100 | <Hecate> | sum :: Num a => t a -> a |
2021-12-23 09:24:35 +0100 | <Hecate> | sum = getSum #. foldMap' Sum |
2021-12-23 09:24:37 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
2021-12-23 09:24:40 +0100 | <Hecate> | in base 4.16 |
2021-12-23 09:24:54 +0100 | <Hecate> | but *not* in base 4.14 ! |
2021-12-23 09:24:55 +0100 | <Sobhan> | i was testing with O2 and this fixed it |
2021-12-23 09:25:05 +0100 | <Hecate> | Sobhan: yes, so, there's a bit of history behind that |
2021-12-23 09:25:07 +0100 | <Sobhan> | thanks |
2021-12-23 09:25:12 +0100 | <Hecate> | (I'm the one who pushed the change to base) |
2021-12-23 09:25:20 +0100 | <Sobhan> | (nice) |
2021-12-23 09:25:29 +0100 | <Hecate> | (thanks, it was unnecessarily painful) |
2021-12-23 09:25:30 +0100 | <Hecate> | so |
2021-12-23 09:25:51 +0100 | <Hecate> | for all intent and purpose, the laziness of sum/product disappears once you start putting O1 and above |
2021-12-23 09:25:57 +0100 | <Hecate> | it's optimised away |
2021-12-23 09:26:00 +0100 | waleee | (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) |
2021-12-23 09:26:13 +0100 | <Hecate> | but with ghci, it's still here! |
2021-12-23 09:26:21 +0100 | <Hecate> | (unless you specify an optimisation level by hand) |
2021-12-23 09:26:49 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 09:26:52 +0100 | <Hecate> | which means that trying out functions in ghci doesn't produce the same outcome in terms of memory consumption and evaluation eagerness/laziness |
2021-12-23 09:27:10 +0100 | <Hecate> | compared to writing it down in a file and using the optimisation levels |
2021-12-23 09:27:53 +0100 | <Hecate> | what was fixed in the base library was the default behaviour to be always eager evaluation |
2021-12-23 09:28:20 +0100 | gehmehgeh | (~user@user/gehmehgeh) |
2021-12-23 09:28:30 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 09:28:33 +0100 | <Sobhan> | i wasn't testing in ghci tho, i was compiling with -O2 |
2021-12-23 09:29:03 +0100 | <Hecate> | and from what I can read, it fixed it? |
2021-12-23 09:29:19 +0100 | <Sobhan> | `sum' = foldl' (+) 0` fixed itr |
2021-12-23 09:29:30 +0100 | <Hecate> | ah great :) |
2021-12-23 09:29:55 +0100 | <EvanR> | moral of the story is you want a foldl' to do a sum |
2021-12-23 09:30:08 +0100 | <EvanR> | how you get there is another story |
2021-12-23 09:30:26 +0100 | <EvanR> | that it depends on optimizations seems weird |
2021-12-23 09:30:45 +0100 | <Hecate> | EvanR: unfortunately it is not |
2021-12-23 09:30:57 +0100 | <Hecate> | I admit it feels weird |
2021-12-23 09:31:31 +0100 | <Sobhan> | my inner "loop" still does 75% of the allocations tho |
2021-12-23 09:31:32 +0100 | <Hecate> | but when I advocated for the change in base, I had very angry people from universities telling me "noooo, Haskell is a lazy language, you're destroying decades of intuition and teaching, noooooo" |
2021-12-23 09:32:34 +0100 | <Hecate> | if you want to see how it went, read the "[Proposal]" thread of October 2020: https://mail.haskell.org/pipermail/libraries/2020-October/thread.html#start |
2021-12-23 09:32:34 +0100 | <Sobhan> | :rofl: |
2021-12-23 09:32:40 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 09:33:09 +0100 | <Hecate> | especially fucking KKK grand wizard David Duke, what a terrible participant in all this :') |
2021-12-23 09:33:13 +0100 | <Sobhan> | dumbSol.kf Main src/Main.hs:69:5-93 2064 9504 2.8 71.1 57.5 86.9 dumbSol.kf.\ Main |
2021-12-23 09:33:13 +0100 | <Sobhan> | src/Main.hs:69:32-71 2066 950400 0.8 15.9 54.6 15.9 |
2021-12-23 09:33:19 +0100 | <EvanR> | what |
2021-12-23 09:33:26 +0100 | <Hecate> | https://mail.haskell.org/pipermail/libraries/2020-October/030877.html |
2021-12-23 09:33:47 +0100 | <Hecate> | EvanR: David J Duke of the Haskell community shares his name with a famous KKK grand wizard |
2021-12-23 09:33:59 +0100 | <EvanR> | ok not actual david duke |
2021-12-23 09:34:05 +0100 | <Hecate> | ;'D |
2021-12-23 09:34:13 +0100 | <Sobhan> | kf is my "inner" loop |
2021-12-23 09:34:27 +0100 | <Sobhan> | is doing that many allocation normal? |
2021-12-23 09:34:28 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 09:34:32 +0100 | <EvanR> | your inner loop doing most of the work, activity, whatever, makes sense ot me |
2021-12-23 09:34:35 +0100 | kuribas | (~user@ptr-25vy0i8krrkad5xv3l1.18120a2.ip6.access.telenet.be) |
2021-12-23 09:34:37 +0100 | zmt01 | (~zmt00@user/zmt00) (Ping timeout: 240 seconds) |
2021-12-23 09:35:32 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 09:35:35 +0100 | <EvanR> | allocation happens as a matter of course behind the scenes in haskell, but you shouldn't think of it like calling malloc |
2021-12-23 09:36:26 +0100 | <Hecate> | Sobhan: oh dear, don't pay too much attention to the allocation, the RTS allocates and the GC eats memory at very high speeds |
2021-12-23 09:37:01 +0100 | <Hecate> | I remember hearing about something 80+GB/s on systems that definitely do not have 80+GB of RAM ;-D |
2021-12-23 09:38:16 +0100 | <dminuoso> | Sobhan: Allocations are bad if they are your bottleneck. |
2021-12-23 09:38:31 +0100 | <EvanR> | this post is pretty terrible |
2021-12-23 09:38:38 +0100 | <dminuoso> | Sobhan: Note, that fusion is one of those optimizations designed to avoid intermediate/unneeded allocations. |
2021-12-23 09:38:49 +0100 | <dminuoso> | But its only really relevant if thats your bottleneck. |
2021-12-23 09:40:32 +0100 | <Hecate> | EvanR: the mailling-list email? yeah it's pretty terrible |
2021-12-23 09:41:07 +0100 | <EvanR> | someone was suggesting making foldMap (not-prime) strict? |
2021-12-23 09:41:26 +0100 | <Hecate> | no |
2021-12-23 09:41:36 +0100 | <EvanR> | ok then |
2021-12-23 09:41:46 +0100 | <Hecate> | Fumiaki doesn't take any shit |
2021-12-23 09:41:47 +0100 | <Hecate> | https://mail.haskell.org/pipermail/libraries/2020-October/030879.html |
2021-12-23 09:42:23 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Ping timeout: 268 seconds) |
2021-12-23 09:45:24 +0100 | <int-e> | I'd hope the GC would reclaim memory, not eat it :) |
2021-12-23 09:46:01 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) |
2021-12-23 09:47:16 +0100 | <Hecate> | int-e: :P I tried to go with metaphores |
2021-12-23 09:47:23 +0100 | <dminuoso> | int-e: Hah, in reality the GC is just pac man. |
2021-12-23 09:47:42 +0100 | coot | (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Quit: coot) |
2021-12-23 09:47:53 +0100 | neurocyte0132889 | (~neurocyte@94.46.68.154) |
2021-12-23 09:47:53 +0100 | neurocyte0132889 | (~neurocyte@94.46.68.154) (Changing host) |
2021-12-23 09:47:53 +0100 | neurocyte0132889 | (~neurocyte@user/neurocyte) |
2021-12-23 09:48:28 +0100 | <space_llama> | what is meant by "pipes" in haskell lingo? |
2021-12-23 09:48:53 +0100 | <Hecate> | space_llama: the library |
2021-12-23 09:49:04 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 09:49:04 +0100 | <Hecate> | or someone is just fond of plumbing |
2021-12-23 09:49:24 +0100 | <dminuoso> | space_llama: This refers to a library or ideas of pipes, much in the same sense how we can use `|` in shell languages to construct data processing pipelines. |
2021-12-23 09:49:26 +0100 | <space_llama> | such as "Guards are indicated by pipes that follow a function's name and its parameters." from learn you a haskell |
2021-12-23 09:49:31 +0100 | <dminuoso> | Ah |
2021-12-23 09:49:35 +0100 | <int-e> | that's just the symbol | |
2021-12-23 09:49:35 +0100 | <dminuoso> | Just the character | |
2021-12-23 09:49:49 +0100 | <space_llama> | oh I see |
2021-12-23 09:49:52 +0100 | <dminuoso> | Incidentally because in shell languages this lets you create "pipes" to connect stuff together |
2021-12-23 09:50:01 +0100 | <Hecate> | yes |
2021-12-23 09:50:03 +0100 | <dminuoso> | Which is also why the library `pipes` is called `pipes` :) |
2021-12-23 09:50:03 +0100 | <Hecate> | sorry space_llama :D |
2021-12-23 09:50:33 +0100 | <dminuoso> | space_llama: Fun fact, in conduit the operator to connect two conduits is also named .| :) |
2021-12-23 09:50:57 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 09:51:13 +0100 | lavaman | (~lavaman@98.38.249.169) |
2021-12-23 09:51:14 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 09:51:35 +0100 | <space_llama> | in math its called vertical bar |
2021-12-23 09:51:53 +0100 | <space_llama> | which incidentally is space llamas favorite place to get a drink |
2021-12-23 09:52:10 +0100 | <space_llama> | :| |
2021-12-23 09:52:35 +0100 | acidjnk | (~acidjnk@p200300d0c7271e77d154eb1f1200bcdb.dip0.t-ipconnect.de) |
2021-12-23 09:53:06 +0100 | nuh^ | (~nuh@64.253.22.77) (Remote host closed the connection) |
2021-12-23 09:54:07 +0100 | <space_llama> | diminuoso https://www.conduitlanguage.com/ ? |
2021-12-23 09:54:58 +0100 | ChaiTRex | (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
2021-12-23 09:54:58 +0100 | Sgeo | (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
2021-12-23 09:55:31 +0100 | mncheck | (~mncheck@193.224.205.254) (Remote host closed the connection) |
2021-12-23 09:55:46 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Ping timeout: 245 seconds) |
2021-12-23 09:55:55 +0100 | lavaman | (~lavaman@98.38.249.169) (Ping timeout: 256 seconds) |
2021-12-23 09:55:57 +0100 | neurocyte0132889 | (~neurocyte@user/neurocyte) (Ping timeout: 268 seconds) |
2021-12-23 09:56:28 +0100 | ChaiTRex | (~ChaiTRex@user/chaitrex) |
2021-12-23 09:56:56 +0100 | <dminuoso> | Yes, that... |
2021-12-23 09:57:03 +0100 | <dminuoso> | I dont even. :( |
2021-12-23 09:57:11 +0100 | eggplantade | (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4) (Remote host closed the connection) |
2021-12-23 09:57:46 +0100 | mncheck | (~mncheck@193.224.205.254) |
2021-12-23 09:58:16 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 09:59:48 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 10:00:06 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 10:02:15 +0100 | Gurkenglas | (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) |
2021-12-23 10:03:38 +0100 | falafel_ | (~falafel@cpe-76-168-195-162.socal.res.rr.com) |
2021-12-23 10:05:25 +0100 | epolanski | (uid312403@id-312403.helmsley.irccloud.com) |
2021-12-23 10:06:11 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 10:06:13 +0100 | jonathanx | (~jonathan@c-5eea3459-74736162.cust.telenor.se) |
2021-12-23 10:06:26 +0100 | pavonia | (~user@user/siracusa) (Quit: Bye!) |
2021-12-23 10:09:10 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 10:10:52 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 10:12:00 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Remote host closed the connection) |
2021-12-23 10:12:46 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) |
2021-12-23 10:13:03 +0100 | <carbolymer> | Can I have two default signatures using DefaultSignatures? |
2021-12-23 10:14:26 +0100 | <carbolymer> | for the same function |
2021-12-23 10:17:06 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 10:17:24 +0100 | geekosaur | (~geekosaur@xmonad/geekosaur) (Remote host closed the connection) |
2021-12-23 10:17:25 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Ping timeout: 240 seconds) |
2021-12-23 10:17:49 +0100 | geekosaur | (~geekosaur@xmonad/geekosaur) |
2021-12-23 10:18:28 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 10:18:38 +0100 | <dminuoso> | carbolymer: What would that even mean? |
2021-12-23 10:18:46 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 10:19:11 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) |
2021-12-23 10:19:14 +0100 | <carbolymer> | dminuoso: two default signatures with exclusive constraints |
2021-12-23 10:19:46 +0100 | <dminuoso> | And how should GHC decide to pick? |
2021-12-23 10:20:19 +0100 | <carbolymer> | dminuoso: if the constraints are exclusive, isn't that obvious? |
2021-12-23 10:20:34 +0100 | <dminuoso> | No? |
2021-12-23 10:20:48 +0100 | space_llama | (~Guest|47@c-73-221-44-172.hsd1.wa.comcast.net) (Quit: Connection closed) |
2021-12-23 10:20:53 +0100 | <dminuoso> | First, how would GHC even know that they are exclusive |
2021-12-23 10:21:00 +0100 | <carbolymer> | I mean, GHC could fail with an error if it can't pick... |
2021-12-23 10:21:36 +0100 | <zero> | theoretically, couldn't we have a (data Strict a = Strict !a) that would make any type behave strictly? where for example, replacing (Int) with (Strict Int) in type signatures would make it an instance of a Num' class which would be a strict version of Num |
2021-12-23 10:21:42 +0100 | <dminuoso> | Or do you mean exclusive in the sense that only one can be satisfied, and you expect GHC to just try out both? |
2021-12-23 10:21:52 +0100 | <dminuoso> | For each instance? |
2021-12-23 10:22:25 +0100 | otherwise | (~otherwise@c-73-221-44-172.hsd1.wa.comcast.net) |
2021-12-23 10:22:27 +0100 | <carbolymer> | dminuoso: yes, try each one, select the one which matches ; if both match, fail with an error |
2021-12-23 10:22:57 +0100 | <dminuoso> | carbolymer: Okay so the answer is simple: the manual lists no such behavior https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/default_signatures.html |
2021-12-23 10:23:38 +0100 | <carbolymer> | dminuoso: yeah, but the manual does not say 'no' also, so I was hoping I could do that... |
2021-12-23 10:23:40 +0100 | <carbolymer> | Well |
2021-12-23 10:23:58 +0100 | <dminuoso> | I guess exlusivity doesn't matter, it would rather be a "go from top-to-bottom, pick first that works") |
2021-12-23 10:24:20 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Ping timeout: 268 seconds) |
2021-12-23 10:24:20 +0100 | <dminuoso> | Well, the manual also doesn't state that `class Jinxed class Thing` is illegal. |
2021-12-23 10:24:32 +0100 | <dminuoso> | Do you expect the GHC manual to explicitly list all the things that you cant do? |
2021-12-23 10:24:48 +0100 | <carbolymer> | dminuoso: sometimes it's not obvious what are the limits |
2021-12-23 10:25:02 +0100 | <dminuoso> | Im not entirely sure why you expect this to work in the first place |
2021-12-23 10:25:57 +0100 | Akiva | (~Akiva@user/Akiva) (Ping timeout: 240 seconds) |
2021-12-23 10:26:17 +0100 | Inst | (~delicacie@2601:6c4:4080:3f80:f9a0:f50b:a310:4e7) |
2021-12-23 10:26:30 +0100 | <Inst> | maybe this is Haskell-offtopic, but is Haskell more Hermione Granger or Luna Lovegood? |
2021-12-23 10:26:48 +0100 | coolnickname | (uid531864@user/coolnickname) |
2021-12-23 10:26:50 +0100 | <carbolymer> | dminuoso: i don't really know why it can't work |
2021-12-23 10:26:59 +0100 | <dminuoso> | carbolymer: Im not saying it couldn't. |
2021-12-23 10:27:07 +0100 | <dminuoso> | Im just saying it doesn't seem like an obvious thing to want. |
2021-12-23 10:27:16 +0100 | <dminuoso> | Arguably Id find this extremely unintuitive |
2021-12-23 10:27:25 +0100 | <dminuoso> | Consider: You write `instance Foo Bar`. What does this do? |
2021-12-23 10:27:30 +0100 | <dminuoso> | Which implementation does it pick? |
2021-12-23 10:27:50 +0100 | <dminuoso> | If you have some subtle bugs, this can alter behavior without you even noticing |
2021-12-23 10:27:55 +0100 | <carbolymer> | dminuoso: the best option here would be to fail with an error if more than one matches I think |
2021-12-23 10:28:19 +0100 | <dminuoso> | carbolymer: still, its completely unintuitive because you cant see what is being done. |
2021-12-23 10:28:32 +0100 | <dminuoso> | You have to play constraint resolution in your head to know which default method would be picked |
2021-12-23 10:29:01 +0100 | <dminuoso> | Each time you change either the default constraints of your Foo, or instances on Bar. |
2021-12-23 10:29:11 +0100 | <carbolymer> | dminuoso: this now make more sense if you phrase it that way |
2021-12-23 10:30:26 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection) |
2021-12-23 10:30:26 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 10:30:55 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: closed) |
2021-12-23 10:31:05 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 10:31:50 +0100 | cosimone | (~user@93-34-133-112.ip49.fastwebnet.it) |
2021-12-23 10:32:01 +0100 | briandaed | (~root@185.234.208.208.r.toneticgroup.pl) |
2021-12-23 10:32:49 +0100 | <carbolymer> | Well so I'm resorted to building a tower of monads then |
2021-12-23 10:35:46 +0100 | ozzloy | (~ozzloy@ozzloy.lifeafterking.org) (Ping timeout: 245 seconds) |
2021-12-23 10:36:11 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 10:37:06 +0100 | <yin> | i wonder if writing a filter like this can negatively impact performance. |
2021-12-23 10:37:08 +0100 | <yin> | length [ () | (0,_) <- M.keys g ] |
2021-12-23 10:37:50 +0100 | meer | (~delicacie@2601:6c4:4080:3f80:d9cb:b805:baaa:394f) |
2021-12-23 10:38:21 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 10:38:43 +0100 | <zero> | yin: as opposed to what? |
2021-12-23 10:39:57 +0100 | Inst | (~delicacie@2601:6c4:4080:3f80:f9a0:f50b:a310:4e7) (Ping timeout: 240 seconds) |
2021-12-23 10:40:01 +0100 | <yin> | something like `length $ filter ((== 0) . fst) $ M.keys g` |
2021-12-23 10:40:15 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 10:43:00 +0100 | <zero> | length . filter is subject to fusion I think, maybe someone can confirm. not sure about your [()] thing |
2021-12-23 10:44:16 +0100 | meer | Inst |
2021-12-23 10:44:26 +0100 | jgeerds | (~jgeerds@55d4ac73.access.ecotel.net) |
2021-12-23 10:44:50 +0100 | mattil | (~mattil@helsinki.portalify.com) (Remote host closed the connection) |
2021-12-23 10:45:06 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Ping timeout: 260 seconds) |
2021-12-23 10:45:30 +0100 | tzh | (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz) |
2021-12-23 10:49:01 +0100 | <yin> | (i want to apologise for earlier. that was definitely my cat) |
2021-12-23 10:49:22 +0100 | <yin> | (just noticed it) |
2021-12-23 10:51:09 +0100 | <yin> | EvanR: how is that an infinite list? |
2021-12-23 10:52:40 +0100 | Akiva | (~Akiva@user/Akiva) |
2021-12-23 10:53:11 +0100 | otherwise | (~otherwise@c-73-221-44-172.hsd1.wa.comcast.net) (Quit: Connection closed) |
2021-12-23 10:57:40 +0100 | eggplantade | (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
2021-12-23 10:58:09 +0100 | <dminuoso> | tomsmeding: By the way, recall this domain trie problem? |
2021-12-23 10:58:27 +0100 | <dminuoso> | It's so bizarre how problems keep reappearing all around you once you think about it. |
2021-12-23 10:58:37 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
2021-12-23 11:01:57 +0100 | eggplantade | (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds) |
2021-12-23 11:02:57 +0100 | dsrt^ | (~dsrt@64.253.22.77) |
2021-12-23 11:05:20 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 11:05:54 +0100 | jonathanx | (~jonathan@c-5eea3459-74736162.cust.telenor.se) (Read error: Connection reset by peer) |
2021-12-23 11:06:11 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2021-12-23 11:06:12 +0100 | jonathanx | (~jonathan@c-5eea3459-74736162.cust.telenor.se) |
2021-12-23 11:07:54 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Remote host closed the connection) |
2021-12-23 11:08:39 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) |
2021-12-23 11:09:16 +0100 | <xerox> | yin: also M.size (M.filter pred m) |
2021-12-23 11:09:28 +0100 | jonathanx | (~jonathan@c-5eea3459-74736162.cust.telenor.se) (Remote host closed the connection) |
2021-12-23 11:09:46 +0100 | jonathanx | (~jonathan@c-5eea3459-74736162.cust.telenor.se) |
2021-12-23 11:10:21 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 11:11:57 +0100 | mvk | (~mvk@2607:fea8:5cdd:f000::917a) (Ping timeout: 240 seconds) |
2021-12-23 11:13:33 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Ping timeout: 256 seconds) |
2021-12-23 11:13:37 +0100 | coot | (~coot@89-64-85-93.dynamic.chello.pl) |
2021-12-23 11:13:46 +0100 | hololeap | (~hololeap@user/hololeap) (Excess Flood) |
2021-12-23 11:15:04 +0100 | hololeap | (~hololeap@user/hololeap) |
2021-12-23 11:15:37 +0100 | jonathanx | (~jonathan@c-5eea3459-74736162.cust.telenor.se) (Ping timeout: 240 seconds) |
2021-12-23 11:16:40 +0100 | <yin> | xerox: what's that? |
2021-12-23 11:16:42 +0100 | <c_wraith> | xerox: |
2021-12-23 11:16:52 +0100 | <c_wraith> | I don't think that's gonna work as nicely |
2021-12-23 11:17:03 +0100 | <c_wraith> | because filtering a Map is a complex operation |
2021-12-23 11:17:09 +0100 | <c_wraith> | no way that'll fuse |
2021-12-23 11:17:31 +0100 | <dminuoso> | Filtering a map will reconstruct a new map, rebalancing it with each element |
2021-12-23 11:17:57 +0100 | <dminuoso> | Right? |
2021-12-23 11:18:05 +0100 | <xerox> | my thought would be that if I use the library's functions I give them a chance to do internal optimizations that would not survive the boundaries of changing data structure |
2021-12-23 11:18:25 +0100 | <dminuoso> | Though containers claims filter to be O(n) mmm |
2021-12-23 11:18:35 +0100 | <c_wraith> | It probably goes through an intermediate list |
2021-12-23 11:18:45 +0100 | <c_wraith> | to a list, filter, reconstruct from a sorted list |
2021-12-23 11:18:50 +0100 | <c_wraith> | that's all O(n) |
2021-12-23 11:19:04 +0100 | <c_wraith> | and obviously more work than just going to a list and filtering and not reconstructing |
2021-12-23 11:19:06 +0100 | <dminuoso> | No it does not |
2021-12-23 11:19:15 +0100 | <yin> | notice how i'm just interested in the keys |
2021-12-23 11:19:16 +0100 | <dminuoso> | It directly operates on Map |
2021-12-23 11:19:35 +0100 | <dminuoso> | I dont understand how this can be O(n)( |
2021-12-23 11:20:15 +0100 | <c_wraith> | well, it's not a typical balanced tree. It's allowed to get pretty far out of balance. |
2021-12-23 11:20:48 +0100 | <c_wraith> | maybe that means it only does O(1) rebalances in the process of deleting an arbitrary number of elements |
2021-12-23 11:20:50 +0100 | <yin> | so... is import Data.Set as S hiding ( take ) |
2021-12-23 11:20:53 +0100 | <xerox> | so I guess M.filterWithKeys would be the correct one to have mentioned |
2021-12-23 11:21:03 +0100 | <yin> | ooops sorry about that |
2021-12-23 11:21:12 +0100 | <c_wraith> | yin: you probably want a qualified in there |
2021-12-23 11:21:13 +0100 | <xerox> | there's also S.size (S.filter pred (M.keysSet m)) |
2021-12-23 11:21:29 +0100 | Lord_of_Life | (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 256 seconds) |
2021-12-23 11:21:39 +0100 | <c_wraith> | yin: then you don't need to hide anything |
2021-12-23 11:21:39 +0100 | <int-e> | c_wraith: note that even fromAscList . filter . toAscList would be O(n) |
2021-12-23 11:21:43 +0100 | <yin> | c_wraith: yeah |
2021-12-23 11:21:50 +0100 | <c_wraith> | int-e: yes, that was my point |
2021-12-23 11:22:09 +0100 | Lord_of_Life | (~Lord@user/lord-of-life/x-2819915) |
2021-12-23 11:22:22 +0100 | <int-e> | but regardless, if all you want is to count, yes, length . filter . toList is the way to go |
2021-12-23 11:22:38 +0100 | <c_wraith> | there's no way it's more efficient to reconstruct a complex data structure |
2021-12-23 11:22:44 +0100 | <c_wraith> | and then throw it out |
2021-12-23 11:23:09 +0100 | <yin> | so `length [ () | (0,_) <- M.keys g ]` is not that smart, is what i'm hearing |
2021-12-23 11:23:18 +0100 | <c_wraith> | nah, it's good |
2021-12-23 11:23:36 +0100 | <dminuoso> | c_wraith: Maybe Im misreading the implementation, but doesn't filterWithKey potentially call `link2`, which potentially rebalances one side? |
2021-12-23 11:23:45 +0100 | <dminuoso> | https://hackage.haskell.org/package/containers-0.6.5.1/docs/src/Data.Map.Internal.html#filterWithKey |
2021-12-23 11:24:25 +0100 | <int-e> | even if it constructs an intermediate list (which I think it avoids; there's a rule toAscList m = build (\c n -> foldrFB (\k x xs -> c (k,x) xs) n m) |
2021-12-23 11:24:39 +0100 | <int-e> | ...so build/foldr fusion should kick in) |
2021-12-23 11:24:51 +0100 | <xerox> | this is nice to know |
2021-12-23 11:24:58 +0100 | <c_wraith> | dminuoso: yes, but that's sort of beside the point. To understand the bound, you'd need to look at the number of rebalances required over the entire process, not the worst case multiplied by each place it could happen |
2021-12-23 11:25:40 +0100 | <xerox> | all these functions are defined via foldrWithKey |
2021-12-23 11:25:52 +0100 | <yin> | @hoogle foldrFB |
2021-12-23 11:25:52 +0100 | <lambdabot> | Data.Massiv.Array foldrFB :: Source r ix e => (e -> b -> b) -> b -> Array r ix e -> b |
2021-12-23 11:26:50 +0100 | <dminuoso> | c_wraith: Ah I get your point. |
2021-12-23 11:26:57 +0100 | <int-e> | yin: https://hackage.haskell.org/package/containers-0.6.5.1/docs/src/Data.Map.Internal.html#foldrFB |
2021-12-23 11:27:12 +0100 | <yin> | int-e: thank |
2021-12-23 11:27:19 +0100 | <dminuoso> | Either way, it looks fairly obvious that using filterWithKey is *not* going to perform well |
2021-12-23 11:27:23 +0100 | <dminuoso> | For this task. |
2021-12-23 11:27:34 +0100 | <c_wraith> | Yeah. It's great when you still want a Map afterwards |
2021-12-23 11:27:45 +0100 | <c_wraith> | But when you just want a list, not so much |
2021-12-23 11:33:45 +0100 | dextaa5 | (~DV@user/dextaa) |
2021-12-23 11:34:19 +0100 | dextaa | (~DV@user/dextaa) (Ping timeout: 265 seconds) |
2021-12-23 11:35:50 +0100 | zangi | (~zangi@103.154.230.133) |
2021-12-23 11:37:59 +0100 | <zangi> | is there a builtin function that can generate every single combinations of a list based on the length? |
2021-12-23 11:38:06 +0100 | <zangi> | > filter ((==3) . length) $ Data.List.subsequences [1..4] |
2021-12-23 11:38:07 +0100 | <lambdabot> | [[1,2,3],[1,2,4],[1,3,4],[2,3,4]] |
2021-12-23 11:38:46 +0100 | <zangi> | Data.List.subsequences doesn't really produce every single combination, i.e. it's missing [3,1,4] |
2021-12-23 11:38:47 +0100 | <int-e> | zangi: now do it for a list with 30 elements |
2021-12-23 11:39:10 +0100 | <int-e> | > permutations [1,2,3] |
2021-12-23 11:39:12 +0100 | <lambdabot> | [[1,2,3],[2,1,3],[3,2,1],[2,3,1],[3,1,2],[1,3,2]] |
2021-12-23 11:40:04 +0100 | <int-e> | a subsequence of a_1..a_n is a_{i_1}...a_{i_k} where 1 <= i_1 < i_2 < ... < i_k <= n. |
2021-12-23 11:40:14 +0100 | <c_wraith> | > replicateM 3 [1..5] |
2021-12-23 11:40:14 +0100 | <int-e> | so [3,1,4] is not a subsequence of [1,2,3,4] |
2021-12-23 11:40:15 +0100 | <lambdabot> | [[1,1,1],[1,1,2],[1,1,3],[1,1,4],[1,1,5],[1,2,1],[1,2,2],[1,2,3],[1,2,4],[1,... |
2021-12-23 11:40:33 +0100 | <c_wraith> | there are all sorts of things you might mean |
2021-12-23 11:41:10 +0100 | <int-e> | > subsequences [1..2] >>= permutations |
2021-12-23 11:41:11 +0100 | <lambdabot> | [[],[1],[2],[1,2],[2,1]] |
2021-12-23 11:42:04 +0100 | max22- | (~maxime@2a01cb088335980010d18673f284ce01.ipv6.abo.wanadoo.fr) |
2021-12-23 11:42:26 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Ping timeout: 245 seconds) |
2021-12-23 11:46:18 +0100 | jonathanx | (~jonathan@94.234.52.89) |
2021-12-23 11:47:43 +0100 | <dminuoso> | I have a `Map K V`, and I want to essentially partition the entire map into some `Map O (Map K V)` by means of a `part :: K -> O`. Do I have to build this myself, or are there primitives in `containers` that might help? |
2021-12-23 11:48:37 +0100 | <dminuoso> | Naively I'd use `toAscList`, groupOn, and then run a nested fromAscList |
2021-12-23 11:49:23 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) |
2021-12-23 11:52:03 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 11:56:17 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Ping timeout: 240 seconds) |
2021-12-23 11:56:29 +0100 | jespada | (~jespada@87.74.33.157) (Ping timeout: 250 seconds) |
2021-12-23 11:57:10 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Remote host closed the connection) |
2021-12-23 11:58:19 +0100 | jespada | (~jespada@87.74.33.157) |
2021-12-23 11:59:23 +0100 | eggplantade | (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4) |
2021-12-23 12:00:34 +0100 | burnsidesLlama | (~burnsides@dhcp168-011.wadham.ox.ac.uk) |
2021-12-23 12:02:32 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) |
2021-12-23 12:03:37 +0100 | eggplantade | (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4) (Ping timeout: 240 seconds) |
2021-12-23 12:06:15 +0100 | ishutin | (~ishutin@78-131-74-101.pool.digikabel.hu) (Ping timeout: 256 seconds) |
2021-12-23 12:06:57 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Ping timeout: 240 seconds) |
2021-12-23 12:07:47 +0100 | ishutin | (~ishutin@80-95-82-198.pool.digikabel.hu) |
2021-12-23 12:08:05 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2021-12-23 12:08:55 +0100 | neceve | (~quassel@2.26.93.228) |
2021-12-23 12:10:49 +0100 | <zero> | what is this: |
2021-12-23 12:10:50 +0100 | <zero> | Suffix occurrence of @. For an as-pattern, remove the leading whitespace. |
2021-12-23 12:10:50 +0100 | <zero> | | |
2021-12-23 12:10:50 +0100 | <zero> | 47 | go m cave@ ~(c:_) |
2021-12-23 12:10:50 +0100 | <zero> | | ^ |
2021-12-23 12:10:52 +0100 | <zero> | ? |
2021-12-23 12:10:57 +0100 | jonathanx | (~jonathan@94.234.52.89) (Ping timeout: 240 seconds) |
2021-12-23 12:11:47 +0100 | <zero> | is this a new 9.2 thing? |
2021-12-23 12:12:02 +0100 | machinedgod | (~machinedg@24.105.81.50) |
2021-12-23 12:12:13 +0100 | <xerox> | which part? |
2021-12-23 12:12:15 +0100 | Vajb | (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer) |
2021-12-23 12:12:22 +0100 | <zero> | the error |
2021-12-23 12:12:49 +0100 | <zero> | never had this error before |
2021-12-23 12:13:00 +0100 | Vajb | (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) |
2021-12-23 12:13:11 +0100 | <mjrosenb> | leading whitespace? not trailing whitespace? |
2021-12-23 12:15:24 +0100 | <zero> | this is how an as pattern irrefutable is supposed to be written, isn't it? |
2021-12-23 12:15:26 +0100 | lambdabot | (~lambdabot@haskell/bot/lambdabot) (Quit: let me try something) |
2021-12-23 12:16:46 +0100 | <zero> | the space in `as@ ~pat` is necessary because otherwise `@~` would be parsed as a unique symbol |
2021-12-23 12:16:50 +0100 | <zero> | right? |
2021-12-23 12:16:52 +0100 | <xerox> | you need parens |
2021-12-23 12:16:54 +0100 | <zero> | what am i missing? |
2021-12-23 12:17:02 +0100 | <xerox> | x@(~(...)) |
2021-12-23 12:17:10 +0100 | <zero> | since when? |
2021-12-23 12:17:34 +0100 | <xerox> | spaces are for different arguments no? |
2021-12-23 12:17:52 +0100 | lambdabot | (~lambdabot@silicon.int-e.eu) |
2021-12-23 12:17:52 +0100 | lambdabot | (~lambdabot@silicon.int-e.eu) (Changing host) |
2021-12-23 12:17:52 +0100 | lambdabot | (~lambdabot@haskell/bot/lambdabot) |
2021-12-23 12:18:45 +0100 | <zero> | never had this problem before |
2021-12-23 12:18:55 +0100 | <zero> | but parens work. thanks |
2021-12-23 12:24:41 +0100 | lambdabot | (~lambdabot@haskell/bot/lambdabot) (Quit: tum tee tum) |
2021-12-23 12:24:49 +0100 | lambdabot | (~lambdabot@haskell/bot/lambdabot) |
2021-12-23 12:25:20 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) |
2021-12-23 12:27:53 +0100 | lambdabot | (~lambdabot@haskell/bot/lambdabot) (Client Quit) |
2021-12-23 12:28:14 +0100 | lambdabot | (~lambdabot@haskell/bot/lambdabot) |
2021-12-23 12:29:56 +0100 | lambdabot | (~lambdabot@haskell/bot/lambdabot) (Client Quit) |
2021-12-23 12:30:06 +0100 | lambdabot | (~lambdabot@silicon.int-e.eu) |
2021-12-23 12:30:06 +0100 | lambdabot | (~lambdabot@silicon.int-e.eu) (Changing host) |
2021-12-23 12:30:06 +0100 | lambdabot | (~lambdabot@haskell/bot/lambdabot) |
2021-12-23 12:30:55 +0100 | <int-e> | > let splitFst = unfoldr (\m -> M.minViewWithKey m >>= \(((k, _),_), _) -> let (m1, m2) = spanAntitone ((<= k) . fst) m in pure ((k, mapKeysMonotonic snd m1), m2)) in splitFst $ M.fromList [((1,2),3),((1,3),2),((2,0),4)] |
2021-12-23 12:31:04 +0100 | <lambdabot> | error: |
2021-12-23 12:31:10 +0100 | <lambdabot> | • Variable not in scope: |
2021-12-23 12:31:27 +0100 | <int-e> | of course. |
2021-12-23 12:31:43 +0100 | <int-e> | > let splitFst = unfoldr (\m -> M.minViewWithKey m >>= \(((k, _),_), _) -> let (m1, m2) = M.spanAntitone ((<= k) . fst) m in pure ((k, mapKeysMonotonic snd m1), m2)) in splitFst $ M.fromList [((1,2),3),((1,3),2),((2,0),4)] |
2021-12-23 12:31:44 +0100 | <lambdabot> | error: |
2021-12-23 12:31:44 +0100 | <lambdabot> | • Variable not in scope: |
2021-12-23 12:31:44 +0100 | <lambdabot> | mapKeysMonotonic :: ((a1, b1) -> b1) -> M.Map (a2, b2) a3 -> b3 |
2021-12-23 12:32:07 +0100 | <int-e> | > let splitFst = unfoldr (\m -> M.minViewWithKey m >>= \(((k, _),_), _) -> let (m1, m2) = M.spanAntitone ((<= k) . fst) m in pure ((k, M.mapKeysMonotonic snd m1), m2)) in splitFst $ M.fromList [((1,2),3),((1,3),2),((2,0),4)] |
2021-12-23 12:32:09 +0100 | <lambdabot> | [(1,fromList [(2,3),(3,2)]),(2,fromList [(0,4)])] |
2021-12-23 12:33:04 +0100 | <int-e> | dminuoso: this /may/ be better than the naive thing, mainly if the groups are large. |
2021-12-23 12:33:39 +0100 | <int-e> | dminuoso: spanAntitone is from Data.Map.Internal though |
2021-12-23 12:34:48 +0100 | <int-e> | and the lambdabot noise was me fixing @let... I didn't realize I broke it with my last experiment maybe a week ago. |
2021-12-23 12:35:32 +0100 | <dminuoso> | int-e: Mmm, that looks neat. |
2021-12-23 12:37:11 +0100 | Guest2359 | (1000@gabilgathol.bandrate.org) (Changing host) |
2021-12-23 12:37:11 +0100 | Guest2359 | (1000@sourcemage/mage/beowulf) |
2021-12-23 12:37:17 +0100 | Guest2359 | |beowulf| |
2021-12-23 12:45:17 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection) |
2021-12-23 12:45:18 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 12:45:35 +0100 | deadmarshal | (~deadmarsh@95.38.231.102) (Ping timeout: 252 seconds) |
2021-12-23 12:45:47 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: closed) |
2021-12-23 12:45:53 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 12:48:21 +0100 | vpan | (~0@212.117.1.172) |
2021-12-23 12:53:40 +0100 | epolanski | (uid312403@id-312403.helmsley.irccloud.com) (Quit: Connection closed for inactivity) |
2021-12-23 12:53:57 +0100 | SummerSonw | (~The_viole@203.77.49.232) |
2021-12-23 12:54:25 +0100 | Erutuon | (~Erutuon@user/erutuon) (Ping timeout: 256 seconds) |
2021-12-23 12:55:00 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) |
2021-12-23 12:56:30 +0100 | Vajb | (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer) |
2021-12-23 12:57:03 +0100 | CiaoSen | (~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
2021-12-23 12:58:16 +0100 | coot | (~coot@89-64-85-93.dynamic.chello.pl) (Remote host closed the connection) |
2021-12-23 13:00:12 +0100 | deadmarshal | (~deadmarsh@95.38.231.102) |
2021-12-23 13:00:31 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection) |
2021-12-23 13:00:32 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 13:01:01 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: closed) |
2021-12-23 13:01:01 +0100 | burnsidesLlama | (~burnsides@dhcp168-011.wadham.ox.ac.uk) (Remote host closed the connection) |
2021-12-23 13:01:03 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
2021-12-23 13:01:25 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 13:01:53 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) |
2021-12-23 13:07:42 +0100 | coot | (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) |
2021-12-23 13:24:58 +0100 | Vajb | (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) |
2021-12-23 13:29:33 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds) |
2021-12-23 13:30:43 +0100 | coot | (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Remote host closed the connection) |
2021-12-23 13:31:46 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
2021-12-23 13:31:46 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
2021-12-23 13:31:46 +0100 | wroathe | (~wroathe@user/wroathe) |
2021-12-23 13:32:05 +0100 | coot | (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) |
2021-12-23 13:34:20 +0100 | coot | (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Remote host closed the connection) |
2021-12-23 13:34:39 +0100 | jlamothe | (~jlamothe@198.251.61.229) (Ping timeout: 256 seconds) |
2021-12-23 13:35:30 +0100 | coot | (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) |
2021-12-23 13:36:43 +0100 | wroathe | (~wroathe@user/wroathe) (Ping timeout: 268 seconds) |
2021-12-23 13:38:21 +0100 | bitmapper | (uid464869@id-464869.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
2021-12-23 13:40:32 +0100 | coot | (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Remote host closed the connection) |
2021-12-23 13:41:49 +0100 | coot | (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) |
2021-12-23 13:48:35 +0100 | coot | (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Remote host closed the connection) |
2021-12-23 13:49:20 +0100 | jeetelongname | (~jeet@88-111-159-26.dynamic.dsl.as9105.com) |
2021-12-23 13:49:23 +0100 | deadmarshal | (~deadmarsh@95.38.231.102) (Ping timeout: 256 seconds) |
2021-12-23 13:49:38 +0100 | loki_ | (~loki@149.red-88-20-26.staticip.rima-tde.net) |
2021-12-23 13:49:56 +0100 | toastloop | (toastloop@user/toastloop) |
2021-12-23 13:50:00 +0100 | coot | (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) |
2021-12-23 13:50:00 +0100 | yauhsien_ | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) |
2021-12-23 13:50:17 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Ping timeout: 268 seconds) |
2021-12-23 13:52:24 +0100 | <loki_> | So I was wondering why |
2021-12-23 13:52:26 +0100 | <loki_> | lucky :: (Integral a) => a -> String |
2021-12-23 13:52:26 +0100 | <loki_> | lucky 7 = "LUCKY NUMBER SEVEN!" |
2021-12-23 13:52:28 +0100 | <loki_> | lucky x = "Sorry, you're out of luck, pal!" |
2021-12-23 13:52:29 +0100 | <loki_> | Works |
2021-12-23 13:52:34 +0100 | <loki_> | but lucky :: (Num a) => a -> String lucky 7 = "LUCKY NUMBER SEVEN!" lucky x = "Sorry, you're out of luck, pal!" |
2021-12-23 13:52:39 +0100 | <loki_> | Doesn't |
2021-12-23 13:52:52 +0100 | lavaman | (~lavaman@98.38.249.169) |
2021-12-23 13:53:09 +0100 | <loki_> | The second example should be: |
2021-12-23 13:53:13 +0100 | <loki_> | lucky :: (Num a) => a -> String |
2021-12-23 13:53:21 +0100 | <loki_> | lucky 7 = "lucky 7!" |
2021-12-23 13:53:23 +0100 | <loki_> | lucky x = "Sorry, you're out of luck, pal!" |
2021-12-23 13:53:47 +0100 | jeetelongname | (~jeet@88-111-159-26.dynamic.dsl.as9105.com) (Ping timeout: 252 seconds) |
2021-12-23 13:53:53 +0100 | <hpc> | (or use semicolons if you really absolutely must for whatever reason have it all on one line) |
2021-12-23 13:54:21 +0100 | <hpc> | ((if you're putting this in ghci, try :{ and :} around your multiline definition as well)) |
2021-12-23 13:54:35 +0100 | <hpc> | (((or just use a file :P))) |
2021-12-23 13:54:39 +0100 | <loki_> | (thanks) |
2021-12-23 13:54:43 +0100 | <loki_> | ((also thanks)) |
2021-12-23 13:54:46 +0100 | <hpc> | :D |
2021-12-23 13:54:49 +0100 | <geekosaur> | pattern matching on numbers secretly uses an Eq instance; this may be present for Integral, but it's absent for Num these days |
2021-12-23 13:54:52 +0100 | <loki_> | (((also, I was using a file))) |
2021-12-23 13:55:05 +0100 | coot | (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Remote host closed the connection) |
2021-12-23 13:55:15 +0100 | <hpc> | ah, that's probably what it is then |
2021-12-23 13:55:42 +0100 | raehik | (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
2021-12-23 13:55:48 +0100 | <geekosaur> | I'd want to see the error message, since "doesn't work" doesn't tell me much |
2021-12-23 13:56:18 +0100 | coot | (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) |
2021-12-23 13:56:57 +0100 | lavaman | (~lavaman@98.38.249.169) (Ping timeout: 240 seconds) |
2021-12-23 13:57:12 +0100 | <loki_> | It's: |
2021-12-23 13:57:16 +0100 | <loki_> | Could not deduce (Eq a) arising from the literal ‘7’ |
2021-12-23 13:57:16 +0100 | <geekosaur> | %% :info Integral |
2021-12-23 13:57:18 +0100 | <yahb> | geekosaur: http://qp.mniip.com/y/36 |
2021-12-23 13:57:21 +0100 | <geekosaur> | yep |
2021-12-23 13:57:25 +0100 | Benzi-Junior | (~BenziJuni@88-149-66-61.du.xdsl.is) (Ping timeout: 240 seconds) |
2021-12-23 13:57:27 +0100 | <loki_> | from the context: Num a |
2021-12-23 13:57:53 +0100 | <loki_> | But it feels like it should be able to deduce Eq from Num, no? |
2021-12-23 13:58:02 +0100 | <geekosaur> | Not for several years |
2021-12-23 13:58:26 +0100 | <loki_> | Do you know why? |
2021-12-23 13:58:28 +0100 | <geekosaur> | I don't recall why Eq and Show were removed from Num at this point |
2021-12-23 13:58:30 +0100 | coot | (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Client Quit) |
2021-12-23 13:58:34 +0100 | <geekosaur> | Haskell 98 required them |
2021-12-23 13:59:56 +0100 | deadmarshal | (~deadmarsh@95.38.231.102) |
2021-12-23 14:02:20 +0100 | loki_ | (~loki@149.red-88-20-26.staticip.rima-tde.net) () |
2021-12-23 14:02:35 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
2021-12-23 14:02:35 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
2021-12-23 14:02:35 +0100 | wroathe | (~wroathe@user/wroathe) |
2021-12-23 14:04:42 +0100 | loki_ | (~loki@149.red-88-20-26.staticip.rima-tde.net) |
2021-12-23 14:06:13 +0100 | max22- | (~maxime@2a01cb088335980010d18673f284ce01.ipv6.abo.wanadoo.fr) (Ping timeout: 240 seconds) |
2021-12-23 14:07:31 +0100 | wroathe | (~wroathe@user/wroathe) (Ping timeout: 256 seconds) |
2021-12-23 14:10:21 +0100 | jakalx | (~jakalx@base.jakalx.net) () |
2021-12-23 14:11:11 +0100 | jakalx | (~jakalx@base.jakalx.net) |
2021-12-23 14:11:21 +0100 | hololeap | (~hololeap@user/hololeap) (Remote host closed the connection) |
2021-12-23 14:12:15 +0100 | yauhsien_ | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Remote host closed the connection) |
2021-12-23 14:12:40 +0100 | hololeap | (~hololeap@user/hololeap) |
2021-12-23 14:13:00 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) |
2021-12-23 14:14:23 +0100 | pretty_dumm_guy | (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) |
2021-12-23 14:14:37 +0100 | Akiva | (~Akiva@user/Akiva) (Ping timeout: 240 seconds) |
2021-12-23 14:18:50 +0100 | loki_ | (~loki@149.red-88-20-26.staticip.rima-tde.net) (Quit: leaving) |
2021-12-23 14:18:52 +0100 | Vajb | (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer) |
2021-12-23 14:19:33 +0100 | loki_ | (~loki@149.red-88-20-26.staticip.rima-tde.net) |
2021-12-23 14:21:05 +0100 | Vajb | (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) |
2021-12-23 14:26:09 +0100 | aliosablack | (~chomwitt@ppp-2-85-245-134.home.otenet.gr) (Quit: Leaving) |
2021-12-23 14:26:28 +0100 | aliosablack | (~chomwitt@2a02:587:dc1c:a00:12c3:7bff:fe6d:d374) |
2021-12-23 14:27:23 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Remote host closed the connection) |
2021-12-23 14:27:26 +0100 | slowButPresent | (~slowButPr@user/slowbutpresent) |
2021-12-23 14:27:35 +0100 | Vajb | (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer) |
2021-12-23 14:27:46 +0100 | Vajb | (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) |
2021-12-23 14:28:10 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) |
2021-12-23 14:29:39 +0100 | timCF | (~timCF@m91-129-100-224.cust.tele2.ee) |
2021-12-23 14:30:03 +0100 | Vajb | (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer) |
2021-12-23 14:30:28 +0100 | Vajb | (~Vajb@2001:999:62:e042:be01:afcc:85c5:1e46) |
2021-12-23 14:33:19 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
2021-12-23 14:33:19 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
2021-12-23 14:33:19 +0100 | wroathe | (~wroathe@user/wroathe) |
2021-12-23 14:34:55 +0100 | fef | (~thedawn@user/thedawn) |
2021-12-23 14:38:02 +0100 | wroathe | (~wroathe@user/wroathe) (Ping timeout: 240 seconds) |
2021-12-23 14:38:27 +0100 | toastloop | (toastloop@user/toastloop) (Quit: Leaving) |
2021-12-23 14:40:15 +0100 | ProfSimm | (~ProfSimm@87.227.196.109) |
2021-12-23 14:40:57 +0100 | deadmarshal | (~deadmarsh@95.38.231.102) (Ping timeout: 256 seconds) |
2021-12-23 14:47:49 +0100 | deadmarshal | (~deadmarsh@95.38.231.102) |
2021-12-23 14:49:18 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2021-12-23 14:55:02 +0100 | Benzi-Junior | (~BenziJuni@dsl-149-66-61.hive.is) |
2021-12-23 14:56:42 +0100 | timCF | (~timCF@m91-129-100-224.cust.tele2.ee) (Quit: leaving) |
2021-12-23 14:58:24 +0100 | <int-e> | dminuoso: or you could go crazy and emulate treeowl: https://gist.github.com/int-e/d8caa46bcc784df86f9997abc5cafff1 |
2021-12-23 15:03:08 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) |
2021-12-23 15:04:22 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija))) |
2021-12-23 15:04:23 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2021-12-23 15:06:27 +0100 | falafel_ | (~falafel@cpe-76-168-195-162.socal.res.rr.com) (Ping timeout: 256 seconds) |
2021-12-23 15:07:37 +0100 | <int-e> | (oops, that didn't compile; now it does) |
2021-12-23 15:10:10 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) |
2021-12-23 15:12:00 +0100 | eron | (~eron@186.192.87.8) |
2021-12-23 15:15:09 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
2021-12-23 15:15:09 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
2021-12-23 15:15:09 +0100 | wroathe | (~wroathe@user/wroathe) |
2021-12-23 15:20:26 +0100 | wroathe | (~wroathe@user/wroathe) (Ping timeout: 260 seconds) |
2021-12-23 15:20:37 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
2021-12-23 15:22:19 +0100 | mncheck | (~mncheck@193.224.205.254) (Ping timeout: 256 seconds) |
2021-12-23 15:22:26 +0100 | acidjnk | (~acidjnk@p200300d0c7271e77d154eb1f1200bcdb.dip0.t-ipconnect.de) (Ping timeout: 245 seconds) |
2021-12-23 15:23:05 +0100 | max22- | (~maxime@2a01cb0883359800ba08fcf16942d473.ipv6.abo.wanadoo.fr) |
2021-12-23 15:31:31 +0100 | jlamothe | (~jlamothe@198.251.61.229) |
2021-12-23 15:33:09 +0100 | briandaed | (~root@185.234.208.208.r.toneticgroup.pl) (Quit: Lost terminal) |
2021-12-23 15:33:28 +0100 | mncheck | (~mncheck@193.224.205.254) |
2021-12-23 15:33:30 +0100 | machinedgod | (~machinedg@24.105.81.50) (Ping timeout: 260 seconds) |
2021-12-23 15:39:17 +0100 | justsomeguy | (~justsomeg@user/justsomeguy) (Ping timeout: 240 seconds) |
2021-12-23 15:47:37 +0100 | chomwitt | (~chomwitt@ppp-2-85-245-134.home.otenet.gr) (Ping timeout: 240 seconds) |
2021-12-23 15:47:57 +0100 | aliosablack | (~chomwitt@2a02:587:dc1c:a00:12c3:7bff:fe6d:d374) (Ping timeout: 240 seconds) |
2021-12-23 15:54:15 +0100 | benin | (~benin@183.82.27.57) (Ping timeout: 268 seconds) |
2021-12-23 15:56:47 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) |
2021-12-23 15:57:58 +0100 | <hololeap> | how often do people use type names as quasi-documentation, for instance type Steps = Int ? the significant problem with it seems to be a newcomer won't know what Steps actually is without looking for the definition |
2021-12-23 15:58:08 +0100 | Sgeo | (~Sgeo@user/sgeo) |
2021-12-23 15:59:00 +0100 | <hololeap> | I'm tempted to define it as `newtype Steps a = Steps a` so that I can have `Steps Int` and that solves both problems |
2021-12-23 16:00:15 +0100 | <geekosaur> | the significant probloem some would claim for it is it looks like a distinct type, but isn't, thus giving a falkse sense of type safety |
2021-12-23 16:01:02 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
2021-12-23 16:01:50 +0100 | dextaa5 | dextaa |
2021-12-23 16:02:07 +0100 | <hololeap> | yeah, I guess you can't substitute real documentation |
2021-12-23 16:02:16 +0100 | notzmv | (~zmv@user/notzmv) (Ping timeout: 268 seconds) |
2021-12-23 16:02:18 +0100 | eggplantade | (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4) |
2021-12-23 16:02:42 +0100 | benin | (~benin@183.82.27.57) |
2021-12-23 16:04:49 +0100 | SummerSonw | (~The_viole@203.77.49.232) (Ping timeout: 256 seconds) |
2021-12-23 16:04:55 +0100 | shapr | (~user@pool-100-36-247-68.washdc.fios.verizon.net) (Read error: Connection reset by peer) |
2021-12-23 16:05:41 +0100 | shapr | (~user@pool-100-36-247-68.washdc.fios.verizon.net) |
2021-12-23 16:06:37 +0100 | eggplantade | (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4) (Ping timeout: 240 seconds) |
2021-12-23 16:07:54 +0100 | justsomeguy | (~justsomeg@user/justsomeguy) |
2021-12-23 16:07:56 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Remote host closed the connection) |
2021-12-23 16:08:43 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) |
2021-12-23 16:12:50 +0100 | coot | (~coot@89-64-85-93.dynamic.chello.pl) |
2021-12-23 16:13:25 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Ping timeout: 240 seconds) |
2021-12-23 16:14:32 +0100 | vpan | (~0@212.117.1.172) (Quit: Leaving.) |
2021-12-23 16:18:51 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) |
2021-12-23 16:21:47 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
2021-12-23 16:21:47 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
2021-12-23 16:21:47 +0100 | wroathe | (~wroathe@user/wroathe) |
2021-12-23 16:22:00 +0100 | zangi | (~zangi@103.154.230.133) (Quit: zangi) |
2021-12-23 16:22:33 +0100 | coot | (~coot@89-64-85-93.dynamic.chello.pl) (Remote host closed the connection) |
2021-12-23 16:23:01 +0100 | zaquest | (~notzaques@5.130.79.72) (Remote host closed the connection) |
2021-12-23 16:23:26 +0100 | bu5hyt0p_ | (~rmsare@2601:281:c780:a510:31c5:bd6a:19eb:499b) |
2021-12-23 16:24:01 +0100 | coot | (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) |
2021-12-23 16:24:07 +0100 | zaquest | (~notzaques@5.130.79.72) |
2021-12-23 16:26:53 +0100 | jgeerds | (~jgeerds@55d4ac73.access.ecotel.net) (Ping timeout: 250 seconds) |
2021-12-23 16:32:06 +0100 | [itchyjunk] | (~itchyjunk@user/itchyjunk/x-7353470) |
2021-12-23 16:32:16 +0100 | coot | (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Remote host closed the connection) |
2021-12-23 16:37:53 +0100 | coot | (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) |
2021-12-23 16:38:29 +0100 | n3rdy1 | (~n3rdy1@2601:281:c780:a510:31c5:bd6a:19eb:499b) |
2021-12-23 16:38:44 +0100 | justsomeguy | (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.3) |
2021-12-23 16:38:55 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) |
2021-12-23 16:39:52 +0100 | bu5hyt0p_ | (~rmsare@2601:281:c780:a510:31c5:bd6a:19eb:499b) () |
2021-12-23 16:43:11 +0100 | chomwitt | (~chomwitt@ppp-2-85-245-134.home.otenet.gr) |
2021-12-23 16:43:12 +0100 | aliosablack | (~chomwitt@ppp-2-85-245-134.home.otenet.gr) |
2021-12-23 16:45:46 +0100 | lavaman | (~lavaman@98.38.249.169) |
2021-12-23 16:46:20 +0100 | loki_ | (~loki@149.red-88-20-26.staticip.rima-tde.net) (Quit: leaving) |
2021-12-23 16:47:55 +0100 | dschrempf | (~dominik@070-207.dynamic.dsl.fonira.net) |
2021-12-23 16:49:22 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
2021-12-23 16:50:14 +0100 | coot | (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Quit: coot) |
2021-12-23 16:51:28 +0100 | coot | (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) |
2021-12-23 16:52:19 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2021-12-23 16:54:45 +0100 | arjun | (~arjun@user/arjun) |
2021-12-23 16:55:37 +0100 | dsrt^ | (~dsrt@64.253.22.77) (Ping timeout: 240 seconds) |
2021-12-23 16:56:39 +0100 | dsrt^ | (~dsrt@64.253.22.77) |
2021-12-23 16:56:44 +0100 | <Inst> | :t join |
2021-12-23 16:56:45 +0100 | <lambdabot> | Monad m => m (m a) -> m a |
2021-12-23 16:57:24 +0100 | mncheck | (~mncheck@193.224.205.254) (Quit: Leaving) |
2021-12-23 16:58:13 +0100 | <Inst> | :t return |
2021-12-23 16:58:14 +0100 | <lambdabot> | Monad m => a -> m a |
2021-12-23 17:00:03 +0100 | chozorho | (~chozorho@2601:146:300:c30::9401) |
2021-12-23 17:00:42 +0100 | <[exa]> | o ye great truths of the universe |
2021-12-23 17:03:18 +0100 | dschrempf | (~dominik@070-207.dynamic.dsl.fonira.net) (Ping timeout: 268 seconds) |
2021-12-23 17:03:52 +0100 | arjun | (~arjun@user/arjun) (Remote host closed the connection) |
2021-12-23 17:05:06 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2021-12-23 17:05:38 +0100 | machinedgod | (~machinedg@24.105.81.50) |
2021-12-23 17:07:15 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) |
2021-12-23 17:07:56 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds) |
2021-12-23 17:10:06 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Ping timeout: 268 seconds) |
2021-12-23 17:11:26 +0100 | zmt00 | (~zmt00@user/zmt00) |
2021-12-23 17:14:02 +0100 | mncheck | (~mncheck@193.224.205.254) |
2021-12-23 17:17:14 +0100 | jgeerds | (~jgeerds@55d4ac73.access.ecotel.net) |
2021-12-23 17:18:37 +0100 | Inst | (~delicacie@2601:6c4:4080:3f80:d9cb:b805:baaa:394f) (Ping timeout: 240 seconds) |
2021-12-23 17:18:45 +0100 | jgeerds_ | (~jgeerds@55d4ac73.access.ecotel.net) |
2021-12-23 17:21:46 +0100 | jgeerds | (~jgeerds@55d4ac73.access.ecotel.net) (Ping timeout: 260 seconds) |
2021-12-23 17:24:14 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Remote host closed the connection) |
2021-12-23 17:24:54 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) |
2021-12-23 17:25:47 +0100 | <ProfSimm> | In Haskell, can I create a type which has custom (polymorphic) implementations of core functions, so those functions can work with my custom type? |
2021-12-23 17:28:16 +0100 | jollygood2 | (~bc8147f2@cerf.good1.com) |
2021-12-23 17:28:17 +0100 | xff0x | (~xff0x@2001:1a81:52d0:e400:55eb:e48f:480a:9ef0) (Ping timeout: 252 seconds) |
2021-12-23 17:29:24 +0100 | xff0x | (~xff0x@2001:1a81:52d0:e400:f16b:c82a:3197:1eaa) |
2021-12-23 17:31:28 +0100 | <[exa]> | ProfSimm: depends on which core functions. Usually not in general, e.g. it's hard to overload `length`. |
2021-12-23 17:31:54 +0100 | Bartol | (~Bartol@user/Bartol) (Quit: Lost terminal) |
2021-12-23 17:32:09 +0100 | <zero> | what? |
2021-12-23 17:32:22 +0100 | <monochrom> | But length is now a method of Foldable, overloadable. :) |
2021-12-23 17:32:26 +0100 | <zero> | @type length |
2021-12-23 17:32:27 +0100 | <lambdabot> | Foldable t => t a -> Int |
2021-12-23 17:32:30 +0100 | <zero> | yeah |
2021-12-23 17:32:40 +0100 | <monochrom> | You may have to pick another example, like fst. |
2021-12-23 17:32:55 +0100 | <zero> | just make your type an instance of Foldable and overload length as you wish |
2021-12-23 17:33:09 +0100 | <monochrom> | But let's take a step back. I don't think we even know what the question means. |
2021-12-23 17:33:28 +0100 | <geekosaur> | that was my problem. I'm not even sure how to ask for a clarification |
2021-12-23 17:33:59 +0100 | <monochrom> | "Show an example?" always works, but I didn't bother. |
2021-12-23 17:36:08 +0100 | <zero> | what are "core" functions? |
2021-12-23 17:36:08 +0100 | Vajb | (~Vajb@2001:999:62:e042:be01:afcc:85c5:1e46) (Read error: Connection reset by peer) |
2021-12-23 17:36:20 +0100 | Vajb | (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) |
2021-12-23 17:36:53 +0100 | <geekosaur> | in any case, if the function is part of a typeclass then you'd instance the typeclass for your type |
2021-12-23 17:37:16 +0100 | <geekosaur> | if it's not, there's not much you can do |
2021-12-23 17:37:36 +0100 | <geekosaur> | but as zero notes, we may have different notions of "core function" |
2021-12-23 17:37:57 +0100 | joo-_ | (~joo-_@fsf/member/joo--) (Ping timeout: 240 seconds) |
2021-12-23 17:39:12 +0100 | Vajb | (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer) |
2021-12-23 17:39:15 +0100 | <ProfSimm> | Well let's say I want "length" to work with a type I made where length is calculated in some bizarre way. |
2021-12-23 17:39:22 +0100 | <ProfSimm> | I make a typeclass? |
2021-12-23 17:39:40 +0100 | <geekosaur> | :t length |
2021-12-23 17:39:40 +0100 | <zero> | you make an instance |
2021-12-23 17:39:41 +0100 | <lambdabot> | Foldable t => t a -> Int |
2021-12-23 17:39:49 +0100 | <geekosaur> | so you make an instance of Foldable |
2021-12-23 17:39:52 +0100 | <monochrom> | Check out the Foldable type class in the standard library. It already exists. |
2021-12-23 17:39:57 +0100 | joo-_ | (~joo-_@87-49-147-205-mobile.dk.customer.tdc.net) |
2021-12-23 17:39:57 +0100 | joo-_ | (~joo-_@87-49-147-205-mobile.dk.customer.tdc.net) (Changing host) |
2021-12-23 17:39:57 +0100 | joo-_ | (~joo-_@fsf/member/joo--) |
2021-12-23 17:40:04 +0100 | <zero> | instance Foldable Yourtype where length = ... |
2021-12-23 17:40:34 +0100 | <ProfSimm> | Oh yes, typeclass is interfaces and types are classes, I'm thinking in OOP terms |
2021-12-23 17:40:36 +0100 | <monochrom> | But I am sure the real problem does not involve length. |
2021-12-23 17:40:55 +0100 | <monochrom> | s/problem/question/ |
2021-12-23 17:41:06 +0100 | <zero> | ProfSimm: not *really* interfaces, but close enough |
2021-12-23 17:41:06 +0100 | <ProfSimm> | monochrom: the real problem was more a general mechanism of how this is best done so I think it kinda answers my question |
2021-12-23 17:41:25 +0100 | <ProfSimm> | zero: what would be the main differences you'd say? |
2021-12-23 17:42:05 +0100 | Bartol | (~Bartol@user/Bartol) |
2021-12-23 17:42:06 +0100 | Bartol | (~Bartol@user/Bartol) (Client Quit) |
2021-12-23 17:42:20 +0100 | Bartol | (~Bartol@user/Bartol) |
2021-12-23 17:42:27 +0100 | burnsidesLlama | (~burnsides@dhcp168-011.wadham.ox.ac.uk) |
2021-12-23 17:42:46 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Remote host closed the connection) |
2021-12-23 17:43:25 +0100 | <geekosaur> | most OOP systems would let you override e.g. length even for an individual object, as long as you conformed to the interface. in Haskelll the "interface" belongs to the type, and in the background it's passing around a record of implementation functions |
2021-12-23 17:43:31 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) |
2021-12-23 17:44:01 +0100 | <ProfSimm> | geekosaur: oh I think many OOP languages you'd find also restrict interface implementation to the whole type |
2021-12-23 17:44:16 +0100 | <monochrom> | In Java, an interface is a type. In Haskell, a class is not a type. |
2021-12-23 17:44:32 +0100 | <monochrom> | There are more. |
2021-12-23 17:44:54 +0100 | <ProfSimm> | monochrom: I didn't get that sorry |
2021-12-23 17:45:06 +0100 | <ProfSimm> | In Java, both interfaces and classes are types |
2021-12-23 17:45:27 +0100 | <ProfSimm> | But interfaces are abstract which I suppose would be like typeclasses no |
2021-12-23 17:45:36 +0100 | <geekosaur> | you cannot, for example, use Foldable as a type in Haskell |
2021-12-23 17:45:41 +0100 | <geekosaur> | you use them as constraints |
2021-12-23 17:45:46 +0100 | <geekosaur> | :t length |
2021-12-23 17:45:47 +0100 | <lambdabot> | Foldable t => t a -> Int |
2021-12-23 17:45:51 +0100 | wroathe | (~wroathe@user/wroathe) (Ping timeout: 268 seconds) |
2021-12-23 17:46:00 +0100 | <monochrom> | The similarity comes from the fact that they solve the same problem. |
2021-12-23 17:46:27 +0100 | <monochrom> | The difference means that they solve the problem from different approaches. |
2021-12-23 17:46:46 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Remote host closed the connection) |
2021-12-23 17:46:47 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
2021-12-23 17:46:47 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
2021-12-23 17:46:47 +0100 | wroathe | (~wroathe@user/wroathe) |
2021-12-23 17:46:55 +0100 | <geekosaur> | in Java you'd write the equivalent of `Foldable a -> Int`, but you can't use a typeclass that way in Haskell |
2021-12-23 17:48:03 +0100 | slowtype- | (~slowtyper@79.103.178.210.dsl.dyn.forthnet.gr) |
2021-12-23 17:48:05 +0100 | slowtyper | (~slowtyper@user/slowtyper) (Ping timeout: 252 seconds) |
2021-12-23 17:48:15 +0100 | <zero> | in haskell you can constrain the same polymorphic type variable by multiple classes |
2021-12-23 17:48:37 +0100 | <zero> | hum |
2021-12-23 17:48:47 +0100 | <zero> | not sure i phrased that correctly |
2021-12-23 17:48:50 +0100 | <monochrom> | I have a problem, I want to do something fun. I have two friends proposing two solutions, one is to play AOE4, the other is to learn more math. |
2021-12-23 17:48:57 +0100 | lavaman | (~lavaman@98.38.249.169) (Ping timeout: 240 seconds) |
2021-12-23 17:49:11 +0100 | <monochrom> | Now suddenly playing AOE4 and learning more math are "the same" just because they solve the same problem. |
2021-12-23 17:49:25 +0100 | <monochrom> | Or even remotely related. |
2021-12-23 17:49:30 +0100 | <int-e> | fun. |
2021-12-23 17:49:59 +0100 | <ProfSimm> | Well I'm not saying they're the same, I'm trying to learn how they're not the same |
2021-12-23 17:50:13 +0100 | <zero> | (Math a, AOE4 a) => Monochrom -> a -> Fun |
2021-12-23 17:50:43 +0100 | <monochrom> | At any rate, I now study the Giry monad and going deep into abstract measure theory during the day, and grind AOE4 during the night. |
2021-12-23 17:51:11 +0100 | mbuf | (~Shakthi@223.178.76.172) (Quit: Leaving) |
2021-12-23 17:51:21 +0100 | <monochrom> | Did you know that you can have a probability distribution over probability distributions? >:) |
2021-12-23 17:51:31 +0100 | <geekosaur> | zero, I think it's closer to both AOE and Math instance MonochromFun |
2021-12-23 17:51:44 +0100 | <zero> | geekosaur: i agree |
2021-12-23 17:52:12 +0100 | <int-e> | monochrom: Ah. That's why this name sounded familiar... |
2021-12-23 17:52:26 +0100 | analognoise | (~analognoi@23.105.41.153) (Read error: Connection reset by peer) |
2021-12-23 17:52:41 +0100 | <int-e> | monochrom: from here: https://isabelle.in.tum.de/library/HOL/HOL-Probability/Giry_Monad.html |
2021-12-23 17:53:00 +0100 | <monochrom> | w00t HOL |
2021-12-23 17:53:07 +0100 | <int-e> | Isabelle/HOL |
2021-12-23 17:53:17 +0100 | <int-e> | (not to be confused with HOL4) |
2021-12-23 17:53:32 +0100 | <monochrom> | Haskell classes are really much closer to C++ overloading than any Java/Scala "interface" notion. |
2021-12-23 17:53:54 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) |
2021-12-23 17:54:18 +0100 | <monochrom> | Classes are groupings of overloadable operators. This "overloadable" is in the C++ sense. |
2021-12-23 17:54:24 +0100 | <zero> | it's just that Haskell's overloading is organised |
2021-12-23 17:54:37 +0100 | jeetelongname | (~jeet@88-111-159-26.dynamic.dsl.as9105.com) |
2021-12-23 17:54:41 +0100 | <monochrom> | Indeed C++ concepts are a generalization of Haskell classes. |
2021-12-23 17:55:01 +0100 | <monochrom> | Yeah I say "organized overloading". |
2021-12-23 17:55:08 +0100 | <int-e> | https://swizec.com/blog/week-20-making-adhoc-polymorphism-less-ad-hoc |
2021-12-23 17:55:10 +0100 | Vajb | (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) |
2021-12-23 17:55:45 +0100 | alfonsox | (~quassel@103.92.42.192) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
2021-12-23 17:56:18 +0100 | <zero> | i wonder... what if class constraints were mandatory for every type variable? |
2021-12-23 17:56:57 +0100 | <int-e> | then we wouldn't be here |
2021-12-23 17:57:30 +0100 | <monochrom> | Then you would need a class that has no methods so you can translate "id :: a -> a" to "id :: Type a => a -> a" |
2021-12-23 17:57:33 +0100 | <geekosaur> | zero: what constraint would you give to a in the type of length? |
2021-12-23 17:58:35 +0100 | <monochrom> | > let i :: () => a -> a; i x = x in i "Phone" |
2021-12-23 17:58:36 +0100 | <lambdabot> | "Phone" |
2021-12-23 17:58:48 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Ping timeout: 268 seconds) |
2021-12-23 17:58:48 +0100 | <monochrom> | There is your mandatory constraint. >:) |
2021-12-23 17:59:23 +0100 | <monochrom> | > let j :: () => Int; j = 4 in j |
2021-12-23 17:59:24 +0100 | <lambdabot> | 4 |
2021-12-23 17:59:30 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija))) |
2021-12-23 17:59:30 +0100 | finn_elija | (~finn_elij@user/finn-elija/x-0085643) |
2021-12-23 17:59:30 +0100 | finn_elija | FinnElija |
2021-12-23 17:59:40 +0100 | <monochrom> | You can even mandate constraints for type constants, too >:) |
2021-12-23 17:59:46 +0100 | <zero> | geekosaur: Lenghtable :p |
2021-12-23 17:59:55 +0100 | <zero> | i get the point |
2021-12-23 18:00:10 +0100 | <geekosaur> | but lengthable applies to the Foldable, not the element type |
2021-12-23 18:00:26 +0100 | <zero> | ah i see |
2021-12-23 18:01:22 +0100 | <zero> | nevermind then |
2021-12-23 18:01:41 +0100 | <geekosaur> | in fact the lack of constraint on `a` there tells you something important: `length` cannot inspect `a`s |
2021-12-23 18:01:42 +0100 | <monochrom> | Tautologies and vacuity solve a lot of problems. :) |
2021-12-23 18:02:20 +0100 | <zero> | what if we allowed functions with no constraints to be arbitrarily overloaded then? |
2021-12-23 18:02:45 +0100 | <int-e> | how is the compiler supposed to know which one you want? |
2021-12-23 18:02:50 +0100 | <geekosaur> | then we'd have the kind of zoo C++ has, where >> can be both a bitshoift and an input operation |
2021-12-23 18:02:56 +0100 | <zero> | by the type |
2021-12-23 18:03:12 +0100 | <int-e> | but we like types to be inferred |
2021-12-23 18:03:54 +0100 | eggplantade | (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4) |
2021-12-23 18:04:06 +0100 | <zero> | yes, so unconstrained functions would be inferred |
2021-12-23 18:04:57 +0100 | raehik | (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 256 seconds) |
2021-12-23 18:04:57 +0100 | <zero> | well i'm not thinking very deeply about this |
2021-12-23 18:05:11 +0100 | <monochrom> | Just look at C++. It already does that. |
2021-12-23 18:05:25 +0100 | <monochrom> | It is very doable. |
2021-12-23 18:05:39 +0100 | <monochrom> | The issue though is error messages. |
2021-12-23 18:05:52 +0100 | <int-e> | zero: To me, you have a vague idea of a solution that is looking for a problem. |
2021-12-23 18:06:00 +0100 | <zero> | int-e: yes |
2021-12-23 18:06:07 +0100 | <int-e> | It's hard to take it seriously. |
2021-12-23 18:06:19 +0100 | <zero> | i'm just spitballing |
2021-12-23 18:06:26 +0100 | <monochrom> | Joke on book reviews: "This book fills a much needed gap." |
2021-12-23 18:06:44 +0100 | <zero> | :) |
2021-12-23 18:07:57 +0100 | eggplantade | (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4) (Ping timeout: 240 seconds) |
2021-12-23 18:08:39 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2021-12-23 18:09:39 +0100 | <zero> | ok, so making unconstrained functions overloadable (but having to respect the more general polymorphic type signature) would be equivalent to... |
2021-12-23 18:10:36 +0100 | <zero> | having one class per... wait |
2021-12-23 18:12:01 +0100 | notzmv | (~zmv@user/notzmv) |
2021-12-23 18:13:01 +0100 | jgeerds_ | (~jgeerds@55d4ac73.access.ecotel.net) (Ping timeout: 240 seconds) |
2021-12-23 18:16:13 +0100 | <zero> | hypothesizing is important, even if it leads nowhere |
2021-12-23 18:16:43 +0100 | <geekosaur> | if you learn something from it, it is |
2021-12-23 18:17:15 +0100 | <zero> | fun is a better goal than knowledge |
2021-12-23 18:18:18 +0100 | <ProfSimm> | In OOP languages I type foo. and I see a list of methods I can apply to foo. What's the alternative in Haskell given I type the function first? |
2021-12-23 18:18:25 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) |
2021-12-23 18:19:05 +0100 | <zero> | hoogle |
2021-12-23 18:19:28 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) |
2021-12-23 18:19:59 +0100 | <zero> | https://hoogle.haskell.org |
2021-12-23 18:20:09 +0100 | lbseale | (~ep1ctetus@user/ep1ctetus) |
2021-12-23 18:20:10 +0100 | <shapr> | also haskell-language-server with type holes |
2021-12-23 18:20:54 +0100 | <zero> | ProfSimm: oh wait, is foo a type? |
2021-12-23 18:21:05 +0100 | <ProfSimm> | Hmm is there no some immediate feedback |
2021-12-23 18:21:22 +0100 | <shapr> | you can get 'intellisense' completion with haskell-language-server |
2021-12-23 18:21:27 +0100 | <geekosaur> | hls gives you immediate feedback |
2021-12-23 18:21:43 +0100 | <ProfSimm> | I mean, how would it work when i type the function first before the argument |
2021-12-23 18:21:56 +0100 | <shapr> | but you'll likely want to use type holes to break it down |
2021-12-23 18:22:18 +0100 | <shapr> | you could also use wingman to do case splits and etc |
2021-12-23 18:23:01 +0100 | <zero> | you can also type `:info Int` into ghci for example to list all it's classes |
2021-12-23 18:23:04 +0100 | <shapr> | ProfSimm: check out the demos? https://haskell-language-server.readthedocs.io/en/latest/features.html#demos |
2021-12-23 18:26:11 +0100 | <zero> | ProfSimm: you might be thinking backwards. if you are typing a function, you must know what type the argument is, right? because if you ask for a list of possible types, that list is ptentially infinite. the relevant thing t know in that situation would be the type of the function you just typed |
2021-12-23 18:26:47 +0100 | <zero> | what would you expect to get when typing `id` ? |
2021-12-23 18:37:49 +0100 | wroathe | (~wroathe@user/wroathe) (Ping timeout: 256 seconds) |
2021-12-23 18:38:29 +0100 | kuribas | (~user@ptr-25vy0i8krrkad5xv3l1.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 26.3)) |
2021-12-23 18:41:29 +0100 | niemand | (~niemand@p5796adc9.dip0.t-ipconnect.de) |
2021-12-23 18:41:38 +0100 | niemand | (~niemand@p5796adc9.dip0.t-ipconnect.de) () |
2021-12-23 18:43:28 +0100 | Akiva | (~Akiva@user/Akiva) |
2021-12-23 18:47:12 +0100 | econo | (uid147250@user/econo) |
2021-12-23 18:49:31 +0100 | yin | (~yin@user/zero) (Remote host closed the connection) |
2021-12-23 18:50:42 +0100 | coot | (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Remote host closed the connection) |
2021-12-23 18:52:00 +0100 | eggplantade | (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4) |
2021-12-23 18:54:52 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
2021-12-23 18:54:52 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
2021-12-23 18:54:52 +0100 | wroathe | (~wroathe@user/wroathe) |
2021-12-23 18:58:11 +0100 | <monochrom> | This is why we say we're doing "functional programming". |
2021-12-23 18:58:26 +0100 | <monochrom> | And why the other guys say they're doing "object programming". |
2021-12-23 18:59:55 +0100 | wroathe | (~wroathe@user/wroathe) (Ping timeout: 256 seconds) |
2021-12-23 19:02:39 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2021-12-23 19:05:39 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) |
2021-12-23 19:06:36 +0100 | coolnickname | (uid531864@user/coolnickname) (Quit: Connection closed for inactivity) |
2021-12-23 19:08:31 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
2021-12-23 19:08:31 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
2021-12-23 19:08:31 +0100 | wroathe | (~wroathe@user/wroathe) |
2021-12-23 19:09:08 +0100 | <EvanR> | when I type a function, I want an immediate list of possible arguments to apply it to xD |
2021-12-23 19:09:34 +0100 | <EvanR> | but seriously there's been much said about "power of the dot" OOP tooling |
2021-12-23 19:09:47 +0100 | tzh | (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) |
2021-12-23 19:10:29 +0100 | geekosaur | (~geekosaur@xmonad/geekosaur) (Remote host closed the connection) |
2021-12-23 19:11:52 +0100 | <EvanR> | the haskell equivalent would be ModuleName.<showMeTheThings> or upcoming myRecord.<showMeTheFields> |
2021-12-23 19:13:00 +0100 | geekosaur | (~geekosaur@xmonad/geekosaur) |
2021-12-23 19:15:17 +0100 | deadmarshal | (~deadmarsh@95.38.231.102) (Ping timeout: 240 seconds) |
2021-12-23 19:16:36 +0100 | Everything | (~Everythin@37.115.210.35) |
2021-12-23 19:20:12 +0100 | wroathe | (~wroathe@user/wroathe) (Ping timeout: 268 seconds) |
2021-12-23 19:20:59 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
2021-12-23 19:20:59 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
2021-12-23 19:20:59 +0100 | wroathe | (~wroathe@user/wroathe) |
2021-12-23 19:21:31 +0100 | phma | (phma@2001:5b0:211c:9c18:ac13:6342:6a86:65e4) (Read error: Connection reset by peer) |
2021-12-23 19:21:43 +0100 | raehik | (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
2021-12-23 19:22:35 +0100 | phma | (phma@2001:5b0:211b:ad08:e5d3:c318:2701:f71f) |
2021-12-23 19:22:43 +0100 | coolnickname | (uid531864@user/coolnickname) |
2021-12-23 19:22:48 +0100 | justsomeguy | (~justsomeg@user/justsomeguy) |
2021-12-23 19:26:09 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2021-12-23 19:26:22 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds) |
2021-12-23 19:27:56 +0100 | eggplantade | (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4) (Remote host closed the connection) |
2021-12-23 19:28:58 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) |
2021-12-23 19:31:03 +0100 | eggplantade | (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
2021-12-23 19:33:25 +0100 | goepsilongo | (~goepsilon@2806:263:c404:8000:f42f:2a6e:3c81:2519) |
2021-12-23 19:33:43 +0100 | Midjak | (~Midjak@may53-1-78-226-116-92.fbx.proxad.net) |
2021-12-23 19:36:42 +0100 | Jing | (~hedgehog@115.207.51.59) (Read error: Connection reset by peer) |
2021-12-23 19:37:30 +0100 | Jing | (~hedgehog@2604:a840:3::1061) |
2021-12-23 19:37:40 +0100 | finn_elija | (~finn_elij@user/finn-elija/x-0085643) |
2021-12-23 19:37:40 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija))) |
2021-12-23 19:37:40 +0100 | finn_elija | FinnElija |
2021-12-23 19:39:35 +0100 | <Raito_Bezarius> | does instance (MonadPlus m, Monoid e) => MonadPlus (ExceptT e m) exist somewhere in base libs? |
2021-12-23 19:39:49 +0100 | <Raito_Bezarius> | so that a + b lifts the + of the value |
2021-12-23 19:39:59 +0100 | <Raito_Bezarius> | (use case: ExceptT e (List a)) |
2021-12-23 19:41:01 +0100 | CiaoSen | (~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 240 seconds) |
2021-12-23 19:43:53 +0100 | <monochrom> | It already exists. You just have to import, for example, Control.Monad.Except |
2021-12-23 19:44:46 +0100 | <monochrom> | It is also more general: instance (Monad m, Monoid e) => MonadPlus (ExceptT e m) |
2021-12-23 19:45:58 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2021-12-23 19:47:26 +0100 | toastloop | (toastloop@user/toastloop) |
2021-12-23 19:48:20 +0100 | cfricke | (~cfricke@user/cfricke) |
2021-12-23 19:50:20 +0100 | cfricke | (~cfricke@user/cfricke) (Client Quit) |
2021-12-23 19:50:36 +0100 | cfricke | (~cfricke@user/cfricke) |
2021-12-23 19:50:47 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) |
2021-12-23 19:54:24 +0100 | <Raito_Bezarius> | I read this instance but it didn't look like that except1 + except2 would merge the result, monochrom |
2021-12-23 19:54:45 +0100 | eron | (~eron@186.192.87.8) (Ping timeout: 256 seconds) |
2021-12-23 19:54:46 +0100 | <Raito_Bezarius> | how do you read: https://hackage.haskell.org/package/transformers-0.6.0.2/docs/src/Control.Monad.Trans.Except.html#… ? |
2021-12-23 19:54:56 +0100 | <Raito_Bezarius> | the Left e -> liftM … seems to ignore mx |
2021-12-23 19:55:17 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
2021-12-23 19:56:13 +0100 | <monochrom> | "Left . mappend e" where e came from "Left e" where "Left e" came from "ex" where "ex <- mx" does not look remotely like ignoring mx to me. |
2021-12-23 19:56:38 +0100 | Erutuon | (~Erutuon@user/erutuon) |
2021-12-23 19:56:46 +0100 | <monochrom> | How do I read it? It mappends the error of mx and the error of my. |
2021-12-23 19:59:18 +0100 | machinedgod | (~machinedg@24.105.81.50) (Remote host closed the connection) |
2021-12-23 19:59:44 +0100 | <Raito_Bezarius> | damn thanks monochrom |
2021-12-23 20:00:15 +0100 | machinedgod | (~machinedg@24.105.81.50) |
2021-12-23 20:00:30 +0100 | <Raito_Bezarius> | and why Right x -> return (Right x) does the right thing wrt to mappend? |
2021-12-23 20:00:36 +0100 | <Raito_Bezarius> | for my |
2021-12-23 20:00:45 +0100 | <Raito_Bezarius> | sorry for the dumb question |
2021-12-23 20:01:48 +0100 | <monochrom> | What is the type of x? Is it e? |
2021-12-23 20:02:09 +0100 | justsomeguy | (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.3) |
2021-12-23 20:02:57 +0100 | <Raito_Bezarius> | it's m |
2021-12-23 20:05:40 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
2021-12-23 20:05:58 +0100 | cfricke | (~cfricke@user/cfricke) (Quit: WeeChat 3.3) |
2021-12-23 20:06:18 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) |
2021-12-23 20:17:42 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
2021-12-23 20:18:05 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2021-12-23 20:22:36 +0100 | cfricke | (~cfricke@user/cfricke) |
2021-12-23 20:25:53 +0100 | nahtnam | (~nahtnam@104-180-254-7.lightspeed.sntcca.sbcglobal.net) |
2021-12-23 20:27:38 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) |
2021-12-23 20:28:08 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) |
2021-12-23 20:29:02 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija))) |
2021-12-23 20:29:02 +0100 | finn_elija | (~finn_elij@user/finn-elija/x-0085643) |
2021-12-23 20:29:02 +0100 | finn_elija | FinnElija |
2021-12-23 20:30:31 +0100 | <hololeap> | Raito_Bezarius: what you're looking for actually only requires Applicative |
2021-12-23 20:30:35 +0100 | <hololeap> | :t liftA2 (<>) |
2021-12-23 20:30:36 +0100 | <lambdabot> | (Applicative f, Semigroup c) => f c -> f c -> f c |
2021-12-23 20:31:20 +0100 | bitmapper | (uid464869@id-464869.lymington.irccloud.com) |
2021-12-23 20:31:42 +0100 | lbseale | (~ep1ctetus@user/ep1ctetus) (Ping timeout: 260 seconds) |
2021-12-23 20:31:47 +0100 | mvk | (~mvk@2607:fea8:5cdd:f000::917a) |
2021-12-23 20:31:56 +0100 | <hololeap> | :t liftA2 (<>) (Right (Sum 4)) (Right (Sum 5)) |
2021-12-23 20:31:57 +0100 | <lambdabot> | Num a1 => Either a2 (Sum a1) |
2021-12-23 20:32:04 +0100 | <hololeap> | > liftA2 (<>) (Right (Sum 4)) (Right (Sum 5)) |
2021-12-23 20:32:06 +0100 | <lambdabot> | Right (Sum {getSum = 9}) |
2021-12-23 20:32:30 +0100 | deadmarshal | (~deadmarsh@95.38.231.102) |
2021-12-23 20:33:20 +0100 | <nahtnam> | Hello! Has anyone been able to get yesod working on an M1 mac? I'm trying with stack and I just cannot get it working. I do `stack new stock-checker yesodweb/postgres`. Then I do `stack install yesod-bin --install-ghc` which fails due to `Cocao` not being installed. I looked around and to fix this I run `stack config set resolver lts`. Then the |
2021-12-23 20:33:21 +0100 | <nahtnam> | previous yesod bin command works. Then I try to do `stack build` which gives me a bunch of inter-dependency issues. I tried copy and pasting them into `extra-deps` but it seems like a circular thing. Finally it starts to build but then fails with presistent PostgreSQL with this issue: "symbol not found in flat namespace '_PQbackendPID'" and I can't |
2021-12-23 20:33:21 +0100 | <nahtnam> | seem to figure this one out |
2021-12-23 20:34:49 +0100 | <Raito_Bezarius> | ah thx, hololeap ! |
2021-12-23 20:36:17 +0100 | <hololeap> | Raito_Bezarius: you might also be interested in Ap from Data.Monoid, which has a Monoid instance for (Applicative f, Monoid a) => Ap f a |
2021-12-23 20:36:38 +0100 | <hololeap> | basically, (<>) = liftA2 (<>) ; mempty = pure mempty |
2021-12-23 20:37:20 +0100 | <Raito_Bezarius> | what would be a idiomatic way to move forward wrt 19:39 in your eyes hololeap ? |
2021-12-23 20:37:31 +0100 | <Raito_Bezarius> | should I do an instance for MonadPlus with Applicative? |
2021-12-23 20:39:04 +0100 | <hololeap> | well, ExceptT doesn't actually fit the MonadPlus abstraction, because there's no general way to define what mzero is |
2021-12-23 20:40:35 +0100 | cfricke | (~cfricke@user/cfricke) (Quit: WeeChat 3.3) |
2021-12-23 20:41:39 +0100 | <hololeap> | wait, no I'm wrong |
2021-12-23 20:42:18 +0100 | <hololeap> | anyway that instance of MonadPlus is already defined in Control.Monad.Trans.Except |
2021-12-23 20:43:35 +0100 | <Raito_Bezarius> | yes |
2021-12-23 20:43:40 +0100 | <Raito_Bezarius> | but how does it actually merge the results? |
2021-12-23 20:43:50 +0100 | <Raito_Bezarius> | (cc 19:54 and 20:00) |
2021-12-23 20:44:52 +0100 | <hololeap> | you can use either <|> (from the Alternative typeclass) or mplus (from MonadPlus) |
2021-12-23 20:45:08 +0100 | <hololeap> | but it's not entirely clear how you want it to behave |
2021-12-23 20:45:53 +0100 | <Raito_Bezarius> | In the context of ExceptT e (List a), I'd like to add two ExceptT so that it merges the value if they are both Right _ |
2021-12-23 20:46:27 +0100 | <Raito_Bezarius> | i.e. a1 a2 :: ExceptT e (List a) ; a1 `mplus` a2 == Right (value a1 ++ value a2) ; something along these lines |
2021-12-23 20:46:28 +0100 | <hololeap> | in that case you don't want to use Alternative or MonadPlus, but just plain old liftA2 |
2021-12-23 20:46:45 +0100 | <Raito_Bezarius> | Right |
2021-12-23 20:46:54 +0100 | <hololeap> | if you used Alternative/MonadPlus it would just return the first Right value and would skip the second one |
2021-12-23 20:47:21 +0100 | <Raito_Bezarius> | that was exactly what I said at 19:54, but monochrom said otherwise so I got confused |
2021-12-23 20:47:27 +0100 | <hololeap> | > Right [1,2,3] `mplus` Right [4,5,6] |
2021-12-23 20:47:29 +0100 | <lambdabot> | error: |
2021-12-23 20:47:29 +0100 | <lambdabot> | • Ambiguous type variable ‘a0’ arising from a use of ‘show_M802144840221... |
2021-12-23 20:47:29 +0100 | <lambdabot> | prevents the constraint ‘(Show a0)’ from being solved. |
2021-12-23 20:47:52 +0100 | <hololeap> | eh, bad example |
2021-12-23 20:48:25 +0100 | <hololeap> | it might be easier to illustrate with Maybe |
2021-12-23 20:48:38 +0100 | <hololeap> | > Just [1,2,3] `mplus` Just [4,5,6] |
2021-12-23 20:48:40 +0100 | <lambdabot> | Just [1,2,3] |
2021-12-23 20:48:59 +0100 | <hololeap> | > liftA2 (<>) (Just [1,2,3]) (Just [4,5,6]) |
2021-12-23 20:49:00 +0100 | <lambdabot> | Just [1,2,3,4,5,6] |
2021-12-23 20:50:58 +0100 | <Raito_Bezarius> | hmm |
2021-12-23 20:51:02 +0100 | <Raito_Bezarius> | what happens when there is two errors hololeap ? |
2021-12-23 20:51:05 +0100 | <Raito_Bezarius> | are * |
2021-12-23 20:51:13 +0100 | <Raito_Bezarius> | can I get the two errors *and* the two values? |
2021-12-23 20:51:43 +0100 | <hololeap> | not with ExceptT but there is another data structure that can do that... |
2021-12-23 20:51:55 +0100 | <hololeap> | if I can remember its name |
2021-12-23 20:52:01 +0100 | <geekosaur> | Chronicle? |
2021-12-23 20:52:13 +0100 | <geekosaur> | although there are others like it |
2021-12-23 20:52:22 +0100 | <geekosaur> | These |
2021-12-23 20:53:39 +0100 | <geekosaur> | Chronicle is a swiss army knife; These is the simple version |
2021-12-23 20:53:55 +0100 | <Raito_Bezarius> | nice |
2021-12-23 20:54:09 +0100 | <hololeap> | @hackage monad-chronicle |
2021-12-23 20:54:10 +0100 | <lambdabot> | https://hackage.haskell.org/package/monad-chronicle |
2021-12-23 20:54:32 +0100 | <geekosaur> | the real question is whetheryour operations make continuing after an error meaningful or not |
2021-12-23 20:54:36 +0100 | <hololeap> | yeah that's it |
2021-12-23 20:57:53 +0100 | <dminuoso> | I was tempted to use monad-chronicle, but found it was easier to model these effects manually and maintain IORefs of critical errors, errors and warnings. |
2021-12-23 20:59:06 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2021-12-23 20:59:46 +0100 | Vajb | (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer) |
2021-12-23 20:59:56 +0100 | Vajb | (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) |
2021-12-23 21:01:55 +0100 | <Raito_Bezarius> | geekosaur: in my context, yes, I want to collect all errors |
2021-12-23 21:02:11 +0100 | syrkis | (~syrkis@109.59.170.168.mobile.3.dk) |
2021-12-23 21:02:14 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds) |
2021-12-23 21:02:47 +0100 | waleee | (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 252 seconds) |
2021-12-23 21:03:07 +0100 | wroathe | (~wroathe@user/wroathe) (Ping timeout: 250 seconds) |
2021-12-23 21:04:50 +0100 | waleee | (~waleee@h-98-128-229-110.NA.cust.bahnhof.se) |
2021-12-23 21:05:09 +0100 | juhp | (~juhp@128.106.188.82) (Ping timeout: 256 seconds) |
2021-12-23 21:06:23 +0100 | syrkis | (~syrkis@109.59.170.168.mobile.3.dk) (Quit: Client closed) |
2021-12-23 21:06:28 +0100 | <dminuoso> | Raito_Bezarius: https://gist.github.com/dminuoso/b273e3a00a0542c4dceda3d98fa56cc0 |
2021-12-23 21:06:33 +0100 | <dminuoso> | This is how we do this manually |
2021-12-23 21:06:43 +0100 | juhp | (~juhp@128.106.188.82) |
2021-12-23 21:06:53 +0100 | <Raito_Bezarius> | Thanks dminuoso! |
2021-12-23 21:06:53 +0100 | <dminuoso> | It's quite simple and yet gives us full power. |
2021-12-23 21:07:39 +0100 | <Raito_Bezarius> | Indeed! |
2021-12-23 21:07:42 +0100 | <dminuoso> | Raito_Bezarius: So our program is split into three phases, and each phase tries to complete even in the presence of errors (to try and collect as many errors as possible) |
2021-12-23 21:08:05 +0100 | <dminuoso> | But we can only proceed into the next phase if there's no errors in the previous one (because each phase has certain preconditions that must be met) |
2021-12-23 21:08:09 +0100 | <Raito_Bezarius> | Correct, I'm in a similar context |
2021-12-23 21:11:23 +0100 | Megant | (megant@user/megant) (Ping timeout: 256 seconds) |
2021-12-23 21:12:50 +0100 | <dminuoso> | Raito_Bezarius: So we then have this small combinator: https://gist.github.com/dminuoso/e2e3fc9071e3afaccaa182cc7ad071c5 |
2021-12-23 21:12:50 +0100 | Megant | (megant@user/megant) |
2021-12-23 21:12:51 +0100 | <hololeap> | Raito_Bezarius: from everything you've said, it sounds to me like you're at a point in your learning where you should read through Typeclassopedia |
2021-12-23 21:12:58 +0100 | <hololeap> | https://wiki.haskell.org/Typeclassopedia |
2021-12-23 21:13:16 +0100 | <dminuoso> | Raito_Bezarius: And then we can do something like `Nothing <$ configErr "Stuff is broken"` |
2021-12-23 21:13:31 +0100 | <hololeap> | it will clear up any confusion surrounding Applicative vs Alternative vs Monad vs MonadPlus, etc |
2021-12-23 21:14:17 +0100 | <dminuoso> | (We even have a typeclass to generate useless defaults, where we can simply say `configErrDef "foo"`, and this will produce some bogus value as a result, while setting an error. |
2021-12-23 21:14:23 +0100 | kupi | (uid212005@id-212005.hampstead.irccloud.com) |
2021-12-23 21:15:08 +0100 | <dminuoso> | i.e. when for some reason you *must* produce something of type String, you might have: "<nonexistant>" <$ configErr "failed to extract text" |
2021-12-23 21:15:09 +0100 | kadir | (~kadir@88.251.54.120) |
2021-12-23 21:16:27 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) |
2021-12-23 21:18:42 +0100 | <Raito_Bezarius> | Thanks hololeap |
2021-12-23 21:26:39 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) |
2021-12-23 21:26:51 +0100 | chexum_ | (~quassel@gateway/tor-sasl/chexum) (Ping timeout: 276 seconds) |
2021-12-23 21:27:44 +0100 | jgeerds_ | (~jgeerds@55d4ac73.access.ecotel.net) |
2021-12-23 21:27:48 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2021-12-23 21:29:37 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) |
2021-12-23 21:30:15 +0100 | nahtnam | (~nahtnam@104-180-254-7.lightspeed.sntcca.sbcglobal.net) (Quit: Client closed) |
2021-12-23 21:30:25 +0100 | <tomsmeding> | What's currently the most reliable way to get GHC working on apple M1, with either stack or cabal (don't care)? I don't have such hardware but a student is asking. Sorry for being the 1e6'th person asking for this, perhaps maerwald knows? |
2021-12-23 21:32:17 +0100 | <geekosaur> | 8.10.7 |
2021-12-23 21:32:59 +0100 | <geekosaur> | it should just work, with either stack or cabal. beware of x86_64 binaries or dylibs lying around somewhere |
2021-12-23 21:33:15 +0100 | <g> | ghcup will install it just fine, but it doesn't appear to be a seamless experience however you install it |
2021-12-23 21:33:48 +0100 | <geekosaur> | make sure your stack or cabal is built for the m1, as an x86_64 one will force the build to be under rosetta |
2021-12-23 21:33:59 +0100 | evocatus | (~evocatus@62.182.78.42) |
2021-12-23 21:38:20 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) |
2021-12-23 21:38:20 +0100 | <tomsmeding> | g, geekosaur: thanks! So I should be able to recommend the standard ghcup install procedure, and tell them to take care to get ghc 8.10.7? |
2021-12-23 21:38:38 +0100 | <geekosaur> | yes |
2021-12-23 21:38:44 +0100 | <tomsmeding> | In other words, will ghcup automatically get the m1 version |
2021-12-23 21:38:47 +0100 | <tomsmeding> | Awesome, thanks! |
2021-12-23 21:39:11 +0100 | <geekosaur> | in particular, 9.2.1 has native support for the m1, but that support was found to be buggy (builds but the result crashes) after release, so avoid it |
2021-12-23 21:39:38 +0100 | <geekosaur> | sign extension bugs |
2021-12-23 21:40:42 +0100 | pavonia | (~user@user/siracusa) |
2021-12-23 21:41:34 +0100 | <tomsmeding> | The student tried something else before (cabal and ghc 8.10.7, not sure how they got those things) and got errors that transformers-compat needs llvm [9,13); does that sound familiar? |
2021-12-23 21:41:56 +0100 | <geekosaur> | iirc you have to point it to /opt/llvm to get a full llvm |
2021-12-23 21:42:57 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
2021-12-23 21:43:16 +0100 | <tomsmeding> | s/transformers-compat/colour/ |
2021-12-23 21:43:43 +0100 | <tomsmeding> | geekosaur: is there already a full llvm there on a standard macos install, or do you need to point something else there? |
2021-12-23 21:44:37 +0100 | <sm> | tomsmeding: echoing geekosaur's warning, if they already installed another way they likely have intel binaries lurking in path, best to clean those out carefully to avoid breakages |
2021-12-23 21:44:55 +0100 | <tomsmeding> | Right |
2021-12-23 21:45:35 +0100 | <sm> | standard macos comes with llvm 13 I think (or maybe after doing xcode-select --install) but I seemed to need to install it again from brew |
2021-12-23 21:46:33 +0100 | lavaman | (~lavaman@98.38.249.169) |
2021-12-23 21:46:53 +0100 | <tomsmeding> | Oh I read some comment from angerman on reddit saying that you need to install a full llvm separately anyway? |
2021-12-23 21:47:16 +0100 | <sm> | (ps not just binaries but also cached artifacts in .cabal, .stack, .cache/hie-bios..) |
2021-12-23 21:47:19 +0100 | <geekosaur> | not sure. at one point someone said there were two versions of llvm under /opt |
2021-12-23 21:47:30 +0100 | <geekosaur> | but installing it via brew might be easiest anyway |
2021-12-23 21:48:17 +0100 | <geekosaur> | (sorry, had to go downstairs and pick up a package) |
2021-12-23 21:48:25 +0100 | <tomsmeding> | geekosaur: as in, `brew install llvm`? |
2021-12-23 21:48:59 +0100 | <geekosaur> | I don't know details, I haven't used Macs for years and when I did I used MacPorts |
2021-12-23 21:49:03 +0100 | <sm> | yes |
2021-12-23 21:49:35 +0100 | <tomsmeding> | sm: thanks, I'll go back and forth with them and come back if we can't figure it out! |
2021-12-23 21:49:39 +0100 | <tomsmeding> | Thanks all |
2021-12-23 21:50:01 +0100 | dsrt^ | (~dsrt@64.253.22.77) (Remote host closed the connection) |
2021-12-23 21:50:08 +0100 | <sm> | np, cf recent m1 thread on /r/haskell |
2021-12-23 21:50:37 +0100 | lavaman | (~lavaman@98.38.249.169) (Ping timeout: 240 seconds) |
2021-12-23 21:50:54 +0100 | fef | (~thedawn@user/thedawn) (Ping timeout: 276 seconds) |
2021-12-23 21:53:28 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2021-12-23 21:53:32 +0100 | <tomsmeding> | sm: the one with xeltius as OP? |
2021-12-23 21:53:33 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: closed) |
2021-12-23 21:53:40 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 21:55:15 +0100 | kadir | (~kadir@88.251.54.120) (goodnight) |
2021-12-23 21:58:32 +0100 | _ht | (~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection) |
2021-12-23 22:00:06 +0100 | vicfred | (~vicfred@user/vicfred) |
2021-12-23 22:00:23 +0100 | <jollygood2> | I have {-# Language OverloadedLists #-} on the of the .hs file, but when I load that file in ghci [1,2,3] is to Num a => [a]. how come? |
2021-12-23 22:00:34 +0100 | <jollygood2> | s/to// |
2021-12-23 22:00:40 +0100 | <sm> | https://www.reddit.com/r/haskell/comments/rjm0x8/help_wanted_for_llvm_config_for_haskell_on_mac/, tomsmeding |
2021-12-23 22:00:57 +0100 | <dsal> | % :set -XOverloadedLists |
2021-12-23 22:00:57 +0100 | <yahb> | dsal: |
2021-12-23 22:01:01 +0100 | <dsal> | % :t [1,2,3] |
2021-12-23 22:01:01 +0100 | <yahb> | dsal: (IsList l, Num (Item l)) => l |
2021-12-23 22:01:17 +0100 | <dsal> | jollygood2: Oh. That's within the file, not within ghci |
2021-12-23 22:01:26 +0100 | <dsal> | That stuff is all pretty well self-contained. |
2021-12-23 22:01:31 +0100 | <jollygood2> | that worked, but why isn't ghci autoloading that extension |
2021-12-23 22:01:38 +0100 | <dsal> | Because it definitely shouldn't. |
2021-12-23 22:01:48 +0100 | <jollygood2> | I disagree |
2021-12-23 22:01:57 +0100 | <dsal> | ghci can pull the symbols out of your file, but it doesn't change the language it interprets based on the file. |
2021-12-23 22:02:03 +0100 | <dsal> | What if you read two files that have conflicting extensions enabled? |
2021-12-23 22:02:54 +0100 | <geekosaur> | :seti -XOverloadedLists ? |
2021-12-23 22:03:10 +0100 | <dsal> | I think it'll also honor anything you put in your project config. |
2021-12-23 22:03:17 +0100 | <dsal> | But file specific should always be file specific. |
2021-12-23 22:03:18 +0100 | <geekosaur> | the language parsed interactively is not that of any source file, as dsal said |
2021-12-23 22:03:29 +0100 | <jollygood2> | dsal, doesn't loading a new file lose all the information about the previously loaded file |
2021-12-23 22:03:37 +0100 | <tomsmeding> | sm: yay thanks, that looks highly relevant! (Spotted your top comment.) Passing on! |
2021-12-23 22:03:39 +0100 | <geekosaur> | you can have multiple files loaded |
2021-12-23 22:03:52 +0100 | <geekosaur> | which one wins? |
2021-12-23 22:05:36 +0100 | <jollygood2> | I just loaded two files one after another. I can't call any functions from the first file, after loading a second one |
2021-12-23 22:07:23 +0100 | <geekosaur> | you can't use :l, but you can use :m * |
2021-12-23 22:07:39 +0100 | <geekosaur> | now you have two or more files loaded as source. again: which one wins? |
2021-12-23 22:08:00 +0100 | <geekosaur> | also, if you load them as binary instead of source, it can't know which extension(s) were enabled during compile |
2021-12-23 22:08:57 +0100 | eggplantade | (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
2021-12-23 22:09:06 +0100 | <jollygood2> | since I never load more than one file, or even knew I could do that, I don't particularly care. but having to manually enable extensions is inconvenient. maybe this should be ghci option |
2021-12-23 22:09:35 +0100 | <geekosaur> | https://downloads.haskell.org/ghc/latest/docs/html/users_guide/ghci.html#setting-options-for-inter… |
2021-12-23 22:09:55 +0100 | <hololeap> | it would be a nice feature if cabal repl could "zoom into" a module and the interpreter behaves with the scope of that module, e.g. all imports/extensions/functions for that module are enabled/in scope |
2021-12-23 22:10:57 +0100 | dschrempf | (~dominik@070-207.dynamic.dsl.fonira.net) |
2021-12-23 22:11:03 +0100 | <dsal> | jollygood2: You can specify the extensions you want to use in your package.yaml or .cabal file and then you have them in ghci and don't have to specify them in each file. But I wouldn't want OverloadedLists without being super aware of it. |
2021-12-23 22:11:17 +0100 | <sm> | +1. (:m +* supporting extensions) |
2021-12-23 22:11:32 +0100 | <hololeap> | yeah overloadedlists bites you more often than not |
2021-12-23 22:11:52 +0100 | <sm> | (uh, unless geekosaur just explained why that can't work. But I still want it) |
2021-12-23 22:12:53 +0100 | <geekosaur> | modules loaded with * and therefore compiled a ssource ought to be able to do it. but I'd want to be told what extensions have been automatically enabled/disabled when I switch scopes, rather than spooky action at a distance |
2021-12-23 22:13:12 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) |
2021-12-23 22:13:19 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) |
2021-12-23 22:13:29 +0100 | kaph_ | (~kaph@net-2-47-236-216.cust.vodafonedsl.it) (Ping timeout: 268 seconds) |
2021-12-23 22:13:35 +0100 | <geekosaur> | *especially* if it's something like OverloadedLists. or worse, RebindableSyntax which OverloadedLists is a subset of |
2021-12-23 22:13:39 +0100 | regr | (~regr@user/regr) |
2021-12-23 22:15:45 +0100 | <geekosaur> | also there's at least one current exception that would need to be thought about: NoMonomorphismRestriction is default interactively but not in files |
2021-12-23 22:15:48 +0100 | <sm> | geekosaur: agreed, that would be great. I've regroupd and typed :set -X[No]LongCaseSensitiveName more than enough |
2021-12-23 22:19:09 +0100 | <monochrom> | You can load multiple files by using :add |
2021-12-23 22:20:47 +0100 | <monochrom> | Also the design of ghci is such that the notion of loading is somewhat detached from the notion of in-scope. :module is about in-scope. |
2021-12-23 22:21:04 +0100 | <monochrom> | This means there are times you have to say both :add and :module |
2021-12-23 22:21:15 +0100 | <geekosaur> | also I'm not sure "all imports" is currently possible. I tried to access xmonad imports with my cabalized setup and failed, no amount of --package etc. seemed to help. (packages were of course visible in cabal file) |
2021-12-23 22:22:18 +0100 | <EvanR> | I've got a cabal script .hs file I want to load into ghci... |
2021-12-23 22:22:29 +0100 | nitrix | nitrix-mas |
2021-12-23 22:22:40 +0100 | <EvanR> | rather than execute as is |
2021-12-23 22:22:41 +0100 | <monochrom> | The said design may be bad, but it has the merit of acknowledging the following issue: :module is valid for modules from installed packages, :load isn't. |
2021-12-23 22:22:54 +0100 | <geekosaur> | hm, I don't think either cabal or stack will do that with scripts currently |
2021-12-23 22:23:06 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2021-12-23 22:23:08 +0100 | toastloopex | (toastloop@user/toastloop) |
2021-12-23 22:23:09 +0100 | <monochrom> | And generally acknowledging the invalidity of DWIM. |
2021-12-23 22:23:30 +0100 | <sm> | with stack, it's stack --package A --package B ghci script.hs, I think |
2021-12-23 22:23:30 +0100 | <EvanR> | can I run ghci and load package vector... even if it's "hidden" |
2021-12-23 22:23:47 +0100 | <monochrom> | I think I heard that stack scripts can be "stack repl"ed. |
2021-12-23 22:23:56 +0100 | <geekosaur> | ghci -package vector-x.y.z |
2021-12-23 22:26:26 +0100 | toastloop | (toastloop@user/toastloop) (Ping timeout: 268 seconds) |
2021-12-23 22:27:08 +0100 | <EvanR> | There is no package.cache... There are no .conf files... cannot satisfy -package vector |
2021-12-23 22:27:23 +0100 | <EvanR> | or vector-0.12.3.1 |
2021-12-23 22:27:40 +0100 | <EvanR> | yes, I don't understand cabal |
2021-12-23 22:27:56 +0100 | <sm> | what was your command line ? |
2021-12-23 22:28:00 +0100 | <monochrom> | Yeah "-package vector-..." requires either having done "cabal install --lib vector-..." or manually playing with -package-db flags. |
2021-12-23 22:28:02 +0100 | <ProfSimm> | When I make a record, Haskell generates field accessors automatically as functions. Where are those functions defined actually, who has access to them? |
2021-12-23 22:28:06 +0100 | <geekosaur> | if you are using cabal repl, it should be --package vector |
2021-12-23 22:28:07 +0100 | <EvanR> | ghci -v -package vector-0.12.3.1 |
2021-12-23 22:28:19 +0100 | <Raito_Bezarius> | Many thanks dminuoso |
2021-12-23 22:28:53 +0100 | <monochrom> | "cabal install --lib" is not very harmful. Perhaps it's the least resistant option. |
2021-12-23 22:29:15 +0100 | <geekosaur> | ProfSimm, they are ordinary functions with the same scope as anything you define at top level in your file, and will for example be exported if you have no (== default) export list |
2021-12-23 22:29:20 +0100 | <nitrix-mas> | ProfSimm, Same module the record type is defined in. Import/exports of those functions works in the same way the type does as well. |
2021-12-23 22:29:20 +0100 | <geekosaur> | Or you can export them explicitly |
2021-12-23 22:29:30 +0100 | <EvanR> | cabal repl --package vector, them import Data.Vector or :load MyFile.hs results in Could not load Data.Vector something something hidden package |
2021-12-23 22:29:37 +0100 | <sm> | when the cabal script runs, which package db is it using ? the user package db for the ghc in PATH, I would have though |
2021-12-23 22:29:38 +0100 | <ProfSimm> | Thanks. |
2021-12-23 22:29:39 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: closed) |
2021-12-23 22:29:59 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 22:30:11 +0100 | <monochrom> | You won't have a filename-and-line-number answer for "where", if that's what you mean. |
2021-12-23 22:30:12 +0100 | <EvanR> | well, doing cabal repl I don't expect it to treat the file as a cabal script |
2021-12-23 22:30:33 +0100 | <geekosaur> | that's pretty much the only thing I would expect *to* treat it as one |
2021-12-23 22:30:35 +0100 | <monochrom> | Compiler auto-gen'ed code that exists only in *.o files. |
2021-12-23 22:30:41 +0100 | <geekosaur> | nothing else would know it was a cabal script |
2021-12-23 22:30:42 +0100 | <EvanR> | cabal v2-run ? |
2021-12-23 22:31:05 +0100 | <monochrom> | Similarly "data X = X deriving (Ord, Eq, Show, Read)" where is the instance code? |
2021-12-23 22:31:06 +0100 | <geekosaur> | in particular bare ghci will think it's an ordinary Haskell source file and ignore the cabal-script stuff entirely |
2021-12-23 22:31:19 +0100 | <EvanR> | makes sense |
2021-12-23 22:31:22 +0100 | eggplantade | (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
2021-12-23 22:32:27 +0100 | <monochrom> | OK, who has access. A better question is: What is its scoping rules. |
2021-12-23 22:32:29 +0100 | <EvanR> | monochrom suggested something like, install vector globally |
2021-12-23 22:32:46 +0100 | <monochrom> | It is firstly in scope in the module that defines that record type. |
2021-12-23 22:33:07 +0100 | <monochrom> | And then that module can choose to export or not export it. Default is export. |
2021-12-23 22:33:20 +0100 | <sm> | EvanR: isn't vector already installed globally , since the script runs by itself ? |
2021-12-23 22:33:47 +0100 | <monochrom> | Yeah but ghci consults the "environment" file. |
2021-12-23 22:34:10 +0100 | <monochrom> | In which case "cabal install --lib vector" has a job of updating that environment file. |
2021-12-23 22:34:13 +0100 | <EvanR> | I guess it's installed due to my previous cabal scripts? |
2021-12-23 22:34:18 +0100 | <sm> | right.. so maybe you're in a project directory EvanR ? |
2021-12-23 22:34:19 +0100 | <monochrom> | Yeah. |
2021-12-23 22:34:35 +0100 | <EvanR> | no project files in sight |
2021-12-23 22:34:41 +0100 | <monochrom> | Well if someone uses ghci directly, maybe they don't want a "project". |
2021-12-23 22:34:42 +0100 | <EvanR> | just .hs file |
2021-12-23 22:34:52 +0100 | <sm> | ghc-pkg list <- includes vector ? |
2021-12-23 22:35:06 +0100 | <EvanR> | no vector |
2021-12-23 22:35:23 +0100 | <monochrom> | "cabal run script.hs" causes building vector but not entering it into the "environment file". |
2021-12-23 22:35:23 +0100 | <EvanR> | I've only installed it in projects and used it from scripts |
2021-12-23 22:35:26 +0100 | <sm> | it seems you have multiple package dbs in play, one way or other |
2021-12-23 22:35:34 +0100 | <geekosaur> | ghc-pkg list doesn't include environment files, that's an open ghc ticket |
2021-12-23 22:35:45 +0100 | <EvanR> | environment file... |
2021-12-23 22:35:55 +0100 | <EvanR> | why didn't I think of that... |
2021-12-23 22:36:03 +0100 | sm | laments the overwhelming cunning of haskell tools, humans do not have much chance |
2021-12-23 22:36:25 +0100 | <monochrom> | Isn't this like common knowledge for 5 years already? |
2021-12-23 22:36:42 +0100 | <sm> | ha, easy to say |
2021-12-23 22:36:55 +0100 | <EvanR> | Can I have a listing of all common knowledge |
2021-12-23 22:36:59 +0100 | <sm> | I've never used an environment file |
2021-12-23 22:37:08 +0100 | <monochrom> | I am saying this as someone who wanted to have nothing to do with cabal v2 until like a year ago. |
2021-12-23 22:37:21 +0100 | <sm> | and even if I had I would still forget about them at times like this |
2021-12-23 22:38:05 +0100 | <EvanR> | before we delve into a metatoolingrant, what does the potential existence of this "environment file" mean to me right now |
2021-12-23 22:38:45 +0100 | <EvanR> | is vector installed? xD |
2021-12-23 22:38:58 +0100 | <EvanR> | I mean i've been using it for a few months |
2021-12-23 22:39:00 +0100 | <monochrom> | It helps you use ghci directly and still enjoy a cabal-v1-like experience of "install a lib, then ghci sees it". |
2021-12-23 22:39:40 +0100 | jgeerds_ | (~jgeerds@55d4ac73.access.ecotel.net) (Quit: Leaving) |
2021-12-23 22:39:47 +0100 | <monochrom> | OK, maybe the following helps. |
2021-12-23 22:39:48 +0100 | <EvanR> | that's handy I guess |
2021-12-23 22:39:48 +0100 | jgeerds | (~jgeerds@55d4ac73.access.ecotel.net) |
2021-12-23 22:40:01 +0100 | <monochrom> | Take a look at $HOME/.cabal/store/ghc-<version> |
2021-12-23 22:40:24 +0100 | <monochrom> | You will find a lot of library packages there. And a package database too to go with them. |
2021-12-23 22:40:27 +0100 | <EvanR> | I have 3 vectors two with the same version |
2021-12-23 22:40:44 +0100 | <monochrom> | Clearly, ghci by default doesn't even know that this place exists. |
2021-12-23 22:41:16 +0100 | <sm> | EvanR: if you're not in a project, why/where do you have an environment file ? just curious |
2021-12-23 22:41:33 +0100 | <monochrom> | Now you have 2 options. For "--lib", turn to page 13. For "cabal 'project'", turn to page 7. |
2021-12-23 22:41:47 +0100 | <EvanR> | sm, I only just heard of an environment file |
2021-12-23 22:41:59 +0100 | <EvanR> | I don't see any file called environment anywhere |
2021-12-23 22:42:10 +0100 | ProfSimm | (~ProfSimm@87.227.196.109) (Remote host closed the connection) |
2021-12-23 22:42:14 +0100 | <sm> | oh. I thought you had discovered one causing the problem |
2021-12-23 22:42:18 +0100 | <EvanR> | no |
2021-12-23 22:42:24 +0100 | <monochrom> | Page 13: "cabal install --lib" updates a file under $HOME/.ghc to point ghci to the existence of some of those packages, very selectively. You can do very fine-grained control. |
2021-12-23 22:42:39 +0100 | <EvanR> | well I know how to make a cabal project |
2021-12-23 22:42:47 +0100 | <monochrom> | Page 7: "cabal build" calls ghc with enough -package-db flags to tell ghc the existence of that place. |
2021-12-23 22:43:15 +0100 | <EvanR> | -package-db flags, got it |
2021-12-23 22:43:37 +0100 | <monochrom> | -package-db flags are not normally meant for human use. :) |
2021-12-23 22:44:02 +0100 | <monochrom> | Then again, I still do it once in a while. Even wrote a few bash aliases to help. |
2021-12-23 22:45:04 +0100 | tomku | (~tomku@user/tomku) (Quit: leaving) |
2021-12-23 22:45:12 +0100 | <EvanR> | interesting there's nothing really under ~/.ghc |
2021-12-23 22:45:35 +0100 | tomku | (~tomku@user/tomku) |
2021-12-23 22:45:37 +0100 | <EvanR> | an empty package.cache.lock file |
2021-12-23 22:46:03 +0100 | <monochrom> | You have multiple vectors of the "same" "version" because if its build dependencies changes by just a little bit, a rebuild is called for. Each build is crytpo-hashed with the exact backgrounds of the build. This is to solve cabal hell. |
2021-12-23 22:46:18 +0100 | <EvanR> | cool |
2021-12-23 22:46:52 +0100 | <EvanR> | but it sounds like that spells trouble for "just load a haskell file that uses vector" |
2021-12-23 22:47:30 +0100 | merijn | (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds) |
2021-12-23 22:48:14 +0100 | <EvanR> | and a .cabal file is cool but still non-non-existent part of a small workflow |
2021-12-23 22:48:18 +0100 | <monochrom> | The environment file will refer to just one of the builds. |
2021-12-23 22:48:19 +0100 | <sm> | my approach to that is `cd; stack ghci FILE --package vector`. This is pretty reliable, it must be possible to do something similar with cabal |
2021-12-23 22:48:41 +0100 | <monochrom> | At worst it refers to an old build you don't want to use any more. |
2021-12-23 22:48:57 +0100 | <EvanR> | is The environment file unique? |
2021-12-23 22:48:58 +0100 | <monochrom> | But you can always edit the env file and delete that line. |
2021-12-23 22:49:01 +0100 | <monochrom> | Yes. |
2021-12-23 22:49:13 +0100 | <sclv> | `cabal repl -b` is the equiv to `stack ghci --package` |
2021-12-23 22:49:46 +0100 | <sm> | there ^ |
2021-12-23 22:49:57 +0100 | <EvanR> | cabal repl doesn't take any extra arguments when outside a project |
2021-12-23 22:50:39 +0100 | <sclv> | right, don't pass in the file for ghci to load |
2021-12-23 22:50:41 +0100 | <sm> | waaaah |
2021-12-23 22:50:46 +0100 | <sclv> | it'll open a clean ghci with all the packages in scope |
2021-12-23 22:50:55 +0100 | <sclv> | and from within ghci, hit `:load path/to/File.hs` |
2021-12-23 22:51:09 +0100 | <monochrom> | Oh, cool trick, haha, didn't think of that. |
2021-12-23 22:51:43 +0100 | <EvanR> | that actually worked |
2021-12-23 22:51:56 +0100 | dschrempf | (~dominik@070-207.dynamic.dsl.fonira.net) (Quit: WeeChat 3.3) |
2021-12-23 22:51:57 +0100 | <EvanR> | what the hell does -b stand for |
2021-12-23 22:52:06 +0100 | <sclv> | --build-depends |
2021-12-23 22:52:14 +0100 | <EvanR> | wow |
2021-12-23 22:52:25 +0100 | <sclv> | so you can give it `containers > 2` etc |
2021-12-23 22:52:40 +0100 | <sm> | victory \o/ |
2021-12-23 22:52:54 +0100 | <sclv> | and note it runs the solver under the hood so you can depend on some beefy collection of packages and it'll solve and build the deps for you |
2021-12-23 22:53:04 +0100 | <EvanR> | yeah ok... final question, have we been talking about "the .ghci file" this whole time |
2021-12-23 22:53:05 +0100 | <monochrom> | The other cool trick I learned today is from the Giry monad file int-e pointed me to. Under Dirac measure, say "unit x", a predicate is true a.e. iff it is true at x. Because the whole point of a Dirac measure is to ignore everything else haha. |
2021-12-23 22:53:22 +0100 | <tomsmeding> | You can also 'cabal repl -b vector --repl-options yourfile.hs' iirc |
2021-12-23 22:53:57 +0100 | <tomsmeding> | monochrom: what does a.e. stand for? |
2021-12-23 22:53:57 +0100 | <sm> | confirmed, tomsmeding |
2021-12-23 22:54:52 +0100 | <tomsmeding> | Ah, almost everywhere |
2021-12-23 22:54:57 +0100 | <monochrom> | "almost everywhere". The technical definition is: A predicate holds "a.e." iff the set of where it doesn't hold has zero measure. |
2021-12-23 22:55:04 +0100 | <tomsmeding> | Right |
2021-12-23 22:55:25 +0100 | <monochrom> | So, the complement of {x} has zero measure! |
2021-12-23 22:55:46 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) |
2021-12-23 22:55:56 +0100 | <monochrom> | More like "ignore almost everywhere except x". :) |
2021-12-23 22:56:00 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
2021-12-23 22:56:00 +0100 | wroathe | (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
2021-12-23 22:56:00 +0100 | wroathe | (~wroathe@user/wroathe) |
2021-12-23 22:56:01 +0100 | <tomsmeding> | The fact that "almost everywhere" has a rigorous definition can be used as a lousy party trick among amateur mathematicians |
2021-12-23 22:56:35 +0100 | <sm> | EvanR: I didn't notice anyone talking about "the .ghci file" ? |
2021-12-23 22:56:40 +0100 | <EvanR> | ok then I'm wrong |
2021-12-23 22:56:48 +0100 | <monochrom> | Well, not sure we should blame it on "a.e." or we should blame it on the very degenerate Dirac measure. :) |
2021-12-23 22:57:11 +0100 | <EvanR> | if I carry on right now, I still won't know wtf an environment file is |
2021-12-23 22:57:23 +0100 | <EvanR> | is it called "environment" or where would it go |
2021-12-23 22:57:34 +0100 | <EvanR> | no duckduckgo results about it |
2021-12-23 22:57:38 +0100 | <sm> | good, best avoid it if you can |
2021-12-23 22:57:44 +0100 | <EvanR> | alright then it's bad |
2021-12-23 22:57:52 +0100 | <sclv> | its a different approach thats slick when it works |
2021-12-23 22:57:54 +0100 | <EvanR> | stricken from the record |
2021-12-23 22:58:07 +0100 | <monochrom> | So, the sifting property "f x = integrate f using (unit x) as the measure" has a lousy party trick proof: f = const (f x) a.e. |
2021-12-23 22:58:08 +0100 | <sm> | https://cabal.readthedocs.io/en/3.6/cabal-project.html?highlight=environment#cfg-field-write-ghc-e… |
2021-12-23 22:58:08 +0100 | <sclv> | but its not so easy to use still, so the other options presented are easier |
2021-12-23 22:58:09 +0100 | <geekosaur> | but bites your butt hard when it doesn't |
2021-12-23 22:58:27 +0100 | takuan | (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
2021-12-23 22:58:51 +0100 | <sclv> | its a sad case where "do what i mean" can cause the XX% of cases when that isn't what you meant to be confusing |
2021-12-23 22:59:49 +0100 | <monochrom> | EvanR: If you have an environment file, then when you start ghci, it has the message "Loaded package environment from ..." and it spells out the exact pathname. |
2021-12-23 23:00:17 +0100 | yauhsien | (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Ping timeout: 240 seconds) |
2021-12-23 23:00:27 +0100 | <EvanR> | Ok, it looks gnarly |
2021-12-23 23:00:31 +0100 | <EvanR> | will do -b |
2021-12-23 23:05:47 +0100 | kjak | (~kjak@pool-108-45-56-21.washdc.fios.verizon.net) |
2021-12-23 23:05:48 +0100 | <EvanR> | interesting, Vector's show instance looks like List's? |
2021-12-23 23:07:09 +0100 | toastlooply | (toastloop@user/toastloop) |
2021-12-23 23:07:23 +0100 | <monochrom> | It adds a "fromList" but yeah. |
2021-12-23 23:07:44 +0100 | <monochrom> | No one wants to invent a really innovative notation! |
2021-12-23 23:08:04 +0100 | <monochrom> | And under the spell of "it should look like Haskell code". |
2021-12-23 23:08:15 +0100 | <geekosaur> | they'd have to get ghc{,i} to recognize it :) |
2021-12-23 23:08:30 +0100 | <geekosaur> | or someone would inevitably try to type it in |
2021-12-23 23:09:07 +0100 | <EvanR> | I'm not seeing the "fromList " part... |
2021-12-23 23:09:53 +0100 | <EvanR> | so I thought I messed up and made a list |
2021-12-23 23:10:23 +0100 | toastloopex | (toastloop@user/toastloop) (Ping timeout: 256 seconds) |
2021-12-23 23:10:49 +0100 | <monochrom> | Hrm, you're right, I misremembered. |
2021-12-23 23:12:02 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) |
2021-12-23 23:12:04 +0100 | wroathe | (~wroathe@user/wroathe) (Ping timeout: 268 seconds) |
2021-12-23 23:16:36 +0100 | coolnickname | (uid531864@user/coolnickname) (Quit: Connection closed for inactivity) |
2021-12-23 23:16:57 +0100 | machinedgod | (~machinedg@24.105.81.50) (Ping timeout: 240 seconds) |
2021-12-23 23:18:00 +0100 | <EvanR> | it's fun to see how other languages decided to 'show' their data structures |
2021-12-23 23:18:09 +0100 | toastloopex | (~toastloop@user/toastloop) |
2021-12-23 23:18:17 +0100 | <EvanR> | they're all special snowflakes |
2021-12-23 23:19:04 +0100 | <EvanR> | deep down we all use the same heap objects and pointers, just in different ways |
2021-12-23 23:19:21 +0100 | <EvanR> | and the pretty printers don't agree |
2021-12-23 23:20:57 +0100 | toastlooply | (toastloop@user/toastloop) (Ping timeout: 240 seconds) |
2021-12-23 23:22:56 +0100 | acidjnk | (~acidjnk@p200300d0c7271e5539f4c4c5e28366d0.dip0.t-ipconnect.de) |
2021-12-23 23:23:46 +0100 | dhouthoo | (~dhouthoo@178-117-36-167.access.telenet.be) (Quit: WeeChat 3.3) |
2021-12-23 23:24:49 +0100 | Morrow | (~quassel@bzq-110-168-31-106.red.bezeqint.net) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
2021-12-23 23:26:18 +0100 | Morrow | (~quassel@bzq-110-168-31-106.red.bezeqint.net) |
2021-12-23 23:26:28 +0100 | Morrow | (~quassel@bzq-110-168-31-106.red.bezeqint.net) (Remote host closed the connection) |
2021-12-23 23:31:22 +0100 | <[itchyjunk]> | Hi, I am curious about "higher order function" vs "first order function". Higher order functions take function as parameter or return one. a `+` can return a partial function, wouldn't that make + a higher order function? |
2021-12-23 23:32:06 +0100 | coot | (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) |
2021-12-23 23:32:20 +0100 | YehoshuaPesachWa | yehoshuapw |
2021-12-23 23:32:32 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection) |
2021-12-23 23:32:33 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 23:32:50 +0100 | <hpc> | only in haskell |
2021-12-23 23:33:07 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: closed) |
2021-12-23 23:33:10 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 23:33:14 +0100 | <hpc> | (+) :: Num a => (a, a) -> a -- wouldn't be particularly higher-order at all |
2021-12-23 23:33:24 +0100 | otherwise | (~otherwise@c-73-181-170-174.hsd1.wa.comcast.net) |
2021-12-23 23:33:24 +0100 | <hpc> | and that's how other languages behave |
2021-12-23 23:33:25 +0100 | lragyrlmtdwnbo^ | (~lragyrlmt@64.253.22.77) |
2021-12-23 23:33:27 +0100 | <[itchyjunk]> | Ah, + in haskell is higher order function since it can return partial function? |
2021-12-23 23:33:34 +0100 | <Rembane> | [itchyjunk]: I would say that +4 evaluates to a function, it's not the function itself that returns a new function. |
2021-12-23 23:33:45 +0100 | <[itchyjunk]> | hmmm |
2021-12-23 23:34:11 +0100 | <[itchyjunk]> | Ah, i kinda see the distinction you're making there |
2021-12-23 23:34:19 +0100 | <Rembane> | If (+) is a higher order function then all functions in Haskell are higher order functions, except for the one hpc mentioned. |
2021-12-23 23:36:24 +0100 | gehmehgeh | (~user@user/gehmehgeh) (Quit: Leaving) |
2021-12-23 23:37:38 +0100 | <hpc> | not all functions, but certainly all functions of "more than one" parameter |
2021-12-23 23:37:51 +0100 | <hpc> | here's another fun question for you |
2021-12-23 23:37:52 +0100 | <hpc> | :t id |
2021-12-23 23:37:53 +0100 | <lambdabot> | a -> a |
2021-12-23 23:38:01 +0100 | coot | (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Remote host closed the connection) |
2021-12-23 23:38:02 +0100 | <hpc> | is that a higher-order function? |
2021-12-23 23:38:32 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2021-12-23 23:39:25 +0100 | <[itchyjunk]> | well it takes a function and maps it to a function (itself) |
2021-12-23 23:39:28 +0100 | coot | (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) |
2021-12-23 23:39:31 +0100 | <[itchyjunk]> | so i should be a higher order function, no? |
2021-12-23 23:39:44 +0100 | <hpc> | maybe |
2021-12-23 23:39:50 +0100 | <hpc> | > id True -- or maybe it's not? |
2021-12-23 23:39:51 +0100 | <lambdabot> | True |
2021-12-23 23:40:11 +0100 | <[itchyjunk]> | oh |
2021-12-23 23:40:15 +0100 | toastloopex | (~toastloop@user/toastloop) (Remote host closed the connection) |
2021-12-23 23:40:20 +0100 | <[itchyjunk]> | there, it didn't take a function but a value? |
2021-12-23 23:40:27 +0100 | <hpc> | yeah |
2021-12-23 23:40:31 +0100 | <[itchyjunk]> | ahhh |
2021-12-23 23:40:36 +0100 | toastloopex | (~toastloop@user/toastloop) |
2021-12-23 23:40:46 +0100 | eggplantade | (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
2021-12-23 23:41:07 +0100 | <hpc> | instead of getting too deep into defining these things exactly, perhaps look at it as "what is this language able to express?" |
2021-12-23 23:41:09 +0100 | <[itchyjunk]> | So it's a very context sensitive concept. great, makes sense! |
2021-12-23 23:41:17 +0100 | <[itchyjunk]> | hmmm |
2021-12-23 23:41:21 +0100 | OscarZ | (~oscarz@95.175.104.235) |
2021-12-23 23:41:45 +0100 | <hpc> | higher order functions make sense as a term when you're not able to have them, and think "what if you could?" |
2021-12-23 23:41:49 +0100 | <[itchyjunk]> | I don't think i understand the question. What are the types of things i can express? like turing completness? |
2021-12-23 23:42:13 +0100 | <hpc> | then once you get them, they're ultimately just yet more functions |
2021-12-23 23:42:37 +0100 | tomku | (~tomku@user/tomku) (Ping timeout: 240 seconds) |
2021-12-23 23:42:44 +0100 | <hpc> | fuzzier than turing-completeness |
2021-12-23 23:42:58 +0100 | lbseale | (~ep1ctetus@user/ep1ctetus) |
2021-12-23 23:43:22 +0100 | <hpc> | for example, bash version 3 is turing-complete, but you can't express arrays properly in it |
2021-12-23 23:43:30 +0100 | <hpc> | (that was added in bash version 4) |
2021-12-23 23:43:41 +0100 | <hpc> | perl 4 didn't have pointers |
2021-12-23 23:43:43 +0100 | nitrix-mas | nitrix |
2021-12-23 23:43:50 +0100 | <hpc> | java 1.4 didn't have parametric polymorphism |
2021-12-23 23:43:57 +0100 | <hpc> | haskell 1.4 didn't have the IO type |
2021-12-23 23:44:06 +0100 | <hpc> | but all are turing complete |
2021-12-23 23:44:23 +0100 | deadmarshal | (~deadmarsh@95.38.231.102) (Ping timeout: 256 seconds) |
2021-12-23 23:44:31 +0100 | <[itchyjunk]> | huh, interesting. so you could still do the same thing in each language, you just didn't have an inbuilt tool for it? |
2021-12-23 23:44:37 +0100 | <hpc> | yeah |
2021-12-23 23:44:56 +0100 | <hpc> | it's also why if you stick around here long enough, people talk about what you "can do" in theorem proving languages |
2021-12-23 23:44:58 +0100 | <[itchyjunk]> | does this mean i could implement higher order functions externally to any equivalently expressive language? |
2021-12-23 23:45:08 +0100 | <hpc> | when they aren't even turing-complete, so in a computational sense they are strictly lesser |
2021-12-23 23:45:10 +0100 | <[itchyjunk]> | oh interesting! |
2021-12-23 23:45:31 +0100 | <hpc> | you can emulate them in various ways, sure |
2021-12-23 23:45:34 +0100 | <[itchyjunk]> | i heard something about Coq not being turing complete. I would like to learn about theorem proving languages too! |
2021-12-23 23:45:43 +0100 | <hpc> | in C you might use function pointers for function parameters |
2021-12-23 23:46:03 +0100 | <hpc> | but then you'd have a yucky time trying to write a version of (+) that lets you partially apply it |
2021-12-23 23:47:01 +0100 | cosimone | (~user@93-34-133-112.ip49.fastwebnet.it) (Quit: ERC (IRC client for Emacs 27.1)) |
2021-12-23 23:48:30 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection) |
2021-12-23 23:48:30 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 23:48:59 +0100 | <regr> | yep, (safe) agda isn't turing complete either |
2021-12-23 23:49:02 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) (Disconnected: closed) |
2021-12-23 23:49:06 +0100 | qrpnxz | (abc4f95c31@user/qrpnxz) |
2021-12-23 23:49:08 +0100 | tromp | (~textual@dhcp-077-249-230-040.chello.nl) |
2021-12-23 23:52:15 +0100 | falafel | (~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com) |
2021-12-23 23:52:53 +0100 | <hololeap> | this might be a stupid way of thinking of it, but I think of a higher order function as one that does not simply associate to the right. so I would consider `(a -> b) -> c` a higher-order function, but I would not consider `a -> (b -> c)` one since it simplifies to `a -> b -> c` |
2021-12-23 23:53:06 +0100 | <regr> | :t let {x :: Void; x = x} in x -- in haskell, you can 'make' an element of any type, even one without a constructor |
2021-12-23 23:53:07 +0100 | <lambdabot> | Void |
2021-12-23 23:54:10 +0100 | <regr> | and theorem prover people don't like it when you can do that, because it's basically like proving a falsehood (for example 4 = 5) which completely ruins their logic |
2021-12-23 23:54:19 +0100 | <sm> | off topic except discussion in here sent me on this tangent.. but isn't the first example at https://en.wikipedia.org/wiki/Chomsky_hierarchy#Formal_grammars wrong ? I don't see it producing "n copies of a followed by n copies of b" |
2021-12-23 23:54:32 +0100 | philg | (~philg@220.240.104.208) |
2021-12-23 23:55:00 +0100 | <regr> | so agda (and probably coq) check that every definition you make actually produces an answer (and many more things) to make sure you can't do that |
2021-12-23 23:55:19 +0100 | <regr> | which is why agda and coq aren't turing complete |
2021-12-23 23:55:25 +0100 | <hpc> | sm: it looks right to me |
2021-12-23 23:55:41 +0100 | <sm> | (phew, I do. n must be the same for both letters. carry on..) |
2021-12-23 23:56:00 +0100 | <hpc> | heh |
2021-12-23 23:56:08 +0100 | <sm> | thanks :) |
2021-12-23 23:56:35 +0100 | philg | (~philg@220.240.104.208) (Client Quit) |
2021-12-23 23:56:51 +0100 | philg | (~philg@220.240.104.208) |
2021-12-23 23:56:57 +0100 | philg | FirstAsTragedy |
2021-12-23 23:57:12 +0100 | <EvanR> | [itchyjunk], you may have learned that a higher order function is one that takes a function as input. Now it's up to you do make of that what you will |
2021-12-23 23:57:25 +0100 | ridcully_ | (~ridcully@pd951f824.dip0.t-ipconnect.de) (Ping timeout: 240 seconds) |
2021-12-23 23:57:30 +0100 | ridcully | (~ridcully@pd951fb88.dip0.t-ipconnect.de) |
2021-12-23 23:57:37 +0100 | <hpc> | (for the audience, if you expand the rules for A and B into the expansion for S, you get the second code block in that section which is obviously correct) |
2021-12-23 23:58:54 +0100 | <EvanR> | it seems normal in haskell, but see all the crazy terminology for this concept in e.g. math... where they call it a "functional" |
2021-12-23 23:59:39 +0100 | <[itchyjunk]> | ah, ill check out functionals |
2021-12-23 23:59:42 +0100 | <EvanR> | which sounds more like a word crashed on the part of speech highway |