signature Queue =
sig
type a Queue
val empty : a Queue
val isEmpty : a Queue -> bool
val snoc : a Queue × a -> a Queue
val head : a Queue -> a (* raises Empty if queue is empty *)
val tail : a Queue -> a Queue (* raises Empty if queue is empty *)
type a Queue = a list × a list
type a Queue = int × a Stream × int × a Stream
type a Queue = a list × int × a list susp × int × a list
type a Queue = a Stream × a list × a Stream
datatype a RotationState =
Idle
| Reversing of int × a list × a list × a list × a list
| Appending of int × a list × a list
| Done of a list
type a Queue = int × a list × a RotationState × int × a list