Import Upstream version 20180207
[hcoop/debian/mlton.git] / lib / mlton / basic / ordered-ring.sig
CommitLineData
7f918cf1
CE
1(* Copyright (C) 1999-2006, 2008 Henry Cejtin, Matthew Fluet, Suresh
2 * Jagannathan, and Stephen Weeks.
3 *
4 * MLton is released under a BSD-style license.
5 * See the file MLton-LICENSE for details.
6 *)
7
8signature ORDERED_RING_STRUCTS =
9 sig
10 include RING_WITH_IDENTITY
11
12 val compare: t * t -> Relation.t
13 val < : t * t -> bool
14 val <= : t * t -> bool
15 val > : t * t -> bool
16 val >= : t * t -> bool
17 end
18
19signature ORDERED_RING =
20 sig
21 include ORDERED_RING_STRUCTS
22
23 val abs: t -> t
24 val factorial: t -> t
25 val foldl: t * t * 'a * ('a * t -> 'a) -> 'a
26 val isNegative: t -> bool
27 val isPositive: t -> bool
28 val max: t * t -> t
29 val min: t * t -> t
30 val prodFromTo: {from: t, to: t, term: t -> t} -> t
31 val sumFromTo: {from: t, to: t, term: t -> t} -> t
32 end