I want to create the following data structure, the first is an algebraic data type OneToTen and the second I want to be a list that holds all the values that OneToTen can be for future mappings I do in my program.
data OneToTen = I | II | III | IV | V | VI | VII | VIII | IX | X
???? SetOneToTen = [I, II, III, IV, V, VI, VII, VIII, IX, X]
Is this somehow possible in haskell, or should i just use a function that returns a list like the one above and work with that?
Update: My haskelly way of doing it:
data OneToTen = I | II | III | IV | V | VI | VII | VIII | IX | X
deriving (Enum, Show)
setOneToTen :: [OneToTen]
setOneToTen = [I .. X]
and then just call this function when you want the list :)