
3 Dec
2022
3 Dec
'22
7:05 p.m.
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. (I vaguely remember that there was a variant that didn’t even need Bounded, just, but I don’t recall it right now. Maybe it was [toEnum 0..]? but that only works for certain instances.) Cheers, Joachim -- Joachim Breitner mail@joachim-breitner.de http://www.joachim-breitner.de/