Newest at the top
| 2026-04-21 16:01:42 +0000 | kupi | (uid212005@id-212005.hampstead.irccloud.com) (Quit: Connection closed for inactivity) |
| 2026-04-21 16:01:02 +0000 | craunts795335385 | (~craunts@152.32.100.66) (Quit: The Lounge - https://thelounge.chat) |
| 2026-04-21 15:48:04 +0000 | puke | (~puke@user/puke) puke |
| 2026-04-21 15:47:39 +0000 | puke | (~puke@user/puke) (Remote host closed the connection) |
| 2026-04-21 15:47:01 +0000 | karenw | (~karenw@user/karenw) karenw |
| 2026-04-21 15:45:36 +0000 | <merijn> | But that's just generalised First |
| 2026-04-21 15:45:19 +0000 | <merijn> | There's Alt |
| 2026-04-21 15:43:11 +0000 | <dutchie> | which is I suppose why First exists |
| 2026-04-21 15:43:03 +0000 | <dutchie> | for some reason I thought there was some sort of Alternative a => Alternative (b -> a) instance but that doesn't even make sense |
| 2026-04-21 15:41:46 +0000 | <merijn> | If you have like, 5+ methods it could be worth it |
| 2026-04-21 15:41:32 +0000 | <merijn> | Yes, hence why I don't think it works for just two |
| 2026-04-21 15:41:09 +0000 | <dutchie> | that is a lot noisier than the fromMaybe thing above, especially when you throw the last pure function in |
| 2026-04-21 15:40:02 +0000 | <dutchie> | i don't much like repeating the x |
| 2026-04-21 15:39:59 +0000 | <merijn> | getFirst $ mconcat [First . f, First . g] x |
| 2026-04-21 15:39:22 +0000 | <dutchie> | I thought that I'd need that instance but couldn't work out how to invoke it |
| 2026-04-21 15:39:20 +0000 | <merijn> | tbh, then I don't think the monoid solution will improve much over just the <|> alternative |
| 2026-04-21 15:38:56 +0000 | <dutchie> | just two and then the "pure" one |
| 2026-04-21 15:38:50 +0000 | <merijn> | dutchie: Yeah |
| 2026-04-21 15:38:47 +0000 | <merijn> | Is it just two alternatives or more |
| 2026-04-21 15:38:41 +0000 | <dutchie> | merijn: the Monoid a => Monoid (x -> a) one? |
| 2026-04-21 15:38:19 +0000 | <dutchie> | `fromMaybe (h x) (f x <|> g x)` feels ugly |
| 2026-04-21 15:38:05 +0000 | <merijn> | dutchie: You can always make use of our friend, the best monoid instance ever |
| 2026-04-21 15:37:47 +0000 | jmcantrell_ | jmcantrell |
| 2026-04-21 15:37:42 +0000 | jmcantrell_ | (~weechat@user/jmcantrell) jmcantrell |
| 2026-04-21 15:37:37 +0000 | <dutchie> | yeah. i've also got an `h :: Foo -> Bar` that I want to run as a last resort too |
| 2026-04-21 15:37:15 +0000 | <merijn> | Get the first "Just"? |
| 2026-04-21 15:36:42 +0000 | <merijn> | What are you trying to do? |
| 2026-04-21 15:36:07 +0000 | <dutchie> | or should I do some `asum . fmap ($ x)` thing |
| 2026-04-21 15:34:41 +0000 | <dutchie> | hmm, is there no nice Alternative instance to let me do `f <|> g $ x` where `f, g :: Foo -> Maybe Bar` |
| 2026-04-21 15:19:12 +0000 | danza | (~danza@user/danza) (Ping timeout: 244 seconds) |
| 2026-04-21 15:17:28 +0000 | danz66376 | (~danza@user/danza) danza |
| 2026-04-21 15:16:20 +0000 | tromp | (~textual@2001:1c00:340e:2700:463:2385:89e0:6cf) |
| 2026-04-21 15:15:49 +0000 | havochunter | (~havochunt@2a02-a467-ef2-0-f6c3-1c29-6870-3369.fixed6.kpn.net) |
| 2026-04-21 15:09:37 +0000 | gentauro | >>> head [] *** Exception: Prelude.head: empty list |
| 2026-04-21 15:09:22 +0000 | gentauro | -> https://hackage-content.haskell.org/package/base-4.22.0.0/docs/Prelude.html#v:head |
| 2026-04-21 15:08:46 +0000 | <gentauro> | :( |
| 2026-04-21 15:08:43 +0000 | <yahb2> | <interactive>:1:1: error: [GHC-76037] Not in scope: ‘List.head’ |
| 2026-04-21 15:08:42 +0000 | <gentauro> | % :i List.head |
| 2026-04-21 15:08:31 +0000 | <gentauro> | :| |
| 2026-04-21 15:08:27 +0000 | <lambdabot> | <hint>:1:1: error: parse error on input `:' |
| 2026-04-21 15:08:26 +0000 | <gentauro> | > :t head |
| 2026-04-21 15:08:21 +0000 | <yahb2> | <interactive>:1:1: warning: [GHC-63394] [-Wx-partial] ; In the use of ‘head’ ; (imported from Prelude, but defined in GHC.Internal.List): ; "This is a partial function, it throws an err... |
| 2026-04-21 15:08:21 +0000 | <gentauro> | % :t head |
| 2026-04-21 15:08:17 +0000 | <gentauro> | dminuoso: so does `head` ;) |
| 2026-04-21 15:05:09 +0000 | craunts795335385 | (~craunts@152.32.100.66) |
| 2026-04-21 15:03:12 +0000 | craunts795335385 | (~craunts@152.32.99.2) (Ping timeout: 265 seconds) |
| 2026-04-21 14:50:45 +0000 | machinedgod | (~machinedg@d172-219-48-230.abhsia.telus.net) machinedgod |
| 2026-04-21 14:48:00 +0000 | confusedalex | (~confuseda@user/confusedalex) confusedalex |
| 2026-04-21 14:42:32 +0000 | arandombit | (~arandombi@user/arandombit) arandombit |
| 2026-04-21 14:40:43 +0000 | tromp | (~textual@2001:1c00:340e:2700:c9bc:b29c:36e3:d32a) (Quit: My iMac has gone to sleep. ZZZzzz…) |