Portability | rank 2 types, MPTCs, TFs, flexible |
---|---|
Stability | provisional |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Safe Haskell | Safe-Infered |
- class Indexed i k where
- index :: ((i -> a) -> b) -> k a b
- type Indexable i a b = forall k. Indexed i k => k a b
- newtype Index i a b = Index {
- withIndex :: (i -> a) -> b
- (.@) :: Indexed (i, j) k => Index i b c -> Index j a b -> k a c
- composeWithIndex :: Indexed k r => (i -> j -> k) -> Index i b c -> Index j a b -> r a c
- reindex :: Indexed j k => (i -> j) -> Index i a b -> k a b
Overloading indexed functions
Permit overloading of function application for things that also admit a notion of a key or index.
Provides overloading for indexed functions.
type Indexable i a b = forall k. Indexed i k => k a bSource
Type alias for passing around polymorphic indexed functions.
A function with access to a index. This constructor may be useful when you need to store
a HasIndex
.
(.@) :: Indexed (i, j) k => Index i b c -> Index j a b -> k a cSource
Composition of indexed functions
composeWithIndex :: Indexed k r => (i -> j -> k) -> Index i b c -> Index j a b -> r a cSource
Composition of indexed functions with a user supplied function for combining indexs