lens-4.15.4: Lenses, Folds and Traversals

Control.Lens.Internal.Bazaar

Description

Synopsis

# Documentation

class Profunctor p => Bizarre p w | w -> p where #

This class is used to run the various Bazaar variants used in this library.

Minimal complete definition

bazaar

Methods

bazaar :: Applicative f => p a (f b) -> w a b t -> f t #

Instances

 Profunctor p => Bizarre p (Bazaar p) # Methodsbazaar :: Applicative f => p a (f b) -> Bazaar p a b t -> f t # Profunctor p => Bizarre p (BazaarT p g) # Methodsbazaar :: Applicative f => p a (f b) -> BazaarT p g a b t -> f t # Corepresentable p => Bizarre p (TakingWhile p g) # Methodsbazaar :: Applicative f => p a (f b) -> TakingWhile p g a b t -> f t # # Methodsbazaar :: Applicative f => Indexed Int a (f b) -> Mafic a b t -> f t # Bizarre (Indexed i) (Molten i) # Methodsbazaar :: Applicative f => Indexed i a (f b) -> Molten i a b t -> f t #

newtype Bazaar p a b t #

This is used to characterize a Traversal.

a.k.a. indexed Cartesian store comonad, indexed Kleene store comonad, or an indexed FunList.

A Bazaar is like a Traversal that has already been applied to some structure.

Where a Context a b t holds an a and a function from b to t, a Bazaar a b t holds N as and a function from N bs to t, (where N might be infinite).

Mnemonically, a Bazaar holds many stores and you can easily add more.

This is a final encoding of Bazaar.

Constructors

 Bazaar FieldsrunBazaar :: forall f. Applicative f => p a (f b) -> f t

Instances

 Corepresentable p => Sellable p (Bazaar p) # Methodssell :: p a (Bazaar p a b b) # Profunctor p => Bizarre p (Bazaar p) # Methodsbazaar :: Applicative f => p a (f b) -> Bazaar p a b t -> f t # # Methodsiextract :: Bazaar p a a t -> t #iduplicate :: Bazaar p a c t -> Bazaar p a b (Bazaar p b c t) #iextend :: (Bazaar p b c t -> r) -> Bazaar p a c t -> Bazaar p a b r # # Methodsifmap :: (s -> t) -> Bazaar p a b s -> Bazaar p a b t # Functor (Bazaar p a b) # Methodsfmap :: (a -> b) -> Bazaar p a b a -> Bazaar p a b b #(<$) :: a -> Bazaar p a b b -> Bazaar p a b a # Applicative (Bazaar p a b) # Methodspure :: a -> Bazaar p a b a #(<*>) :: Bazaar p a b (a -> b) -> Bazaar p a b a -> Bazaar p a b b #(*>) :: Bazaar p a b a -> Bazaar p a b b -> Bazaar p a b b #(<*) :: Bazaar p a b a -> Bazaar p a b b -> Bazaar p a b a # ((~) * a b, Conjoined p) => Comonad (Bazaar p a b) # Methodsextract :: Bazaar p a b a -> a #duplicate :: Bazaar p a b a -> Bazaar p a b (Bazaar p a b a) #extend :: (Bazaar p a b a -> b) -> Bazaar p a b a -> Bazaar p a b b # ((~) * a b, Conjoined p) => ComonadApply (Bazaar p a b) # Methods(<@>) :: Bazaar p a b (a -> b) -> Bazaar p a b a -> Bazaar p a b b #(@>) :: Bazaar p a b a -> Bazaar p a b b -> Bazaar p a b b #(<@) :: Bazaar p a b a -> Bazaar p a b b -> Bazaar p a b a # Apply (Bazaar p a b) # Methods(<.>) :: Bazaar p a b (a -> b) -> Bazaar p a b a -> Bazaar p a b b #(.>) :: Bazaar p a b a -> Bazaar p a b b -> Bazaar p a b b #(<.) :: Bazaar p a b a -> Bazaar p a b b -> Bazaar p a b a # type Bazaar' p a = Bazaar p a a # This alias is helpful when it comes to reducing repetition in type signatures. type Bazaar' p a t = Bazaar p a a t  newtype BazaarT p g a b t # BazaarT is like Bazaar, except that it provides a questionable Contravariant instance To protect this instance it relies on the soundness of another Contravariant type, and usage conventions. For example. This lets us write a suitably polymorphic and lazy taking, but there must be a better way! Constructors  BazaarT FieldsrunBazaarT :: forall f. Applicative f => p a (f b) -> f t Instances  Corepresentable p => Sellable p (BazaarT p g) # Methodssell :: p a (BazaarT p g a b b) # Profunctor p => Bizarre p (BazaarT p g) # Methodsbazaar :: Applicative f => p a (f b) -> BazaarT p g a b t -> f t # Conjoined p => IndexedComonad (BazaarT p g) # Methodsiextract :: BazaarT p g a a t -> t #iduplicate :: BazaarT p g a c t -> BazaarT p g a b (BazaarT p g b c t) #iextend :: (BazaarT p g b c t -> r) -> BazaarT p g a c t -> BazaarT p g a b r # # Methodsifmap :: (s -> t) -> BazaarT p g a b s -> BazaarT p g a b t # Functor (BazaarT p g a b) # Methodsfmap :: (a -> b) -> BazaarT p g a b a -> BazaarT p g a b b #(<$) :: a -> BazaarT p g a b b -> BazaarT p g a b a # Applicative (BazaarT p g a b) # Methodspure :: a -> BazaarT p g a b a #(<*>) :: BazaarT p g a b (a -> b) -> BazaarT p g a b a -> BazaarT p g a b b #(*>) :: BazaarT p g a b a -> BazaarT p g a b b -> BazaarT p g a b b #(<*) :: BazaarT p g a b a -> BazaarT p g a b b -> BazaarT p g a b a # (Profunctor p, Contravariant g) => Contravariant (BazaarT p g a b) # Methodscontramap :: (a -> b) -> BazaarT p g a b b -> BazaarT p g a b a #(>$) :: b -> BazaarT p g a b b -> BazaarT p g a b a # ((~) * a b, Conjoined p) => Comonad (BazaarT p g a b) # Methodsextract :: BazaarT p g a b a -> a #duplicate :: BazaarT p g a b a -> BazaarT p g a b (BazaarT p g a b a) #extend :: (BazaarT p g a b a -> b) -> BazaarT p g a b a -> BazaarT p g a b b # ((~) * a b, Conjoined p) => ComonadApply (BazaarT p g a b) # Methods(<@>) :: BazaarT p g a b (a -> b) -> BazaarT p g a b a -> BazaarT p g a b b #(@>) :: BazaarT p g a b a -> BazaarT p g a b b -> BazaarT p g a b b #(<@) :: BazaarT p g a b a -> BazaarT p g a b b -> BazaarT p g a b a # Apply (BazaarT p g a b) # Methods(<.>) :: BazaarT p g a b (a -> b) -> BazaarT p g a b a -> BazaarT p g a b b #(.>) :: BazaarT p g a b a -> BazaarT p g a b b -> BazaarT p g a b b #(<.) :: BazaarT p g a b a -> BazaarT p g a b b -> BazaarT p g a b a # Contravariant g => Semigroup (BazaarT p g a b t) # Methods(<>) :: BazaarT p g a b t -> BazaarT p g a b t -> BazaarT p g a b t #sconcat :: NonEmpty (BazaarT p g a b t) -> BazaarT p g a b t #stimes :: Integral b => b -> BazaarT p g a b t -> BazaarT p g a b t # Contravariant g => Monoid (BazaarT p g a b t) # Methodsmempty :: BazaarT p g a b t #mappend :: BazaarT p g a b t -> BazaarT p g a b t -> BazaarT p g a b t #mconcat :: [BazaarT p g a b t] -> BazaarT p g a b t # type BazaarT' p g a = BazaarT p g a a # This alias is helpful when it comes to reducing repetition in type signatures. type BazaarT' p g a t = BazaarT p g a a t  class Profunctor p => Bizarre1 p w | w -> p where # Minimal complete definition bazaar1 Methods bazaar1 :: Apply f => p a (f b) -> w a b t -> f t # Instances  Profunctor p => Bizarre1 p (Bazaar1 p) # Methodsbazaar1 :: Apply f => p a (f b) -> Bazaar1 p a b t -> f t # Profunctor p => Bizarre1 p (BazaarT1 p g) # Methodsbazaar1 :: Apply f => p a (f b) -> BazaarT1 p g a b t -> f t # newtype Bazaar1 p a b t # This is used to characterize a Traversal. a.k.a. indexed Cartesian store comonad, indexed Kleene store comonad, or an indexed FunList. http://twanvl.nl/blog/haskell/non-regular1 A Bazaar1 is like a Traversal that has already been applied to some structure. Where a Context a b t holds an a and a function from b to t, a Bazaar1 a b t holds N as and a function from N bs to t, (where N might be infinite). Mnemonically, a Bazaar1 holds many stores and you can easily add more. This is a final encoding of Bazaar1. Constructors  Bazaar1 FieldsrunBazaar1 :: forall f. Apply f => p a (f b) -> f t Instances  Corepresentable p => Sellable p (Bazaar1 p) # Methodssell :: p a (Bazaar1 p a b b) # Profunctor p => Bizarre1 p (Bazaar1 p) # Methodsbazaar1 :: Apply f => p a (f b) -> Bazaar1 p a b t -> f t # # Methodsiextract :: Bazaar1 p a a t -> t #iduplicate :: Bazaar1 p a c t -> Bazaar1 p a b (Bazaar1 p b c t) #iextend :: (Bazaar1 p b c t -> r) -> Bazaar1 p a c t -> Bazaar1 p a b r # # Methodsifmap :: (s -> t) -> Bazaar1 p a b s -> Bazaar1 p a b t # Functor (Bazaar1 p a b) # Methodsfmap :: (a -> b) -> Bazaar1 p a b a -> Bazaar1 p a b b #(<$) :: a -> Bazaar1 p a b b -> Bazaar1 p a b a # ((~) * a b, Conjoined p) => Comonad (Bazaar1 p a b) # Methodsextract :: Bazaar1 p a b a -> a #duplicate :: Bazaar1 p a b a -> Bazaar1 p a b (Bazaar1 p a b a) #extend :: (Bazaar1 p a b a -> b) -> Bazaar1 p a b a -> Bazaar1 p a b b # ((~) * a b, Conjoined p) => ComonadApply (Bazaar1 p a b) # Methods(<@>) :: Bazaar1 p a b (a -> b) -> Bazaar1 p a b a -> Bazaar1 p a b b #(@>) :: Bazaar1 p a b a -> Bazaar1 p a b b -> Bazaar1 p a b b #(<@) :: Bazaar1 p a b a -> Bazaar1 p a b b -> Bazaar1 p a b a # Apply (Bazaar1 p a b) # Methods(<.>) :: Bazaar1 p a b (a -> b) -> Bazaar1 p a b a -> Bazaar1 p a b b #(.>) :: Bazaar1 p a b a -> Bazaar1 p a b b -> Bazaar1 p a b b #(<.) :: Bazaar1 p a b a -> Bazaar1 p a b b -> Bazaar1 p a b a #

type Bazaar1' p a = Bazaar1 p a a #

This alias is helpful when it comes to reducing repetition in type signatures.

type Bazaar1' p a t = Bazaar1 p a a t


newtype BazaarT1 p g a b t #

BazaarT1 is like Bazaar1, except that it provides a questionable Contravariant instance To protect this instance it relies on the soundness of another Contravariant type, and usage conventions.

For example. This lets us write a suitably polymorphic and lazy taking, but there must be a better way!

Constructors

 BazaarT1 FieldsrunBazaarT1 :: forall f. Apply f => p a (f b) -> f t

Instances

 Corepresentable p => Sellable p (BazaarT1 p g) # Methodssell :: p a (BazaarT1 p g a b b) # Profunctor p => Bizarre1 p (BazaarT1 p g) # Methodsbazaar1 :: Apply f => p a (f b) -> BazaarT1 p g a b t -> f t # Conjoined p => IndexedComonad (BazaarT1 p g) # Methodsiextract :: BazaarT1 p g a a t -> t #iduplicate :: BazaarT1 p g a c t -> BazaarT1 p g a b (BazaarT1 p g b c t) #iextend :: (BazaarT1 p g b c t -> r) -> BazaarT1 p g a c t -> BazaarT1 p g a b r # # Methodsifmap :: (s -> t) -> BazaarT1 p g a b s -> BazaarT1 p g a b t # Functor (BazaarT1 p g a b) # Methodsfmap :: (a -> b) -> BazaarT1 p g a b a -> BazaarT1 p g a b b #(<$) :: a -> BazaarT1 p g a b b -> BazaarT1 p g a b a # (Profunctor p, Contravariant g) => Contravariant (BazaarT1 p g a b) # Methodscontramap :: (a -> b) -> BazaarT1 p g a b b -> BazaarT1 p g a b a #(>$) :: b -> BazaarT1 p g a b b -> BazaarT1 p g a b a # ((~) * a b, Conjoined p) => Comonad (BazaarT1 p g a b) # Methodsextract :: BazaarT1 p g a b a -> a #duplicate :: BazaarT1 p g a b a -> BazaarT1 p g a b (BazaarT1 p g a b a) #extend :: (BazaarT1 p g a b a -> b) -> BazaarT1 p g a b a -> BazaarT1 p g a b b # ((~) * a b, Conjoined p) => ComonadApply (BazaarT1 p g a b) # Methods(<@>) :: BazaarT1 p g a b (a -> b) -> BazaarT1 p g a b a -> BazaarT1 p g a b b #(@>) :: BazaarT1 p g a b a -> BazaarT1 p g a b b -> BazaarT1 p g a b b #(<@) :: BazaarT1 p g a b a -> BazaarT1 p g a b b -> BazaarT1 p g a b a # Apply (BazaarT1 p g a b) # Methods(<.>) :: BazaarT1 p g a b (a -> b) -> BazaarT1 p g a b a -> BazaarT1 p g a b b #(.>) :: BazaarT1 p g a b a -> BazaarT1 p g a b b -> BazaarT1 p g a b b #(<.) :: BazaarT1 p g a b a -> BazaarT1 p g a b b -> BazaarT1 p g a b a # Contravariant g => Semigroup (BazaarT1 p g a b t) # Methods(<>) :: BazaarT1 p g a b t -> BazaarT1 p g a b t -> BazaarT1 p g a b t #sconcat :: NonEmpty (BazaarT1 p g a b t) -> BazaarT1 p g a b t #stimes :: Integral b => b -> BazaarT1 p g a b t -> BazaarT1 p g a b t #

type BazaarT1' p g a = BazaarT1 p g a a #

This alias is helpful when it comes to reducing repetition in type signatures.

type BazaarT1' p g a t = BazaarT1 p g a a t