%export stack
        empty push isempty top pop stack_contents
abstype stack *
with empty :: stack *
     push :: * -> stack * -> stack *
     isempty :: stack * -> bool
     top :: stack * -> *
     pop :: stack * -> stack *
     stack_contents :: stack * -> [*]
     showstack :: (* -> [char]) -> (stack *) -> [char]
  stack * == [*]
    empty = []
    push = :
    isempty = (=[])
    top (a:x) = a
    pop (a:x) = x
    stack_contents = id
    showstack showelement x 
      = "<" ++ restofshowstack (map showelement x)
        where
        restofshowstack [] = ">"
        restofshowstack [a] = a++">"
        restofshowstack (a:x) = a++","++restofshowstack x
