{-# OPTIONS_HADDOCK not-home #-}
module Optics.Internal.IxFold where
import Data.Functor
import Data.Foldable
import Data.Profunctor.Indexed
import Optics.Internal.Bi
import Optics.Internal.Indexed.Classes
import Optics.Internal.Optic
import Optics.Internal.Fold
ifoldVL__
:: (Bicontravariant p, Traversing p)
=> (forall f. Applicative f => (i -> a -> f u) -> s -> f v)
-> Optic__ p j (i -> j) s t a b
ifoldVL__ :: forall (p :: * -> * -> * -> *) i a u s v j t b.
(Bicontravariant p, Traversing p) =>
(forall (f :: * -> *).
Applicative f =>
(i -> a -> f u) -> s -> f v)
-> Optic__ p j (i -> j) s t a b
ifoldVL__ forall (f :: * -> *). Applicative f => (i -> a -> f u) -> s -> f v
f = forall (p :: * -> * -> * -> *) i c a b.
(Profunctor p, Bicontravariant p) =>
p i c a -> p i c b
rphantom forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: * -> * -> * -> *) i a b s t j.
Traversing p =>
(forall (f :: * -> *).
Applicative f =>
(i -> a -> f b) -> s -> f t)
-> p j a b -> p (i -> j) s t
iwander forall (f :: * -> *). Applicative f => (i -> a -> f u) -> s -> f v
f forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: * -> * -> * -> *) i c a b.
(Profunctor p, Bicontravariant p) =>
p i c a -> p i c b
rphantom
{-# INLINE ifoldVL__ #-}
ifolded__
:: (Bicontravariant p, Traversing p, FoldableWithIndex i f)
=> Optic__ p j (i -> j) (f a) t a b
ifolded__ :: forall (p :: * -> * -> * -> *) i (f :: * -> *) j a t b.
(Bicontravariant p, Traversing p, FoldableWithIndex i f) =>
Optic__ p j (i -> j) (f a) t a b
ifolded__ = forall (p :: * -> * -> * -> *) i a b s t j.
Profunctor p =>
(p i a b -> p i s t) -> (p i a b -> p j s t) -> p i a b -> p j s t
conjoined__ (forall (p :: * -> * -> * -> *) a u s v i t b.
(Bicontravariant p, Traversing p) =>
(forall (f :: * -> *). Applicative f => (a -> f u) -> s -> f v)
-> Optic__ p i i s t a b
foldVL__ forall (t :: * -> *) (f :: * -> *) a b.
(Foldable t, Applicative f) =>
(a -> f b) -> t a -> f ()
traverse_) (forall (p :: * -> * -> * -> *) i a u s v j t b.
(Bicontravariant p, Traversing p) =>
(forall (f :: * -> *).
Applicative f =>
(i -> a -> f u) -> s -> f v)
-> Optic__ p j (i -> j) s t a b
ifoldVL__ forall i (t :: * -> *) (f :: * -> *) a b.
(FoldableWithIndex i t, Applicative f) =>
(i -> a -> f b) -> t a -> f ()
itraverse_)
{-# INLINE ifolded__ #-}
ifoldring__
:: (Bicontravariant p, Traversing p)
=> (forall f. Applicative f => (i -> a -> f u -> f u) -> f v -> s -> f w)
-> Optic__ p j (i -> j) s t a b
ifoldring__ :: forall (p :: * -> * -> * -> *) i a u v s w j t b.
(Bicontravariant p, Traversing p) =>
(forall (f :: * -> *).
Applicative f =>
(i -> a -> f u -> f u) -> f v -> s -> f w)
-> Optic__ p j (i -> j) s t a b
ifoldring__ forall (f :: * -> *).
Applicative f =>
(i -> a -> f u -> f u) -> f v -> s -> f w
fr = forall (p :: * -> * -> * -> *) i a u s v j t b.
(Bicontravariant p, Traversing p) =>
(forall (f :: * -> *).
Applicative f =>
(i -> a -> f u) -> s -> f v)
-> Optic__ p j (i -> j) s t a b
ifoldVL__ forall a b. (a -> b) -> a -> b
$ \i -> a -> f Any
f -> forall (f :: * -> *) a. Functor f => f a -> f ()
void forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (f :: * -> *).
Applicative f =>
(i -> a -> f u -> f u) -> f v -> s -> f w
fr (\i
i a
a -> (i -> a -> f Any
f i
i a
a forall (f :: * -> *) a b. Applicative f => f a -> f b -> f b
*>)) (forall (f :: * -> *) a. Applicative f => a -> f a
pure forall {a}. a
v)
where
v :: a
v = forall a. HasCallStack => [Char] -> a
error [Char]
"ifoldring__: value used"
{-# INLINE ifoldring__ #-}