on master help sign in
Some trivial renamings
commit75e34a75789cb48e143a5aac0ef28317e39a9ab9 authorEdwin Brady <ecb10@st-andrews.ac.uk> dateSun 17 Jan 2016, 18:32 (11 years ago) parent0c5f1de
5 files changed+40−40
libs/contrib/Data/ZZ.idr+2−2 libs/prelude/Prelude/Algebra.idr+4−4 libs/prelude/Prelude/Classes.idr+25−25 libs/prelude/Prelude/Interactive.idr+4−4 libs/prelude/Prelude/Show.idr+5−5
libs/contrib/Data/ZZ.idr+2−2
@@ -68,8 +68,8 @@ multZ (Pos n) (NegS m) = negNat $ n * (S m)
6868||| Convert an `Integer` to an inductive representation.
6969fromInt : Integer -> ZZ
7070fromInt n = if n < 0
71− then NegS $ fromInteger {a=Nat} ((-n) - 1)
72− else Pos $ fromInteger {a=Nat} n
71+ then NegS $ fromInteger ((-n) - 1)
72+ else Pos $ fromInteger n
7373
7474implementation Cast Nat ZZ where
7575 cast n = Pos n
libs/prelude/Prelude/Algebra.idr+4−4
@@ -15,8 +15,8 @@ infixl 6 <+>
1515|||
1616||| + Associativity of `<+>`:
1717||| forall a b c, a <+> (b <+> c) == (a <+> b) <+> c
18−interface Semigroup a where
19− (<+>) : a -> a -> a
18+interface Semigroup ty where
19+ (<+>) : ty -> ty -> ty
2020
2121
2222||| Sets equipped with a single binary operation that is associative, along with
@@ -28,6 +28,6 @@ interface Semigroup a where
2828||| + Neutral for `<+>`:
2929||| forall a, a <+> neutral == a
3030||| forall a, neutral <+> a == a
31−interface Semigroup a => Monoid a where
32− neutral : a
31+interface Semigroup ty => Monoid ty where
32+ neutral : ty
3333
libs/prelude/Prelude/Classes.idr+25−25
@@ -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
libs/prelude/Prelude/Interactive.idr+4−4
@@ -46,20 +46,20 @@ putStrLn = putStrLn'
4646
4747||| Output something showable to stdout, without a trailing newline, for any FFI
4848||| descriptor
49−print' : Show a => a -> IO' ffi ()
49+print' : Show ty => ty -> IO' ffi ()
5050print' x = putStr' (show x)
5151
5252||| Output something showable to stdout, without a trailing newline
53−print : Show a => a -> IO ()
53+print : Show ty => ty -> IO ()
5454print = print'
5555
5656||| Output something showable to stdout, with a trailing newline, for any FFI
5757||| descriptor
58−printLn' : Show a => a -> IO' ffi ()
58+printLn' : Show ty => ty -> IO' ffi ()
5959printLn' x = putStrLn' (show x)
6060
6161||| Output something showable to stdout, with a trailing newline
62−printLn : Show a => a -> IO ()
62+printLn : Show ty => ty -> IO ()
6363printLn = printLn'
6464
6565||| Read one line of input from stdin, without the trailing newline, for any FFI
libs/prelude/Prelude/Show.idr+5−5
@@ -38,12 +38,12 @@ Ord Prec where
3838 compare x y = compare (precCon x) (precCon y)
3939
4040||| Things that have a canonical `String` representation.
41−interface Show a where
41+interface Show ty where
4242 ||| Convert a value to its `String` representation.
4343 |||
44− ||| @ a the value to convert
44+ ||| @ x the value to convert
4545 partial
46− show : (x : a) -> String
46+ show : (x : ty) -> String
4747 show = showPrec Open
4848
4949 ||| Convert a value to its `String` representation in a certain precedence
@@ -58,9 +58,9 @@ interface Show a where
5858 ||| their own bracketing, like `Pair` and `List`.
5959 |||
6060 ||| @ d the precedence context.
61− ||| @ a the value to convert
61+ ||| @ x the value to convert
6262 partial
63− showPrec : (d : Prec) -> (x : a) -> String
63+ showPrec : (d : Prec) -> (x : ty) -> String
6464 showPrec _ = show
6565
6666||| Surround a `String` with parentheses depending on a condition.