h$1+      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                     (C) 2011-2013 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  provisionalMPTCs, fundeps Safe-InferredV  (c) Edward Kmett 2011-2014BSD3ekmett@gmail.com experimentalNone>? adjunctionsA  functor f is  if   and ! witness an isomorphism to  (_ -> Rep f).   . ! D id ! .   D id  adjunctions  f (  g) =   (g . f) " adjunctions " f p D   $  (! p)  . f # adjunctions  and !# form two halves of an isomorphism./This can be used with the combinators from the lens package. # ::  f => Iso' (a ->  f) (f a)! "#$! "#$(C) 2011-2013 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  provisionalMPTCs Trustworthy %+ adjunctionsAn adjunction from Hask^op to Hask  (f a) b ~ Hask a (g b) / , =  . - =  Any adjunction from Hask to Hask^op would indirectly permit unsafePerformIO, and therefore does not exist.0 adjunctions. and /# form two halves of an isomorphism./This can be used with the combinators from the lens package. 0 :: + f g => Iso' (b -> f a) (a -> g b)1 adjunctions Represent a  functor that has a left adjoint3 adjunctionsThis gives rise to the  Cont Bool 4 adjunctionsThis + gives rise to the Cont +,-./012+,-./012(C) 2011 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  provisionalMPTCs, fundeps Safe-Inferred 56789:8:9567(c) Edward Kmett 2011-2014BSD3ekmett@gmail.com experimental Trustworthy59>?B A adjunctionsOn the surface,  WrappedRec is a simple wrapper around F;. But it plays a very important role: it prevents generic E instances for recursive types from sending the typechecker into an infinite loop. Consider the following datatype: (data Stream a = a :< Stream a deriving (,  ) instance E Stream With A, we have its F being: F Stream =  () (A Stream) If A didn't exist, it would be: F0 Stream = Either () (Either () (Either () ...)) An infinite type! A& breaks the potentially infinite loop.D adjunctionsA default implementation of F( for a datatype that is an instance of . This is usually composed of ', tuples, unit tuples, and underlying F# values. For instance, if you have: 6data Foo a = MkFoo a (Bar a) (Baz (Quux a)) deriving (,  ) instance E Foo Then you'll get: D Foo = Either () (Either (A Bar) (A Baz, A Quux)) (See the Haddocks for A$ for an explanation of its purpose.)E adjunctionsA  f is E if G and H witness an isomorphism to (->) x.Every   is actually E.Every E & from Hask to Hask is a right adjoint. G . H D id H . G D id G .  D  F adjunctions3If no definition is provided, this will default to D.G adjunctions  f . G D G .  f 3If no definition is provided, this will default to I.H adjunctions3If no definition is provided, this will default to J.I adjunctionsA default implementation of G in terms of D.J adjunctionsA default implementation of H in terms of D.K adjunctionsG and H# form two halves of an isomorphism./This can be used with the combinators from the lens package. K :: E f => Iso' (F f -> a) (f a)&>?@ABCDEFHGIJKLMNOPQRSTUVWXYZ[\]^_`abc&EFHGK>?@LUVTMbcNOQPRSZ[\]^WXY_`aDJIABC 2008-2013 Edward KmettBSDEdward Kmett  experimentalrank 2 types, MPTCs, fundeps Trustworthy   adjunctions$An adjunction between Hask and Hask.Minimal definition: both  and  or both  and , subject to the constraints imposed by the default definitions that the following laws should hold. unit = leftAdjunct id counit = rightAdjunct id leftAdjunct f = fmap f . unit rightAdjunct f = counit . fmap f.Any implementation is required to ensure that  and  witness an isomorphism from  Nat (f a, b) to  Nat (a, g b) .rightAdjunct unit = id leftAdjunct counit = id adjunctions and # form two halves of an isomorphism./This can be used with the combinators from the lens package.  ::  f u => Iso' (f a -> b) (a -> u b) adjunctionsEvery right adjoint is representable by its left adjoint applied to a unit elementUse this definition and the primitives in Data.Functor.Representable to meet the requirements of the superclasses of Representable. adjunctions5This definition admits a default definition for the H> method of 'Index", one of the superclasses of Representable. adjunctions>A right adjoint functor admits an intrinsic notion of zipping adjunctions*Every functor in Haskell permits unzipping adjunctions:A left adjoint must be inhabited, or we can derive bottom. adjunctions;And a left adjoint must be inhabited by exactly one element adjunctions!Every functor in Haskell permits  uncozipping (C) 2011-2013 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  provisionalMPTCs, fundeps Safe-Inferredi adjunctionsExploiting this instance requires that we have the missing Traversables for Identity, (,)e and IdentityT (C) 2011-2013 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  provisionalMPTCs, fundeps Safe-Inferred#'(c) Edward Kmett & Sjoerd Visscher 2011BSD3ekmett@gmail.com experimental Safe-Inferred >?&  adjunctions+A state transformer monad parameterized by:g? - A representable functor used to memoize results for a state Rep gm - The inner monad.The , function leaves the state unchanged, while >>= uses the final state of the first computation as the initial state of the second. adjunctionsA memoized state monad parameterized by a representable functor g!, where the representatation of g, Rep g is the state to carry.The , function leaves the state unchanged, while >>= uses the final state of the first computation as the initial state of the second. adjunctionsUnwrap a state monad computation as a function. (The inverse of .) adjunctionsEvaluate a state computation with the given initial state and return the final value, discarding the final state.  m s =  ( m s) adjunctionsEvaluate a state computation with the given initial state and return the final state, discarding the final value.  m s =  ( m s) adjunctionsMap both the return value and final state of a computation using the given function.  ( f m) = f .  m adjunctionsEvaluate a state computation with the given initial state and return the final value, discarding the final state.  m s =   ( m s) adjunctionsEvaluate a state computation with the given initial state and return the final state, discarding the final value.  m s =   ( m s) adjunctionsUniform lifting of a callCC operation to the new monad. This version rolls back to the original state on entering the continuation. adjunctionsIn-situ lifting of a callCC operation to the new monad. This version uses the current state on entering the continuation. It does not satisfy the laws of a monad transformer. adjunctions$state-passing computation to execute adjunctions initial state adjunctionsreturn value and final state adjunctions$state-passing computation to execute adjunctions initial value adjunctions%return value of the state computation adjunctions$state-passing computation to execute adjunctions initial value adjunctions final state  =(c) Edward Kmett 2011, (c) Conal Elliott 2008BSD3ekmett@gmail.com experimental Safe-Inferred'(>?'2 >?@ABCDEGFHFIJKLMNOPQRSTUVWXYZ[\]^_`abc  '(c) Edward Kmett & Sjoerd Visscher 2011BSD3ekmett@gmail.com experimental Safe-Inferred >?+y adjunctions-A store transformer comonad parameterized by:g - A representable functor used to memoize results for an index Rep gw - The inner comonad. adjunctionsA memoized store comonad parameterized by a representable functor g!, where the representatation of g, Rep g is the index of the store. adjunctionsConstruct a store comonad computation from a function and a current index. (The inverse of .) adjunctionsUnwrap a store comonad computation as a function and a current index. (The inverse of .) adjunctions computation adjunctionsindex adjunctionsa store to access adjunctions initial state         !"#$%&'()*+,-./0123456789:;<=>?@ABCDEEFGHIJKLMMNOPQR./01ST3UVWXYZ[\]^_`abcdefghijklmnopqrstuv56wx7yz{|}~: ; < = > ? @                           E E F G H I  J K L E E F G H I    L(adjunctions-4.4.2-4Bppt6QvzVn7ARRjwXvzhD#Control.Comonad.Representable.Store!Control.Monad.Representable.State"Control.Monad.Representable.ReaderControl.Monad.Trans.ContsData.Functor.Contravariant.Rep%Data.Functor.Contravariant.Adjunction)Control.Monad.Trans.Contravariant.AdjointData.Functor.RepData.Functor.AdjunctionControl.Monad.Trans.AdjointControl.Comonad.Trans.Adjoint$comonad-5.0.8-DrzarP33Ajl7kpsuStRFeZControl.Comonad.Store.Class experimentseeksseekpeekspeekpos ComonadStore mtl-2.2.2Control.Monad.State.Classstateputget MonadStateControl.Monad.Reader.Classreaderlocalask MonadReaderContsT runContsTContsContcontrunContcontsrunContscallCC$fMonadTransContsT $fMonadContsT$fApplicativeContsT $fApplyContsT$fFunctorContsT RepresentableReptabulateindexcontramapWithRep tabulated contramapRep$fRepresentable:*:$fRepresentableU1$fRepresentableProduct$fRepresentablePredicate$fRepresentableOp$fRepresentableProxy Adjunctionunitcounit leftAdjunct rightAdjunct adjunctedcontrarepAdjunctioncoindexAdjunction$fAdjunctionPredicatePredicate$fAdjunctionOpOpAdjointT runAdjointTAdjointadjoint runAdjoint$fMonadAdjointT$fApplicativeAdjointT$fFunctorAdjointTCounCo WrappedRepWrapRep unwrapRepGRep gtabulategindexfmapReppureRepbindRepmfixRep mzipWithRepmzipRepaskReplocalRepapRep distributeRep collectRepduplicateRepBy extendRepBy extractRepBy duplicatedRep extendedRep duplicateRep extendRep extractRepimapRep ifoldMapRep itraverseRepliftR2liftR3 $fGTabulateM1$fGTabulatePar1$fGTabulate:*: $fGIndexM1 $fGIndexPar1 $fGIndex:*:$fRepresentableM1$fRepresentableRec1$fRepresentablePar1$fRepresentable:.:$fRepresentableComplex$fRepresentableSum$fRepresentableDual$fRepresentableReverse$fRepresentableBackwards$fRepresentableCofree$fRepresentableProduct0$fRepresentableCompose$fRepresentableReaderT$fRepresentable->$fRepresentableIdentityT$fRepresentableTagged$fRepresentableIdentity $fGIndexRec1$fGTabulateRec1 $fGIndex:.:$fGTabulate:.:$fComonadTransCo $fComonadCo $fExtendCo$fMonadReaderaCo $fMonadCo$fBindCo$fDistributiveCo$fApplicativeCo $fApplyCo$fRepresentableCo$fRepresentableTracedT $fFunctorCotabulateAdjunctionindexAdjunctionzapWithAdjunctionsplitLunsplitLextractL duplicateLzipRunzipRabsurdL unabsurdLcozipLuncozipL$fAdjunction:+::*:$fAdjunction:.::.:$fAdjunctionRec1Rec1$fAdjunctionPar1Par1$fAdjunctionV1U1$fAdjunctionFreeCofree$fAdjunctionSumProduct$fAdjunctionComposeCompose$fAdjunctionWriterTTracedT$fAdjunctionEnvTReaderT$fAdjunctionIdentityTIdentityT$fAdjunctionIdentityIdentity$fAdjunction(,)->$fMonadTransAdjointT$fComonadTransAdjointT$fComonadAdjointT$fExtendAdjointTStateT getStateTStaterunState evalState execStatemapStatestateT runStateT mapStateT evalStateT execStateT liftCallCC liftCallCC'$fMonadFreefStateT$fMonadContStateT$fMonadWriterwStateT$fMonadReadereStateT$fMonadStatesStateT$fMonadTransStateT$fBindTransStateT $fMonadStateT $fBindStateT$fApplicativeStateT $fApplyStateT$fFunctorStateTReaderT getReaderTReader runReaderreaderT runReaderT$fTraversable1ReaderT$fTraversableReaderT$fFoldable1ReaderT$fFoldableReaderT$fMonadWriterwReaderT$fMonadIOReaderT$fComonadReaderT$fExtendReaderT$fDistributiveReaderT$fMonadTransReaderT$fMonadReaderT $fBindReaderT$fApplicativeReaderT$fApplyReaderT$fFunctorReaderTStoreTStorestorerunStorestoreT runStoreT$fComonadCofreefStoreT$fComonadEnvmStoreT$fComonadTracedmStoreT$fComonadHoistStoreT$fComonadTransStoreT$fComonadStoreT$fExtendStoreT$fApplicativeStoreT$fComonadApplyStoreT $fApplyStoreT$fFunctorStoreT$fComonadStoresStoreTbaseData.Functor.Contravariant Contravariant contramap Data.EithereitherGHC.BaseidOpMonadFunctor GHC.GenericsGeneric1Either+distributive-0.6.2.1-JWFFgCWot4N260iZGUfpeHData.Distributive Distributivereturnfmap Data.TuplefstsndliftM