Import Upstream version 20180207
[hcoop/debian/mlton.git] / lib / mlton / env / poly-cache.sig
CommitLineData
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
8signature POLY_CACHE =
9 sig
10 include FINITE_FUNCTION
11
12 val addNew: ('a, 'b) t * 'a * 'b -> unit
13 val eq: ('a, 'b) t * ('a, 'b) t -> bool
14 val fromList: {equal: 'a * 'a -> bool, elements: ('a * 'b) list} -> ('a, 'b) t
15 val getOrAdd: ('a, 'b) t * 'a * (unit -> 'b) -> 'b
16 val new: {equal: 'a * 'a -> bool} -> ('a, 'b) t
17 val peek: ('a, 'b) t * 'a -> 'b option
18 val toList: ('a, 'b) t -> ('a * 'b) list
19 end