Newest at the top
2024-10-22 13:23:28 +0200 | merijn | (~merijn@77.242.116.146) (Ping timeout: 252 seconds) |
2024-10-22 13:19:41 +0200 | ljdarj | (~Thunderbi@user/ljdarj) ljdarj |
2024-10-22 13:16:56 +0200 | L29Ah | (~L29Ah@wikipedia/L29Ah) L29Ah |
2024-10-22 13:14:25 +0200 | araujo | (~araujo@45.146.55.99) |
2024-10-22 13:13:50 +0200 | xff0x | (~xff0x@2405:6580:b080:900:61f:49ca:1cad:ed6) |
2024-10-22 13:13:28 +0200 | merijn | (~merijn@77.242.116.146) merijn |
2024-10-22 13:11:29 +0200 | <kaol> | Still going to be a run time program breaking event if it happens. |
2024-10-22 13:10:57 +0200 | <tromp> | yep; that "fixes" it |
2024-10-22 13:10:32 +0200 | <kaol> | I always forget about lazy patterns. |
2024-10-22 13:09:40 +0200 | madjestic | (~madjestic@213.208.215.120) madjestic |
2024-10-22 13:08:53 +0200 | <mauke> | ~(A b) <- ts |
2024-10-22 13:07:36 +0200 | <kaol> | To expand on this a bit more: Having fail in Monad was always ugly since it's not a part of the definition in category theory and for many monads, you can't really do anything but invoke "error" if a pattern match failure happens and that's a silent source of partial functions. |
2024-10-22 13:07:28 +0200 | merijn | (~merijn@77.242.116.146) (Ping timeout: 245 seconds) |
2024-10-22 13:04:46 +0200 | <tromp> | Thanks for help |
2024-10-22 13:04:38 +0200 | <kaol> | If your purpose is to just follow some code at home, you may define your own MonadFail instance. But watch out if you think of doing the same in production. |
2024-10-22 13:04:29 +0200 | ljdarj | (~Thunderbi@user/ljdarj) (Ping timeout: 260 seconds) |
2024-10-22 13:03:28 +0200 | <kaol> | They may be using an old GHC version or they may give it a catch all MonadFail instance. But this is the reason it won't work if you try it at home. |
2024-10-22 13:02:28 +0200 | caconym | (~caconym@user/caconym) caconym |
2024-10-22 13:02:24 +0200 | <tromp> | oh, i can still run it online with the "Try it online! link |
2024-10-22 13:01:41 +0200 | <kaol> | That's "old" for the purpose of this difference. |
2024-10-22 13:01:09 +0200 | <tromp> | it's a post from 2017 |
2024-10-22 13:00:42 +0200 | <kaol> | Monad used to have "fail" as a part of it and old code on the Internet may still expect that to work. |
2024-10-22 13:00:14 +0200 | <tromp> | and the author provides the output of running the code |
2024-10-22 13:00:05 +0200 | alexherbo2 | (~alexherbo@2a02-8440-3211-c257-559a-6e1d-739b-a378.rev.sfr.net) alexherbo2 |
2024-10-22 13:00:05 +0200 | caconym | (~caconym@user/caconym) (Quit: bye) |
2024-10-22 12:59:27 +0200 | <tromp> | i took the code from https://codegolf.stackexchange.com/questions/105991/combinatory-conundrum/106008#106008 (top answer) |
2024-10-22 12:58:53 +0200 | <merijn> | tromp: And N.NonEmpty (according to GHC) does not have a MonadFail instance |
2024-10-22 12:58:28 +0200 | <merijn> | tromp: Any pattern that can fail incurs a MonadFail constraint when used on the left hand of <- |
2024-10-22 12:55:26 +0200 | <tromp> | and followed by just b |
2024-10-22 12:55:12 +0200 | <tromp> | it's after a N.sort $ do |
2024-10-22 12:54:38 +0200 | <mauke> | ? |
2024-10-22 12:54:27 +0200 | <tromp> | looks like it wants to skip those |
2024-10-22 12:54:26 +0200 | mreh | (~matthew@host86-128-2-51.range86-128.btcentralplus.com) (Ping timeout: 255 seconds) |
2024-10-22 12:54:08 +0200 | <mauke> | what do you want to happen if the pattern doesn't match? |
2024-10-22 12:53:49 +0200 | <tromp> | doing A b <- ts where ts is N.NonEmpty Term |
2024-10-22 12:52:35 +0200 | <tromp> | I'm getting a compilation error: • No instance for (MonadFail N.NonEmpty) |
2024-10-22 12:50:29 +0200 | lortabac | (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) lortabac |
2024-10-22 12:49:37 +0200 | lxsameer | (~lxsameer@Serene/lxsameer) (Ping timeout: 244 seconds) |
2024-10-22 12:39:35 +0200 | kuribas | (~user@ip-188-118-57-242.reverse.destiny.be) (Ping timeout: 255 seconds) |
2024-10-22 12:32:42 +0200 | synchromesh | (~john@2406:5a00:2497:300:dc88:9a2b:e157:f2e6) synchromesh |
2024-10-22 12:30:39 +0200 | synchromesh | (~john@2406:5a00:2497:300:dc88:9a2b:e157:f2e6) (Read error: Connection reset by peer) |
2024-10-22 12:25:15 +0200 | merijn | (~merijn@77.242.116.146) merijn |
2024-10-22 12:14:31 +0200 | mceresa | (~mceresa@user/mceresa) mceresa |
2024-10-22 12:12:10 +0200 | lortabac | (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Quit: WeeChat 4.2.2) |
2024-10-22 12:12:04 +0200 | myme | (~myme@2a01:799:d5c:5f00:3450:111a:e305:e38a) myme |
2024-10-22 12:11:41 +0200 | merijn | (~merijn@77.242.116.146) (Ping timeout: 255 seconds) |
2024-10-22 12:08:59 +0200 | xff0x | (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) (Ping timeout: 255 seconds) |
2024-10-22 12:01:25 +0200 | Unicorn_Princess | (~Unicorn_P@user/Unicorn-Princess/x-3540542) Unicorn_Princess |
2024-10-22 11:58:42 +0200 | myme | (~myme@40.51-175-185.customer.lyse.net) (Ping timeout: 248 seconds) |
2024-10-22 11:56:41 +0200 | merijn | (~merijn@77.242.116.146) merijn |