1 (* Copyright (C
) 1999-2005, 2008 Henry Cejtin
, Matthew Fluet
, Suresh
2 * Jagannathan
, and Stephen Weeks
.
3 * Copyright (C
) 1997-2000 NEC Research Institute
.
5 * MLton is released under a BSD
-style license
.
6 * See the file MLton
-LICENSE for details
.
9 _overload ~
: ('a
-> 'a
)
14 _overload
+ : ('a
* 'a
-> 'a
)
21 _overload
- : ('a
* 'a
-> 'a
)
28 _overload
* : ('a
* 'a
-> 'a
)
35 (* Can
't use the following
overload, because
then
36 * fun f (x
, y
) = x
+ y
/ y
37 * fails to
type check
. The problem is that because
+ and / are not constrained
,
38 * the
type checker chooses the default
type for
+, int * int -> int. It is
39 * then screwed because it can
't chose that
type for
/. The problem happens
40 * when there are overloaded variables that have some compatible
type (in this
41 * case real) but one
of whose default
types (int) is not a valid instance
45 * _overload
/ : ('a
* 'a
-> 'a
)
50 _overload
div: ('a
* 'a
-> 'a
)
56 _overload
mod: ('a
* 'a
-> 'a
)
62 _overload
< : ('a
* 'a
-> bool)
71 _overload
<= : ('a
* 'a
-> bool)
80 _overload
> : ('a
* 'a
-> bool)
89 _overload
>= : ('a
* 'a
-> bool)
98 _overload abs
: ('a
-> 'a
)