## typelocked-priority-queue.api
# Compiled by:
#
src/lib/std/standard.lib### "A rock pile ceases to be a rock pile
### the moment a single man contemplates it,
### bearing within him the image of a cathedral."
###
### -- Antoine de Saint Exupéry
# This api describes the interface to typelocked functional
# priority queues.
api Typelocked_Priority_Queue {
Item;
Queue;
empty: Queue;
singleton: Item -> Queue; # Create a queue from a single item
from_list: List( Item ) -> Queue; # Build a queue from a list of items
set: ((Item, Queue)) -> Queue; # insert an item
remove: Queue -> ((Item, Queue));
# Remove the highest priority item from the queue.
# Raise list::EMPTY if the queue is empty.
next: Queue -> Null_Or( (Item, Queue) );
# Remove the highest priority item from the queue.
# Return NULL if the queue is empty.
merge: ((Queue, Queue)) -> Queue; # Merge two queues.
vals_count: Queue -> Int; # Return the number of items in the queue
is_empty: Queue -> Bool; # Return TRUE, iff the queue is empty
};
## COPYRIGHT (c) 2002 Bell Labs, Lucent Technologies
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.