utility-ht-0.0.10: Various small helper functions for Lists, Maybes, Tuples, Functions

Safe HaskellSafe-Inferred

Data.Ix.Enum

Description

Implementations of Ix methods in terms of Enum methods.

For a type T of class Enum you can easily define an Ix instance by copying the following code into your module:

import qualified Data.Ix.Enum as IxEnum

instance Ix T where
   range           = IxEnum.range
   index           = IxEnum.index
   inRange         = IxEnum.inRange
   rangeSize       = IxEnum.rangeSize
   unsafeIndex     = IxEnum.unsafeIndex
   unsafeRangeSize = IxEnum.unsafeRangeSize

Documentation

range :: Enum a => (a, a) -> [a]Source

index :: Enum a => (a, a) -> a -> IntSource

unsafeIndex :: Enum a => (a, a) -> a -> IntSource

inRange :: Enum a => (a, a) -> a -> BoolSource

rangeSize :: Enum a => (a, a) -> IntSource

unsafeRangeSize :: Enum a => (a, a) -> IntSource