{-# LANGUAGE CPP #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE Trustworthy #-}
#if __GLASGOW_HASKELL__ >= 800
{-# LANGUAGE TypeInType #-}
#endif
#ifndef MIN_VERSION_mtl
#define MIN_VERSION_mtl(x,y,z) 1
#endif
#if __GLASGOW_HASKELL__ >= 800
{-# OPTIONS_GHC -Wno-trustworthy-safe #-}
#endif
module Control.Lens.Lens
(
Lens, Lens'
, IndexedLens, IndexedLens'
, ALens, ALens'
, AnIndexedLens, AnIndexedLens'
, lens, ilens, iplens, withLens
, (%%~), (%%=)
, (%%@~), (%%@=)
, (<%@~), (<%@=)
, (<<%@~), (<<%@=)
, (&), (<&>), (??)
, (&~)
, choosing
, chosen
, alongside
, inside
, (<%~), (<+~), (<-~), (<*~), (<//~)
, (<^~), (<^^~), (<**~)
, (<||~), (<&&~), (<<>~)
, (<<%~), (<<.~), (<<?~), (<<+~), (<<-~), (<<*~)
, (<<//~), (<<^~), (<<^^~), (<<**~)
, (<<||~), (<<&&~), (<<<>~)
, (<%=), (<+=), (<-=), (<*=), (<//=)
, (<^=), (<^^=), (<**=)
, (<||=), (<&&=), (<<>=)
, (<<%=), (<<.=), (<<?=), (<<+=), (<<-=), (<<*=)
, (<<//=), (<<^=), (<<^^=), (<<**=)
, (<<||=), (<<&&=), (<<<>=)
, (<<~)
, cloneLens
, cloneIndexPreservingLens
, cloneIndexedLens
, overA
, storing
, (^#)
, ( #~ ), ( #%~ ), ( #%%~ ), (<#~), (<#%~)
, ( #= ), ( #%= ), ( #%%= ), (<#=), (<#%=)
, devoid
, united
, head1, last1
, Context(..)
, Context'
, locus
, fusing
) where
import Control.Applicative
import Control.Arrow
import Control.Comonad
import Control.Lens.Internal.Context
import Control.Lens.Internal.Getter
import Control.Lens.Internal.Indexed
import Control.Lens.Type
import Control.Monad.State as State
import Data.Functor.Apply
import Data.Functor.Reverse
import Data.Functor.Yoneda
import Data.Monoid
import Data.Profunctor
import Data.Profunctor.Rep
import Data.Profunctor.Sieve
import Data.Profunctor.Unsafe
import Data.Semigroup.Traversable
import Data.Void
import Prelude
#if MIN_VERSION_base(4,8,0)
import Data.Function ((&))
#endif
#if MIN_VERSION_base(4,11,0)
import Data.Functor ((<&>))
#endif
#if __GLASGOW_HASKELL__ >= 800
import GHC.Exts (TYPE)
#endif
#ifdef HLINT
{-# ANN module "HLint: ignore Use ***" #-}
#endif
infixl 8 ^#
infixr 4 %%@~, <%@~, <<%@~, %%~, <+~, <*~, <-~, <//~, <^~, <^^~, <**~, <&&~, <||~, <<>~, <%~, <<%~, <<.~, <<?~, <#~, #~, #%~, <#%~, #%%~
, <<+~, <<-~, <<*~, <<//~, <<^~, <<^^~, <<**~, <<||~, <<&&~, <<<>~
infix 4 %%@=, <%@=, <<%@=, %%=, <+=, <*=, <-=, <//=, <^=, <^^=, <**=, <&&=, <||=, <<>=, <%=, <<%=, <<.=, <<?=, <#=, #=, #%=, <#%=, #%%=
, <<+=, <<-=, <<*=, <<//=, <<^=, <<^^=, <<**=, <<||=, <<&&=, <<<>=
infixr 2 <<~
infixl 1 ??, &~
type ALens s t a b = LensLike (Pretext (->) a b) s t a b
type ALens' s a = ALens s s a a
type AnIndexedLens i s t a b = Optical (Indexed i) (->) (Pretext (Indexed i) a b) s t a b
type AnIndexedLens' i s a = AnIndexedLens i s s a a
lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b
lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b
lens sa :: s -> a
sa sbt :: s -> b -> t
sbt afb :: a -> f b
afb s :: s
s = s -> b -> t
sbt s
s (b -> t) -> f b -> f t
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a -> f b
afb (s -> a
sa s
s)
{-# INLINE lens #-}
#if __GLASGOW_HASKELL__ >= 800
withLens :: forall s t a b rep (r :: TYPE rep).
ALens s t a b -> ((s -> a) -> (s -> b -> t) -> r) -> r
#else
withLens :: ALens s t a b -> ((s -> a) -> (s -> b -> t) -> r) -> r
#endif
withLens :: ALens s t a b -> ((s -> a) -> (s -> b -> t) -> r) -> r
withLens l :: ALens s t a b
l f :: (s -> a) -> (s -> b -> t) -> r
f = (s -> a) -> (s -> b -> t) -> r
f (s -> ALens s t a b -> a
forall s t a b. s -> ALens s t a b -> a
^# ALens s t a b
l) ((b -> s -> t) -> s -> b -> t
forall a b c. (a -> b -> c) -> b -> a -> c
flip (ALens s t a b -> b -> s -> t
forall s t a b. ALens s t a b -> b -> s -> t
storing ALens s t a b
l))
{-# INLINE withLens #-}
iplens :: (s -> a) -> (s -> b -> t) -> IndexPreservingLens s t a b
iplens :: (s -> a) -> (s -> b -> t) -> IndexPreservingLens s t a b
iplens sa :: s -> a
sa sbt :: s -> b -> t
sbt pafb :: p a (f b)
pafb = (Corep p s -> f t) -> p s (f t)
forall (p :: * -> * -> *) d c.
Corepresentable p =>
(Corep p d -> c) -> p d c
cotabulate ((Corep p s -> f t) -> p s (f t))
-> (Corep p s -> f t) -> p s (f t)
forall a b. (a -> b) -> a -> b
$ \ws :: Corep p s
ws -> s -> b -> t
sbt (Corep p s -> s
forall (w :: * -> *) a. Comonad w => w a -> a
extract Corep p s
ws) (b -> t) -> f b -> f t
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> p a (f b) -> Corep p a -> f b
forall (p :: * -> * -> *) (f :: * -> *) a b.
Cosieve p f =>
p a b -> f a -> b
cosieve p a (f b)
pafb (s -> a
sa (s -> a) -> Corep p s -> Corep p a
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Corep p s
ws)
{-# INLINE iplens #-}
ilens :: (s -> (i, a)) -> (s -> b -> t) -> IndexedLens i s t a b
ilens :: (s -> (i, a)) -> (s -> b -> t) -> IndexedLens i s t a b
ilens sia :: s -> (i, a)
sia sbt :: s -> b -> t
sbt iafb :: p a (f b)
iafb s :: s
s = s -> b -> t
sbt s
s (b -> t) -> f b -> f t
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (i -> a -> f b) -> (i, a) -> f b
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry (p a (f b) -> i -> a -> f b
forall i (p :: * -> * -> *) a b.
Indexable i p =>
p a b -> i -> a -> b
indexed p a (f b)
iafb) (s -> (i, a)
sia s
s)
{-# INLINE ilens #-}
(&~) :: s -> State s a -> s
s :: s
s &~ :: s -> State s a -> s
&~ l :: State s a
l = State s a -> s -> s
forall s a. State s a -> s -> s
execState State s a
l s
s
{-# INLINE (&~) #-}
(%%~) :: LensLike f s t a b -> (a -> f b) -> s -> f t
%%~ :: LensLike f s t a b -> LensLike f s t a b
(%%~) = LensLike f s t a b -> LensLike f s t a b
forall a. a -> a
id
{-# INLINE (%%~) #-}
(%%=) :: MonadState s m => Over p ((,) r) s s a b -> p a (r, b) -> m r
#if MIN_VERSION_mtl(2,1,1)
l :: Over p ((,) r) s s a b
l %%= :: Over p ((,) r) s s a b -> p a (r, b) -> m r
%%= f :: p a (r, b)
f = (s -> (r, s)) -> m r
forall s (m :: * -> *) a. MonadState s m => (s -> (a, s)) -> m a
State.state (Over p ((,) r) s s a b
l p a (r, b)
f)
#else
l %%= f = do
(r, s) <- State.gets (l f)
State.put s
return r
#endif
{-# INLINE (%%=) #-}
#if !(MIN_VERSION_base(4,8,0))
(&) :: a -> (a -> b) -> b
a & f = f a
{-# INLINE (&) #-}
infixl 1 &
#endif
#if !(MIN_VERSION_base(4,11,0))
(<&>) :: Functor f => f a -> (a -> b) -> f b
as <&> f = f <$> as
{-# INLINE (<&>) #-}
infixl 1 <&>
#endif
(??) :: Functor f => f (a -> b) -> a -> f b
fab :: f (a -> b)
fab ?? :: f (a -> b) -> a -> f b
?? a :: a
a = ((a -> b) -> b) -> f (a -> b) -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((a -> b) -> a -> b
forall a b. (a -> b) -> a -> b
$ a
a) f (a -> b)
fab
{-# INLINE (??) #-}
inside :: Corepresentable p => ALens s t a b -> Lens (p e s) (p e t) (p e a) (p e b)
inside :: ALens s t a b -> Lens (p e s) (p e t) (p e a) (p e b)
inside l :: ALens s t a b
l f :: p e a -> f (p e b)
f es :: p e s
es = p e b -> p e t
o (p e b -> p e t) -> f (p e b) -> f (p e t)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> p e a -> f (p e b)
f p e a
i where
i :: p e a
i = (Corep p e -> a) -> p e a
forall (p :: * -> * -> *) d c.
Corepresentable p =>
(Corep p d -> c) -> p d c
cotabulate ((Corep p e -> a) -> p e a) -> (Corep p e -> a) -> p e a
forall a b. (a -> b) -> a -> b
$ \ e :: Corep p e
e -> Pretext (->) a b t -> a
forall (w :: * -> * -> * -> *) a c t.
IndexedComonadStore w =>
w a c t -> a
ipos (Pretext (->) a b t -> a) -> Pretext (->) a b t -> a
forall a b. (a -> b) -> a -> b
$ ALens s t a b
l a -> Pretext (->) a b b
forall (p :: * -> * -> *) (w :: * -> * -> * -> *) a b.
Sellable p w =>
p a (w a b b)
sell (p e s -> Corep p e -> s
forall (p :: * -> * -> *) (f :: * -> *) a b.
Cosieve p f =>
p a b -> f a -> b
cosieve p e s
es Corep p e
e)
o :: p e b -> p e t
o ea :: p e b
ea = (Corep p e -> t) -> p e t
forall (p :: * -> * -> *) d c.
Corepresentable p =>
(Corep p d -> c) -> p d c
cotabulate ((Corep p e -> t) -> p e t) -> (Corep p e -> t) -> p e t
forall a b. (a -> b) -> a -> b
$ \ e :: Corep p e
e -> b -> Pretext (->) a b t -> t
forall (w :: * -> * -> * -> *) c a t.
IndexedComonadStore w =>
c -> w a c t -> t
ipeek (p e b -> Corep p e -> b
forall (p :: * -> * -> *) (f :: * -> *) a b.
Cosieve p f =>
p a b -> f a -> b
cosieve p e b
ea Corep p e
e) (Pretext (->) a b t -> t) -> Pretext (->) a b t -> t
forall a b. (a -> b) -> a -> b
$ ALens s t a b
l a -> Pretext (->) a b b
forall (p :: * -> * -> *) (w :: * -> * -> * -> *) a b.
Sellable p w =>
p a (w a b b)
sell (p e s -> Corep p e -> s
forall (p :: * -> * -> *) (f :: * -> *) a b.
Cosieve p f =>
p a b -> f a -> b
cosieve p e s
es Corep p e
e)
{-# INLINE inside #-}
choosing :: Functor f
=> LensLike f s t a b
-> LensLike f s' t' a b
-> LensLike f (Either s s') (Either t t') a b
choosing :: LensLike f s t a b
-> LensLike f s' t' a b
-> LensLike f (Either s s') (Either t t') a b
choosing l :: LensLike f s t a b
l _ f :: a -> f b
f (Left a :: s
a) = t -> Either t t'
forall a b. a -> Either a b
Left (t -> Either t t') -> f t -> f (Either t t')
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> LensLike f s t a b
l a -> f b
f s
a
choosing _ r :: LensLike f s' t' a b
r f :: a -> f b
f (Right a' :: s'
a') = t' -> Either t t'
forall a b. b -> Either a b
Right (t' -> Either t t') -> f t' -> f (Either t t')
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> LensLike f s' t' a b
r a -> f b
f s'
a'
{-# INLINE choosing #-}
chosen :: IndexPreservingLens (Either a a) (Either b b) a b
chosen :: p a (f b) -> p (Either a a) (f (Either b b))
chosen pafb :: p a (f b)
pafb = (Corep p (Either a a) -> f (Either b b))
-> p (Either a a) (f (Either b b))
forall (p :: * -> * -> *) d c.
Corepresentable p =>
(Corep p d -> c) -> p d c
cotabulate ((Corep p (Either a a) -> f (Either b b))
-> p (Either a a) (f (Either b b)))
-> (Corep p (Either a a) -> f (Either b b))
-> p (Either a a) (f (Either b b))
forall a b. (a -> b) -> a -> b
$ \weaa :: Corep p (Either a a)
weaa -> p (Either a a) (f b) -> Corep p (Either a a) -> f b
forall (p :: * -> * -> *) (f :: * -> *) a b.
Cosieve p f =>
p a b -> f a -> b
cosieve ((a -> a) -> (a -> a) -> Either a a -> a
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either a -> a
forall a. a -> a
id a -> a
forall a. a -> a
id (Either a a -> a) -> p a (f b) -> p (Either a a) (f b)
forall (p :: * -> * -> *) a b c.
Profunctor p =>
(a -> b) -> p b c -> p a c
`lmap` p a (f b)
pafb) Corep p (Either a a)
weaa f b -> (b -> Either b b) -> f (Either b b)
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \b :: b
b -> case Corep p (Either a a) -> Either a a
forall (w :: * -> *) a. Comonad w => w a -> a
extract Corep p (Either a a)
weaa of
Left _ -> b -> Either b b
forall a b. a -> Either a b
Left b
b
Right _ -> b -> Either b b
forall a b. b -> Either a b
Right b
b
{-# INLINE chosen #-}
alongside :: LensLike (AlongsideLeft f b') s t a b
-> LensLike (AlongsideRight f t) s' t' a' b'
-> LensLike f (s, s') (t, t') (a, a') (b, b')
alongside :: LensLike (AlongsideLeft f b') s t a b
-> LensLike (AlongsideRight f t) s' t' a' b'
-> LensLike f (s, s') (t, t') (a, a') (b, b')
alongside l1 :: LensLike (AlongsideLeft f b') s t a b
l1 l2 :: LensLike (AlongsideRight f t) s' t' a' b'
l2 f :: (a, a') -> f (b, b')
f (a1 :: s
a1, a2 :: s'
a2)
= AlongsideRight f t t' -> f (t, t')
forall (f :: * -> *) a b. AlongsideRight f a b -> f (a, b)
getAlongsideRight (AlongsideRight f t t' -> f (t, t'))
-> AlongsideRight f t t' -> f (t, t')
forall a b. (a -> b) -> a -> b
$ LensLike (AlongsideRight f t) s' t' a' b'
l2 LensLike (AlongsideRight f t) s' t' a' b'
-> s' -> (a' -> AlongsideRight f t b') -> AlongsideRight f t t'
forall (f :: * -> *) a b. Functor f => f (a -> b) -> a -> f b
?? s'
a2 ((a' -> AlongsideRight f t b') -> AlongsideRight f t t')
-> (a' -> AlongsideRight f t b') -> AlongsideRight f t t'
forall a b. (a -> b) -> a -> b
$ \b2 :: a'
b2 -> f (t, b') -> AlongsideRight f t b'
forall (f :: * -> *) a b. f (a, b) -> AlongsideRight f a b
AlongsideRight
(f (t, b') -> AlongsideRight f t b')
-> f (t, b') -> AlongsideRight f t b'
forall a b. (a -> b) -> a -> b
$ AlongsideLeft f b' t -> f (t, b')
forall (f :: * -> *) b a. AlongsideLeft f b a -> f (a, b)
getAlongsideLeft (AlongsideLeft f b' t -> f (t, b'))
-> AlongsideLeft f b' t -> f (t, b')
forall a b. (a -> b) -> a -> b
$ LensLike (AlongsideLeft f b') s t a b
l1 LensLike (AlongsideLeft f b') s t a b
-> s -> (a -> AlongsideLeft f b' b) -> AlongsideLeft f b' t
forall (f :: * -> *) a b. Functor f => f (a -> b) -> a -> f b
?? s
a1 ((a -> AlongsideLeft f b' b) -> AlongsideLeft f b' t)
-> (a -> AlongsideLeft f b' b) -> AlongsideLeft f b' t
forall a b. (a -> b) -> a -> b
$ \b1 :: a
b1 -> f (b, b') -> AlongsideLeft f b' b
forall (f :: * -> *) b a. f (a, b) -> AlongsideLeft f b a
AlongsideLeft
(f (b, b') -> AlongsideLeft f b' b)
-> f (b, b') -> AlongsideLeft f b' b
forall a b. (a -> b) -> a -> b
$ (a, a') -> f (b, b')
f (a
b1,a'
b2)
{-# INLINE alongside #-}
locus :: IndexedComonadStore p => Lens (p a c s) (p b c s) a b
locus :: Lens (p a c s) (p b c s) a b
locus f :: a -> f b
f w :: p a c s
w = (b -> p a c s -> p b c s
forall (w :: * -> * -> * -> *) b a c t.
IndexedComonadStore w =>
b -> w a c t -> w b c t
`iseek` p a c s
w) (b -> p b c s) -> f b -> f (p b c s)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a -> f b
f (p a c s -> a
forall (w :: * -> * -> * -> *) a c t.
IndexedComonadStore w =>
w a c t -> a
ipos p a c s
w)
{-# INLINE locus #-}
cloneLens :: ALens s t a b -> Lens s t a b
cloneLens :: ALens s t a b -> Lens s t a b
cloneLens l :: ALens s t a b
l afb :: a -> f b
afb s :: s
s = Pretext (->) a b t -> (a -> f b) -> f t
forall (p :: * -> * -> *) a b t.
Pretext p a b t
-> forall (f :: * -> *). Functor f => p a (f b) -> f t
runPretext (ALens s t a b
l a -> Pretext (->) a b b
forall (p :: * -> * -> *) (w :: * -> * -> * -> *) a b.
Sellable p w =>
p a (w a b b)
sell s
s) a -> f b
afb
{-# INLINE cloneLens #-}
cloneIndexPreservingLens :: ALens s t a b -> IndexPreservingLens s t a b
cloneIndexPreservingLens :: ALens s t a b -> IndexPreservingLens s t a b
cloneIndexPreservingLens l :: ALens s t a b
l pafb :: p a (f b)
pafb = (Corep p s -> f t) -> p s (f t)
forall (p :: * -> * -> *) d c.
Corepresentable p =>
(Corep p d -> c) -> p d c
cotabulate ((Corep p s -> f t) -> p s (f t))
-> (Corep p s -> f t) -> p s (f t)
forall a b. (a -> b) -> a -> b
$ \ws :: Corep p s
ws -> Pretext (->) a b t
-> forall (f :: * -> *). Functor f => (a -> f b) -> f t
forall (p :: * -> * -> *) a b t.
Pretext p a b t
-> forall (f :: * -> *). Functor f => p a (f b) -> f t
runPretext (ALens s t a b
l a -> Pretext (->) a b b
forall (p :: * -> * -> *) (w :: * -> * -> * -> *) a b.
Sellable p w =>
p a (w a b b)
sell (Corep p s -> s
forall (w :: * -> *) a. Comonad w => w a -> a
extract Corep p s
ws)) ((a -> f b) -> f t) -> (a -> f b) -> f t
forall a b. (a -> b) -> a -> b
$ \a :: a
a -> p a (f b) -> Corep p a -> f b
forall (p :: * -> * -> *) (f :: * -> *) a b.
Cosieve p f =>
p a b -> f a -> b
cosieve p a (f b)
pafb (a
a a -> Corep p s -> Corep p a
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$ Corep p s
ws)
{-# INLINE cloneIndexPreservingLens #-}
cloneIndexedLens :: AnIndexedLens i s t a b -> IndexedLens i s t a b
cloneIndexedLens :: AnIndexedLens i s t a b -> IndexedLens i s t a b
cloneIndexedLens l :: AnIndexedLens i s t a b
l f :: p a (f b)
f s :: s
s = Pretext (Indexed i) a b t -> Indexed i a (f b) -> f t
forall (p :: * -> * -> *) a b t.
Pretext p a b t
-> forall (f :: * -> *). Functor f => p a (f b) -> f t
runPretext (AnIndexedLens i s t a b
l Indexed i a (Pretext (Indexed i) a b b)
forall (p :: * -> * -> *) (w :: * -> * -> * -> *) a b.
Sellable p w =>
p a (w a b b)
sell s
s) ((i -> a -> f b) -> Indexed i a (f b)
forall i a b. (i -> a -> b) -> Indexed i a b
Indexed (p a (f b) -> i -> a -> f b
forall i (p :: * -> * -> *) a b.
Indexable i p =>
p a b -> i -> a -> b
indexed p a (f b)
f))
{-# INLINE cloneIndexedLens #-}
(<%~) :: LensLike ((,) b) s t a b -> (a -> b) -> s -> (b, t)
l :: LensLike ((,) b) s t a b
l <%~ :: LensLike ((,) b) s t a b -> (a -> b) -> s -> (b, t)
<%~ f :: a -> b
f = LensLike ((,) b) s t a b
l LensLike ((,) b) s t a b -> LensLike ((,) b) s t a b
forall a b. (a -> b) -> a -> b
$ (\t :: b
t -> (b
t, b
t)) (b -> (b, b)) -> (a -> b) -> a -> (b, b)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> b
f
{-# INLINE (<%~) #-}
(<+~) :: Num a => LensLike ((,)a) s t a a -> a -> s -> (a, t)
l :: LensLike ((,) a) s t a a
l <+~ :: LensLike ((,) a) s t a a -> a -> s -> (a, t)
<+~ a :: a
a = LensLike ((,) a) s t a a
l LensLike ((,) a) s t a a -> (a -> a) -> s -> (a, t)
forall b s t a. LensLike ((,) b) s t a b -> (a -> b) -> s -> (b, t)
<%~ (a -> a -> a
forall a. Num a => a -> a -> a
+ a
a)
{-# INLINE (<+~) #-}
(<-~) :: Num a => LensLike ((,)a) s t a a -> a -> s -> (a, t)
l :: LensLike ((,) a) s t a a
l <-~ :: LensLike ((,) a) s t a a -> a -> s -> (a, t)
<-~ a :: a
a = LensLike ((,) a) s t a a
l LensLike ((,) a) s t a a -> (a -> a) -> s -> (a, t)
forall b s t a. LensLike ((,) b) s t a b -> (a -> b) -> s -> (b, t)
<%~ a -> a -> a
forall a. Num a => a -> a -> a
subtract a
a
{-# INLINE (<-~) #-}
(<*~) :: Num a => LensLike ((,)a) s t a a -> a -> s -> (a, t)
l :: LensLike ((,) a) s t a a
l <*~ :: LensLike ((,) a) s t a a -> a -> s -> (a, t)
<*~ a :: a
a = LensLike ((,) a) s t a a
l LensLike ((,) a) s t a a -> (a -> a) -> s -> (a, t)
forall b s t a. LensLike ((,) b) s t a b -> (a -> b) -> s -> (b, t)
<%~ (a -> a -> a
forall a. Num a => a -> a -> a
* a
a)
{-# INLINE (<*~) #-}
(<//~) :: Fractional a => LensLike ((,)a) s t a a -> a -> s -> (a, t)
l :: LensLike ((,) a) s t a a
l <//~ :: LensLike ((,) a) s t a a -> a -> s -> (a, t)
<//~ a :: a
a = LensLike ((,) a) s t a a
l LensLike ((,) a) s t a a -> (a -> a) -> s -> (a, t)
forall b s t a. LensLike ((,) b) s t a b -> (a -> b) -> s -> (b, t)
<%~ (a -> a -> a
forall a. Fractional a => a -> a -> a
/ a
a)
{-# INLINE (<//~) #-}
(<^~) :: (Num a, Integral e) => LensLike ((,)a) s t a a -> e -> s -> (a, t)
l :: LensLike ((,) a) s t a a
l <^~ :: LensLike ((,) a) s t a a -> e -> s -> (a, t)
<^~ e :: e
e = LensLike ((,) a) s t a a
l LensLike ((,) a) s t a a -> (a -> a) -> s -> (a, t)
forall b s t a. LensLike ((,) b) s t a b -> (a -> b) -> s -> (b, t)
<%~ (a -> e -> a
forall a b. (Num a, Integral b) => a -> b -> a
^ e
e)
{-# INLINE (<^~) #-}
(<^^~) :: (Fractional a, Integral e) => LensLike ((,)a) s t a a -> e -> s -> (a, t)
l :: LensLike ((,) a) s t a a
l <^^~ :: LensLike ((,) a) s t a a -> e -> s -> (a, t)
<^^~ e :: e
e = LensLike ((,) a) s t a a
l LensLike ((,) a) s t a a -> (a -> a) -> s -> (a, t)
forall b s t a. LensLike ((,) b) s t a b -> (a -> b) -> s -> (b, t)
<%~ (a -> e -> a
forall a b. (Fractional a, Integral b) => a -> b -> a
^^ e
e)
{-# INLINE (<^^~) #-}
(<**~) :: Floating a => LensLike ((,)a) s t a a -> a -> s -> (a, t)
l :: LensLike ((,) a) s t a a
l <**~ :: LensLike ((,) a) s t a a -> a -> s -> (a, t)
<**~ a :: a
a = LensLike ((,) a) s t a a
l LensLike ((,) a) s t a a -> (a -> a) -> s -> (a, t)
forall b s t a. LensLike ((,) b) s t a b -> (a -> b) -> s -> (b, t)
<%~ (a -> a -> a
forall a. Floating a => a -> a -> a
** a
a)
{-# INLINE (<**~) #-}
(<||~) :: LensLike ((,)Bool) s t Bool Bool -> Bool -> s -> (Bool, t)
l :: LensLike ((,) Bool) s t Bool Bool
l <||~ :: LensLike ((,) Bool) s t Bool Bool -> Bool -> s -> (Bool, t)
<||~ b :: Bool
b = LensLike ((,) Bool) s t Bool Bool
l LensLike ((,) Bool) s t Bool Bool
-> (Bool -> Bool) -> s -> (Bool, t)
forall b s t a. LensLike ((,) b) s t a b -> (a -> b) -> s -> (b, t)
<%~ (Bool -> Bool -> Bool
|| Bool
b)
{-# INLINE (<||~) #-}
(<&&~) :: LensLike ((,)Bool) s t Bool Bool -> Bool -> s -> (Bool, t)
l :: LensLike ((,) Bool) s t Bool Bool
l <&&~ :: LensLike ((,) Bool) s t Bool Bool -> Bool -> s -> (Bool, t)
<&&~ b :: Bool
b = LensLike ((,) Bool) s t Bool Bool
l LensLike ((,) Bool) s t Bool Bool
-> (Bool -> Bool) -> s -> (Bool, t)
forall b s t a. LensLike ((,) b) s t a b -> (a -> b) -> s -> (b, t)
<%~ (Bool -> Bool -> Bool
&& Bool
b)
{-# INLINE (<&&~) #-}
(<<%~) :: LensLike ((,)a) s t a b -> (a -> b) -> s -> (a, t)
<<%~ :: LensLike ((,) a) s t a b -> (a -> b) -> s -> (a, t)
(<<%~) l :: LensLike ((,) a) s t a b
l = LensLike ((,) a) s t a b
l LensLike ((,) a) s t a b
-> ((a -> b) -> a -> (a, b)) -> (a -> b) -> s -> (a, t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> (a, a)) -> ((a, a) -> (a, b)) -> a -> (a, b)
forall (p :: * -> * -> *) a b c.
Profunctor p =>
(a -> b) -> p b c -> p a c
lmap (\a :: a
a -> (a
a, a
a)) (((a, a) -> (a, b)) -> a -> (a, b))
-> ((a -> b) -> (a, a) -> (a, b)) -> (a -> b) -> a -> (a, b)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> b) -> (a, a) -> (a, b)
forall (p :: * -> * -> *) a b c.
Strong p =>
p a b -> p (c, a) (c, b)
second'
{-# INLINE (<<%~) #-}
(<<.~) :: LensLike ((,)a) s t a b -> b -> s -> (a, t)
l :: LensLike ((,) a) s t a b
l <<.~ :: LensLike ((,) a) s t a b -> b -> s -> (a, t)
<<.~ b :: b
b = LensLike ((,) a) s t a b
l LensLike ((,) a) s t a b -> LensLike ((,) a) s t a b
forall a b. (a -> b) -> a -> b
$ \a :: a
a -> (a
a, b
b)
{-# INLINE (<<.~) #-}
(<<?~) :: LensLike ((,)a) s t a (Maybe b) -> b -> s -> (a, t)
l :: LensLike ((,) a) s t a (Maybe b)
l <<?~ :: LensLike ((,) a) s t a (Maybe b) -> b -> s -> (a, t)
<<?~ b :: b
b = LensLike ((,) a) s t a (Maybe b)
l LensLike ((,) a) s t a (Maybe b) -> Maybe b -> s -> (a, t)
forall a s t b. LensLike ((,) a) s t a b -> b -> s -> (a, t)
<<.~ b -> Maybe b
forall a. a -> Maybe a
Just b
b
{-# INLINE (<<?~) #-}
(<<+~) :: Num a => LensLike' ((,) a) s a -> a -> s -> (a, s)
l :: LensLike' ((,) a) s a
l <<+~ :: LensLike' ((,) a) s a -> a -> s -> (a, s)
<<+~ b :: a
b = LensLike' ((,) a) s a
l LensLike' ((,) a) s a -> LensLike' ((,) a) s a
forall a b. (a -> b) -> a -> b
$ \a :: a
a -> (a
a, a
a a -> a -> a
forall a. Num a => a -> a -> a
+ a
b)
{-# INLINE (<<+~) #-}
(<<-~) :: Num a => LensLike' ((,) a) s a -> a -> s -> (a, s)
l :: LensLike' ((,) a) s a
l <<-~ :: LensLike' ((,) a) s a -> a -> s -> (a, s)
<<-~ b :: a
b = LensLike' ((,) a) s a
l LensLike' ((,) a) s a -> LensLike' ((,) a) s a
forall a b. (a -> b) -> a -> b
$ \a :: a
a -> (a
a, a
a a -> a -> a
forall a. Num a => a -> a -> a
- a
b)
{-# INLINE (<<-~) #-}
(<<*~) :: Num a => LensLike' ((,) a) s a -> a -> s -> (a, s)
l :: LensLike' ((,) a) s a
l <<*~ :: LensLike' ((,) a) s a -> a -> s -> (a, s)
<<*~ b :: a
b = LensLike' ((,) a) s a
l LensLike' ((,) a) s a -> LensLike' ((,) a) s a
forall a b. (a -> b) -> a -> b
$ \a :: a
a -> (a
a, a
a a -> a -> a
forall a. Num a => a -> a -> a
* a
b)
{-# INLINE (<<*~) #-}
(<<//~) :: Fractional a => LensLike' ((,) a) s a -> a -> s -> (a, s)
l :: LensLike' ((,) a) s a
l <<//~ :: LensLike' ((,) a) s a -> a -> s -> (a, s)
<<//~ b :: a
b = LensLike' ((,) a) s a
l LensLike' ((,) a) s a -> LensLike' ((,) a) s a
forall a b. (a -> b) -> a -> b
$ \a :: a
a -> (a
a, a
a a -> a -> a
forall a. Fractional a => a -> a -> a
/ a
b)
{-# INLINE (<<//~) #-}
(<<^~) :: (Num a, Integral e) => LensLike' ((,) a) s a -> e -> s -> (a, s)
l :: LensLike' ((,) a) s a
l <<^~ :: LensLike' ((,) a) s a -> e -> s -> (a, s)
<<^~ e :: e
e = LensLike' ((,) a) s a
l LensLike' ((,) a) s a -> LensLike' ((,) a) s a
forall a b. (a -> b) -> a -> b
$ \a :: a
a -> (a
a, a
a a -> e -> a
forall a b. (Num a, Integral b) => a -> b -> a
^ e
e)
{-# INLINE (<<^~) #-}
(<<^^~) :: (Fractional a, Integral e) => LensLike' ((,) a) s a -> e -> s -> (a, s)
l :: LensLike' ((,) a) s a
l <<^^~ :: LensLike' ((,) a) s a -> e -> s -> (a, s)
<<^^~ e :: e
e = LensLike' ((,) a) s a
l LensLike' ((,) a) s a -> LensLike' ((,) a) s a
forall a b. (a -> b) -> a -> b
$ \a :: a
a -> (a
a, a
a a -> e -> a
forall a b. (Fractional a, Integral b) => a -> b -> a
^^ e
e)
{-# INLINE (<<^^~) #-}
(<<**~) :: Floating a => LensLike' ((,) a) s a -> a -> s -> (a, s)
l :: LensLike' ((,) a) s a
l <<**~ :: LensLike' ((,) a) s a -> a -> s -> (a, s)
<<**~ e :: a
e = LensLike' ((,) a) s a
l LensLike' ((,) a) s a -> LensLike' ((,) a) s a
forall a b. (a -> b) -> a -> b
$ \a :: a
a -> (a
a, a
a a -> a -> a
forall a. Floating a => a -> a -> a
** a
e)
{-# INLINE (<<**~) #-}
(<<||~) :: LensLike' ((,) Bool) s Bool -> Bool -> s -> (Bool, s)
l :: LensLike' ((,) Bool) s Bool
l <<||~ :: LensLike' ((,) Bool) s Bool -> Bool -> s -> (Bool, s)
<<||~ b :: Bool
b = LensLike' ((,) Bool) s Bool
l LensLike' ((,) Bool) s Bool -> LensLike' ((,) Bool) s Bool
forall a b. (a -> b) -> a -> b
$ \a :: Bool
a -> (Bool
a, Bool
b Bool -> Bool -> Bool
|| Bool
a)
{-# INLINE (<<||~) #-}
(<<&&~) :: LensLike' ((,) Bool) s Bool -> Bool -> s -> (Bool, s)
l :: LensLike' ((,) Bool) s Bool
l <<&&~ :: LensLike' ((,) Bool) s Bool -> Bool -> s -> (Bool, s)
<<&&~ b :: Bool
b = LensLike' ((,) Bool) s Bool
l LensLike' ((,) Bool) s Bool -> LensLike' ((,) Bool) s Bool
forall a b. (a -> b) -> a -> b
$ \a :: Bool
a -> (Bool
a, Bool
b Bool -> Bool -> Bool
&& Bool
a)
{-# INLINE (<<&&~) #-}
(<<<>~) :: Monoid r => LensLike' ((,) r) s r -> r -> s -> (r, s)
l :: LensLike' ((,) r) s r
l <<<>~ :: LensLike' ((,) r) s r -> r -> s -> (r, s)
<<<>~ b :: r
b = LensLike' ((,) r) s r
l LensLike' ((,) r) s r -> LensLike' ((,) r) s r
forall a b. (a -> b) -> a -> b
$ \a :: r
a -> (r
a, r
a r -> r -> r
forall a. Monoid a => a -> a -> a
`mappend` r
b)
{-# INLINE (<<<>~) #-}
(<%=) :: MonadState s m => LensLike ((,)b) s s a b -> (a -> b) -> m b
l :: LensLike ((,) b) s s a b
l <%= :: LensLike ((,) b) s s a b -> (a -> b) -> m b
<%= f :: a -> b
f = LensLike ((,) b) s s a b
l LensLike ((,) b) s s a b -> (a -> (b, b)) -> m b
forall k s (m :: * -> *) (p :: k -> * -> *) r (a :: k) b.
MonadState s m =>
Over p ((,) r) s s a b -> p a (r, b) -> m r
%%= (\b :: b
b -> (b
b, b
b)) (b -> (b, b)) -> (a -> b) -> a -> (b, b)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> b
f
{-# INLINE (<%=) #-}
(<+=) :: (MonadState s m, Num a) => LensLike' ((,)a) s a -> a -> m a
l :: LensLike' ((,) a) s a
l <+= :: LensLike' ((,) a) s a -> a -> m a
<+= a :: a
a = LensLike' ((,) a) s a
l LensLike' ((,) a) s a -> (a -> a) -> m a
forall s (m :: * -> *) b a.
MonadState s m =>
LensLike ((,) b) s s a b -> (a -> b) -> m b
<%= (a -> a -> a
forall a. Num a => a -> a -> a
+ a
a)
{-# INLINE (<+=) #-}
(<-=) :: (MonadState s m, Num a) => LensLike' ((,)a) s a -> a -> m a
l :: LensLike' ((,) a) s a
l <-= :: LensLike' ((,) a) s a -> a -> m a
<-= a :: a
a = LensLike' ((,) a) s a
l LensLike' ((,) a) s a -> (a -> a) -> m a
forall s (m :: * -> *) b a.
MonadState s m =>
LensLike ((,) b) s s a b -> (a -> b) -> m b
<%= a -> a -> a
forall a. Num a => a -> a -> a
subtract a
a
{-# INLINE (<-=) #-}
(<*=) :: (MonadState s m, Num a) => LensLike' ((,)a) s a -> a -> m a
l :: LensLike' ((,) a) s a
l <*= :: LensLike' ((,) a) s a -> a -> m a
<*= a :: a
a = LensLike' ((,) a) s a
l LensLike' ((,) a) s a -> (a -> a) -> m a
forall s (m :: * -> *) b a.
MonadState s m =>
LensLike ((,) b) s s a b -> (a -> b) -> m b
<%= (a -> a -> a
forall a. Num a => a -> a -> a
* a
a)
{-# INLINE (<*=) #-}
(<//=) :: (MonadState s m, Fractional a) => LensLike' ((,)a) s a -> a -> m a
l :: LensLike' ((,) a) s a
l <//= :: LensLike' ((,) a) s a -> a -> m a
<//= a :: a
a = LensLike' ((,) a) s a
l LensLike' ((,) a) s a -> (a -> a) -> m a
forall s (m :: * -> *) b a.
MonadState s m =>
LensLike ((,) b) s s a b -> (a -> b) -> m b
<%= (a -> a -> a
forall a. Fractional a => a -> a -> a
/ a
a)
{-# INLINE (<//=) #-}
(<^=) :: (MonadState s m, Num a, Integral e) => LensLike' ((,)a) s a -> e -> m a
l :: LensLike' ((,) a) s a
l <^= :: LensLike' ((,) a) s a -> e -> m a
<^= e :: e
e = LensLike' ((,) a) s a
l LensLike' ((,) a) s a -> (a -> a) -> m a
forall s (m :: * -> *) b a.
MonadState s m =>
LensLike ((,) b) s s a b -> (a -> b) -> m b
<%= (a -> e -> a
forall a b. (Num a, Integral b) => a -> b -> a
^ e
e)
{-# INLINE (<^=) #-}
(<^^=) :: (MonadState s m, Fractional a, Integral e) => LensLike' ((,)a) s a -> e -> m a
l :: LensLike' ((,) a) s a
l <^^= :: LensLike' ((,) a) s a -> e -> m a
<^^= e :: e
e = LensLike' ((,) a) s a
l LensLike' ((,) a) s a -> (a -> a) -> m a
forall s (m :: * -> *) b a.
MonadState s m =>
LensLike ((,) b) s s a b -> (a -> b) -> m b
<%= (a -> e -> a
forall a b. (Fractional a, Integral b) => a -> b -> a
^^ e
e)
{-# INLINE (<^^=) #-}
(<**=) :: (MonadState s m, Floating a) => LensLike' ((,)a) s a -> a -> m a
l :: LensLike' ((,) a) s a
l <**= :: LensLike' ((,) a) s a -> a -> m a
<**= a :: a
a = LensLike' ((,) a) s a
l LensLike' ((,) a) s a -> (a -> a) -> m a
forall s (m :: * -> *) b a.
MonadState s m =>
LensLike ((,) b) s s a b -> (a -> b) -> m b
<%= (a -> a -> a
forall a. Floating a => a -> a -> a
** a
a)
{-# INLINE (<**=) #-}
(<||=) :: MonadState s m => LensLike' ((,)Bool) s Bool -> Bool -> m Bool
l :: LensLike' ((,) Bool) s Bool
l <||= :: LensLike' ((,) Bool) s Bool -> Bool -> m Bool
<||= b :: Bool
b = LensLike' ((,) Bool) s Bool
l LensLike' ((,) Bool) s Bool -> (Bool -> Bool) -> m Bool
forall s (m :: * -> *) b a.
MonadState s m =>
LensLike ((,) b) s s a b -> (a -> b) -> m b
<%= (Bool -> Bool -> Bool
|| Bool
b)
{-# INLINE (<||=) #-}
(<&&=) :: MonadState s m => LensLike' ((,)Bool) s Bool -> Bool -> m Bool
l :: LensLike' ((,) Bool) s Bool
l <&&= :: LensLike' ((,) Bool) s Bool -> Bool -> m Bool
<&&= b :: Bool
b = LensLike' ((,) Bool) s Bool
l LensLike' ((,) Bool) s Bool -> (Bool -> Bool) -> m Bool
forall s (m :: * -> *) b a.
MonadState s m =>
LensLike ((,) b) s s a b -> (a -> b) -> m b
<%= (Bool -> Bool -> Bool
&& Bool
b)
{-# INLINE (<&&=) #-}
(<<%=) :: (Strong p, MonadState s m) => Over p ((,)a) s s a b -> p a b -> m a
l :: Over p ((,) a) s s a b
l <<%= :: Over p ((,) a) s s a b -> p a b -> m a
<<%= f :: p a b
f = Over p ((,) a) s s a b
l Over p ((,) a) s s a b -> p a (a, b) -> m a
forall k s (m :: * -> *) (p :: k -> * -> *) r (a :: k) b.
MonadState s m =>
Over p ((,) r) s s a b -> p a (r, b) -> m r
%%= (a -> (a, a)) -> p (a, a) (a, b) -> p a (a, b)
forall (p :: * -> * -> *) a b c.
Profunctor p =>
(a -> b) -> p b c -> p a c
lmap (\a :: a
a -> (a
a,a
a)) (p a b -> p (a, a) (a, b)
forall (p :: * -> * -> *) a b c.
Strong p =>
p a b -> p (c, a) (c, b)
second' p a b
f)
{-# INLINE (<<%=) #-}
(<<.=) :: MonadState s m => LensLike ((,)a) s s a b -> b -> m a
l :: LensLike ((,) a) s s a b
l <<.= :: LensLike ((,) a) s s a b -> b -> m a
<<.= b :: b
b = LensLike ((,) a) s s a b
l LensLike ((,) a) s s a b -> (a -> (a, b)) -> m a
forall k s (m :: * -> *) (p :: k -> * -> *) r (a :: k) b.
MonadState s m =>
Over p ((,) r) s s a b -> p a (r, b) -> m r
%%= \a :: a
a -> (a
a,b
b)
{-# INLINE (<<.=) #-}
(<<?=) :: MonadState s m => LensLike ((,)a) s s a (Maybe b) -> b -> m a
l :: LensLike ((,) a) s s a (Maybe b)
l <<?= :: LensLike ((,) a) s s a (Maybe b) -> b -> m a
<<?= b :: b
b = LensLike ((,) a) s s a (Maybe b)
l LensLike ((,) a) s s a (Maybe b) -> Maybe b -> m a
forall s (m :: * -> *) a b.
MonadState s m =>
LensLike ((,) a) s s a b -> b -> m a
<<.= b -> Maybe b
forall a. a -> Maybe a
Just b
b
{-# INLINE (<<?=) #-}
(<<+=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a
l :: LensLike' ((,) a) s a
l <<+= :: LensLike' ((,) a) s a -> a -> m a
<<+= n :: a
n = LensLike' ((,) a) s a
l LensLike' ((,) a) s a -> (a -> (a, a)) -> m a
forall k s (m :: * -> *) (p :: k -> * -> *) r (a :: k) b.
MonadState s m =>
Over p ((,) r) s s a b -> p a (r, b) -> m r
%%= \a :: a
a -> (a
a, a
a a -> a -> a
forall a. Num a => a -> a -> a
+ a
n)
{-# INLINE (<<+=) #-}
(<<-=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a
l :: LensLike' ((,) a) s a
l <<-= :: LensLike' ((,) a) s a -> a -> m a
<<-= n :: a
n = LensLike' ((,) a) s a
l LensLike' ((,) a) s a -> (a -> (a, a)) -> m a
forall k s (m :: * -> *) (p :: k -> * -> *) r (a :: k) b.
MonadState s m =>
Over p ((,) r) s s a b -> p a (r, b) -> m r
%%= \a :: a
a -> (a
a, a
a a -> a -> a
forall a. Num a => a -> a -> a
- a
n)
{-# INLINE (<<-=) #-}
(<<*=) :: (MonadState s m, Num a) => LensLike' ((,) a) s a -> a -> m a
l :: LensLike' ((,) a) s a
l <<*= :: LensLike' ((,) a) s a -> a -> m a
<<*= n :: a
n = LensLike' ((,) a) s a
l LensLike' ((,) a) s a -> (a -> (a, a)) -> m a
forall k s (m :: * -> *) (p :: k -> * -> *) r (a :: k) b.
MonadState s m =>
Over p ((,) r) s s a b -> p a (r, b) -> m r
%%= \a :: a
a -> (a
a, a
a a -> a -> a
forall a. Num a => a -> a -> a
* a
n)
{-# INLINE (<<*=) #-}
(<<//=) :: (MonadState s m, Fractional a) => LensLike' ((,) a) s a -> a -> m a
l :: LensLike' ((,) a) s a
l <<//= :: LensLike' ((,) a) s a -> a -> m a
<<//= n :: a
n = LensLike' ((,) a) s a
l LensLike' ((,) a) s a -> (a -> (a, a)) -> m a
forall k s (m :: * -> *) (p :: k -> * -> *) r (a :: k) b.
MonadState s m =>
Over p ((,) r) s s a b -> p a (r, b) -> m r
%%= \a :: a
a -> (a
a, a
a a -> a -> a
forall a. Fractional a => a -> a -> a
/ a
n)
{-# INLINE (<<//=) #-}
(<<^=) :: (MonadState s m, Num a, Integral e) => LensLike' ((,) a) s a -> e -> m a
l :: LensLike' ((,) a) s a
l <<^= :: LensLike' ((,) a) s a -> e -> m a
<<^= n :: e
n = LensLike' ((,) a) s a
l LensLike' ((,) a) s a -> (a -> (a, a)) -> m a
forall k s (m :: * -> *) (p :: k -> * -> *) r (a :: k) b.
MonadState s m =>
Over p ((,) r) s s a b -> p a (r, b) -> m r
%%= \a :: a
a -> (a
a, a
a a -> e -> a
forall a b. (Num a, Integral b) => a -> b -> a
^ e
n)
{-# INLINE (<<^=) #-}
(<<^^=) :: (MonadState s m, Fractional a, Integral e) => LensLike' ((,) a) s a -> e -> m a
l :: LensLike' ((,) a) s a
l <<^^= :: LensLike' ((,) a) s a -> e -> m a
<<^^= n :: e
n = LensLike' ((,) a) s a
l LensLike' ((,) a) s a -> (a -> (a, a)) -> m a
forall k s (m :: * -> *) (p :: k -> * -> *) r (a :: k) b.
MonadState s m =>
Over p ((,) r) s s a b -> p a (r, b) -> m r
%%= \a :: a
a -> (a
a, a
a a -> e -> a
forall a b. (Fractional a, Integral b) => a -> b -> a
^^ e
n)
{-# INLINE (<<^^=) #-}
(<<**=) :: (MonadState s m, Floating a) => LensLike' ((,) a) s a -> a -> m a
l :: LensLike' ((,) a) s a
l <<**= :: LensLike' ((,) a) s a -> a -> m a
<<**= n :: a
n = LensLike' ((,) a) s a
l LensLike' ((,) a) s a -> (a -> (a, a)) -> m a
forall k s (m :: * -> *) (p :: k -> * -> *) r (a :: k) b.
MonadState s m =>
Over p ((,) r) s s a b -> p a (r, b) -> m r
%%= \a :: a
a -> (a
a, a
a a -> a -> a
forall a. Floating a => a -> a -> a
** a
n)
{-# INLINE (<<**=) #-}
(<<||=) :: MonadState s m => LensLike' ((,) Bool) s Bool -> Bool -> m Bool
l :: LensLike' ((,) Bool) s Bool
l <<||= :: LensLike' ((,) Bool) s Bool -> Bool -> m Bool
<<||= b :: Bool
b = LensLike' ((,) Bool) s Bool
l LensLike' ((,) Bool) s Bool -> (Bool -> (Bool, Bool)) -> m Bool
forall k s (m :: * -> *) (p :: k -> * -> *) r (a :: k) b.
MonadState s m =>
Over p ((,) r) s s a b -> p a (r, b) -> m r
%%= \a :: Bool
a -> (Bool
a, Bool
a Bool -> Bool -> Bool
|| Bool
b)
{-# INLINE (<<||=) #-}
(<<&&=) :: MonadState s m => LensLike' ((,) Bool) s Bool -> Bool -> m Bool
l :: LensLike' ((,) Bool) s Bool
l <<&&= :: LensLike' ((,) Bool) s Bool -> Bool -> m Bool
<<&&= b :: Bool
b = LensLike' ((,) Bool) s Bool
l LensLike' ((,) Bool) s Bool -> (Bool -> (Bool, Bool)) -> m Bool
forall k s (m :: * -> *) (p :: k -> * -> *) r (a :: k) b.
MonadState s m =>
Over p ((,) r) s s a b -> p a (r, b) -> m r
%%= \a :: Bool
a -> (Bool
a, Bool
a Bool -> Bool -> Bool
&& Bool
b)
{-# INLINE (<<&&=) #-}
(<<<>=) :: (MonadState s m, Monoid r) => LensLike' ((,) r) s r -> r -> m r
l :: LensLike' ((,) r) s r
l <<<>= :: LensLike' ((,) r) s r -> r -> m r
<<<>= b :: r
b = LensLike' ((,) r) s r
l LensLike' ((,) r) s r -> (r -> (r, r)) -> m r
forall k s (m :: * -> *) (p :: k -> * -> *) r (a :: k) b.
MonadState s m =>
Over p ((,) r) s s a b -> p a (r, b) -> m r
%%= \a :: r
a -> (r
a, r
a r -> r -> r
forall a. Monoid a => a -> a -> a
`mappend` r
b)
{-# INLINE (<<<>=) #-}
(<<~) :: MonadState s m => ALens s s a b -> m b -> m b
l :: ALens s s a b
l <<~ :: ALens s s a b -> m b -> m b
<<~ mb :: m b
mb = do
b
b <- m b
mb
(s -> s) -> m ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify ((s -> s) -> m ()) -> (s -> s) -> m ()
forall a b. (a -> b) -> a -> b
$ \s :: s
s -> b -> Pretext (->) a b s -> s
forall (w :: * -> * -> * -> *) c a t.
IndexedComonadStore w =>
c -> w a c t -> t
ipeek b
b (ALens s s a b
l a -> Pretext (->) a b b
forall (p :: * -> * -> *) (w :: * -> * -> * -> *) a b.
Sellable p w =>
p a (w a b b)
sell s
s)
b -> m b
forall (m :: * -> *) a. Monad m => a -> m a
return b
b
{-# INLINE (<<~) #-}
(<<>~) :: Monoid m => LensLike ((,)m) s t m m -> m -> s -> (m, t)
l :: LensLike ((,) m) s t m m
l <<>~ :: LensLike ((,) m) s t m m -> m -> s -> (m, t)
<<>~ m :: m
m = LensLike ((,) m) s t m m
l LensLike ((,) m) s t m m -> (m -> m) -> s -> (m, t)
forall b s t a. LensLike ((,) b) s t a b -> (a -> b) -> s -> (b, t)
<%~ (m -> m -> m
forall a. Monoid a => a -> a -> a
`mappend` m
m)
{-# INLINE (<<>~) #-}
(<<>=) :: (MonadState s m, Monoid r) => LensLike' ((,)r) s r -> r -> m r
l :: LensLike' ((,) r) s r
l <<>= :: LensLike' ((,) r) s r -> r -> m r
<<>= r :: r
r = LensLike' ((,) r) s r
l LensLike' ((,) r) s r -> (r -> r) -> m r
forall s (m :: * -> *) b a.
MonadState s m =>
LensLike ((,) b) s s a b -> (a -> b) -> m b
<%= (r -> r -> r
forall a. Monoid a => a -> a -> a
`mappend` r
r)
{-# INLINE (<<>=) #-}
overA :: Arrow ar => LensLike (Context a b) s t a b -> ar a b -> ar s t
overA :: LensLike (Context a b) s t a b -> ar a b -> ar s t
overA l :: LensLike (Context a b) s t a b
l p :: ar a b
p = (s -> (b -> t, a)) -> ar s (b -> t, a)
forall (a :: * -> * -> *) b c. Arrow a => (b -> c) -> a b c
arr (\s :: s
s -> let (Context f :: b -> t
f a :: a
a) = LensLike (Context a b) s t a b
l a -> Context a b b
forall (p :: * -> * -> *) (w :: * -> * -> * -> *) a b.
Sellable p w =>
p a (w a b b)
sell s
s in (b -> t
f, a
a))
ar s (b -> t, a) -> ar (b -> t, a) t -> ar s t
forall k (cat :: k -> k -> *) (a :: k) (b :: k) (c :: k).
Category cat =>
cat a b -> cat b c -> cat a c
>>> ar a b -> ar (b -> t, a) (b -> t, b)
forall (a :: * -> * -> *) b c d.
Arrow a =>
a b c -> a (d, b) (d, c)
second ar a b
p
ar (b -> t, a) (b -> t, b) -> ar (b -> t, b) t -> ar (b -> t, a) t
forall k (cat :: k -> k -> *) (a :: k) (b :: k) (c :: k).
Category cat =>
cat a b -> cat b c -> cat a c
>>> ((b -> t, b) -> t) -> ar (b -> t, b) t
forall (a :: * -> * -> *) b c. Arrow a => (b -> c) -> a b c
arr (((b -> t) -> b -> t) -> (b -> t, b) -> t
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry (b -> t) -> b -> t
forall a. a -> a
id)
(<%@~) :: Over (Indexed i) ((,) b) s t a b -> (i -> a -> b) -> s -> (b, t)
l :: Over (Indexed i) ((,) b) s t a b
l <%@~ :: Over (Indexed i) ((,) b) s t a b -> (i -> a -> b) -> s -> (b, t)
<%@~ f :: i -> a -> b
f = Over (Indexed i) ((,) b) s t a b
l ((i -> a -> (b, b)) -> Indexed i a (b, b)
forall i a b. (i -> a -> b) -> Indexed i a b
Indexed ((i -> a -> (b, b)) -> Indexed i a (b, b))
-> (i -> a -> (b, b)) -> Indexed i a (b, b)
forall a b. (a -> b) -> a -> b
$ \i :: i
i a :: a
a -> let b :: b
b = i -> a -> b
f i
i a
a in (b
b, b
b))
{-# INLINE (<%@~) #-}
(<<%@~) :: Over (Indexed i) ((,) a) s t a b -> (i -> a -> b) -> s -> (a, t)
l :: Over (Indexed i) ((,) a) s t a b
l <<%@~ :: Over (Indexed i) ((,) a) s t a b -> (i -> a -> b) -> s -> (a, t)
<<%@~ f :: i -> a -> b
f = Over (Indexed i) ((,) a) s t a b
l Over (Indexed i) ((,) a) s t a b
-> Over (Indexed i) ((,) a) s t a b
forall a b. (a -> b) -> a -> b
$ (i -> a -> (a, b)) -> Indexed i a (a, b)
forall i a b. (i -> a -> b) -> Indexed i a b
Indexed ((i -> a -> (a, b)) -> Indexed i a (a, b))
-> (i -> a -> (a, b)) -> Indexed i a (a, b)
forall a b. (a -> b) -> a -> b
$ \i :: i
i a :: a
a -> (a -> b) -> (a, a) -> (a, b)
forall (p :: * -> * -> *) a b c.
Strong p =>
p a b -> p (c, a) (c, b)
second' (i -> a -> b
f i
i) (a
a,a
a)
{-# INLINE (<<%@~) #-}
(%%@~) :: Over (Indexed i) f s t a b -> (i -> a -> f b) -> s -> f t
%%@~ :: Over (Indexed i) f s t a b -> (i -> a -> f b) -> s -> f t
(%%@~) l :: Over (Indexed i) f s t a b
l = Over (Indexed i) f s t a b
l Over (Indexed i) f s t a b
-> ((i -> a -> f b) -> Indexed i a (f b))
-> (i -> a -> f b)
-> s
-> f t
forall (p :: * -> * -> *) a b c (q :: * -> * -> *).
(Profunctor p, Coercible b a) =>
p b c -> q a b -> p a c
.# (i -> a -> f b) -> Indexed i a (f b)
forall i a b. (i -> a -> b) -> Indexed i a b
Indexed
{-# INLINE (%%@~) #-}
(%%@=) :: MonadState s m => Over (Indexed i) ((,) r) s s a b -> (i -> a -> (r, b)) -> m r
#if MIN_VERSION_mtl(2,1,0)
l :: Over (Indexed i) ((,) r) s s a b
l %%@= :: Over (Indexed i) ((,) r) s s a b -> (i -> a -> (r, b)) -> m r
%%@= f :: i -> a -> (r, b)
f = (s -> (r, s)) -> m r
forall s (m :: * -> *) a. MonadState s m => (s -> (a, s)) -> m a
State.state (Over (Indexed i) ((,) r) s s a b
l Over (Indexed i) ((,) r) s s a b
-> (i -> a -> (r, b)) -> s -> (r, s)
forall k i (f :: k -> *) s (t :: k) a (b :: k).
Over (Indexed i) f s t a b -> (i -> a -> f b) -> s -> f t
%%@~ i -> a -> (r, b)
f)
#else
l %%@= f = do
(r, s) <- State.gets (l %%@~ f)
State.put s
return r
#endif
{-# INLINE (%%@=) #-}
(<%@=) :: MonadState s m => Over (Indexed i) ((,) b) s s a b -> (i -> a -> b) -> m b
l :: Over (Indexed i) ((,) b) s s a b
l <%@= :: Over (Indexed i) ((,) b) s s a b -> (i -> a -> b) -> m b
<%@= f :: i -> a -> b
f = Over (Indexed i) ((,) b) s s a b
l Over (Indexed i) ((,) b) s s a b -> (i -> a -> (b, b)) -> m b
forall s (m :: * -> *) i r a b.
MonadState s m =>
Over (Indexed i) ((,) r) s s a b -> (i -> a -> (r, b)) -> m r
%%@= \ i :: i
i a :: a
a -> let b :: b
b = i -> a -> b
f i
i a
a in (b
b, b
b)
{-# INLINE (<%@=) #-}
(<<%@=) :: MonadState s m => Over (Indexed i) ((,) a) s s a b -> (i -> a -> b) -> m a
#if MIN_VERSION_mtl(2,1,0)
l :: Over (Indexed i) ((,) a) s s a b
l <<%@= :: Over (Indexed i) ((,) a) s s a b -> (i -> a -> b) -> m a
<<%@= f :: i -> a -> b
f = (s -> (a, s)) -> m a
forall s (m :: * -> *) a. MonadState s m => (s -> (a, s)) -> m a
State.state (Over (Indexed i) ((,) a) s s a b
l ((i -> a -> (a, b)) -> Indexed i a (a, b)
forall i a b. (i -> a -> b) -> Indexed i a b
Indexed ((i -> a -> (a, b)) -> Indexed i a (a, b))
-> (i -> a -> (a, b)) -> Indexed i a (a, b)
forall a b. (a -> b) -> a -> b
$ \ i :: i
i a :: a
a -> (a
a, i -> a -> b
f i
i a
a)))
#else
l <<%@= f = do
(r, s) <- State.gets (l (Indexed $ \ i a -> (a, f i a)))
State.put s
return r
#endif
{-# INLINE (<<%@=) #-}
(^#) :: s -> ALens s t a b -> a
s :: s
s ^# :: s -> ALens s t a b -> a
^# l :: ALens s t a b
l = Pretext (->) a b t -> a
forall (w :: * -> * -> * -> *) a c t.
IndexedComonadStore w =>
w a c t -> a
ipos (ALens s t a b
l a -> Pretext (->) a b b
forall (p :: * -> * -> *) (w :: * -> * -> * -> *) a b.
Sellable p w =>
p a (w a b b)
sell s
s)
{-# INLINE (^#) #-}
storing :: ALens s t a b -> b -> s -> t
storing :: ALens s t a b -> b -> s -> t
storing l :: ALens s t a b
l b :: b
b s :: s
s = b -> Pretext (->) a b t -> t
forall (w :: * -> * -> * -> *) c a t.
IndexedComonadStore w =>
c -> w a c t -> t
ipeek b
b (ALens s t a b
l a -> Pretext (->) a b b
forall (p :: * -> * -> *) (w :: * -> * -> * -> *) a b.
Sellable p w =>
p a (w a b b)
sell s
s)
{-# INLINE storing #-}
( #~ ) :: ALens s t a b -> b -> s -> t
( #~ ) l :: ALens s t a b
l b :: b
b s :: s
s = b -> Pretext (->) a b t -> t
forall (w :: * -> * -> * -> *) c a t.
IndexedComonadStore w =>
c -> w a c t -> t
ipeek b
b (ALens s t a b
l a -> Pretext (->) a b b
forall (p :: * -> * -> *) (w :: * -> * -> * -> *) a b.
Sellable p w =>
p a (w a b b)
sell s
s)
{-# INLINE ( #~ ) #-}
( #%~ ) :: ALens s t a b -> (a -> b) -> s -> t
( #%~ ) l :: ALens s t a b
l f :: a -> b
f s :: s
s = (a -> b) -> Pretext (->) a b t -> t
forall (w :: * -> * -> * -> *) a c t.
IndexedComonadStore w =>
(a -> c) -> w a c t -> t
ipeeks a -> b
f (ALens s t a b
l a -> Pretext (->) a b b
forall (p :: * -> * -> *) (w :: * -> * -> * -> *) a b.
Sellable p w =>
p a (w a b b)
sell s
s)
{-# INLINE ( #%~ ) #-}
( #%%~ ) :: Functor f => ALens s t a b -> (a -> f b) -> s -> f t
( #%%~ ) l :: ALens s t a b
l f :: a -> f b
f s :: s
s = Pretext (->) a b t -> (a -> f b) -> f t
forall (p :: * -> * -> *) a b t.
Pretext p a b t
-> forall (f :: * -> *). Functor f => p a (f b) -> f t
runPretext (ALens s t a b
l a -> Pretext (->) a b b
forall (p :: * -> * -> *) (w :: * -> * -> * -> *) a b.
Sellable p w =>
p a (w a b b)
sell s
s) a -> f b
f
{-# INLINE ( #%%~ ) #-}
( #= ) :: MonadState s m => ALens s s a b -> b -> m ()
l :: ALens s s a b
l #= :: ALens s s a b -> b -> m ()
#= f :: b
f = (s -> s) -> m ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ALens s s a b
l ALens s s a b -> b -> s -> s
forall s t a b. ALens s t a b -> b -> s -> t
#~ b
f)
{-# INLINE ( #= ) #-}
( #%= ) :: MonadState s m => ALens s s a b -> (a -> b) -> m ()
l :: ALens s s a b
l #%= :: ALens s s a b -> (a -> b) -> m ()
#%= f :: a -> b
f = (s -> s) -> m ()
forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify (ALens s s a b
l ALens s s a b -> (a -> b) -> s -> s
forall s t a b. ALens s t a b -> (a -> b) -> s -> t
#%~ a -> b
f)
{-# INLINE ( #%= ) #-}
(<#%~) :: ALens s t a b -> (a -> b) -> s -> (b, t)
l :: ALens s t a b
l <#%~ :: ALens s t a b -> (a -> b) -> s -> (b, t)
<#%~ f :: a -> b
f = \s :: s
s -> Pretext (->) a b t
-> forall (f :: * -> *). Functor f => (a -> f b) -> f t
forall (p :: * -> * -> *) a b t.
Pretext p a b t
-> forall (f :: * -> *). Functor f => p a (f b) -> f t
runPretext (ALens s t a b
l a -> Pretext (->) a b b
forall (p :: * -> * -> *) (w :: * -> * -> * -> *) a b.
Sellable p w =>
p a (w a b b)
sell s
s) ((a -> (b, b)) -> (b, t)) -> (a -> (b, b)) -> (b, t)
forall a b. (a -> b) -> a -> b
$ \a :: a
a -> let b :: b
b = a -> b
f a
a in (b
b, b
b)
{-# INLINE (<#%~) #-}
(<#%=) :: MonadState s m => ALens s s a b -> (a -> b) -> m b
l :: ALens s s a b
l <#%= :: ALens s s a b -> (a -> b) -> m b
<#%= f :: a -> b
f = ALens s s a b
l ALens s s a b -> (a -> (b, b)) -> m b
forall s (m :: * -> *) a b r.
MonadState s m =>
ALens s s a b -> (a -> (r, b)) -> m r
#%%= \a :: a
a -> let b :: b
b = a -> b
f a
a in (b
b, b
b)
{-# INLINE (<#%=) #-}
( #%%= ) :: MonadState s m => ALens s s a b -> (a -> (r, b)) -> m r
#if MIN_VERSION_mtl(2,1,1)
l :: ALens s s a b
l #%%= :: ALens s s a b -> (a -> (r, b)) -> m r
#%%= f :: a -> (r, b)
f = (s -> (r, s)) -> m r
forall s (m :: * -> *) a. MonadState s m => (s -> (a, s)) -> m a
State.state ((s -> (r, s)) -> m r) -> (s -> (r, s)) -> m r
forall a b. (a -> b) -> a -> b
$ \s :: s
s -> Pretext (->) a b s -> (a -> (r, b)) -> (r, s)
forall (p :: * -> * -> *) a b t.
Pretext p a b t
-> forall (f :: * -> *). Functor f => p a (f b) -> f t
runPretext (ALens s s a b
l a -> Pretext (->) a b b
forall (p :: * -> * -> *) (w :: * -> * -> * -> *) a b.
Sellable p w =>
p a (w a b b)
sell s
s) a -> (r, b)
f
#else
l #%%= f = do
p <- State.gets (l sell)
let (r, t) = runPretext p f
State.put t
return r
#endif
{-# INLINE ( #%%= ) #-}
(<#~) :: ALens s t a b -> b -> s -> (b, t)
l :: ALens s t a b
l <#~ :: ALens s t a b -> b -> s -> (b, t)
<#~ b :: b
b = \s :: s
s -> (b
b, ALens s t a b -> b -> s -> t
forall s t a b. ALens s t a b -> b -> s -> t
storing ALens s t a b
l b
b s
s)
{-# INLINE (<#~) #-}
(<#=) :: MonadState s m => ALens s s a b -> b -> m b
l :: ALens s s a b
l <#= :: ALens s s a b -> b -> m b
<#= b :: b
b = do
ALens s s a b
l ALens s s a b -> b -> m ()
forall s (m :: * -> *) a b.
MonadState s m =>
ALens s s a b -> b -> m ()
#= b
b
b -> m b
forall (m :: * -> *) a. Monad m => a -> m a
return b
b
{-# INLINE (<#=) #-}
devoid :: Over p f Void Void a b
devoid :: Over p f Void Void a b
devoid _ = Void -> f Void
forall a. Void -> a
absurd
{-# INLINE devoid #-}
united :: Lens' a ()
united :: (() -> f ()) -> a -> f a
united f :: () -> f ()
f v :: a
v = () -> f ()
f () f () -> (() -> a) -> f a
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> \ () -> a
v
{-# INLINE united #-}
data First1 f a = First1 (f a) a
instance (Functor f) => Functor (First1 f) where
fmap :: (a -> b) -> First1 f a -> First1 f b
fmap f :: a -> b
f (First1 fa :: f a
fa a :: a
a) = f b -> b -> First1 f b
forall (f :: * -> *) a. f a -> a -> First1 f a
First1 (a -> b
f (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> f a
fa) (a -> b
f a
a)
{-# INLINE fmap #-}
instance (Functor f) => Apply (First1 f) where
First1 ff :: f (a -> b)
ff f :: a -> b
f <.> :: First1 f (a -> b) -> First1 f a -> First1 f b
<.> First1 _ x :: a
x = f b -> b -> First1 f b
forall (f :: * -> *) a. f a -> a -> First1 f a
First1 (((a -> b) -> a -> b
forall a b. (a -> b) -> a -> b
$ a
x) ((a -> b) -> b) -> f (a -> b) -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> f (a -> b)
ff) (a -> b
f a
x)
{-# INLINE (<.>) #-}
getFirst1 :: First1 f a -> f a
getFirst1 :: First1 f a -> f a
getFirst1 (First1 fa :: f a
fa _) = f a
fa
{-# INLINE getFirst1 #-}
head1 :: (Traversable1 t) => Lens' (t a) a
head1 :: Lens' (t a) a
head1 f :: a -> f a
f = First1 f (t a) -> f (t a)
forall (f :: * -> *) a. First1 f a -> f a
getFirst1 (First1 f (t a) -> f (t a))
-> (t a -> First1 f (t a)) -> t a -> f (t a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> First1 f a) -> t a -> First1 f (t a)
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable1 t, Apply f) =>
(a -> f b) -> t a -> f (t b)
traverse1 (\a :: a
a -> f a -> a -> First1 f a
forall (f :: * -> *) a. f a -> a -> First1 f a
First1 (a -> f a
f a
a) a
a)
{-# INLINE head1 #-}
last1 :: (Traversable1 t) => Lens' (t a) a
last1 :: Lens' (t a) a
last1 f :: a -> f a
f = (Reverse t a -> t a) -> f (Reverse t a) -> f (t a)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Reverse t a -> t a
forall k (f :: k -> *) (a :: k). Reverse f a -> f a
getReverse (f (Reverse t a) -> f (t a))
-> (t a -> f (Reverse t a)) -> t a -> f (t a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> f a) -> Reverse t a -> f (Reverse t a)
forall (t :: * -> *) a. Traversable1 t => Lens' (t a) a
head1 a -> f a
f (Reverse t a -> f (Reverse t a))
-> (t a -> Reverse t a) -> t a -> f (Reverse t a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. t a -> Reverse t a
forall k (f :: k -> *) (a :: k). f a -> Reverse f a
Reverse
{-# INLINE last1 #-}
fusing :: Functor f => LensLike (Yoneda f) s t a b -> LensLike f s t a b
fusing :: LensLike (Yoneda f) s t a b -> LensLike f s t a b
fusing t :: LensLike (Yoneda f) s t a b
t = \f :: a -> f b
f -> Yoneda f t -> f t
forall (f :: * -> *) a. Yoneda f a -> f a
lowerYoneda (Yoneda f t -> f t) -> (s -> Yoneda f t) -> s -> f t
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike (Yoneda f) s t a b
t (f b -> Yoneda f b
forall (f :: * -> *) a. Functor f => f a -> Yoneda f a
liftYoneda (f b -> Yoneda f b) -> (a -> f b) -> a -> Yoneda f b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> f b
f)
{-# INLINE fusing #-}