git.iko.soy
/
Idris-dev
readme
files
commits
refs
on
master
help
sign in
Added the Zero Constructor to Data.Sign
cf25411
Jakob Brünker
12 years ago
libs/base/Data/Sign.idr
+1
−1
compare with master
unified
split
@@ -1,7 +1,7 @@
1
module Data.Sign
1
module Data.Sign
2
2
3
||| A representation of signs for signed datatypes such as `ZZ`
3
||| A representation of signs for signed datatypes such as `ZZ`
4
−
data Sign = Plus | Minus
4
+
data Sign = Plus |
Zero |
Minus
5
5
6
||| Discover the sign of some type
6
||| Discover the sign of some type
7
class Signed t where
7
class Signed t where
libs/base/Data/ZZ.idr
+1
@@ -15,6 +15,7 @@ import Data.Sign
15
data ZZ = Pos Nat | NegS Nat
15
data ZZ = Pos Nat | NegS Nat
16
16
17
instance Signed ZZ where
17
instance Signed ZZ where
18
+
sign (Pos Z) = Zero
18
sign (Pos _) = Plus
19
sign (Pos _) = Plus
19
sign (NegS _) = Minus
20
sign (NegS _) = Minus
20
21
keys
esc to close
j k
move down, up
enter
open
esc
back, or up a level
1 2 3 4
readme, files, commits, refs
/
filter
y
copy the clone command
c
compare the chosen commit with another (or shift-click both)
?
show or hide this list