úÎ4Ô1X)      !"#\$%&'(portable provisionalEdward Kmett <ekmett@gmail.com>Safe Dual function arrows. Define an equivalence relation *Defines a total ordering on a type as per ) 6Any instance should be subject to the following laws:   contramap id = id / contramap f . contramap g = contramap (g . f) GNote, that the second law follows from the free theorem of the type of   ; and the first law, so you need only check that the former  condition holds. Compare using ) Check for equivalence with * +Equivalence relations are  , because you can B apply the contramapped function to each input to the equivalence  relation. ,A  is a   - , because   can @ apply its function argument to each input to each input to the  comparison function. .A   is a   - , because   can < apply its function argument to the input of the predicate.  /0+,.1234567      /0+,.1234567portable experimentalekmett@gmail.com Safe-Inferred4Composition of contravariant and covariant functors 4Composition of covariant and contravariant functors *Composition of two contravariant functors 89:;<  89:;<portable provisionalEdward Kmett <ekmett@gmail.com> Trustworthy 3The Day convolution of two contravariant functors. Construct the Day convolution   \$ ( f g) = f  % ( f g) = g ?Break apart the Day convolution of two contravariant functors. ?Day convolution provides a monoidal product. The associativity  of this monoid is witnessed by  and  .    .   = =    .  = =    f >  =  >   f  ?Day convolution provides a monoidal product. The associativity  of this monoid is witnessed by  and  .    .   = =    .  = =    f >   =   >   f !The monoid for Day convolution  in Haskell is symmetric.     f > ! = ! >   f "-Proxy serves as the unit of Day convolution.   \$ > " = =    f > " = " >   f #-Proxy serves as the unit of Day convolution.   % > # = =    f > # = # >   f \$PIn Haskell we can do general purpose elimination, but in a more general setting , it is only possible to eliminate the unit.   \$ > " = =  \$ = ? >     f > \$ = \$ >   f %PIn Haskell we can do general purpose elimination, but in a more general setting , it is only possible to eliminate the unit.    % > # = =  % = @ >     f > % = % >   f   &!Diagonalize the Day convolution:   \$ > & = =  % > & = =  'runDay > & = a -> (a,a)    f . & = & .   f 'KApply a natural transformation to the left-hand side of a Day convolution. IThis respects the naturality of the natural transformation you supplied:     f > ' fg = ' fg >   f (LApply a natural transformation to the right-hand side of a Day convolution. IThis respects the naturality of the natural transformation you supplied:     f > ( fg = ( fg >   f A !"#\$%&'(BC !"#\$%&'( !"#\$%&'(A !"#\$%&'(BCD       !"#\$%&'%&()*+,-./0123456789:;<+,=+,>+?@+?ABCDEcontravariant-0.4.4Data.Functor.Contravariant"Data.Functor.Contravariant.ComposeData.Functor.Contravariant.DayOpgetOp EquivalencegetEquivalence Comparison getComparison Predicate getPredicate Contravariant contramap>\$<>\$\$<defaultComparisondefaultEquivalence ComposeCF getComposeCF ComposeFC getComposeFCCompose getComposeDaydayrunDayassocdisassocswappedintro1intro2day1day2diagtrans1trans2ghc-prim GHC.Classescompare==\$fContravariantEquivalence\$fContravariantComparisonbaseGHC.BaseFunctor\$fContravariantPredicate\$fContravariantOp \$fCategoryOp\$fContravariantProxy\$fContravariantReverse\$fContravariantBackwards\$fContravariantCompose\$fContravariantConst\$fContravariantConstant\$fContravariantProduct\$fFunctorComposeCF\$fContravariantComposeCF\$fFunctorComposeFC\$fContravariantComposeFC\$fFunctorComposeid. Data.TuplefstsnddayTyCon\$fContravariantDay\$fTypeable1Day