lens-4.15.4: Lenses, Folds and Traversals

Copyright (C) 2012-2016 Edward Kmett BSD-style (see the file LICENSE) Edward Kmett experimental non-portable Safe Haskell98

Control.Lens.Internal.Magma

Contents

Description

Synopsis

# Magma

data Magma i t b a where Source #

This provides a way to peek at the internal structure of a Traversal or IndexedTraversal

Constructors

 MagmaAp :: Magma i (x -> y) b a -> Magma i x b a -> Magma i y b a MagmaPure :: x -> Magma i x b a MagmaFmap :: (x -> y) -> Magma i x b a -> Magma i y b a Magma :: i -> a -> Magma i b b a
Instances

# Mafic

data Mafic a b t Source #

This is used to generate an indexed magma from an unindexed source

By constructing it this way we avoid infinite reassociations in sums where possible.

Constructors

 Mafic Int (Int -> Magma Int t b a)
Instances
 Source # Instance detailsMethodsifmap :: (s -> t) -> Mafic a b s -> Mafic a b t Source # Source # Instance detailsMethodsbazaar :: Applicative f => Indexed Int a (f b) -> Mafic a b t -> f t Source # Functor (Mafic a b) Source # Instance detailsMethodsfmap :: (a0 -> b0) -> Mafic a b a0 -> Mafic a b b0 #(<$) :: a0 -> Mafic a b b0 -> Mafic a b a0 # Applicative (Mafic a b) Source # Instance detailsMethodspure :: a0 -> Mafic a b a0 #(<*>) :: Mafic a b (a0 -> b0) -> Mafic a b a0 -> Mafic a b b0 #liftA2 :: (a0 -> b0 -> c) -> Mafic a b a0 -> Mafic a b b0 -> Mafic a b c #(*>) :: Mafic a b a0 -> Mafic a b b0 -> Mafic a b b0 #(<*) :: Mafic a b a0 -> Mafic a b b0 -> Mafic a b a0 # Apply (Mafic a b) Source # Instance detailsMethods(<.>) :: Mafic a b (a0 -> b0) -> Mafic a b a0 -> Mafic a b b0 #(.>) :: Mafic a b a0 -> Mafic a b b0 -> Mafic a b b0 #(<.) :: Mafic a b a0 -> Mafic a b b0 -> Mafic a b a0 # Source # Instance detailsMethodssell :: (LiftedRep -> LiftedRep) a (Mafic a b b) Source # runMafic :: Mafic a b t -> Magma Int t b a Source # Generate a Magma using from a prefix sum. # TakingWhile data TakingWhile p (g :: * -> *) a b t Source # This is used to generate an indexed magma from an unindexed source By constructing it this way we avoid infinite reassociations where possible. In TakingWhile p g a b t, g has a nominal role to avoid exposing an illegal _|_ via Contravariant, while the remaining arguments are degraded to a nominal role by the invariants of Magma Constructors  TakingWhile Bool t (Bool -> Magma () t b (Corep p a)) Instances  Corepresentable p => Bizarre p (TakingWhile p g) Source # Instance detailsMethodsbazaar :: Applicative f => p a (f b) -> TakingWhile p g a b t -> f t Source # Source # Instance detailsMethodsifmap :: (s -> t) -> TakingWhile p f a b s -> TakingWhile p f a b t Source # Functor (TakingWhile p f a b) Source # Instance detailsMethodsfmap :: (a0 -> b0) -> TakingWhile p f a b a0 -> TakingWhile p f a b b0 #(<$) :: a0 -> TakingWhile p f a b b0 -> TakingWhile p f a b a0 # Applicative (TakingWhile p f a b) Source # Instance detailsMethodspure :: a0 -> TakingWhile p f a b a0 #(<*>) :: TakingWhile p f a b (a0 -> b0) -> TakingWhile p f a b a0 -> TakingWhile p f a b b0 #liftA2 :: (a0 -> b0 -> c) -> TakingWhile p f a b a0 -> TakingWhile p f a b b0 -> TakingWhile p f a b c #(*>) :: TakingWhile p f a b a0 -> TakingWhile p f a b b0 -> TakingWhile p f a b b0 #(<*) :: TakingWhile p f a b a0 -> TakingWhile p f a b b0 -> TakingWhile p f a b a0 # Contravariant f => Contravariant (TakingWhile p f a b) Source # Instance detailsMethodscontramap :: (a0 -> b0) -> TakingWhile p f a b b0 -> TakingWhile p f a b a0 #(>\$) :: b0 -> TakingWhile p f a b b0 -> TakingWhile p f a b a0 # Apply (TakingWhile p f a b) Source # Instance detailsMethods(<.>) :: TakingWhile p f a b (a0 -> b0) -> TakingWhile p f a b a0 -> TakingWhile p f a b b0 #(.>) :: TakingWhile p f a b a0 -> TakingWhile p f a b b0 -> TakingWhile p f a b b0 #(<.) :: TakingWhile p f a b a0 -> TakingWhile p f a b b0 -> TakingWhile p f a b a0 #

runTakingWhile :: TakingWhile p f a b t -> Magma () t b (Corep p a) Source #

Generate a Magma with leaves only while the predicate holds from left to right.