You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
strictly:: (Profunctorp, Profunctorq, Functorf) =>Opticalpq (BoxTf) stab->Opticalpqfstab
strictly l f = rmap (fmap getSolo .# runBoxT) $ l (rmap (BoxT#.fmap (Solo$!)) f)
where BoxT is the following applicative transformer:
newtypeBoxTfa=BoxT{runBoxT::f (Soloa) }derivingFunctorinstanceApplyf=>Apply (BoxTf) where
liftF2 f (BoxT m) (BoxT n) =BoxT (liftF2 (liftA2 f) m n)
instanceApplicativef=>Applicative (BoxTf) wherepure=BoxT.fmapSolo
liftA2 f (BoxT m) (BoxT n) =BoxT (liftA2 (liftA2 f) m n)
-- The Contravariant instance probably isn't really useful (strictifying-- a getter or fold doesn't change anything) but it at least *seems*-- harmless.instanceContravariantf=>Contravariant (BoxTf) where
contramap f (BoxT m) =BoxT (contramap (fmap f))
-- BoxT intentionally does *not* have a Settable instance,-- because it's impossible to strictify things like `mapped` that-- are really just setters.
I figured you might be interested in doing something similar here.
The text was updated successfully, but these errors were encountered:
I'm currently working on a PR for
lens
that addswhere
BoxT
is the following applicative transformer:I figured you might be interested in doing something similar here.
The text was updated successfully, but these errors were encountered: