úÎ ™%     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 (wzip a b) = (extract a, extract b) 0By extension, the following law must also hold:  + extract (a <.> b) = extract a (extract b) Minimum definition:  Based on the ComonadZip from #The Essence of Dataflow Programming Hby Tarmo Uustalu and Varmo Vene, but adapted to fit the conventions of =Control.Monad and to provide a similar programming style to that of Control.Applicative.   (<.>) = liftW2 id   (.>) = liftW2 (const id)   (<.) = liftW2 const (There are two ways to define a comonad: I. Provide definitions for ,  , and   satisfying these laws:   extract . duplicate == id  fmap extract . duplicate == id 8 duplicate . duplicate == fmap duplicate . duplicate II. Provide definitions for   and   satisfying these laws:   extend extract == id  extract . extend f == f . extend f . extend g == extend (f . extend g) (2 cannot be defaulted, but a comonad which defines   may simply set  equal to .) $A comonad providing definitions for   and  , must also satisfy these laws:  ! extend f == fmap f . duplicate  duplicate == extend id # fmap f == extend (f . extract) $(The first two are the defaults for   and  , #and the third is the definition of .) "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   wzip wa wb = (,) <$> wa <.> wb  wzip = liftW2 (,) Called czip in Essence of Dataflow Programming             comonad-0.1.1Control.ComonadbaseGHC.BaseFunctor<$fmap Cokleisli runCokleisli ComonadZip<.>.><.Comonadextract duplicateextendliftW=>><<==<==>=unfoldWwfix<..>wzipliftW2liftW3 Control.ArrowArrow>>=Monad