Import Upstream version 20180207
[hcoop/debian/mlton.git] / lib / mlton / env / array-finite-function.sig
1 (* Copyright (C) 1999-2005 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 signature ARRAY_FINITE_FUNCTION =
9 sig
10 include FINITE_FUNCTION
11
12 structure Domain :
13 sig
14 type 'a t = {size: int,
15 fromInt: int -> 'a,
16 toInt: 'a -> int}
17
18 val pair: 'a1 t * 'a2 t
19 * ('a1 -> 'a) * ('a2 -> 'a)
20 * (('a * ('a1 -> int) * ('a2 -> int)) -> int)
21 -> 'a t
22 end
23
24 val empty: 'a Domain.t -> ('a, 'b option) t
25 val new: 'a Domain.t * 'b -> ('a, 'b) t
26 val tabulate: 'a Domain.t * ('a -> 'b) -> ('a, 'b) t
27 val set: ('a, 'b) t * 'a * 'b -> unit
28 end