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
obsidiansystems
GHC
Commits
f2eda367
Commit
f2eda367
authored
May 11, 2000
by
rrt
Browse files
[project @ 2000-05-11 19:43:08 by rrt]
Rename From*Bounded functions to boundedFrom* for consistency with numericFrom*
parent
efcd3f2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/lib/std/PrelEnum.lhs
View file @
f2eda367
...
...
@@ -10,7 +10,7 @@ Instances of Bounded for various datatypes.
module PrelEnum(
Bounded(..), Enum(..),
e
numFrom
B
ounded
, e
numFromThen
Bounded
,
boundedE
numFrom
, b
ounded
E
numFromThen,
-- Instances for Bounded and Eum: (), Char, Int
...
...
@@ -51,11 +51,11 @@ class Enum a where
enumFromThenTo x1 x2 y = map toEnum [fromEnum x1, fromEnum x2 .. fromEnum y]
-- Default methods for bounded enumerations
enumFromBounded
:: (Enum a, Bounded a) => a -> [a]
enumFromBounded
n = map toEnum [fromEnum n .. fromEnum (maxBound `asTypeOf` n)]
boundedEnumFrom
:: (Enum a, Bounded a) => a -> [a]
boundedEnumFrom
n = map toEnum [fromEnum n .. fromEnum (maxBound `asTypeOf` n)]
e
numFromThen
Bounded
:: (Enum a, Bounded a) => a -> a -> [a]
e
numFromThen
Bounded
n1 n2
boundedE
numFromThen :: (Enum a, Bounded a) => a -> a -> [a]
boundedE
numFromThen n1 n2
| i_n2 >= i_n1 = map toEnum [i_n1, i_n2 .. fromEnum (maxBound `asTypeOf` n1)]
| otherwise = map toEnum [i_n1, i_n2 .. fromEnum (minBound `asTypeOf` n1)]
where
...
...
@@ -130,8 +130,8 @@ instance Enum Bool where
fromEnum True = oneInt
-- Use defaults for the rest
enumFrom =
enumFromBounded
enumFromThen =
e
numFromThen
Bounded
enumFrom =
boundedEnumFrom
enumFromThen =
boundedE
numFromThen
\end{code}
%*********************************************************
...
...
@@ -164,8 +164,8 @@ instance Enum Ordering where
fromEnum GT = twoInt
-- Use defaults for the rest
enumFrom =
enumFromBounded
enumFromThen =
e
numFromThen
Bounded
enumFrom =
boundedEnumFrom
enumFromThen =
boundedE
numFromThen
\end{code}
%*********************************************************
...
...
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