Skip to content

Instantly share code, notes, and snippets.

@vito
Created January 13, 2009 00:45
Show Gist options
  • Save vito/46270 to your computer and use it in GitHub Desktop.
Save vito/46270 to your computer and use it in GitHub Desktop.
data Gender = Male | Female
data Person = Person { name :: String
, gender :: Gender
, doSomething :: Bool -> Bool
}
bill = Person { name = "Bill"
, gender = Male
, doSomething = not
}
main = do print $ (doSomething bill) True -- Use their "doSomething" function on True
print $ name bill -- Their name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment