semialign-1.2.0.1: Align and Zip type-classes from the common Semialign ancestor.

Safe Haskell | Safe
Language | Haskell2010

Data.Semialign.Indexed

Description

Zipping and aligning of indexed functors.

Synopsis

- class (FunctorWithIndex i f, Semialign f) => SemialignWithIndex i f | f -> i where
  - ialignWith :: (i -> These a b -> c) -> f a -> f b -> f c
- class (SemialignWithIndex i f, Zip f) => ZipWithIndex i f | f -> i where
  - izipWith :: (i -> a -> b -> c) -> f a -> f b -> f c
- class (ZipWithIndex i f, Repeat f) => RepeatWithIndex i f | f -> i where
  - irepeat :: (i -> a) -> f a

# Documentation

class (FunctorWithIndex i f, Semialign f) => SemialignWithIndex i f | f -> i where #

Indexed version of `Semialign`.

Since: 1.2

Minimal complete definition

Nothing

Methods

ialignWith :: (i -> These a b -> c) -> f a -> f b -> f c #

Analogous to `alignWith`, but also provides an index.

#### Instances

Instances details

SemialignWithIndex Int [] # |
Instance details Defined in Data.Semialign.Internal Methods ialignWith :: (Int -> These a b -> c) -> [a] -> [b] -> [c] #
SemialignWithIndex Int ZipList # |
Instance details Defined in Data.Semialign.Internal Methods ialignWith :: (Int -> These a b -> c) -> ZipList a -> ZipList b -> ZipList c #
SemialignWithIndex Int NonEmpty # |
Instance details Defined in Data.Semialign.Internal Methods ialignWith :: (Int -> These a b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c #
SemialignWithIndex Int IntMap # |
Instance details Defined in Data.Semialign.Internal Methods ialignWith :: (Int -> These a b -> c) -> IntMap a -> IntMap b -> IntMap c #
SemialignWithIndex Int Seq # |
Instance details Defined in Data.Semialign.Internal Methods ialignWith :: (Int -> These a b -> c) -> Seq a -> Seq b -> Seq c #
SemialignWithIndex Int Vector # |
Instance details Defined in Data.Semialign.Internal Methods ialignWith :: (Int -> These a b -> c) -> Vector a -> Vector b -> Vector c #
SemialignWithIndex () Maybe # |
Instance details Defined in Data.Semialign.Internal Methods ialignWith :: (() -> These a b -> c) -> Maybe a -> Maybe b -> Maybe c #
SemialignWithIndex () Identity # |
Instance details Defined in Data.Semialign.Internal Methods ialignWith :: (() -> These a b -> c) -> Identity a -> Identity b -> Identity c #
(Eq k, Hashable k) => SemialignWithIndex k (HashMap k) # |
Instance details Defined in Data.Semialign.Internal Methods ialignWith :: (k -> These a b -> c) -> HashMap k a -> HashMap k b -> HashMap k c #
Ord k => SemialignWithIndex k (Map k) # |
Instance details Defined in Data.Semialign.Internal Methods ialignWith :: (k -> These a b -> c) -> Map k a -> Map k b -> Map k c #
SemialignWithIndex Void (Proxy :: Type -> Type) # |
Instance details Defined in Data.Semialign.Internal Methods ialignWith :: (Void -> These a b -> c) -> Proxy a -> Proxy b -> Proxy c #
SemialignWithIndex () (Tagged b) # |
Instance details Defined in Data.Semialign.Internal Methods ialignWith :: (() -> These a b0 -> c) -> Tagged b a -> Tagged b b0 -> Tagged b c #
SemialignWithIndex e ((->) e :: Type -> Type) # |
Instance details Defined in Data.Semialign.Internal Methods ialignWith :: (e -> These a b -> c) -> (e -> a) -> (e -> b) -> e -> c #
(SemialignWithIndex i f, SemialignWithIndex j g) => SemialignWithIndex (Either i j) (Product f g) # |
Instance details Defined in Data.Semialign.Internal Methods ialignWith :: (Either i j -> These a b -> c) -> Product f g a -> Product f g b -> Product f g c #
(SemialignWithIndex i f, SemialignWithIndex j g) => SemialignWithIndex (i, j) (Compose f g) # |
Instance details Defined in Data.Semialign.Internal Methods ialignWith :: ((i, j) -> These a b -> c) -> Compose f g a -> Compose f g b -> Compose f g c #

class (SemialignWithIndex i f, Zip f) => ZipWithIndex i f | f -> i where #

Indexed version of `Zip`.

Since: 1.2

Minimal complete definition

Nothing

Methods

izipWith :: (i -> a -> b -> c) -> f a -> f b -> f c #

Analogous to `zipWith`, but also provides an index.

#### Instances

Instances details

ZipWithIndex Int [] # |
Instance details Defined in Data.Semialign.Internal Methods izipWith :: (Int -> a -> b -> c) -> [a] -> [b] -> [c] #
ZipWithIndex Int ZipList # |
Instance details Defined in Data.Semialign.Internal Methods izipWith :: (Int -> a -> b -> c) -> ZipList a -> ZipList b -> ZipList c #
ZipWithIndex Int NonEmpty # |
Instance details Defined in Data.Semialign.Internal Methods izipWith :: (Int -> a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c #
ZipWithIndex Int IntMap # |
Instance details Defined in Data.Semialign.Internal Methods izipWith :: (Int -> a -> b -> c) -> IntMap a -> IntMap b -> IntMap c #
ZipWithIndex Int Seq # |
Instance details Defined in Data.Semialign.Internal Methods izipWith :: (Int -> a -> b -> c) -> Seq a -> Seq b -> Seq c #
ZipWithIndex Int Vector # |
Instance details Defined in Data.Semialign.Internal Methods izipWith :: (Int -> a -> b -> c) -> Vector a -> Vector b -> Vector c #
ZipWithIndex () Maybe # |
Instance details Defined in Data.Semialign.Internal Methods izipWith :: (() -> a -> b -> c) -> Maybe a -> Maybe b -> Maybe c #
ZipWithIndex () Identity # |
Instance details Defined in Data.Semialign.Internal Methods izipWith :: (() -> a -> b -> c) -> Identity a -> Identity b -> Identity c #
(Eq k, Hashable k) => ZipWithIndex k (HashMap k) # |
Instance details Defined in Data.Semialign.Internal Methods izipWith :: (k -> a -> b -> c) -> HashMap k a -> HashMap k b -> HashMap k c #
Ord k => ZipWithIndex k (Map k) # |
Instance details Defined in Data.Semialign.Internal Methods izipWith :: (k -> a -> b -> c) -> Map k a -> Map k b -> Map k c #
ZipWithIndex Void (Proxy :: Type -> Type) # |
Instance details Defined in Data.Semialign.Internal Methods izipWith :: (Void -> a -> b -> c) -> Proxy a -> Proxy b -> Proxy c #
ZipWithIndex () (Tagged b) # |
Instance details Defined in Data.Semialign.Internal Methods izipWith :: (() -> a -> b0 -> c) -> Tagged b a -> Tagged b b0 -> Tagged b c #
ZipWithIndex e ((->) e :: Type -> Type) # |
Instance details Defined in Data.Semialign.Internal Methods izipWith :: (e -> a -> b -> c) -> (e -> a) -> (e -> b) -> e -> c #
(ZipWithIndex i f, ZipWithIndex j g) => ZipWithIndex (Either i j) (Product f g) # |
Instance details Defined in Data.Semialign.Internal Methods izipWith :: (Either i j -> a -> b -> c) -> Product f g a -> Product f g b -> Product f g c #
(ZipWithIndex i f, ZipWithIndex j g) => ZipWithIndex (i, j) (Compose f g) # |
Instance details Defined in Data.Semialign.Internal Methods izipWith :: ((i, j) -> a -> b -> c) -> Compose f g a -> Compose f g b -> Compose f g c #

class (ZipWithIndex i f, Repeat f) => RepeatWithIndex i f | f -> i where #

Indexed version of `Repeat`.

Since: 1.2

Minimal complete definition

Nothing

Methods

irepeat :: (i -> a) -> f a #

Analogous to `repeat`, but also provides an index.

This should be the same as `tabulate` for representable functors.

#### Instances

Instances details

RepeatWithIndex Int [] # |
Instance details Defined in Data.Semialign.Internal Methods irepeat :: (Int -> a) -> [a] #
RepeatWithIndex Int ZipList # |
Instance details Defined in Data.Semialign.Internal Methods irepeat :: (Int -> a) -> ZipList a #
RepeatWithIndex Int NonEmpty # |
Instance details Defined in Data.Semialign.Internal Methods irepeat :: (Int -> a) -> NonEmpty a #
RepeatWithIndex () Maybe # |
Instance details Defined in Data.Semialign.Internal Methods irepeat :: (() -> a) -> Maybe a #
RepeatWithIndex () Identity # |
Instance details Defined in Data.Semialign.Internal Methods irepeat :: (() -> a) -> Identity a #
RepeatWithIndex Void (Proxy :: Type -> Type) # |
Instance details Defined in Data.Semialign.Internal Methods irepeat :: (Void -> a) -> Proxy a #
RepeatWithIndex () (Tagged b) # |
Instance details Defined in Data.Semialign.Internal Methods irepeat :: (() -> a) -> Tagged b a #
RepeatWithIndex e ((->) e :: Type -> Type) # |
Instance details Defined in Data.Semialign.Internal Methods irepeat :: (e -> a) -> e -> a #
(RepeatWithIndex i f, RepeatWithIndex j g) => RepeatWithIndex (Either i j) (Product f g) # |
Instance details Defined in Data.Semialign.Internal Methods irepeat :: (Either i j -> a) -> Product f g a #
(RepeatWithIndex i f, RepeatWithIndex j g) => RepeatWithIndex (i, j) (Compose f g) # |
Instance details Defined in Data.Semialign.Internal Methods irepeat :: ((i, j) -> a) -> Compose f g a #