HsTools-0.0.1.1: Haskell helper functions

Data.Ix.List

Description

Transform lists of bounded enumerables into an index. A version for lists of different sizes exists as well.

Synopsis

Documentation

list2idx :: (Enum a, Bounded a) => [a] -> IntSource

transform a list of bounded enumerables into an integer index. the first character will be least significant, the last most significant

listAll2idx :: (Enum a, Bounded a) => [a] -> IntSource

Version for lists of different sizes.

blist2idx :: (Enum a, Bounded a) => (a, a) -> [a] -> IntSource

same as above, but now the list is bounded (hence _b_oundedlist) by the user.