
3 Dec
2022
3 Dec
'22
7:17 p.m.
Hi, Am Samstag, dem 03.12.2022 um 20:12 +0100 schrieb Henning Thielemann:
if you want to golf it a bit more, then
[minBound..]
works as well.
Wouldn't this create an infinite tail of undefined value
That’s what I thought until I learned about this. Anyways, ghci says it doesn’t: ghci> [False .. ] [False,True] ghci> [LT .. ] [LT,EQ,GT] [x..] is just enumFrom x, and the docs for Enum says
enumFrom and enumFromThen should be defined with an implicit bound,
https://hackage.haskell.org/package/base-4.17.0.0/docs/Prelude.html#t:Enum Cheers, Joachim -- Joachim Breitner mail@joachim-breitner.de http://www.joachim-breitner.de/