Import Upstream version 20180207
[hcoop/debian/mlton.git] / lib / stubs / basis-stubs-for-smlnj / int.sml
... / ...
CommitLineData
1(* Copyright (C) 2009 Matthew Fluet.
2 * Copyright (C) 1999-2006 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
10functor FixInt(PInt: sig include INTEGER end) : INTEGER =
11 struct
12 open PInt
13
14 local
15 (* SML/NJ uses lower instead of upper case. *)
16 val toUpper = String.translate (Char.toString o Char.toUpper)
17 in
18 fun fmt r w = toUpper (PInt.fmt r w)
19 fun toString w = toUpper (PInt.toString w)
20 end
21 end
22
23structure FixedInt = FixInt(struct open Pervasive.FixedInt end)
24structure Int = FixInt(struct open Pervasive.Int end)
25structure Int31 = FixInt(struct open Pervasive.Int31 end)
26structure Int32 = FixInt(struct open Pervasive.Int32 end)
27structure Int64 = FixInt(struct open Pervasive.Int64 end)
28structure LargeInt = FixInt(struct open Pervasive.LargeInt end)
29structure Position = FixInt(struct open Pervasive.Position end)