hb6      !"#$%&'()*+,-./012345GADTs provisionalEdward Kmett <ekmett@gmail.com> Safe-Inferred Coend of  from  Hask -> Hask. portable provisionalEdward Kmett <ekmett@gmail.com>UnsafeFormally, the class  represents a profunctor  from Hask -> Hask. HIntuitively it is a bifunctor where the first argument is contravariant ' and the second argument is covariant. You can define a  by either defining  or by defining both   and . If you supply , you should ensure that:   6 6 "a 6If you supply  and  , ensure:     6 "a 6   6 "a 6 ,If you supply both, you should also ensure:   f g "a  f 7  gThese ensure by parametricity:    (f 7 g) (h 7 i) "a  g h 7  f i   (f 7 g) "a  g 7  f   (f 7 g) "a  f 7  g *Map over both arguments at the same time.  f g "a  f 7  g(Map the first argument contravariantly.  f "a  f 6%Map the second argument covariantly.  "a  6*Strictly map the second argument argument - covariantly with a function that is assumed / operationally to be a cast, such as a newtype  constructor. Note: This operation is explicitly unsafe + since an implementation may choose to use  8 to implement this combinator 2 and it has no way to validate that your function  meets the requirements. &If you implement this combinator with  8$, then you are taking upon yourself  the obligation that you don't use GADT-like  tricks to distinguish values. If you import Data.Profunctor.Unsafe you are . taking upon yourself the obligation that you 3 will only call this with a first argument that is  operationally identity. 7The semantics of this function with respect to bottoms & should match the default definition: (  ) "a \f -> \p -> p `seq`  f p)Strictly map the first argument argument 1 contravariantly with a function that is assumed / operationally to be a cast, such as a newtype  constructor. Note: This operation is explicitly unsafe + since an implementation may choose to use  8 to implement this combinator 2 and it has no way to validate that your function  meets the requirements. &If you implement this combinator with  8$, then you are taking upon yourself  the obligation that you don't use GADT-like  tricks to distinguish values. If you import Data.Profunctor.Unsafe you are . taking upon yourself the obligation that you 4 will only call this with a second argument that is  operationally identity. () "a \p -> p `seq` \f ->  f p 9:;<9:;<portable provisionalEdward Kmett <ekmett@gmail.com> TrustworthyThe generalization of  of a "costrong" = Minimal complete definition:   or   Note: We use > and ?& as approximate costrength as needed.  Generalizing upstar of a strong = Minimal complete definition:   or   Note: Every = in Haskell is strong. Wrap an arrow for use as a . Lift a = into a  (backwards). Lift a = into a  (forwards). @A approximates  costrength B? approximates  costrength . CDE@BFGHIJKLMNOPQRSTUVWXYZ[\   "  CDE@BFGHIJKLMNOPQRSTUVWXYZ[\ Type-Families provisionalEdward Kmett <ekmett@gmail.com> TrustworthyA  p is  if there exists a = f such that  p d c is isomorphic to f d -> c. A  p is  if there exists a = f such that  p d c is isomorphic to d -> f c. "  and !$ form two halves of an isomorphism. /This can be used with the combinators from the lens package. " ::  p => Iso' (d ->  p c) (p d c)# and $ form two halves of an isomorphism. /This can be used with the combinators from the lens package. " ::  f p => Iso' (f d -> c) (p d c)] !"#^_`abcd  !"#  !"# ] !"#^_`abcdGADTs provisionalEdward Kmett <ekmett@gmail.com> Trustworthy$$ p q is the  composition of the  s p and q. For a good explanation of  composition in Haskell  see Dan Piponi' s article:  :http://blog.sigfpe.com/2011/07/profunctors-in-haskell.html '(->)! functions as a lax identity for  composition. This provides an e for the lens package that witnesses the  isomorphism between $ (->) q d c and q d c, which  is the left identity law.   ' ::  q => Iso' ($ (->) q d c) (q d c) ((->)! functions as a lax identity for  composition. This provides an e for the lens package that witnesses the  isomorphism between $ q (->) d c and q d c, which  is the right identity law.   ( ::  q => Iso' ($ q (->) d c) (q d c) ) composition generalizes = composition in two ways. $This is the first, which shows that exists b. (a -> f b, b -> g c) is  isomorphic to  a -> f (g c). ) :: = f => Iso' ($ ( f) ( g) d c) ( (f f g) d c)* composition generalizes = composition in two ways. %This is the second, which shows that exists b. (f a -> b, g b -> c) is  isomorphic to  g (f a) -> c. * :: = f => Iso' ($ ( f) ( g) d c) ( (f g f) d c)+This is a variant on ) that uses g instead of . + :: h f => Iso' ($ (g f) (g g) d c) (g (f f g) d c),This is a variant on * that uses i instead  of . , :: = f => Iso' ($ (i f) (i g) d c) (i (f g f) d c)jThe composition of two  s is  by + the composition of their representations. $%e&'()*+,klmjno $%&'()*+, $%&'()+*,$%e&'()*+,klmjno Rank2Types provisionalEdward Kmett <ekmett@gmail.com> Trustworthy-(This represents the right Kan lift of a  q along a  p in a limited version of the 2-category of Profunctors where the only object is the category Hask, 1-morphisms are profunctors composed and compose with Profunctor composition, and 2-morphisms are just natural transformations. 0.The 2-morphism that defines a right Kan lift.  Note: When f is left adjoint to - f (->) then 0 is the counit of the adjunction. p- p p forms a h in the . 2-category, which is isomorphic to a Haskell q instance. -./01prs-./01-./01-./01prsMPTCs provisionalEdward Kmett <ekmett@gmail.com> Trustworthy2The cograph of a . 2345tuv234525432543tuvw      !"#$%&'())*+,-./01123456789:;9:<9=>?@AB9CD9EFGHIJ9EKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmngopq9rs9CtGHuvwxyz{|9:}~profunctors-4.0.1Data.Profunctor.TraceData.Profunctor.UnsafeData.ProfunctorData.Profunctor.RepData.Profunctor.CompositionData.Profunctor.RiftData.Profunctor.Collage ProfunctorProfuctor.Unsafe#.Tracedimaplmaprmap.#Choiceleft'right'Strongfirst'second'Forget runForget WrappedArrow WrapArrow unwrapArrowDownStar runDownStarUpStar runUpStarCorepresentableCorep cotabulatecorep RepresentableReptabulaterep tabulated cotabulated Procompose procomposedidlidrupstars downstarskleislis cokleislisRiftrunRift decomposeRiftprecomposeRiftCollageCRLbaseControl.Categoryid. Unsafe.Coerce unsafeCoerce$fProfunctorCokleisli$fProfunctorKleisli$fProfunctorTagged$fProfunctor(->)GHC.BaseFunctorData.Traversabletraverse comonad-4.0Control.Comonadextract$fChoiceDownStarsequence$fChoiceCokleisli$fChoiceForget$fChoiceWrappedArrow$fChoiceTagged$fChoiceUpStar$fChoiceKleisli $fChoice(->)$fStrongForget$fStrongWrappedArrow$fStrongUpStar$fStrongKleisli $fStrong(->)$fTraversableForget$fFoldableForget$fFunctorForget$fProfunctorForget$fProfunctorWrappedArrow$fArrowLoopWrappedArrow$fArrowApplyWrappedArrow$fArrowChoiceWrappedArrow$fArrowZeroWrappedArrow$fArrowWrappedArrow$fCategoryWrappedArrow$fFunctorDownStar$fProfunctorDownStar$fFunctorUpStar$fProfunctorUpStarIso$fCorepresentableDownStar$fCorepresentableTagged$fCorepresentableCokleisli$fCorepresentable(->)$fRepresentableUpStar$fRepresentableKleisli$fRepresentable(->)transformers-0.3.0.0Data.Functor.ComposeCompose Control.ArrowKleisliMonad Cokleisli$fRepresentableProcompose$fChoiceProcompose$fStrongProcompose$fCorepresentableProcompose$fFunctorProcompose$fProfunctorProcompose$fCategoryRiftCategory $fFunctorRift$fProfunctorRift $fObCollageR $fObCollageL$fSemigroupoidCollage