!")      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      ! " # $ % & ' ( (c) Conal Elliott 2007BSD3conal@conal.net experimentalportableSafeT(c) Conal Elliott 2007BSD3conal@conal.net experimental TypeOperatorsSafeUV TypeComposeBijective functions TypeComposeA type of bijective arrows TypeCompose)Bijective identity arrow. Warning: uses ) on (~>). If you have no ), but you have a  DeepArrow, you can instead use  Bi idA idA. TypeComposeInverse bijection TypeComposeBijections on functors TypeComposeBijections on arrows.  TypeCompose@Apply a function in an alternative (monomorphic) representation.   82(c) Conal Elliott 2007-2013BSD3conal@conal.net experimentalsee LANGUAGE pragmaNone-17=>?@AHMSUVXu4C  TypeCompose;Arrow-like type between type constructors (doesn't enforce  Arrow (~>) here). TypeCompose#Pairing of binary type constructors TypeCompose"Pairing of unary type constructors TypeComposeNIdentity type constructor. Until there's a better place to find it. I'd use Control.Monad.IdentityA, but I don't want to introduce a dependency on mtl just for Id. TypeComposeCompatibility synonym for (:$). TypeCompose'Type application We can also drop the AppC constructor, but then we overlap with many other instances, like [a]. Here's a template for App-free instances. t instance (Applicative f, Monoid a) => Monoid (f a) where mempty = pure mempty mappend = liftA2 mappend TypeComposeConvert to an . TypeCompose(-> IO ()) as a . A ContraFunctor. TypeComposeFlip type arguments" TypeComposeSimulates universal constraint forall a. Monoid (f a)..See Simulating Quantified Class Constraints ( 1http://flint.cs.yale.edu/trifonov/papers/sqcc.pdf/) Instantiate this schema wherever necessary: H instance Monoid_f f where { mempty_f = mempty ; mappend_f = mappend }% TypeComposeSupport needed for a + to be an *.+ TypeComposeCommon pattern for *s.. TypeCompose>Composition of type constructors: unary with binary. Called  StaticArrow in [1].1 TypeComposeMonad distributivity.+TODO: what conditions are required so that (m :. n) satisfies the monad laws?3 TypeComposeCompatibility synonym4 TypeCompose&Composition of unary type constructors There are (at least) two useful +Z instances, so you'll have to pick one and type-specialize it (filling in all or parts of g and/or f). b -- standard Monoid instance for Applicative applied to Monoid instance (Applicative (g :. f), Monoid a) => Monoid ((g :. f) a) where { mempty = pure mempty; mappend = liftA2 mappend } -- Especially handy when g is a Monoid_f. instance Monoid (g (f a)) => Monoid ((g :. f) a) where { mempty = O mempty; mappend = inO2 mappend }8Corresponding to the first and second definitions above,  instance (Applicative g, Monoid_f f) => Monoid_f (g :. f) where { mempty_f = O (pure mempty_f); mappend_f = inO2 (liftA2 mappend_f) } instance Monoid_f g => Monoid_f (g :. f) where { mempty_f = O mempty_f; mappend_f = inO2 mappend_f } Similarly, there are two useful , instances and two useful 6 instances.  instance ( Functor g, Functor f) => Functor (g :. f) where fmap = fmapFF instance (ContraFunctor g, ContraFunctor f) => Functor (g :. f) where fmap = fmapCC instance ( Functor g, ContraFunctor f) => ContraFunctor (g :. f) where contraFmap = contraFmapFC instance (ContraFunctor g, Functor f) => ContraFunctor (g :. f) where contraFmap = contraFmapCFSHowever, it's such a bother to define the Functor instances per composition type, I've left the fmapFF case in. If you want the fmapCC one, you're out of luck for now. I'd love to hear a good solution. Maybe someday Haskell will do Prolog-style search for instances, subgoaling the constraints, rather than just matching instance heads.6 TypeCompose*Contravariant functors. often useful for  acceptors (consumers, sinks) of values.8 TypeComposeBinary functions9 TypeComposeUnary functions: TypeComposeDAdd pre-processing argument :: (a' -> a) -> ((a -> b) -> (a' -> b)); TypeComposeAdd post-processing< TypeComposeAdd pre- and post processing> TypeCompose6Like '(~>)' but specialized to functors and functions.@ TypeCompose$Bijections on contravariant functorsA TypeComposeUnwrap a '(:.)'.B TypeComposenewtype bijectionC TypeCompose"Compose a bijection, Functor styleD TypeCompose(Compose a bijection, ContraFunctor styleE TypeCompose"Apply a unary function within the 4 constructor.F TypeCompose#Apply a binary function within the 4 constructor.G TypeCompose$Apply a ternary function within the 4 constructor.H TypeComposeHandy combination of 4 and -.I TypeComposeHandy combination of E and ..J TypeComposeHandy combination of F and /.K TypeComposeHandy combination of G and 0.L TypeCompose Used for the Functor :. Functor instance of ,M TypeCompose Used for the ContraFunctor :. ContraFunctor instance of ,N TypeCompose Used for the Functor :. ContraFunctor instance of ,O TypeCompose Used for the ContraFunctor :. Functor instance of ,P TypeCompose A candidate 1 for (m :. n)Q TypeComposeA candidate '(>>=)' for (m :. n)S TypeCompose1--like function for implicitly composed monadsT TypeCompose1--like function for explicitly composed monadsU TypeComposeApply unary function in side a + representation.V TypeCompose Apply binary function in side a + representation.W TypeComposenewtype bijection[ TypeComposenewtype bijectiona TypeComposenewtype bijectionb TypeComposeHandy infix & curried c TypeComposenewtype bijectiond TypeComposeCompose a bijectione TypeComposeApply unary function inside of f :*: g representation.f TypeCompose Apply binary function inside of f :*: g representation.g TypeCompose!Apply ternary function inside of f :*: g representation.h TypeCompose8A handy combining form. See '(***#)' for an sample use.i TypeCompose<Combine two binary functions into a binary function on pairsj TypeComposeHandy infix & curried k TypeCompose Apply binary function inside of f :*: g representation.l TypeCompose Apply binary function inside of f :*: g representation.m TypeComposeApply unary function inside of Arrw representation.n TypeCompose Apply binary function inside of  Arrw j f g representation.o TypeCompose!Apply ternary function inside of  Arrw j f g representation.p TypeComposenewtype bijectionq TypeComposeCompose a bijectionr TypeComposenewtype bijectionv TypeComposenewtype bijectionw TypeCompose.Convenience for partial-manipulating functions& TypeComposefor )l  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwl98;:<>=?67@453ABCDEFGHIJKLMNO12PQRST./0+,-UV%&'()*"#$ !WXYZ[\]^a_`bcdihefgjkl  pqmnorstuvw 17049 <1=1>1?1h0i3(c) Conal Elliott 2007BSD3conal@conal.net experimentalmulti-parameter type classesNone =?@ACSUVX  TypeComposeLike Copair, but for functions TypeComposeLike Unpair?, but for functions. Minimal instance definition: either (a)  or (b) both of  and . TypeComposeDeconstruct pair-like value TypeComposeFirst part of pair-like value TypeComposeSecond part of pair-like value TypeComposePType constructor class for function-like things having lambda-like construction. TypeComposeType of  method. Think of src: as the bound variable (or pattern) part of a lambda and snka as the expression part. They combine to form a function-typed expression. Instance template: m instance (Applicative f, Lambda src snk) => Lambda (f :. src) (f :. snk) where lambda = apLambda 2 TypeCompose Handy for 3 functor instances of 4 TypeCompose with  . Warning: definition uses )+, so only use if your arrow has a working ). TypeComposeForm a function-like value (c) Conal Elliott 2007BSD3conal@conal.net experimentalGHCNoneSUVX?  TypeComposeDual to 0. Especially handy for contravariant functors (6$) . Use this template (filling in f) : ` instance ContraFunctor f => Copair f where { cofsts = cofmap fst ; cosnds = cofmap snd } TypeCompose6Unpairpable. Minimal instance definition: either (a)  or (b) both of  and *. A standard template to substitute any , f. But watch out for effects! K instance Functor f => Unpair f where {fsts = fmap fst; snds = fmap snd} TypeComposeType of  method. Generalizes . TypeComposeType constructor class for -like things. Here are some standard instance templates you can fill in. They're not defined in the general forms below, because they would lead to a lot of overlap.  instance Applicative f => Pair f where pair = liftA2 (,) instance (Applicative h, Pair f) => Pair (h :. f) where pair = apPair instance (Functor g, Pair g, Pair f) => Pair (g :. f) where pair = ppPair instance (Arrow (~>), Unpair f, Pair g) => Pair (Arrw (~>) f g) where pair = arPair instance (Monoid_f h, Copair h) => Pair h where pair = copair.Also, if you have a type constructor that's a , and a , here is a way to define '( *)' for 3:  (<*>) = pairWith ($)"Minimum definitions for instances. TypeComposeType of  method TypeCompose Handy for  instances TypeCompose Handy for  instances TypeCompose Pairing of   values. Warning: definition uses )+, so only use if your arrow has a working ). TypeCompose Pairing of ( values. Combines contribution of each. TypeCompose<Turn a pair of sources into a source of pair-editors. See  6http://conal.net/blog/posts/pairs-sums-and-reactivity/. 'Functor'\/'Monoid' version. See also . TypeCompose<Turn a pair of sources into a source of pair-editors. See  6http://conal.net/blog/posts/pairs-sums-and-reactivity/. Monad version. See also . TypeComposePair-like value from first part TypeCompose Pair-like value from second part TypeComposegeneralized unpair TypeComposeFirst part of pair-like value TypeComposeSecond part of pair-like value TypeCompose Generalized (c) Conal Elliott 2007BSD3conal@conal.net experimentalMPTCSafe@ACZ TypeCompose Class of monads with references. TypeComposeChange the contents of a ref(c) Conal Elliott 2007BSD3conal@conal.net experimentalportableNone=?UV TypeCompose for all applications of f TypeComposeSProvide a title on a value. If you can title polymorphically, please instantiate 5 instead of Title. Then you'll automatically get a - for each type instance, thanks to this rule. : instance Title_f f => Title (f a) where title = title_f #To handle ambiguity for types like  ([] Char) -- aka 5 , this module is compiled with OverlappingInstances and UndecidableInstances+. The more specific instance (yours) wins.MIn defining your instance, you might want to use the String instance, e.g.,  title ttl "".(c) Conal Elliott 2007BSD3conal@conal.net experimentalsynonym instanceNone=MUV TypeComposeCType of context-dependent monoid. Includes an explicit dictionary. TypeComposeDictionary for . TypeComposenewtype bijection(c) Conal Elliott 2007BSD3conal@conal.net experimentalGHCNoneSUVX  TypeComposeDual to 0. Especially handy for contravariant functors ( Cofunctor$) . Use this template (filling in f) : [ instance Cofunctor f => Cozip f where { cofsts = cofmap fst ; cosnds = cofmap snd } TypeCompose5Unzippable. Minimal instance definition: either (a)  or (b) both of  and *. A standard template to substitute any , f. But watch out for effects! J instance Functor f => Unzip f where {fsts = fmap fst; snds = fmap snd} TypeComposeType of  method. Generalizes 6. TypeComposeType constructor class for -like things. Here are some standard instance templates you can fill in. They're not defined in the general forms below, because they would lead to a lot of overlap. x instance Applicative f => Zip f where zip = liftA2 (,) instance (Applicative h, Zip f) => Zip (h :. f) where zip = apZip instance (Functor g, Zip g, Zip f) => Zip (g :. f) where zip = ppZip instance (Arrow (~>), Unzip f, Zip g) => Zip (Arrw (~>) f g) where zip = arZip instance (Monoid_f h, Cozip h) => Zip h where zip = cozip.Also, if you have a type constructor that's a , and a , here is a way to define '( *)' for 3:  (<*>) = zipWith ($)"Minimum definitions for instances. TypeComposeType of  method TypeCompose Generalized 7 TypeCompose Generalized 7 TypeCompose Handy for  instances TypeCompose Handy for  instances TypeCompose Ziping of   values. Warning: definition uses )+, so only use if your arrow has a working ). TypeCompose Ziping of ( values. Combines contribution of each.  TypeCompose<Turn a pair of sources into a source of pair-editors. See  6http://conal.net/blog/posts/pairs-sums-and-reactivity/. 'Functor'\/'Monoid' version. See also  .  TypeCompose<Turn a pair of sources into a source of pair-editors. See  6http://conal.net/blog/posts/pairs-sums-and-reactivity/. Monad version. See also  . TypeComposeZip-like value from first part TypeComposeZip-like value from second part TypeComposegeneralized unzip TypeComposeFirst part of pair-like value TypeComposeSecond part of pair-like value TypeCompose Generalized 8    (c) Conal Elliott 2007BSD3conal@conal.net experimentalportableNone=! TypeCompose8Partial value. Represented an endomorphism, which is a + under 9 and '(.)'. Then :, is the completely undefined value, and in u ` 'mappend'@` v, v selectively replaces parts of  u@. The ; instances for Pair, Unpair, Copair, Unfun, and Cofun( are all very useful on partial values." TypeCompose[Treat a full value as a partial one. Fully overrides any "previous" (earlier argument to mappend) partial value.# TypeComposePForce a partial value into a full one, filling in bottom for any missing parts.$ TypeComposedInverse to "element" access, on all elements. A way to inject some info about every element. For f, consider '[]', (->) a, Event, etc.% TypeCompose)Provide in info about a function argument& TypeCompose$Provide info about a function result' TypeCompose>Inject a partial argument-source into a partial function-sink. !"#$%&'! "#$%&'<     !"!#$%&''()*+,-./0122344567898:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~          ! " # $ %&'(&')&*+&*,&*-&*.&*/&*0&*12&*34&*5&6&6&6&*7&*8&9:;)TypeCompose-0.9.14-4iCBqWWcPGLDb6u5L5trZIData.BijectionControl.Compose Data.Lambda Data.Pair Data.RefMonad Data.Title Data.CxMonoidData.Zip Data.PartialControl.Instances:<->: BijectionBibiTobiFromidbinversebimap--->inBi$fArrowBijection$fCategoryTYPEBijection:->:ArrwunArrw::*::ProddunProdd:*:ProdunProdIdApp:$unAppToOItoOIOIFlipunFlipMonoid_fmempty_f mappend_fFunAblearrFunfirstFun secondFun***%&&&%FunAunFunAOOunOODistribMdistribMO:. ContraFunctor contraFmapBinopUnopargumentresult~><~~>**<~bicomapunObiOconvOcoconvOinOinO2inO3oPureoFmapoLiftA2oLiftA3fmapFFfmapCC contraFmapFC contraFmapCF joinDistribM bindDistribMreturnDistribMjoinMMT joinComposeTinFunAinFunA2biFlipinFlipinFlip2inFlip3biAppinAppinApp2unIdinIdinId2biId*:*biProdconvProdinProdinProd2inProd3$****#*::*inProddinProdd2inArrwinArrw2inArrw3biFunconvFunbiConstinConstinConst2inConst3biEndoinEndo$fApplicative:.$fTraversable:. $fFoldable:. $fFunctor:. $fArrowOO $fCategorykOO $fArrowFunA$fCategoryTYPEFunA$fMonoid_fTYPEEndo$fMonoid_fTYPE[]$fMonoid_fTYPEFlip $fMonoidFlip$fSemigroupFlip$fContraFunctorFlip $fToOIFlip $fMonoid:$ $fSemigroup:$$fTraversableId $fFoldableId $fMonadId$fApplicativeId $fFunctorId$fApplicative:*: $fFunctor:*:$fMonoid_fk:*:$fOrd:*:$fEq:*: $fShow:*: $fArrow::*::$fCategoryk::*::$fContraFunctorArrw $fFunctorArrw$fEq:.$fShow:.$fOrd:. $fGeneric:. $fGeneric1:.$fEqId$fShowId$fOrdId $fGenericId $fGeneric1Id $fShow::*:: $fEq::*:: $fOrd::*:: $fMonoidArrw$fSemigroupArrwColambdacoresUnlambdaunlambdafsrcfresLambdalambdaLambdaTy$fLambda:*::*: $fLambdafArrw $fLambdaf:. $fLambdaf:.0$fLambdaIOFlip$fLambdaIdFlip$fUnlambdaEndoEndo$fLambdaArrwArrw$fColambdaEndoCopaircofstscosndsUnpairunpairfstssndsUnpairTyPairpairPairTyapPairppPairarPaircopairpairEdit pairEditM $fPairEndo $fPair:*: $fPairFlip$fPairId $fPairConst$fPairIO$fPair-> $fPair(,)$fPair[] $fUnpairEndo $fUnpairId $fUnpairConst $fUnpair(,) $fUnpair-> $fUnpair[] $fPairArrw $fCopairEndo $fCopair:*: $fCopair:. $fCopairFlip $fCopairConstRefMonadnewRefreadRefwriteRef modifyRef$fRefMonadSTSTRef$fRefMonadIOIORefTitle_ftitle_fTitletitle $fTitle-> $fTitle[] $fTitle_fFlip $fTitle_fIO$fTitlef $fTitle_f:.CxMonoid unCxMonoid MonoidDict biCxMonoid$fTitleCxMonoid$fMonoidCxMonoid$fSemigroupCxMonoidCozipUnzipunzipUnzipTyZipzipZipTyzipWithzipWith3apZipppZiparZipcozip $fZipEndo$fZip:*: $fZipFlip$fZipId $fZipConst$fZipIO$fZip->$fZip(,)$fZip[] $fUnzipEndo $fUnzipId $fUnzipConst $fUnzip(,) $fUnzip-> $fUnzip[] $fZipArrw $fCozipEndo $fCozip:*: $fCozip:. $fCozipFlip $fCozipConstPartialXPartialvalppvalpUnEltpUnArgpUnRespUnSrc $fFunAbleEndobase Control.ArrowarrArrowGHC.BaseMonoidFunctorpurefmapliftA2liftA3joinapLambda ApplicativearLambdaStringGHC.ListidmemptyData.Semigroup.InternalEndo