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

Safe HaskellSafe
LanguageHaskell98

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 -> Int Source #

unsafeIndex :: Enum a => (a, a) -> a -> Int Source #

inRange :: Enum a => (a, a) -> a -> Bool Source #

rangeSize :: Enum a => (a, a) -> Int Source #

unsafeRangeSize :: Enum a => (a, a) -> Int Source #