Import Debian changes 20180207-1
[hcoop/debian/mlton.git] / basis-library / primitive / prim-char.sml
CommitLineData
7f918cf1
CE
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(* Primitive names are special -- see atoms/prim.fun. *)
10
11structure Primitive = struct
12
13open Primitive
14
15structure Char8 =
16 struct
17 open Char8
18
19 val < = _prim "WordU8_lt": char * char -> bool;
20
21 val idToWord8 = _prim "WordU8_extdToWord8": char -> Word8.word;
22 val idFromWord8 = _prim "WordU8_extdToWord8": Word8.word -> char;
23 val idToInt8 = _prim "WordS8_extdToWord8": char -> Int8.int;
24 val idFromInt8 = _prim "WordS8_extdToWord8": Int8.int -> char;
25 end
26structure Char8 =
27 struct
28 open Char8
29 local
30 structure S = IntegralComparisons(Char8)
31 in
32 open S
33 end
34 end
35
36structure Char16 =
37 struct
38 open Char16
39
40 val < = _prim "WordU16_lt": char * char -> bool;
41
42 val idToWord16 = _prim "WordU16_extdToWord16": char -> Word16.word;
43 val idFromWord16 = _prim "WordU16_extdToWord16": Word16.word -> char;
44 val idToInt16 = _prim "WordS16_extdToWord16": char -> Int16.int;
45 val idFromInt16 = _prim "WordS16_extdToWord16": Int16.int -> char;
46 end
47structure Char16 =
48 struct
49 open Char16
50 local
51 structure S = IntegralComparisons(Char16)
52 in
53 open S
54 end
55 end
56
57structure Char32 =
58 struct
59 open Char32
60
61 val < = _prim "WordU32_lt": char * char -> bool;
62
63 val idToWord32 = _prim "WordU32_extdToWord32": char -> Word32.word;
64 val idFromWord32 = _prim "WordU32_extdToWord32": Word32.word -> char;
65 val idToInt32 = _prim "WordS32_extdToWord32": char -> Int32.int;
66 val idFromInt32 = _prim "WordS32_extdToWord32": Int32.int -> char;
67 end
68structure Char32 =
69 struct
70 open Char32
71 local
72 structure S = IntegralComparisons(Char32)
73 in
74 open S
75 end
76 end
77
78end