parameterized-utils-2.1.10.0: Classes and data structures for working with data-kind indexed types
Copyright(c) Galois Inc 2021
MaintainerLangston Barrett
Safe HaskellNone
LanguageHaskell2010

Data.Parameterized.TraversableFC.WithIndex

Description

As in the package indexed-traversable.

Synopsis

Documentation

class FunctorFC t => FunctorFCWithIndex (t :: (k -> Type) -> l -> Type) where Source #

Methods

imapFC :: forall f g (z :: l). (forall (x :: k). IndexF (t f z) x -> f x -> g x) -> t f z -> t g z Source #

Like fmapFC, but with an index.

fmapFC f ≡ imapFC (const f)

Instances

Instances details
FunctorFCWithIndex (Assignment :: (k -> Type) -> Ctx k -> Type) Source # 
Instance details

Defined in Data.Parameterized.Context.Unsafe

Methods

imapFC :: forall f g (z :: Ctx k). (forall (x :: k). IndexF (Assignment f z) x -> f x -> g x) -> Assignment f z -> Assignment g z Source #

FunctorFCWithIndex (List :: (k -> Type) -> [k] -> Type) Source # 
Instance details

Defined in Data.Parameterized.List

Methods

imapFC :: forall f g (z :: [k]). (forall (x :: k). IndexF (List f z) x -> f x -> g x) -> List f z -> List g z Source #

class (FoldableFC t, FunctorFCWithIndex t) => FoldableFCWithIndex (t :: (k -> Type) -> l -> Type) where Source #

Minimal complete definition

Nothing

Methods

ifoldMapFC :: forall f m (z :: l). Monoid m => (forall (x :: k). IndexF (t f z) x -> f x -> m) -> t f z -> m Source #

Like foldMapFC, but with an index.

foldMapFC f ≡ ifoldMapFC (const f)

ifoldrFC :: forall (z :: l) f b. (forall (x :: k). IndexF (t f z) x -> f x -> b -> b) -> b -> t f z -> b Source #

Like foldrFC, but with an index.

ifoldlFC :: forall f b (z :: l). (forall (x :: k). IndexF (t f z) x -> b -> f x -> b) -> b -> t f z -> b Source #

Like foldlFC, but with an index.

ifoldrFC' :: forall f b (z :: l). (forall (x :: k). IndexF (t f z) x -> f x -> b -> b) -> b -> t f z -> b Source #

Like ifoldrFC, but with an index.

ifoldlFC' :: forall f b. (forall (x :: k). b -> f x -> b) -> forall (x :: l). b -> t f x -> b Source #

Like ifoldlFC, but with an index.

itoListFC :: forall f a (z :: l). (forall (x :: k). IndexF (t f z) x -> f x -> a) -> t f z -> [a] Source #

Convert structure to list.

Instances

Instances details
FoldableFCWithIndex (Assignment :: (k -> Type) -> Ctx k -> Type) Source # 
Instance details

Defined in Data.Parameterized.Context.Unsafe

Methods

ifoldMapFC :: forall f m (z :: Ctx k). Monoid m => (forall (x :: k). IndexF (Assignment f z) x -> f x -> m) -> Assignment f z -> m Source #

ifoldrFC :: forall (z :: Ctx k) f b. (forall (x :: k). IndexF (Assignment f z) x -> f x -> b -> b) -> b -> Assignment f z -> b Source #

ifoldlFC :: forall f b (z :: Ctx k). (forall (x :: k). IndexF (Assignment f z) x -> b -> f x -> b) -> b -> Assignment f z -> b Source #

ifoldrFC' :: forall f b (z :: Ctx k). (forall (x :: k). IndexF (Assignment f z) x -> f x -> b -> b) -> b -> Assignment f z -> b Source #

ifoldlFC' :: forall f b. (forall (x :: k). b -> f x -> b) -> forall (x :: Ctx k). b -> Assignment f x -> b Source #

itoListFC :: forall f a (z :: Ctx k). (forall (x :: k). IndexF (Assignment f z) x -> f x -> a) -> Assignment f z -> [a] Source #

FoldableFCWithIndex (List :: (k -> Type) -> [k] -> Type) Source # 
Instance details

Defined in Data.Parameterized.List

Methods

ifoldMapFC :: forall f m (z :: [k]). Monoid m => (forall (x :: k). IndexF (List f z) x -> f x -> m) -> List f z -> m Source #

ifoldrFC :: forall (z :: [k]) f b. (forall (x :: k). IndexF (List f z) x -> f x -> b -> b) -> b -> List f z -> b Source #

ifoldlFC :: forall f b (z :: [k]). (forall (x :: k). IndexF (List f z) x -> b -> f x -> b) -> b -> List f z -> b Source #

ifoldrFC' :: forall f b (z :: [k]). (forall (x :: k). IndexF (List f z) x -> f x -> b -> b) -> b -> List f z -> b Source #

ifoldlFC' :: forall f b. (forall (x :: k). b -> f x -> b) -> forall (x :: [k]). b -> List f x -> b Source #

itoListFC :: forall f a (z :: [k]). (forall (x :: k). IndexF (List f z) x -> f x -> a) -> List f z -> [a] Source #

ifoldlMFC :: forall {k} {l} t m f (z :: l) b. (FoldableFCWithIndex t, Monad m) => (forall (x :: k). IndexF (t f z) x -> b -> f x -> m b) -> b -> t f z -> m b Source #

Like foldlMFC, but with an index.

ifoldrMFC :: forall {k} {l} t m f (z :: l) b. (FoldableFCWithIndex t, Monad m) => (forall (x :: k). IndexF (t f z) x -> f x -> b -> m b) -> b -> t f z -> m b Source #

Like foldrMFC, but with an index.

iallFC :: forall {k} {l} t f (z :: l). FoldableFCWithIndex t => (forall (x :: k). IndexF (t f z) x -> f x -> Bool) -> t f z -> Bool Source #

Like allFC, but with an index.

ianyFC :: forall {k} {l} t f (z :: l). FoldableFCWithIndex t => (forall (x :: k). IndexF (t f z) x -> f x -> Bool) -> t f z -> Bool Source #

Like anyFC, but with an index.

class (TraversableFC t, FoldableFCWithIndex t) => TraversableFCWithIndex (t :: (k -> Type) -> l -> Type) where Source #

Methods

itraverseFC :: forall m (z :: l) f g. Applicative m => (forall (x :: k). IndexF (t f z) x -> f x -> m (g x)) -> t f z -> m (t g z) Source #

Like traverseFC, but with an index.

traverseFC f ≡ itraverseFC (const f)

Instances

Instances details
TraversableFCWithIndex (Assignment :: (k -> Type) -> Ctx k -> Type) Source # 
Instance details

Defined in Data.Parameterized.Context.Unsafe

Methods

itraverseFC :: forall m (z :: Ctx k) f g. Applicative m => (forall (x :: k). IndexF (Assignment f z) x -> f x -> m (g x)) -> Assignment f z -> m (Assignment g z) Source #

TraversableFCWithIndex (List :: (k -> Type) -> [k] -> Type) Source # 
Instance details

Defined in Data.Parameterized.List

Methods

itraverseFC :: forall m (z :: [k]) f g. Applicative m => (forall (x :: k). IndexF (List f z) x -> f x -> m (g x)) -> List f z -> m (List g z) Source #

imapFCDefault :: forall {k} {l} t f g (z :: l). TraversableFCWithIndex t => (forall (x :: k). IndexF (t f z) x -> f x -> g x) -> t f z -> t g z Source #

ifoldMapFCDefault :: forall {k} {l} t m (z :: l) f. (TraversableFCWithIndex t, Monoid m) => (forall (x :: k). IndexF (t f z) x -> f x -> m) -> t f z -> m Source #