id	summary	reporter	owner	description	type	status	milestone	resolution	keywords	cc	section	state
109	split Enum into two typeclasses	guest	none	"The current uses of Enum are somewhat confusing -- this is partially because of the name, but partially because two seperate interfaces are glued together.  One provides Enumeration of all possible values and conversion to integers for binary storage, and the other provides sequences of values (usually arithmetic) (which [a..b], etc desugar to).

{{{
class Enum a where
    succ, pred :: a -> a
    toEnum     :: Int -> a
    fromEnum   :: a -> Int

instance Enum Integer
instance Enum Int
instance Enum Bool
instance Enum Ordering
instance Enum Word...
}}}

{{{
class ArithmeticSequence a where
    stepFrom        :: a -> [a]           -- [n..]
    stepFromThen    :: a -> a -> [a]      -- [n, n'..]
    stepFromTo      :: a -> a -> [a]      -- [n..m]
    stepFromThenTo  :: a -> a -> a -> [a] -- [n,n'..m]

instance ArithmeticSequence Integer
instance ArithmeticSequence Int
instance ArithmeticSequence Bool
instance ArithmeticSequence Ordering
instance ArithmeticSequence Float
instance ArithmeticSequence Double
instance ArithmeticSequence Rational
instance ArithmeticSequence Word...
...
}}}

Steppable may be a preferrable name.

pros:
 
 * Clearly divides two seperate uses, while keeping functionality.
 * Can re-introduce relationship between Ix and Enum?

cons:

 * Yet another typeclass.
 * Slightly misleading name, as non-arithmetic structures _should_ be supported.  Also a bit long.
 * Automatically supporting such isn't trivial if they're not in Enum, though."	task	new						
