h$%\!#      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz { | } ~                      (C) 2008-2015 Edward Kmett, (C) 2004 Dave Menendez BSD-style (see the file LICENSE)Edward Kmett  provisionalportableSafe.239bcomonadThe   s of a given  comonad ComonadApply is to Comonad like  Applicative is to Monad.Mathematically, it is a strong lax symmetric semi-monoidal comonad on the category Hask' of Haskell types. That it to say that w 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 ( ), 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  provisionalportable Safe-Inferred6comonad$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  provisionalportableSafe8989(C) 2008-2013 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  provisionalportableSafe23?>comonad.Create an Env using an environment and a valueAcomonad/Gets rid of the environment. This differs from  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  provisionalportableSafeU (C) 2008-2014 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  experimentalnon-portable (fundeps, MPTCs)Safe!  (C) 2008-2013 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  provisionalportableSafe23YQcomonad 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  provisionalportableSafe23 `abcdefghi cde`abfghi(C) 2008-2012 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  experimentalnon-portable (fundeps, MPTCs)Safe>rstrst (C) 2008-2014 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  experimentalnon-portable (fundeps, MPTCs)Safeu  89`abcderst rstcde`ab (C) 2008-2012 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  experimentalnon-portable (fundeps, MPTCs)Safe> z|~{} z|~{}(C) 2008-2014 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  experimentalnon-portable (fundeps, MPTCs)SafeW*  89NOPQRSz|~{} z|~{}PQRNOS (C) 2008-2015 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  experimentalnon-portable (fundeps, MPTCs)Safe>?(C) 2008-2014 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  experimentalnon-portable (fundeps, MPTCs)Safe'  89;<=>?@D D=>?;<@  Safe-Inferred!comonadWe 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.7-DXeGfG4ctVzI3WlwhyxGRUControl.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.6.2Control.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$fFunctorWithIndex(,)TracedT$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<>Monoidmconcatmemptymappend Data.MonoidFirstgetFirstLastgetLastApgetApData.Semigroup.InternalDualgetDualEndoappEndoAllgetAllAnygetAnySumgetSumProduct getProductAltgetAlt