Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
835564a7
Commit
835564a7
authored
Aug 31, 1999
by
simonpj
Browse files
[project @ 1999-08-31 15:29:00 by simonpj]
Fix default Enum methods
parent
202fc4bc
Changes
1
Show whitespace changes
Inline
Side-by-side
ghc/lib/std/PrelEnum.lhs
View file @
835564a7
...
...
@@ -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]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment