-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPersons.hs
30 lines (23 loc) · 816 Bytes
/
Persons.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module Persons
( Person(..)
, Car(..)
) where
data Person = Person { firstName :: String
, lastName :: String
, age :: Int
} deriving (Eq, Show, Read)
data Car = Car {company :: String
, model :: String
, year :: Int
} deriving (Show)
-- Car a b c || type constructor
data Day = Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | Sunday
deriving (Eq, Ord, Show, Read, Bounded, Enum)
type AssocList k v = [(k,v)]
--[(1,2),(3,5),(8,9)] :: AssocList Int Int
type PhoneNumber = String
type Name = String
type PhoneBook = [(Name,PhoneNumber)]
type IntMap v = Map Int v
type IntMap = Map Int
data Either a b = Left a | Right b deriving (Eq, Ord, Read, Show)