data-diverse-lens-2.0.0.0: Isos & Lens for Data.Diverse.Many and Prisms for Data.Diverse.Which

Safe HaskellNone
LanguageHaskell2010

Data.Diverse.Profunctor.Which

Contents

Synopsis

Combinators similar to Profunctor Choice

faceted :: forall w a as x b bs y. Faceted w a as x b bs y => w a b -> w x y Source #

Like Choice or ArrowChoice but lifting into a polymorphic variant.

faceted' :: (Profunctor w, Choice w) => w a b -> w (Which '[a]) (Which '[b]) Source #

Like Choice or ArrowChoice but lifting into Which of one type

injected :: Injected w a a' b b' => w (Which a) (Which b) -> w (Which a') (Which b') Source #

Like Choice or ArrowChoice but lifting from Which into another type of Which NB. It is a compile error if all of the input types in the second arrow a is not the output types of the first arrow. This prevents surprising behaviour where the second arrow is ignored.

(+||+) :: forall w a1 a2 a3 b1 b2 b3. ChooseBetween w a1 a2 a3 b1 b2 b3 => w (Which a1) (Which b1) -> w (Which a2) (Which b2) -> w (Which a3) (Which b3) infixr 2 Source #

Split the input between the two argument arrows, retagging and merging their outputs. The output is merged into a Which of unique types. Analogous to a Which combination of both +++ and |||. It is a compile error if the types are not distinct after Appending both argument arrows inputs. This is to prevent accidently processing an input type twice. The compile error will be due to (Append a1 a2) which will not satisfy UniqueMember constraints in Reinterpret.

(>||>) :: forall w a a2 b1 b2 b3. AlsoChoose w a2 b1 b2 b3 => w a (Which b1) -> w (Which a2) (Which b2) -> w a (Which b3) infixr 2 Source #

Left-to-right chaining of arrows one after another, where left over possibilities not handled by the right arrow is forwarded to the output. It is a compile error if the types are not distinct in each of the argument arrow inputs, or if the types are not distinct of each of the argument arrow output, or if the input of the second arrow is not a subset of the output of the first arrow. This is to prevent surprises behaviour of the second arrow being ignored. The compile error will be due to the Complement c b ~ '[] constraint.

(<||<) :: forall w a a2 b1 b2 b3. AlsoChoose w a2 b1 b2 b3 => w (Which a2) (Which b2) -> w a (Which b1) -> w a (Which b3) infixl 2 Source #

right-to-left version of '(>||>)'