@@ -21,9 +21,9 @@ boolOp op x y = intToBool (op x y)
22-- ---------------------------------------------------------- [ Equality Interface ]
22-- ---------------------------------------------------------- [ Equality Interface ]
23||| The Eq interface defines inequality and equality.
23||| The Eq interface defines inequality and equality.
24−interface Eq a where
24+interface Eq ty where
25− (==) : a -> a -> Bool
25+ (==) : ty -> ty -> Bool
26− (/=) : a -> a -> Bool
26+ (/=) : ty -> ty -> Bool
28 x /= y = not (x == y)
28 x /= y = not (x == y)
29 x == y = not (x /= y)
29 x == y = not (x /= y)
@@ -78,29 +78,29 @@ thenCompare EQ y = y
78thenCompare GT y = GT
78thenCompare GT y = GT
80||| The Ord interface defines comparison operations on ordered data types.
80||| The Ord interface defines comparison operations on ordered data types.
81−interface Eq a => Ord a where
81+interface Eq ty => Ord ty where
82− compare : a -> a -> Ordering
82+ compare : ty -> ty -> Ordering
84− (<) : a -> a -> Bool
84+ (<) : ty -> ty -> Bool
85 (<) x y with (compare x y)
85 (<) x y with (compare x y)
86 (<) x y | LT = True
86 (<) x y | LT = True
87 (<) x y | _ = False
87 (<) x y | _ = False
89− (>) : a -> a -> Bool
89+ (>) : ty -> ty -> Bool
90 (>) x y with (compare x y)
90 (>) x y with (compare x y)
91 (>) x y | GT = True
91 (>) x y | GT = True
92 (>) x y | _ = False
92 (>) x y | _ = False
94− (<=) : a -> a -> Bool
94+ (<=) : ty -> ty -> Bool
95 (<=) x y = x < y || x == y
95 (<=) x y = x < y || x == y
97− (>=) : a -> a -> Bool
97+ (>=) : ty -> ty -> Bool
98 (>=) x y = x > y || x == y
98 (>=) x y = x > y || x == y
100− max : a -> a -> a
100+ max : ty -> ty -> ty
101 max x y = if x > y then x else y
101 max x y = if x > y then x else y
103− min : a -> a -> a
103+ min : ty -> ty -> ty
104 min x y = if (x < y) then x else y
104 min x y = if (x < y) then x else y
106Ord () where
106Ord () where
@@ -151,11 +151,11 @@ Ord Bool where
152-- --------------------------------------------------------- [ Numerical Interface ]
152-- --------------------------------------------------------- [ Numerical Interface ]
153||| The Num interface defines basic numerical arithmetic.
153||| The Num interface defines basic numerical arithmetic.
154−interface Num a where
154+interface Num ty where
155− (+) : a -> a -> a
155+ (+) : ty -> ty -> ty
156− (*) : a -> a -> a
156+ (*) : ty -> ty -> ty
157 ||| Conversion from Integer.
157 ||| Conversion from Integer.
158− fromInteger : Integer -> a
158+ fromInteger : Integer -> ty
160Num Integer where
160Num Integer where
161 (+) = prim__addBigInt
161 (+) = prim__addBigInt
@@ -198,12 +198,12 @@ Num Bits64 where
199-- --------------------------------------------------------- [ Negatable Interface ]
199-- --------------------------------------------------------- [ Negatable Interface ]
200||| The `Neg` interface defines operations on numbers which can be negative.
200||| The `Neg` interface defines operations on numbers which can be negative.
201−interface Num a => Neg a where
201+interface Num ty => Neg ty where
202 ||| The underlying of unary minus. `-5` desugars to `negate (fromInteger 5)`.
202 ||| The underlying of unary minus. `-5` desugars to `negate (fromInteger 5)`.
203− negate : a -> a
203+ negate : ty -> ty
204− (-) : a -> a -> a
204+ (-) : ty -> ty -> ty
205 ||| Absolute value
205 ||| Absolute value
206− abs : a -> a
206+ abs : ty -> ty
208Neg Integer where
208Neg Integer where
209 negate x = prim__subBigInt 0 x
209 negate x = prim__subBigInt 0 x
@@ -306,9 +306,9 @@ MaxBound Bits64 where
307-- ------------------------------------------------------------- [ Fractionals ]
307-- ------------------------------------------------------------- [ Fractionals ]
309−interface Num a => Fractional a where
309+interface Num ty => Fractional ty where
310− (/) : a -> a -> a
310+ (/) : ty -> ty -> ty
311− recip : a -> a
311+ recip : ty -> ty
313 recip x = 1 / x
313 recip x = 1 / x
@@ -318,9 +318,9 @@ Fractional Double where
318-- --------------------------------------------------------------- [ Integrals ]
318-- --------------------------------------------------------------- [ Integrals ]
319%default partial
319%default partial
321−interface Num a => Integral a where
321+interface Num ty => Integral ty where
322− div : a -> a -> a
322+ div : ty -> ty -> ty
323− mod : a -> a -> a
323+ mod : ty -> ty -> ty
325-- ---------------------------------------------------------------- [ Integers ]
325-- ---------------------------------------------------------------- [ Integers ]
326divBigInt : Integer -> Integer -> Integer
326divBigInt : Integer -> Integer -> Integer