lens-5.0.1: Lenses, Folds and Traversals
Copyright (C) 2012-2016 Edward Kmett
License BSD-style (see the file LICENSE)
Maintainer Edward Kmett <ekmett@gmail.com>
Stability experimental
Portability non-portable
Safe Haskell Safe-Inferred
Language Haskell2010

Control.Lens.Internal.Magma

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

Instances details
FunctorWithIndex i ( Magma i t b) Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

imap :: (i -> a -> b0) -> Magma i t b a -> Magma i t b b0 Source #

FoldableWithIndex i ( Magma i t b) Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

ifoldMap :: Monoid m => (i -> a -> m) -> Magma i t b a -> m Source #

ifoldMap' :: Monoid m => (i -> a -> m) -> Magma i t b a -> m Source #

ifoldr :: (i -> a -> b0 -> b0) -> b0 -> Magma i t b a -> b0 Source #

ifoldl :: (i -> b0 -> a -> b0) -> b0 -> Magma i t b a -> b0 Source #

ifoldr' :: (i -> a -> b0 -> b0) -> b0 -> Magma i t b a -> b0 Source #

ifoldl' :: (i -> b0 -> a -> b0) -> b0 -> Magma i t b a -> b0 Source #

TraversableWithIndex i ( Magma i t b) Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

itraverse :: Applicative f => (i -> a -> f b0) -> Magma i t b a -> f ( Magma i t b b0) Source #

Functor ( Magma i t b) Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

fmap :: (a -> b0) -> Magma i t b a -> Magma i t b b0 Source #

(<$) :: a -> Magma i t b b0 -> Magma i t b a Source #

Foldable ( Magma i t b) Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

fold :: Monoid m => Magma i t b m -> m Source #

foldMap :: Monoid m => (a -> m) -> Magma i t b a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Magma i t b a -> m Source #

foldr :: (a -> b0 -> b0) -> b0 -> Magma i t b a -> b0 Source #

foldr' :: (a -> b0 -> b0) -> b0 -> Magma i t b a -> b0 Source #

foldl :: (b0 -> a -> b0) -> b0 -> Magma i t b a -> b0 Source #

foldl' :: (b0 -> a -> b0) -> b0 -> Magma i t b a -> b0 Source #

foldr1 :: (a -> a -> a) -> Magma i t b a -> a Source #

foldl1 :: (a -> a -> a) -> Magma i t b a -> a Source #

toList :: Magma i t b a -> [a] Source #

null :: Magma i t b a -> Bool Source #

length :: Magma i t b a -> Int Source #

elem :: Eq a => a -> Magma i t b a -> Bool Source #

maximum :: Ord a => Magma i t b a -> a Source #

minimum :: Ord a => Magma i t b a -> a Source #

sum :: Num a => Magma i t b a -> a Source #

product :: Num a => Magma i t b a -> a Source #

Traversable ( Magma i t b) Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

traverse :: Applicative f => (a -> f b0) -> Magma i t b a -> f ( Magma i t b b0) Source #

sequenceA :: Applicative f => Magma i t b (f a) -> f ( Magma i t b a) Source #

mapM :: Monad m => (a -> m b0) -> Magma i t b a -> m ( Magma i t b b0) Source #

sequence :: Monad m => Magma i t b (m a) -> m ( Magma i t b a) Source #

( Show i, Show a) => Show ( Magma i t b a) Source #
Instance details

Defined in Control.Lens.Internal.Magma

runMagma :: Magma i t a a -> t Source #

Run a Magma where all the individual leaves have been converted to the expected type

Molten

newtype Molten i a b t Source #

This is a a non-reassociating initially encoded version of Bazaar .

Constructors

Molten

Fields

Instances

Instances details
IndexedComonad ( Molten i) Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

iextract :: Molten i a a t -> t Source #

iduplicate :: Molten i a c t -> Molten i a b ( Molten i b c t) Source #

iextend :: ( Molten i b c t -> r) -> Molten i a c t -> Molten i a b r Source #

IndexedFunctor ( Molten i) Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

ifmap :: (s -> t) -> Molten i a b s -> Molten i a b t Source #

Sellable ( Indexed i) ( Molten i) Source #
Instance details

Defined in Control.Lens.Internal.Magma

Bizarre ( Indexed i) ( Molten i) Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

bazaar :: Applicative f => Indexed i a (f b) -> Molten i a b t -> f t Source #

Functor ( Molten i a b) Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

fmap :: (a0 -> b0) -> Molten i a b a0 -> Molten i a b b0 Source #

(<$) :: a0 -> Molten i a b b0 -> Molten i a b a0 Source #

Applicative ( Molten i a b) Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

pure :: a0 -> Molten i a b a0 Source #

(<*>) :: Molten i a b (a0 -> b0) -> Molten i a b a0 -> Molten i a b b0 Source #

liftA2 :: (a0 -> b0 -> c) -> Molten i a b a0 -> Molten i a b b0 -> Molten i a b c Source #

(*>) :: Molten i a b a0 -> Molten i a b b0 -> Molten i a b b0 Source #

(<*) :: Molten i a b a0 -> Molten i a b b0 -> Molten i a b a0 Source #

a ~ b => Comonad ( Molten i a b) Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

extract :: Molten i a b a0 -> a0 Source #

duplicate :: Molten i a b a0 -> Molten i a b ( Molten i a b a0) Source #

extend :: ( Molten i a b a0 -> b0) -> Molten i a b a0 -> Molten i a b b0 Source #

Apply ( Molten i a b) Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

(<.>) :: Molten i a b (a0 -> b0) -> Molten i a b a0 -> Molten i a b b0 Source #

(.>) :: Molten i a b a0 -> Molten i a b b0 -> Molten i a b b0 Source #

(<.) :: Molten i a b a0 -> Molten i a b b0 -> Molten i a b a0 Source #

liftF2 :: (a0 -> b0 -> c) -> Molten i a b a0 -> Molten i a b b0 -> Molten i a b c Source #

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

Instances details
IndexedFunctor Mafic Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

ifmap :: (s -> t) -> Mafic a b s -> Mafic a b t Source #

Bizarre ( Indexed Int ) Mafic Source #
Instance details

Defined in Control.Lens.Internal.Magma

Functor ( Mafic a b) Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

fmap :: (a0 -> b0) -> Mafic a b a0 -> Mafic a b b0 Source #

(<$) :: a0 -> Mafic a b b0 -> Mafic a b a0 Source #

Applicative ( Mafic a b) Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

pure :: a0 -> Mafic a b a0 Source #

(<*>) :: Mafic a b (a0 -> b0) -> Mafic a b a0 -> Mafic a b b0 Source #

liftA2 :: (a0 -> b0 -> c) -> Mafic a b a0 -> Mafic a b b0 -> Mafic a b c Source #

(*>) :: Mafic a b a0 -> Mafic a b b0 -> Mafic a b b0 Source #

(<*) :: Mafic a b a0 -> Mafic a b b0 -> Mafic a b a0 Source #

Apply ( Mafic a b) Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

(<.>) :: Mafic a b (a0 -> b0) -> Mafic a b a0 -> Mafic a b b0 Source #

(.>) :: Mafic a b a0 -> Mafic a b b0 -> Mafic a b b0 Source #

(<.) :: Mafic a b a0 -> Mafic a b b0 -> Mafic a b a0 Source #

liftF2 :: (a0 -> b0 -> c) -> Mafic a b a0 -> Mafic a b b0 -> Mafic a b c Source #

Sellable ((->) :: Type -> Type -> Type ) Mafic Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

sell :: 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

Instances details
Corepresentable p => Bizarre p ( TakingWhile p g) Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

bazaar :: Applicative f => p a (f b) -> TakingWhile p g a b t -> f t Source #

IndexedFunctor ( TakingWhile p f) Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

ifmap :: (s -> t) -> TakingWhile p f a b s -> TakingWhile p f a b t Source #

Functor ( TakingWhile p f a b) Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

fmap :: (a0 -> b0) -> TakingWhile p f a b a0 -> TakingWhile p f a b b0 Source #

(<$) :: a0 -> TakingWhile p f a b b0 -> TakingWhile p f a b a0 Source #

Applicative ( TakingWhile p f a b) Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

pure :: a0 -> TakingWhile p f a b a0 Source #

(<*>) :: TakingWhile p f a b (a0 -> b0) -> TakingWhile p f a b a0 -> TakingWhile p f a b b0 Source #

liftA2 :: (a0 -> b0 -> c) -> TakingWhile p f a b a0 -> TakingWhile p f a b b0 -> TakingWhile p f a b c Source #

(*>) :: TakingWhile p f a b a0 -> TakingWhile p f a b b0 -> TakingWhile p f a b b0 Source #

(<*) :: TakingWhile p f a b a0 -> TakingWhile p f a b b0 -> TakingWhile p f a b a0 Source #

Contravariant f => Contravariant ( TakingWhile p f a b) Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

contramap :: (a0 -> b0) -> TakingWhile p f a b b0 -> TakingWhile p f a b a0 Source #

(>$) :: b0 -> TakingWhile p f a b b0 -> TakingWhile p f a b a0 Source #

Apply ( TakingWhile p f a b) Source #
Instance details

Defined in Control.Lens.Internal.Magma

Methods

(<.>) :: TakingWhile p f a b (a0 -> b0) -> TakingWhile p f a b a0 -> TakingWhile p f a b b0 Source #

(.>) :: TakingWhile p f a b a0 -> TakingWhile p f a b b0 -> TakingWhile p f a b b0 Source #

(<.) :: TakingWhile p f a b a0 -> TakingWhile p f a b b0 -> TakingWhile p f a b a0 Source #

liftF2 :: (a0 -> b0 -> c) -> TakingWhile p f a b a0 -> TakingWhile p f a b b0 -> TakingWhile p f a b c Source #

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.