I'm trying to create a 'Person' type where each person has a sex and a name.
data Sex = Sex Char deriving Show
male = Sex 'M'
female = Sex 'F'
data Name = Name [Char] deriving Show
data Person = Person {
Sex :: Sex,
Name :: Name
} deriving (Show)
When I try to load this in ghci I just get the unhelpful error parse error on input 'Sex'
What am I doing wrong here?