Skip to content

Instantly share code, notes, and snippets.

@vvviiimmm
Created January 7, 2019 14:42
Show Gist options
  • Save vvviiimmm/bf9818ca1db557fb82d185fe10e9ab85 to your computer and use it in GitHub Desktop.
Save vvviiimmm/bf9818ca1db557fb82d185fe10e9ab85 to your computer and use it in GitHub Desktop.
-- Person is a product type consisting of 3 fields
data Person = Person
{ name :: String
, age :: Int
, address :: Address
}
-- Address is a product type on its own
data Address = Address
{ country :: String
, city :: String
, street :: String
}
-- In order to create Position you have to provide all 3 coordinates
data Position = Position
{ x :: Integer
, y :: Integer
, z :: Integer
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment