klequis / zz-haskell-notebook

Notes from learning Haskell
1 stars 0 forks source link

`type` keyword #67

Open klequis opened 2 years ago

klequis commented 2 years ago

The type keyword declares a type synonym, or type alias. The below are all Integer types, but we can give them different names to make them easier for human eyes to distinguish in type signatures.

type Numerator = Integer
type Denominator = Integer
type Quotient = Integer

dividedBy :: Numerator
    -> Denominator
    -> Quotient
dividedBy = div

type is used to make types easier for humans to distinguish.