Import Upstream version 20180207
[hcoop/debian/mlton.git] / mlton / atoms / con-.fun
1 (* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
2 * Jagannathan, and Stephen Weeks.
3 * Copyright (C) 1997-2000 NEC Research Institute.
4 *
5 * MLton is released under a BSD-style license.
6 * See the file MLton-LICENSE for details.
7 *)
8
9 functor Con (S: CON_STRUCTS): CON =
10 struct
11
12 open S
13
14 structure C = Id (val noname = "C")
15 open C
16
17 structure P = PrimCons (C)
18 open P
19
20 val all = [cons, falsee, nill, reff, truee, bind, match]
21
22 fun stats () =
23 let
24 open Layout
25 in
26 align
27 (List.map (all, fn c =>
28 seq [layout c, str " size is ",
29 Int.layout (MLton.size c),
30 str " plist length is ",
31 Int.layout (PropertyList.length (plist c))]))
32 end
33 (* quell unused warning *)
34 val _ = stats
35
36 fun fromBool b = if b then truee else falsee
37
38 end