I'm trying to convert a SML type to a Haskell type.
type Identifier = string
type 'a Environment = (Identifier * 'a) list
CodePudding user response:
I guess the same code in Haskell could be
type Identifier = String
type Environment a = [(Identifier, a)]
Still, I would recommend to use newtype
s to increase type safety, like in
newtype Identifier = Identifier String
newtype Environment a = Environment [(Identifier, a)]