If I have a data type say:
data Color = Red | Yellow | Green
Is there a way I can turn this into a list of type [Color] getting all possible values? [Red, Yellow, Green]
Perhaps this is a complete anti pattern?
data Color = Red | Yellow | Green deriving Enum allColors = [Red ..]
2.1m questions
2.1m answers
60 comments
57.0k users