[Haskell-cafe] How to create a list of each constructor value
PICCA Frederic-Emmanuel
frederic-emmanuel.picca at synchrotron-soleil.fr
Wed Nov 30 15:37:09 UTC 2022
Thanks you all for these rapid answers
----- Le 30 Nov 22, à 16:21, Henning Thielemann lemming at henning-thielemann.de a écrit :
> On Wed, 30 Nov 2022, PICCA Frederic-Emmanuel wrote:
>
>> Hello, I have a type like this
>>
>> data InputType = CristalK6C
>> | MarsFlyscan
>> | MarsSbs
>> | SixsFlyMedH
>> | SixsFlyMedV
>> | SixsFlyMedVEiger
>> | SixsFlyMedVS70
>> | SixsFlyScanUhv
>> | SixsFlyScanUhv2
>> | SixsFlyScanUhvTest
>> | SixsFlyScanUhvUfxc
>> | SixsSbsFixedDetector
>> | SixsSbsMedH
>> | SixsSbsMedV
>> | SixsSbsMedVFixDetector
>> deriving (Eq, Show)
>>
>> 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]
More information about the Haskell-Cafe
mailing list