A stack.
import Stack as S
S.isEmpty S.empty == True
S.push 2 (S.push 1 S.empty) == S.fromList [ 2, 1 ]
S.top (S.fromList [ 2, 1 ]) == Just 2
S.pop (S.fromList [ 3, 2, 1 ]) == Just ( 3, S.fromList [ 2, 1 ])
S.toList (S.fromList [ 4, 3, 2, 1 ]) == [ 4, 3, 2, 1 ]
type Stack a
-- Construct
empty : Stack a
fromList : List a -> Stack a
-- Query
isEmpty : Stack a -> Bool
top : Stack a -> Maybe a
-- Modify
push : a -> Stack a -> Stack a
pop : Stack a -> Maybe ( a, Stack a )
-- Convert
toList : Stack a -> List a