Newest at the top
| 2026-06-23 07:57:27 +0000 | califax_ | califax |
| 2026-06-23 07:57:27 +0000 | gmg | (~user@user/gehmehgeh) gehmehgeh |
| 2026-06-23 07:57:05 +0000 | marinelli | (~weechat@gateway/tor-sasl/marinelli) marinelli |
| 2026-06-23 07:56:59 +0000 | tusko | (~uwu@user/tusko) tusko |
| 2026-06-23 07:56:53 +0000 | yanmaani | (~yanmaani@gateway/tor-sasl/yanmaani) yanmaani |
| 2026-06-23 07:56:31 +0000 | tusko | (~uwu@user/tusko) (Ping timeout: 245 seconds) |
| 2026-06-23 07:56:31 +0000 | gmg | (~user@user/gehmehgeh) (Ping timeout: 245 seconds) |
| 2026-06-23 07:56:31 +0000 | califax | (~califax@user/califx) (Ping timeout: 245 seconds) |
| 2026-06-23 07:56:13 +0000 | califax_ | (~califax@user/califx) califx |
| 2026-06-23 07:56:06 +0000 | yanmaani | (~yanmaani@gateway/tor-sasl/yanmaani) (Ping timeout: 245 seconds) |
| 2026-06-23 07:56:06 +0000 | marinelli | (~weechat@gateway/tor-sasl/marinelli) (Ping timeout: 245 seconds) |
| 2026-06-23 07:52:09 +0000 | merijn | (~merijn@2a02:a420:22df:d034:8458:927c:ac6e:3896) (Ping timeout: 248 seconds) |
| 2026-06-23 07:46:41 +0000 | terrorjack | (~terrorjac@2a01:4f8:271:2d98::2) terrorjack |
| 2026-06-23 07:42:14 +0000 | terrorjack | (~terrorjac@2a01:4f8:271:2d98::2) (Quit: The Lounge - https://thelounge.chat) |
| 2026-06-23 07:40:15 +0000 | karenw_ | (~karenw@user/karenw) (Quit: Deep into that darkness peering...) |
| 2026-06-23 07:39:52 +0000 | <lambdabot> | 32768 |
| 2026-06-23 07:39:51 +0000 | <gentauro> | > (length . take maxBound) [0 :: Int16 ..] |
| 2026-06-23 07:37:41 +0000 | <humasect> | ah i miss haskell . |
| 2026-06-23 07:37:25 +0000 | <lambdabot> | *Exception: <<timeout>> |
| 2026-06-23 07:37:18 +0000 | <mauke> | > (length . take maxBound) [0 ..] |
| 2026-06-23 07:34:57 +0000 | <gentauro> | mauke: `length . take maxBound` -> `✲ Name: Infinite: ghc-internal/length` |
| 2026-06-23 07:25:54 +0000 | humasect | (~humasect@dyn-192-249-132-90.nexicom.net) humasect |
| 2026-06-23 07:24:50 +0000 | merijn | (~merijn@2a02:a420:22df:d034:8458:927c:ac6e:3896) merijn |
| 2026-06-23 07:23:44 +0000 | <lambdabot> | [a] -> Int |
| 2026-06-23 07:23:43 +0000 | <mauke> | :t length . take maxBound |
| 2026-06-23 07:23:34 +0000 | tromp | (~textual@2001:1c00:340e:2700:f85c:5d3d:452:a65a) |
| 2026-06-23 07:23:32 +0000 | fp1 | (~Thunderbi@130.233.70.229) fp |
| 2026-06-23 07:21:41 +0000 | <probie> | We're allowed to diverge right, so you're happy with `head xs = case xs of { x:_ -> x; [] -> let x = x in x }` since it's as "total" as `length` |
| 2026-06-23 07:20:31 +0000 | <gentauro> | pattern-matching SHOULD be the way |
| 2026-06-23 07:20:11 +0000 | <gentauro> | probie: tbh, `head` shouldn't even exists in the first place … |
| 2026-06-23 07:19:30 +0000 | <probie> | To clarify, I think it's a silly rule to raise a warning about, but not that much more silly than the one for `head` |
| 2026-06-23 07:16:34 +0000 | tzh | (~tzh@c-76-115-131-146.hsd1.or.comcast.net) (Quit: zzz) |
| 2026-06-23 07:15:50 +0000 | <probie> | If you want to make `length` total, just stick `take n` (for some large n) in front of the list you're calling `length` on |
| 2026-06-23 07:14:07 +0000 | <lambdabot> | (GT,EQ,LT) |
| 2026-06-23 07:14:06 +0000 | <probie> | > let n `compareWithLength` xs = foldr (\x k acc -> if acc <= 0 then LT else k $! (acc - 1)) (\acc -> if acc == 0 then EQ else GT) xs n in (42 `compareWithLength` [1..5], 42 `compareWithLength` [1..42], 42 `compareWithLength` [1..]) |
| 2026-06-23 07:11:36 +0000 | <pavonia> | Right. To me this seems like a too restrictive check |
| 2026-06-23 07:10:13 +0000 | <probie> | (if you still want your code to be total) |
| 2026-06-23 07:10:03 +0000 | chele | (~chele@user/chele) chele |
| 2026-06-23 07:09:59 +0000 | <probie> | What you can't do is compare the length of two lists or treat the length as an Int |
| 2026-06-23 07:09:20 +0000 | <probie> | You can compare an `Int` against the length of a list |
| 2026-06-23 07:08:57 +0000 | <pavonia> | probie: But isn't that just deferring the problem to other functions? If you want to do comparisons with the length of the list you could run into the same issue |
| 2026-06-23 07:06:58 +0000 | merijn | (~merijn@62.45.136.136) (Ping timeout: 276 seconds) |
| 2026-06-23 07:06:34 +0000 | <gentauro> | `length (A l _) = l` 👍 |
| 2026-06-23 07:04:04 +0000 | <gentauro> | hmmm, perhaps that now that I have push access to Hackage. Maybe I should invest time to add my `Data.Array.Log{32|64|128|256}` -> https://blog.stermon.org/articles/2020/05/22/haskell-data-array-log256-safe-idiomatic-and-bottom.h… |
| 2026-06-23 07:03:54 +0000 | <probie> | `data N = Z | S N`, `length = foldr (const S) Z` |
| 2026-06-23 07:03:17 +0000 | <pavonia> | How would you check the length of a list in a productive way then? |
| 2026-06-23 07:01:56 +0000 | merijn | (~merijn@62.45.136.136) merijn |
| 2026-06-23 07:00:59 +0000 | <probie> | I think both are equally valid warnings. `head` is a partial function and `length` is not a productive function |
| 2026-06-23 06:58:57 +0000 | dextaa | (~DV@user/dextaa) (Ping timeout: 271 seconds) |
| 2026-06-23 06:56:36 +0000 | <pavonia> | No idea, tbh. You can't really check whether a list is infinite |