Commit | Line | Data |
---|---|---|
7f918cf1 CE |
1 | (* Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh |
2 | * Jagannathan, and Stephen Weeks. | |
3 | * | |
4 | * MLton is released under a BSD-style license. | |
5 | * See the file MLton-LICENSE for details. | |
6 | *) | |
7 | (*-------------------------------------------------------------------*) | |
8 | (* PersistentQueue *) | |
9 | (*-------------------------------------------------------------------*) | |
10 | ||
11 | functor PersistentQueue(Q: BASIC_PERSISTENT_QUEUE) | |
12 | : PERSISTENT_QUEUE = | |
13 | struct | |
14 | ||
15 | open Q | |
16 | ||
17 | exception Deque | |
18 | fun deque q = | |
19 | case destruct q of | |
20 | SOME xq => xq | |
21 | | NONE => raise Deque | |
22 | ||
23 | end |