62 lines · 2.2 KB · Standard ML
RawDownload
(* Intmap -- Applicative maps with integer keys                  *)(* From SML/NJ lib 0.2, copyright 1993 by AT&T Bell Laboratories *)(* Original implementation due to Stephen Adams, Southampton, UK *) type 'a intmap exception NotFound val empty     : unit -> 'a intmapval insert    : 'a intmap * int * 'a -> 'a intmapval retrieve  : 'a intmap * int -> 'aval peek      : 'a intmap * int -> 'a optionval remove    : 'a intmap * int -> 'a intmap * 'aval numItems  : 'a intmap ->  intval listItems : 'a intmap -> (int * 'a) listval app       : (int * 'a -> unit) -> 'a intmap -> unitval revapp    : (int * 'a -> unit) -> 'a intmap -> unitval foldr     : (int * 'a * 'b -> 'b) -> 'b -> 'a intmap -> 'bval foldl     : (int * 'a * 'b -> 'b) -> 'b -> 'a intmap -> 'bval map       : (int * 'a -> 'b) -> 'a intmap -> 'b intmapval transform : ('a -> 'b) -> 'a intmap -> 'b intmap (*    ['a intmap] is the type of applicative maps from int to 'a.    [empty] creates a new empty map.    [insert(m, i, v)] extends (or modifies) map m to map i to v.    [retrieve(m, i)] returns v if m maps i to v; otherwise raises   NotFound.    [peek(m, i)] returns SOME v if m maps i to v; otherwise NONE.    [remove(m, i)] removes i from the domain of m and returns the   modified map and the element v corresponding to i.  Raises NotFound   if i is not in the domain of m.    [numItems m] returns the number of entries in m (that is, the size   of the domain of m).    [listItems m] returns a list of the entries (i, v) of integers i and   the corresponding values v in m, in increasing order of i.    [app f m] applies function f to the entries (i, v) in m, in   increasing order of i.    [revapp f m] applies function f to the entries (i, v) in m, in   decreasing order of i.    [foldl f e m] applies the folding function f to the entries (i, v)   in m, in increasing order of i.    [foldr f e m] applies the folding function f to the entries (i, v)   in m, in decreasing order of i.    [map f m] returns a new map whose entries have form (i, f(i,v)),   where (i, v) is an entry in m.    [transform f m] returns a new map whose entries have form (i, f(i,v)),   where (i, v) is an entry in m.*)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t