@@ -21,9 +21,9 @@ boolOp op x y = intToBool (op x y)
2121
2222-- ---------------------------------------------------------- [ Equality Interface ]
2323||| The Eq interface defines inequality and equality.
24−interface Eq a where
25− (==) : a -> a -> Bool
26− (/=) : a -> a -> Bool
24+interface Eq ty where
25+ (==) : ty -> ty -> Bool
26+ (/=) : ty -> ty -> Bool
2727
2828 x /= y = not (x == y)
2929 x == y = not (x /= y)
@@ -78,29 +78,29 @@ thenCompare EQ y = y
7878thenCompare GT y = GT
7979
8080||| The Ord interface defines comparison operations on ordered data types.
81−interface Eq a => Ord a where
82− compare : a -> a -> Ordering
81+interface Eq ty => Ord ty where
82+ compare : ty -> ty -> Ordering
8383
84− (<) : a -> a -> Bool
84+ (<) : ty -> ty -> Bool
8585 (<) x y with (compare x y)
8686 (<) x y | LT = True
8787 (<) x y | _ = False
8888
89− (>) : a -> a -> Bool
89+ (>) : ty -> ty -> Bool
9090 (>) x y with (compare x y)
9191 (>) x y | GT = True
9292 (>) x y | _ = False
9393
94− (<=) : a -> a -> Bool
94+ (<=) : ty -> ty -> Bool
9595 (<=) x y = x < y || x == y
9696
97− (>=) : a -> a -> Bool
97+ (>=) : ty -> ty -> Bool
9898 (>=) x y = x > y || x == y
9999
100− max : a -> a -> a
100+ max : ty -> ty -> ty
101101 max x y = if x > y then x else y
102102
103− min : a -> a -> a
103+ min : ty -> ty -> ty
104104 min x y = if (x < y) then x else y
105105
106106Ord () where
@@ -151,11 +151,11 @@ Ord Bool where
151151
152152-- --------------------------------------------------------- [ Numerical Interface ]
153153||| The Num interface defines basic numerical arithmetic.
154−interface Num a where
155− (+) : a -> a -> a
156− (*) : a -> a -> a
154+interface Num ty where
155+ (+) : ty -> ty -> ty
156+ (*) : ty -> ty -> ty
157157 ||| Conversion from Integer.
158− fromInteger : Integer -> a
158+ fromInteger : Integer -> ty
159159
160160Num Integer where
161161 (+) = prim__addBigInt
@@ -198,12 +198,12 @@ Num Bits64 where
198198
199199-- --------------------------------------------------------- [ Negatable Interface ]
200200||| 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
202202 ||| The underlying of unary minus. `-5` desugars to `negate (fromInteger 5)`.
203− negate : a -> a
204− (-) : a -> a -> a
203+ negate : ty -> ty
204+ (-) : ty -> ty -> ty
205205 ||| Absolute value
206− abs : a -> a
206+ abs : ty -> ty
207207
208208Neg Integer where
209209 negate x = prim__subBigInt 0 x
@@ -306,9 +306,9 @@ MaxBound Bits64 where
306306
307307-- ------------------------------------------------------------- [ Fractionals ]
308308
309−interface Num a => Fractional a where
310− (/) : a -> a -> a
311− recip : a -> a
309+interface Num ty => Fractional ty where
310+ (/) : ty -> ty -> ty
311+ recip : ty -> ty
312312
313313 recip x = 1 / x
314314
@@ -318,9 +318,9 @@ Fractional Double where
318318-- --------------------------------------------------------------- [ Integrals ]
319319%default partial
320320
321−interface Num a => Integral a where
322− div : a -> a -> a
323− mod : a -> a -> a
321+interface Num ty => Integral ty where
322+ div : ty -> ty -> ty
323+ mod : ty -> ty -> ty
324324
325325-- ---------------------------------------------------------------- [ Integers ]
326326divBigInt : Integer -> Integer -> Integer