Import Debian changes 20180207-1
[hcoop/debian/mlton.git] / mlton / atoms / const.sig
CommitLineData
7f918cf1
CE
1(* Copyright (C) 2009,2014,2017 Matthew Fluet.
2 * Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
3 * Jagannathan, and Stephen Weeks.
4 * Copyright (C) 1997-2000 NEC Research Institute.
5 *
6 * MLton is released under a BSD-style license.
7 * See the file MLton-LICENSE for details.
8 *)
9
10signature CONST_STRUCTS =
11 sig
12 structure RealX: REAL_X
13 structure WordX: WORD_X
14 structure WordXVector: WORD_X_VECTOR
15 sharing WordX = RealX.WordX = WordXVector.WordX
16 end
17
18signature CONST =
19 sig
20 include CONST_STRUCTS
21
22 structure ConstType: CONST_TYPE
23 sharing ConstType.RealSize = RealX.RealSize
24 sharing ConstType.WordSize = WordX.WordSize
25
26 structure IntInfRep:
27 sig
28 datatype t = Big of WordXVector.t | Small of WordX.t
29 val bigToIntInf: WordXVector.t -> IntInf.t option
30 val fromIntInf: IntInf.t -> t
31 val smallToIntInf: WordX.t -> IntInf.t option
32 end
33
34 datatype t =
35 IntInf of IntInf.t
36 | Null
37 | Real of RealX.t
38 | Word of WordX.t
39 | WordVector of WordXVector.t
40
41 val deWord: t -> WordX.t
42 val deWordOpt: t -> WordX.t option
43 val equals: t * t -> bool
44 val intInf: IntInf.t -> t
45 val hash: t -> word
46 val layout: t -> Layout.t
47 (* lookup is for constants defined by _const, _build_const, and
48 * _command_line_const. It is set in main/compile.fun.
49 *)
50 val lookup: ({default: string option,
51 name: string} * ConstType.t -> t) ref
52 val null: t
53 val real: RealX.t -> t
54 val string: string -> t
55 val toString: t -> string
56 val word: WordX.t -> t
57 val wordVector: WordXVector.t -> t
58 end