úÎ!yno“      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxy z { | } ~  € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž ‘ ’ B(C) 2008-2015 Edward Kmett, (C) 2004 Dave Menendez BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalportableSafe-128H2ûcomonadThe  “ s of a given  comonad ComonadApply is to Comonad like  Applicative is to Monad.TMathematically, it is a strong lax symmetric semi-monoidal comonad on the category Hask' of Haskell types. That it to say that wF is a strong lax symmetric semi-monoidal functor on Hask, where both  and 1 are symmetric monoidal natural transformations.Laws: (”)  u   v   w = u   (v   w)  (p   q) =  p ( q)  (p   q) = ( )   p    q If our type is both a   and • we further require (–) = ( ) "Finally, if you choose to define () and ( D), the results of your definitions should match the following laws: a   b = — ˜  a   b a  b = —  a   b comonad'There are two ways to define a comonad:I. Provide definitions for  and  satisfying these laws:   = ˜  .  f = f  f .  g =  (f .  g) !In this case, you may simply set  = .ÄThese laws are directly analogous to the laws for monads and perhaps can be made clearer by viewing them as laws stating that Cokleisli composition must be associative, and has extract for a unit: f   = f   f = f (f  g)  h = f  (g  h) ;II. Alternately, you may choose to provide definitions for , , and  satisfying these laws:  .  = ˜   .  = ˜  .  =   .  7In this case you may not rely on the ability to define  in terms of .)You may of course, choose to define both  and 0. In that case you must also satisfy these laws:  f =  f .   =  id  f =  (f . ) %These are the default definitions of  and  and the definition of  respectively.comonad  .  f = f .  comonad  =  ˜  ( f) .  =  .  f comonad  f =  f .  comonad"A suitable default definition for  for a $. Promotes a function to a comonad.You can only safely use  to define  if your  defines  , not just , since defining  in terms of duplicate uses !  f =  f =  (f . ) comonad)Comonadic fixed point à la David Menendezcomonad*Comonadic fixed point à la Dominic Orchardcomonad)Comonadic fixed point à la Kenneth Foner: This is the evaluate function from his  +https://www.youtube.com/watch?v=F7F-BzOB670!"Getting a Quick Fix on Comonads" talk.comonad% with the arguments swapped. Dual to ™ for a š.comonad in operator formcomonadRight-to-left  compositioncomonadLeft-to-right  compositioncomonad A variant of   with the arguments reversed.comonadLift a binary function into a  with zippingcomonadLift a ternary function into a  with zipping      4 4411114(C) 2008-2013 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalportableSafeSX8$6comonad$Given any comonad-homomorphism from w to v* this yields a comonad homomorphism from t w to t v.5656(C) 2008-2015 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalportableSafe:'8989(C) 2008-2013 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalportableSafe12>B&>comonad.Create an Env using an environment and a valueAcomonad/Gets rid of the environment. This differs from Q in that it will not continue extracting the value from the contained comonad.BcomonadRetrieves the environment.CcomonadLike B3, but modifies the resulting value with a function. asks = f . askDcomonad6Modifies the environment using the specified function. ;<=>?@ABCD =>?;<@ABCD(C) 2008-2011 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalportableSafeDi (C) 2008-2014 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimentalnon-portable (fundeps, MPTCs)SafeFÌ!›œ  (C) 2008-2013 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalportableSafe12VºQcomonad<Create a Store using an accessor function and a stored valueTcomonadRead the stored valuepos $ store fst (1,5)(1,5)UcomonadSet the stored value"pos . seek (3,7) $ store fst (1,5)(3,7)Seek satisfies the law seek s = peek s . duplicateVcomonadModify the stored value"pos . seeks swap $ store fst (1,5)(5,1)Seeks satisfies the law seeks f = peeks f . duplicateWcomonadDPeek at what the current focus would be for a different stored valuePeek satisfies the law !peek x . extend (peek y) = peek yXcomonad\Peek at what the current focus would be if the stored value was modified by some functionYcomonaduApplies a functor-valued function to the stored value, and then uses the new accessor to read the resulting focus./let f x = if x > 0 then Just (x^2) else Nothingexperiment f $ store (+1) 2Just 5experiment f $ store (+1) (-2)Nothing NOPQRSTUVWXY PQRNOSTUVWXY(C) 2008-2014 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalportableSafe12Y `abcdefghi cde`abfghi(C) 2008-2012 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimentalnon-portable (fundeps, MPTCs)Safe=?@AC[èqrsqrs (C) 2008-2014 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimentalnon-portable (fundeps, MPTCs)Safe^KIžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿À  89`abcdeqrs qrscde`ab (C) 2008-2012 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimentalnon-portable (fundeps, MPTCs)Safe=?@ACb y{}z~|€ y{}z~|€(C) 2008-2014 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimentalnon-portable (fundeps, MPTCs)Safed¡*  89NOPQRSy{}z~| y{}z~|PQRNOS (C) 2008-2015 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimentalnon-portable (fundeps, MPTCs)Safe=?@ACgø†‡ˆ†‡ˆ(C) 2008-2014 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimentalnon-portable (fundeps, MPTCs)Safej['  89;<=>?@D†‡ˆ †‡ˆD=>?;<@ SafenScomonad¶We often need to distinguish between various forms of Functor-like composition in Haskell in order to please the type system. This lets us work with these representations uniformly.‘‘Á !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNNOPQRSTUVWXYZ[\]^_``abcdefghijklmnopqqrstuvwxyz{|}~€v‚ƒ„…†‡ ˆ e h i f g j ‰ Š ‹ Œ Ž  T U ‘ ’ “ ” • – — ˜ ™š›œžŸ œ¡¢£¤¥¤¥¤¦§¨©ª«¬­¬­¬®¬¯¬¯¬°¬±¬±¬²³´³´³µ³¶³¶³·³¸³¸³¹³º³º³»³¼³¼³½³¾³¾³¿³À³À³ÁÂ$comonad-5.0.6-7wZqiQcXU6FCBGJSmfYZqAControl.ComonadControl.Comonad.Trans.IdentityControl.Comonad.Hoist.ClassControl.Comonad.Trans.ClassControl.Comonad.Trans.EnvControl.Comonad.Trans.StoreControl.Comonad.Trans.TracedControl.Comonad.Traced.ClassControl.Comonad.Store.ClassControl.Comonad.Env.ClassData.Functor.CompositionControl.Comonad.IdentityControl.Comonad.TracedControl.Comonad.StoreControl.Comonad.EnvbaseGHC.BasefmapFunctor Data.Functor$><$><$transformers-0.5.5.0Control.Monad.Trans.Identity runIdentityT IdentityT Cokleisli runCokleisli ComonadApply<@>@><@Comonadextract duplicateextendliftWwfixcfixkfix=>><<==<==>=<@@>liftW2liftW3 $fComonadSum$fComonadNonEmpty $fComonadTree$fComonadIdentityT$fComonadTagged$fComonadIdentity $fComonad-> $fComonadArg $fComonad(,)$fComonadApplyTree$fComonadApplyIdentityT$fComonadApplyIdentity$fComonadApply->$fComonadApplyNonEmpty$fComonadApply(,)$fMonadCokleisli$fApplicativeCokleisli$fFunctorCokleisli$fArrowLoopCokleisli$fArrowChoiceCokleisli$fArrowApplyCokleisli$fArrowCokleisli$fCategoryTYPECokleisli ComonadHoistcohoist$fComonadHoistIdentityT ComonadTranslower$fComonadTransIdentityTEnvTEnvenvrunEnvrunEnvT lowerEnvTaskaskslocal$fTraversableEnvT$fFoldableEnvT$fComonadApplyEnvT$fComonadHoistEnvT$fApplicativeEnvT$fComonadTransEnvT $fComonadEnvT $fFunctorEnvT $fDataEnvTStoreTStorestorerunStore runStoreTposseekseekspeekpeeks experiment$fComonadHoistStoreT$fComonadTransStoreT$fComonadStoreT$fApplicativeStoreT$fComonadApplyStoreT$fFunctorStoreTTracedT runTracedTTracedtraced runTracedtracelistenlistenscensor$fDistributiveTracedT$fComonadHoistTracedT$fComonadTransTracedT$fComonadTracedT$fApplicativeTracedT$fComonadApplyTracedT$fFunctorTracedT ComonadTracedtraces$fComonadTracedmStoreT$fComonadTracedmEnvT$fComonadTracedmIdentityT$fComonadTracedm->$fComonadTracedmTracedT ComonadStorelowerPos lowerPeek$fComonadStoresTracedT$fComonadStoresEnvT$fComonadStoresIdentityT$fComonadStoresStoreT ComonadEnv$fComonadEnveTracedT$fComonadEnveIdentityT$fComonadEnveStoreT$fComonadEnveArg$fComonadEnve(,)$fComonadEnveEnvT Composition decomposecompose$fCompositionCompose Control.ArrowArrowControl.Category. Applicative<*>constid>>=MonadData.Functor.IdentityIdentity runIdentity<>Monoidmemptymappendmconcat Data.MonoidFirstgetFirstLastgetLastApgetApData.Semigroup.InternalDualgetDualEndoappEndoAllgetAllAnygetAnySumgetSumProduct getProductAltgetAlt