projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
202fc4b
)
[project @ 1999-08-31 15:29:00 by simonpj]
author
simonpj
<unknown>
Tue, 31 Aug 1999 15:29:00 +0000
(15:29 +0000)
committer
simonpj
<unknown>
Tue, 31 Aug 1999 15:29:00 +0000
(15:29 +0000)
Fix default Enum methods
ghc/lib/std/PrelEnum.lhs
patch
|
blob
|
history
diff --git
a/ghc/lib/std/PrelEnum.lhs
b/ghc/lib/std/PrelEnum.lhs
index
8d88920
..
2ace283
100644
(file)
--- a/
ghc/lib/std/PrelEnum.lhs
+++ b/
ghc/lib/std/PrelEnum.lhs
@@
-43,8
+43,10
@@
class Enum a where
succ = toEnum . (`plusInt` oneInt) . fromEnum
pred = toEnum . (`minusInt` oneInt) . fromEnum
succ = toEnum . (`plusInt` oneInt) . fromEnum
pred = toEnum . (`minusInt` oneInt) . fromEnum
- enumFromTo n m = map toEnum [fromEnum n .. fromEnum m]
- enumFromThenTo n1 n2 m = map toEnum [fromEnum n1, fromEnum n2 .. fromEnum m]
+ enumFrom x = map toEnum [fromEnum x ..]
+ enumFromThen x y = map toEnum [fromEnum x, fromEnum y ..]
+ enumFromTo x y = map toEnum [fromEnum x .. fromEnum y]
+ enumFromThenTo x1 x2 y = map toEnum [fromEnum x1, fromEnum x2 .. fromEnum y]
-- Default methods for bounded enumerations
enumFromBounded :: (Enum a, Bounded a) => a -> [a]
-- Default methods for bounded enumerations
enumFromBounded :: (Enum a, Bounded a) => a -> [a]