definition:
|
class Enum a where
succ :: a -> a
pred :: a -> a
toEnum :: Int -> a
fromEnum :: a -> Int
enumFrom :: a -> [a]
enumFromThen :: a -> a -> [a]
enumFromTo :: a -> a -> [a]
enumFromThenTo :: a -> a -> a -> [a]
succ = toEnum . (+ 1) . fromEnum
pred = toEnum . (\x -> x - 1) . fromEnum
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 x y z = map toEnum [fromEnum x, fromEnum y .. fromEnum z]
|
methods:
|
["succ 0 :: a -> a","pred 0 :: a -> a","toEnum :: Int -> a","fromEnum :: a -> Int","enumFrom 1 :: a -> [a]","enumFromThen 2 :: a -> a -> [a]","enumFromTo 2 :: a -> a -> [a]","enumFromThenTo 3 :: a -> a -> a -> [a]"]
|