úÎ#í"†     portable provisionalEdward Kmett <ekmett@gmail.com>The   s of a given   XAs a symmetric semi-monoidal comonad, an instance of ComonadZip is required to satisfy:  + extract (a <.> b) = extract a (extract b) Minimal definition:  Based on the ComonadZip from "#The Essence of Dataflow Programming" Mby Tarmo Uustalu and Varmo Vene, but adapted to fit the programming style of Control.Applicative.  (There are two ways to define a comonad: I. Provide definitions for   and   satisfying these laws:   extend extract = id  extract . extend f = f - extend f . extend g = extend (f . extend g) !In this case, you may simply set  = . 9These laws are directly analogous to the laws for monads @and perhaps can be made clearer by viewing them as laws stating Dthat Cokleisli composition must be associative, and has extract for a unit:   f =>= extract = f  extract =>= f = f # (f =>= g) =>= h = f =>= (g =>= h) ;II. Alternately, you may choose to provide definitions for ,  , and   satisfying these laws:   extract . duplicate = id  fmap extract . duplicate = id 7 duplicate . duplicate = fmap duplicate . duplicate 7In this case you may not rely on the ability to define  in  terms of . )You may of course, choose to define both   and  . /In that case you must also satisfy these laws:   extend f = fmap f . duplicate  duplicate = extend id " fmap f = extend (f . extract) %These are the default definitions of   and  and the  'default' definition of  respectively.  aka coreturn  aka cojoin  aka cobind "A suitable default definition for  for a  . # Promotes a function to a comonad.  % with the arguments swapped. Dual to  for a .   in operator form %Right-to-left Cokleisli composition $Left-to-right Cokleisli composition )A generalized comonadic list anamorphism Comonadic fixed point  A variant of  with the arguments reversed. 3Lift a binary function into a comonad with zipping 4Lift a ternary function into a comonad with zipping             comonad-0.3.0Control.ComonadbaseGHC.BaseFunctor<$fmap Cokleisli runCokleisli ComonadZip<.>.><.Comonadextract duplicateextendliftW=>><<==<==>=unfoldWwfix<..>liftW2liftW3 Control.ArrowArrow>>=Monad