diff options
author | simonpj <unknown> | 1999-08-31 15:29:00 +0000 |
---|---|---|
committer | simonpj <unknown> | 1999-08-31 15:29:00 +0000 |
commit | 835564a79b091f7e17d794425655ec2aa7ca6ca7 (patch) | |
tree | 056af339baf3cfc6aa9f381e3eb1508aafc31069 /ghc | |
parent | 202fc4bc65a98ee3d06ca89fe3c61e9db340285b (diff) | |
download | haskell-835564a79b091f7e17d794425655ec2aa7ca6ca7.tar.gz |
[project @ 1999-08-31 15:29:00 by simonpj]
Fix default Enum methods
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/lib/std/PrelEnum.lhs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ghc/lib/std/PrelEnum.lhs b/ghc/lib/std/PrelEnum.lhs index 8d88920c69..2ace283077 100644 --- 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 - 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] |