From: simonpj Date: Tue, 31 Aug 1999 15:29:00 +0000 (+0000) Subject: [project @ 1999-08-31 15:29:00 by simonpj] X-Git-Tag: Approximately_9120_patches~5851 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=835564a79b091f7e17d794425655ec2aa7ca6ca7;p=ghc-hetmet.git [project @ 1999-08-31 15:29:00 by simonpj] Fix default Enum methods --- diff --git a/ghc/lib/std/PrelEnum.lhs b/ghc/lib/std/PrelEnum.lhs index 8d88920..2ace283 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]