structure Queue1:QueueSig = struct abstype 'a Queue = Q of 'a list with val empty = Q [] fun isEmpty (Q []) = true | isEmpty _ = false fun enq(Q q, e) = Q(e :: q) fun deq(Q [a]) = (Q [],a) | deq(Q (h :: t)) = let val (Q rest, last) = deq(Q t) in (Q (h :: rest), last) end end end