structure IntStack : QueueSig = struct exception Deq type Item = int abstype Queue = Q of Item list with val empty = Q [] fun isEmpty (Q []) = true | isEmpty _ = false fun enq(Q s, e) = Q(e :: s) fun deq(Q(h :: t)) = (Q t, h) | deq _ = raise Deq end end;