Newest at the top
2024-09-27 21:25:12 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) merijn |
2024-09-27 21:24:47 +0200 | vanishingideal | (~vanishing@user/vanishingideal) (Client Quit) |
2024-09-27 21:24:34 +0200 | m1dnight | (~christoph@d8D861908.access.telenet.be) m1dnight |
2024-09-27 21:24:16 +0200 | vanishingideal | (~vanishing@user/vanishingideal) vanishingideal |
2024-09-27 21:19:44 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-09-27 21:18:54 +0200 | morb | (~morb@pool-108-41-100-120.nycmny.fios.verizon.net) (Ping timeout: 276 seconds) |
2024-09-27 21:17:36 +0200 | AlexZenon | (~alzenon@178.34.162.53) |
2024-09-27 21:14:53 +0200 | <EvanR> | usually because it would be too inconvenient |
2024-09-27 21:14:31 +0200 | athan | (~athan@syn-098-153-145-140.biz.spectrum.com) (Quit: Konversation terminated!) |
2024-09-27 21:14:23 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 255 seconds) |
2024-09-27 21:13:44 +0200 | ash3en | (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) ash3en |
2024-09-27 21:13:39 +0200 | <EvanR> | sometimes with resistance sometimes not |
2024-09-27 21:13:26 +0200 | <EvanR> | safeFromJust lampoons the idea properly, but this idea comes up all the time in other languages for serious |
2024-09-27 21:13:08 +0200 | <EvanR> | to make a function safe, make it return a Maybe |
2024-09-27 21:11:51 +0200 | <dmj`> | safeMaybe x = case x of { Nothing -> Nothing; Just y -> Just y; } |
2024-09-27 21:11:31 +0200 | AlexZenon | (~alzenon@178.34.162.53) (Ping timeout: 244 seconds) |
2024-09-27 21:10:25 +0200 | <EvanR> | another function that works |
2024-09-27 21:10:10 +0200 | <lambdabot> | monochrom says: I use safeFromJust :: Maybe a -> Maybe a |
2024-09-27 21:10:10 +0200 | <monochrom> | @quote safeFromJust |
2024-09-27 21:09:25 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) merijn |
2024-09-27 21:09:03 +0200 | <EvanR> | map head . group works, but if you put a bunch more work into it and use this stuff hidden in a modular somewhere, and download a safeHead, it will still work xD |
2024-09-27 21:08:51 +0200 | <monochrom> | At least it is not Scheme Any -> Any |
2024-09-27 21:07:54 +0200 | <EvanR> | uh huh |
2024-09-27 21:05:43 +0200 | <lambdabot> | Eq a => [a] -> [a] |
2024-09-27 21:05:40 +0200 | <dmj`> | :t \xs -> [ x | x : _ <- group xs ] |
2024-09-27 21:05:09 +0200 | <monochrom> | There is another group in Data.List.NonEmpty that gives [NonEmpty a] so you don't have to worry about head. |
2024-09-27 21:04:39 +0200 | <lambdabot> | Eq a => [a] -> [a] |
2024-09-27 21:04:38 +0200 | <dmj`> | :t catMaybes . map listToMaybe . group |
2024-09-27 21:03:42 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-09-27 21:02:25 +0200 | <EvanR> | and no compiler or linter can save you |
2024-09-27 21:01:45 +0200 | <EvanR> | it's stuff like this that makes haskell still feel like a dynamic language, stuff you can do that works but slightly different crashes everything |
2024-09-27 21:01:05 +0200 | <EvanR> | not wrongheaded at all |
2024-09-27 21:00:55 +0200 | Smiles | (uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
2024-09-27 21:00:51 +0200 | <EvanR> | a use of head which is not wrong |
2024-09-27 21:00:43 +0200 | caconym | (~caconym@user/caconym) caconym |
2024-09-27 21:00:32 +0200 | <EvanR> | that's a good one |
2024-09-27 21:00:05 +0200 | caconym | (~caconym@user/caconym) (Quit: bye) |
2024-09-27 20:58:11 +0200 | <lambdabot> | Eq b => [b] -> [b] |
2024-09-27 20:58:09 +0200 | <dmj`> | :t map head . group |
2024-09-27 20:57:57 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
2024-09-27 20:57:51 +0200 | morb | (~morb@pool-108-41-100-120.nycmny.fios.verizon.net) |
2024-09-27 20:55:18 +0200 | <[exa]> | nubOrd needs Ord for sorting, I only have Eq |
2024-09-27 20:55:09 +0200 | <glguy> | monochrom: If I was paying attention to the status messages I'd have known that split was coming, but... |
2024-09-27 20:54:13 +0200 | misterfish | (~misterfis@87.215.131.102) misterfish |
2024-09-27 20:53:06 +0200 | <monochrom> | OK but if you know it's pre-sorted and don't want to sort again... |
2024-09-27 20:52:38 +0200 | <geekosaur> | it's even a bootlib! |
2024-09-27 20:52:31 +0200 | <geekosaur> | psst! https://downloads.haskell.org/ghc/latest/docs/libraries/containers-0.7-cfc3/Data-Containers-ListUt… |
2024-09-27 20:52:04 +0200 | merijn | (~merijn@204-220-045-062.dynamic.caiway.nl) merijn |
2024-09-27 20:52:01 +0200 | <monochrom> | There was a long thread on a forum where everyone competed^W shared their overpowered solutions. But I don't know of anyone who actually packaged it up and put it on hackage. |
2024-09-27 20:51:20 +0200 | <geekosaur> | Data.Containers.ListUtils in `containers` |