class Stack stack where empty :: stack a push :: a -> stack a -> stack a pop :: stack a -> stack a top :: stack a -> a is_empty :: stack a -> Bool instance Stack [] where empty = [] push = (:) pop = tail top = head is_empty = null test = top . pop . push 8 . push 3 $ (empty :: [Integer])