[Haskell-cafe] How to create a list of each constructor value
Henning Thielemann
lemming at henning-thielemann.de
Sat Dec 3 19:12:59 UTC 2022
On Sat, 3 Dec 2022, Joachim Breitner wrote:
> Hi,
>
> Am Mittwoch, dem 30.11.2022 um 16:21 +0100 schrieb Henning Thielemann:
>> > I want to create a list of each values in order to create meaningfull
>> > error message for the user and simplify my Arbitrary instances.
>>
>> deriving (Enum, Bounded)
>>
>> then use [minBound .. maxBound]
>
> if you want to golf it a bit more, then
>
> [minBound..]
>
> works as well.
Wouldn't this create an infinite tail of undefined values?
More information about the Haskell-Cafe
mailing list