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 |
Synopsis
- data Magma i t b a where
- runMagma :: Magma i t a a -> t
- newtype Molten i a b t = Molten {}
- data Mafic a b t = Mafic Int (Int -> Magma Int t b a)
- runMafic :: Mafic a b t -> Magma Int t b a
- data TakingWhile p (g :: * -> *) a b t = TakingWhile Bool t (Bool -> Magma () t b (Corep p a))
- runTakingWhile :: TakingWhile p f a b t -> Magma () t b (Corep p a)
Magma
This provides a way to peek at the internal structure of a
Traversal
or IndexedTraversal
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
TraversableWithIndex i (Magma i t b) # | |
Defined in Control.Lens.Indexed itraverse :: Applicative f => (i -> a -> f b0) -> Magma i t b a -> f (Magma i t b b0) # itraversed :: IndexedTraversal i (Magma i t b a) (Magma i t b b0) a b0 # | |
FoldableWithIndex i (Magma i t b) # | |
Defined in Control.Lens.Indexed ifoldMap :: Monoid m => (i -> a -> m) -> Magma i t b a -> m # ifolded :: IndexedFold i (Magma i t b a) a # ifoldr :: (i -> a -> b0 -> b0) -> b0 -> Magma i t b a -> b0 # ifoldl :: (i -> b0 -> a -> b0) -> b0 -> Magma i t b a -> b0 # ifoldr' :: (i -> a -> b0 -> b0) -> b0 -> Magma i t b a -> b0 # ifoldl' :: (i -> b0 -> a -> b0) -> b0 -> Magma i t b a -> b0 # | |
FunctorWithIndex i (Magma i t b) # | |
Defined in Control.Lens.Indexed | |
Functor (Magma i t b) # | |
Foldable (Magma i t b) # | |
Defined in Control.Lens.Internal.Magma fold :: Monoid m => Magma i t b m -> m # foldMap :: Monoid m => (a -> m) -> Magma i t b a -> m # foldMap' :: Monoid m => (a -> m) -> Magma i t b a -> m # foldr :: (a -> b0 -> b0) -> b0 -> Magma i t b a -> b0 # foldr' :: (a -> b0 -> b0) -> b0 -> Magma i t b a -> b0 # foldl :: (b0 -> a -> b0) -> b0 -> Magma i t b a -> b0 # foldl' :: (b0 -> a -> b0) -> b0 -> Magma i t b a -> b0 # foldr1 :: (a -> a -> a) -> Magma i t b a -> a # foldl1 :: (a -> a -> a) -> Magma i t b a -> a # toList :: Magma i t b a -> [a] # null :: Magma i t b a -> Bool # length :: Magma i t b a -> Int # elem :: Eq a => a -> Magma i t b a -> Bool # maximum :: Ord a => Magma i t b a -> a # minimum :: Ord a => Magma i t b a -> a # | |
Traversable (Magma i t b) # | |
Defined in Control.Lens.Internal.Magma | |
(Show i, Show a) => Show (Magma i t b a) # | |
runMagma :: Magma i t a a -> t #
Run a Magma
where all the individual leaves have been converted to the
expected type
Molten
This is a a non-reassociating initially encoded version of Bazaar
.
Instances
IndexedComonad (Molten i) # | |
IndexedFunctor (Molten i) # | |
Defined in Control.Lens.Internal.Magma | |
Sellable (Indexed i) (Molten i) # | |
Defined in Control.Lens.Internal.Magma | |
Bizarre (Indexed i) (Molten i) # | |
Defined in Control.Lens.Internal.Magma bazaar :: Applicative f => Indexed i a (f b) -> Molten i a b t -> f t # | |
Functor (Molten i a b) # | |
Applicative (Molten i a b) # | |
Defined in Control.Lens.Internal.Magma pure :: a0 -> Molten i a b a0 # (<*>) :: Molten i a b (a0 -> b0) -> Molten i a b a0 -> Molten i a b b0 # liftA2 :: (a0 -> b0 -> c) -> Molten i a b a0 -> Molten i a b b0 -> Molten i a b c # (*>) :: Molten i a b a0 -> Molten i a b b0 -> Molten i a b b0 # (<*) :: Molten i a b a0 -> Molten i a b b0 -> Molten i a b a0 # | |
a ~ b => Comonad (Molten i a b) # | |
Apply (Molten i a b) # | |
Defined in Control.Lens.Internal.Magma |
Mafic
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.
Instances
IndexedFunctor Mafic # | |
Defined in Control.Lens.Internal.Magma | |
Bizarre (Indexed Int) Mafic # | |
Defined in Control.Lens.Internal.Magma | |
Functor (Mafic a b) # | |
Applicative (Mafic a b) # | |
Defined in Control.Lens.Internal.Magma | |
Apply (Mafic a b) # | |
Sellable ((->) :: Type -> Type -> Type) Mafic # | |
Defined in Control.Lens.Internal.Magma |
TakingWhile
data TakingWhile p (g :: * -> *) a b t #
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 tg
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
TakingWhile Bool t (Bool -> Magma () t b (Corep p a)) |
Instances
Corepresentable p => Bizarre p (TakingWhile p g) # | |
Defined in Control.Lens.Internal.Magma bazaar :: Applicative f => p a (f b) -> TakingWhile p g a b t -> f t # | |
IndexedFunctor (TakingWhile p f) # | |
Defined in Control.Lens.Internal.Magma ifmap :: (s -> t) -> TakingWhile p f a b s -> TakingWhile p f a b t # | |
Functor (TakingWhile p f a b) # | |
Defined in Control.Lens.Internal.Magma fmap :: (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) # | |
Defined in Control.Lens.Internal.Magma pure :: 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) # | |
Defined in Control.Lens.Internal.Magma contramap :: (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) # | |
Defined in Control.Lens.Internal.Magma (<.>) :: 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 # liftF2 :: (a0 -> b0 -> c) -> TakingWhile p f a b a0 -> TakingWhile p f a b b0 -> TakingWhile p f a b c # |
runTakingWhile :: TakingWhile p f a b t -> Magma () t b (Corep p a) #
Generate a Magma
with leaves only while the predicate holds from left to right.