I am trying to create an interpreter for a functional language in haskell (I am new to the language). I am creating, perhaps, a strange combination of minimalism and convenience - no abstract data types, but I want to provide the ability to create uniform lists.
So my main variables are data Datum = DatInt Int | DatDbl Double | DatBool Bool data Datum = DatInt Int | DatDbl Double | DatBool Bool data Datum = DatInt Int | DatDbl Double | DatBool Bool , and I realized that I'm not at all sure how to present homogeneous lists. Adding a List Datum constructor or something like that would make a heterogeneous list, and create a separate list for each type, i.e. ListInt [Int] | ListDbl [Double] ListInt [Int] | ListDbl [Double] , would exclude lists of lists.
What would be the best way to present a uniform list?
source share