Is it possible to create a list of possible type values? For example.
data Shape = Circle | Rectangle | Triangle | Pentagon
to
[Circle,Rectangle,Triangle,Pentagon]
Yes maybe. These are duty of Enum and Bounded type classes, for example
λ data Shape = Circle | Rectangle | Triangle | Pentagon deriving (Show, Enum, Bounded) λ [minBound .. maxBound] :: [Shape] [Circle,Rectangle,Triangle,Pentagon] λ [minBound ..] :: [Shape] [Circle,Rectangle,Triangle,Pentagon]