Slide 5
Slide 5 text
Type Signatures
Types:
Haskell -> () Int Float Char String
OCaml -> unit int float char string
Composite Types:
Haskell -> (Int, Int) [Bool]
OCaml -> int * int bool list
Data Types:
Haskell -> data Tree a = Node a (Tree a) (Tree a) | Leaf
OCaml -> type 'a tree = Node of 'a * 'a tree * 'a tree | Leaf
Records:
Haskell -> data Vinyl = Vinyl {artist :: Text, tracks :: [string]}
OCaml -> type vinyl = {artist : Text; tracks : string list}