jXIo      !"#$%&'()*+,-./01234 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W XYZ[\]^_`abcdefghijklmn Safe-Inferredportable provisionalEdward Kmett <ekmett@gmail.com>Safe  duplicated = extended id 2 fmap (fmap f) . duplicated = duplicated . fmap f  # extended f = fmap f . duplicated opqrstuvwxyz{|opqrstuvwxyz{|portable provisionalEdward Kmett <ekmett@gmail.com> Trustworthy A } sans ~. Minimal definition: Either   or   OIf defining both, then the following laws (the default definitions) must hold:   join = (>>- id)  m >>- f = join (fmap f m) Laws:  4 induced definition of <.>: f <.> x = f >>- (<$> x) 1Finally, there are two associativity conditions:  G associativity of (>>-): (m >>- f) >>- g == m >>- (\x -> f x >>- g) ; associativity of join: join . join = join . fmap join ?These can both be seen as special cases of the constraint that ; associativity of (->-): (f ->- g) ->- h = f ->- (g ->- h) 8Transform a Apply into an Applicative by adding a unit. Wrap an  to be used as a member of  (A strong lax semi-monoidal endofunctor.  This is equivalent to an  without . Laws: B associative composition: (.) <$> u <.> v <.> w = u <.> (v <.> w)   a .> b = const id <$> a <.> b   a <. b = const <$> a <.> b  A variant of  with the arguments reversed. 3Lift a binary function into a comonad with zipping 4Lift a ternary function into a comonad with zipping An  is not a }, but it is an instance of  A  is not a }, but it is an instance of  An IntMap is not , but it is an instance of   A Map is not , but it is an instance of  \    S  portable provisionalEdward Kmett <ekmett@gmail.com> Safe-Inferred1A subset of monad transformers can transform any  as well.  portable provisionalEdward Kmett <ekmett@gmail.com> Trustworthy% sans   Ahttp://en.wikipedia.org/wiki/Band_(mathematics)#Rectangular_bands  !"#$%& !"#$%&%&"#$ !  !"#$%&portable provisionalEdward Kmett <ekmett@gmail.com> Safe-Inferred'()'()'()'() Trustworthy*semigroupoid with inverses. This technically should be a category with inverses, except we need to use Ob to define the valid objects for the category *+*+*+*+ Trustworthy,-./,-./,-./,-./ Safe-Inferred0123012301230123  Safe-Inferred 456789:456789:874659:465789: non-portable (flexible MPTCs) experimentalEdward Kmett <ekmett@gmail.com> Safe-Inferred;<;<;<;<portable provisionalEdward Kmett <ekmett@gmail.com>Safe  portable provisionalEdward Kmett <ekmett@gmail.com> Safe-InferredCEUsable default for foldMap, but only if you define foldMap1 yourself =>?@ABC=>?@ABC=>?@ABC=>?@ABC portable provisionalEdward Kmett <ekmett@gmail.com> Safe-Inferred DEFGDEFGDEFG DEFG SafeH<Used to map a more traditional bifunctor into a semifunctor PRSemifunctors map objects to objects, and arrows to arrows preserving connectivity S as normal functors, but do not purport to preserve identity arrows. We apply them $ to semigroupoids, because those don''t even claim to offer identity arrows! HIJKLMNOPQRSTUVW     # !"#$%&0123;<HIJKLMNOPQRSTUVWPQHIRSTUVWMNOJKLHIJKLMNOPQRSTUVW      MPTCs, GADTs experimentalEdward Kmett <ekmett@gmail.com> Safe-InferredXYZ[\]^_XYZ[\]^_Z[\]XY^_XYZ[\]^_ MPTCs, GADTs experimentalEdward Kmett <ekmett@gmail.com>Safe`abcde !"#$%`abcdeabcd`e`abcde !"#$%portable provisionalEdward Kmett <ekmett@gmail.com>SafefLaws:  C <!> is associative: (a <!> b) <!> c = a <!> (b <!> c) K <$> left-distributes over <!>: f <$> (a <!> b) = (f <$> a) <!> (f <$> b) If extended to an & then g should equal '. Ideally, an instance of f also satisfies the "left distributon" law of  MonadPlus with respect to  .:  K <.> right-distributes over <!>: (a <!> b) <.> c = (a <.> c) <!> (b <.> c) But (, ), * a, + e m, and STM satisfy the alternative  " left catch" law instead:   pure a <!> b = pure a PHowever, this variation cannot be stated purely in terms of the dependencies of f. IWhen and if MonadPlus is successfully refactored, this class should also * be refactored to remove these instances. BThe right distributive law should extend in the cases where the a  or } is = provided to yield variations of the right distributive law: + (m <!> n) >>- f = (m >>- f) <!> (m >>- f) + (m <!> n) >>= f = (m >>= f) <!> (m >>= f) g( |) without a required empty ,-This instance does not actually satisfy the ( .) right distributive law  It instead satisfies the  Left-Catch law fghi-./0123456789:;<=>?@A,B fghifghifghi-./0123456789:;<=>?@A,Bportable provisionalEdward Kmett <ekmett@gmail.com>SafejLaws:   zero <!> m = m  m <!> zero = m If extended to an & then k should equal C. jkDEFGHIJKLMNOPQRSTUVWX fghijkjkjkDEFGHIJKLMNOPQRSTUVWX TrustworthylmnYZ[\]^_`abcdelmnlmnlmnYZ[\]^_`abcdef !"#$%%&'()*+,-./01234567889:;<=>??@ABCCDEFGHI J K L K L M N O P Q R S T U V W X Y Z [ \ \ ] ^ _ ` a b c d e f g h i jklmnopqrstuvwxyz{|}~                                   ! " # $%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~semigroupoids-4.0Data.Functor.BindData.Functor.ExtendData.Functor.Bind.TransData.SemigroupoidData.Semigroupoid.Dual Data.GroupoidData.IsomorphismData.Semigroupoid.ProductData.Semigroupoid.CoproductData.Semigroupoid.ObData.Semigroup.FoldableData.Semigroup.TraversableData.SemifunctorData.Semifunctor.AssociativeData.Semifunctor.BraidedData.Functor.AltData.Functor.PlusData.Semigroupoid.StaticData.Traversable.InstancesData.Functor.ApplybaseGHC.BasefmapFunctor Data.Functor<$><$ comonad-4.0Control.Comonad$>Extend duplicatedextendedBind>>-join MaybeApply runMaybeApplyWrappedApplicativeWrapApplicativeunwrapApplicativeApply<.>.><.<..>liftF2liftF3 returning-<<->--<- apDefault BindTransliftBSemigetSemiWrappedCategory WrapCategoryunwrapCategory SemigroupoidoDualgetDualGroupoidinvIsoembedprojectProductPairdistributeDualProductfactorDualProduct CoproductRLdistributeDualCoproductfactorDualCoproductObsemiid Foldable1fold1foldMap1 traverse1_for1_ sequenceA1_foldMapDefault1 Traversable1 traverse1 sequence1foldMap1DefaultBiWrappedTraversable1WrapTraversable1unwrapTraversable1WrappedFunctor WrapFunctor unwrapFunctor Semifunctorsemimap# semibimap semifirst semisecondfirstsecondDisassociative disassociate Associative associatekleisliAssociatecokleisliAssociatekleisliDisassociatecokleisliDisassociate SymmetricBraidedbraid kleisliBraidcokleisliBraidswapAltsomemanyPluszeroStatic runStatic$fExtendNonEmpty$fExtendIdentityT$fExtendIdentity$fExtendTracedT$fExtendStoreT $fExtendEnvT$fExtendCoproduct $fExtendTree $fExtendSeq $fExtend(->) $fExtend(,)$fExtendEither $fExtendMaybe $fExtend[]MonadreturnControl.Applicative Applicativepure $fBindIntMapcontainers-0.5.0.0Data.IntMap.BaseIntMap $fBindMap Data.Map.BaseMap $fApplyIntMap $fApplyMap $fBindTree $fBindSeq $fBindContT $fBindRWST $fBindRWST0 $fBindStateT $fBindStateT0 $fBindWriterT$fBindWriterT0 $fBindReaderT $fBindErrorT $fBindListT $fBindMaybeT$fBindWrappedMonad$fBindIdentityT$fBindIdentity $fBindOption $fBindMaybe$fBindIO$fBindNonEmpty$fBind[] $fBind(->) $fBindProduct $fBindEither $fBind(,)$fApplyCokleisli$fComonadMaybeApply$fExtendMaybeApply$fApplicativeMaybeApply$fApplyMaybeApply$fFunctorMaybeApply$fAlternativeWrappedApplicative$fApplicativeWrappedApplicative$fApplyWrappedApplicative$fFunctorWrappedApplicative$fApplyTracedT $fApplyStoreT $fApplyEnvT $fApplyContT $fApplyRWST $fApplyRWST0 $fApplyStateT$fApplyStateT0$fApplyWriterT$fApplyWriterT0 $fApplyListT$fApplyReaderT $fApplyErrorT $fApplyMaybeT $fApplyTree $fApplySeq$fApplyWrappedArrow$fApplyWrappedMonad$fApplyIdentityT$fApplyIdentity $fApplyOption $fApplyMaybe $fApplyIO $fApply[]$fApplyZipList $fApply(->) $fApplyConst $fApplyEither$fApplyNonEmpty $fApply(,)$fApplyProduct$fApplyCompose$fBindTransContT$fBindTransRWST$fBindTransRWST0$fBindTransStateT$fBindTransStateT0$fBindTransWriterT$fBindTransWriterT0$fBindTransReaderT$fBindTransIdentityTControl.CategoryCategoryid$fSemigroupoid(,)$fCategorySemi$fSemigroupoidSemi$fCategoryWrappedCategory$fSemigroupoidWrappedCategory$fSemigroupoidOp$fSemigroupoidCokleisli$fSemigroupoidKleisli$fSemigroupoid(->)$fCategoryDual$fSemigroupoidDual$fGroupoidDual $fCategoryIso $fGroupoidIso$fSemigroupoidIso$fGroupoidProduct$fSemigroupoidProduct$fGroupoidCoproduct$fSemigroupoidCoproduct $fOb(->)a$fObCokleislia $fObKleislia$fObCoproductR$fObCoproductL$fObProduct(,)ActgetAct $fFunctorAct$fSemigroupAct$fFoldable1NonEmpty$fFoldable1Coproduct$fFoldable1Product$fFoldable1Compose$fFoldable1IdentityT$fFoldable1Identity$fFoldable1Tree$fTraversable1NonEmpty$fTraversable1Tree$fTraversable1Coproduct$fTraversable1Product$fTraversable1Compose$fTraversable1IdentityT$fTraversable1IdentityfstPsndPleftright$fSemifunctorBiProductCokleisli$fSemifunctorBiProductKleisli$fSemifunctorBiProductKleisli0$fSemifunctorBiProduct(->)$fSemifunctorBiProduct(->)0$fSemifunctorfDualDual.$fSemifunctorWrappedTraversable1KleisliKleisli-$fSemifunctorWrappedFunctorCokleisliCokleisli)$fSemifunctorWrappedFunctorKleisliKleisli#$fSemifunctorWrappedFunctor(->)(->)>>><<<.$fDisassociativeCokleisliBi$fDisassociativeKleisliBi$fDisassociativeKleisliBi0$fDisassociative(->)Bi$fDisassociative(->)Bi0$fAssociativeCokleisliBi$fAssociativeKleisliBi$fAssociativeKleisliBi0$fAssociative(->)Bi$fAssociative(->)Bi0$fSymmetricCokleisliBi$fSymmetricKleisliBi$fSymmetricKleisliBi0$fSymmetric(->)Bi$fSymmetric(->)Bi0$fBraidedCokleisliBi$fBraidedKleisliBi$fBraidedKleisliBi0$fBraided(->)Bi$fBraided(->)Bi0 Alternative<|> Data.MaybeMaybeghc-prim GHC.TypesIO Data.EitherEithertransformers-0.3.0.0Control.Monad.Trans.ErrorErrorT$fAltIO $fAltRWST $fAltRWST0 $fAltWriterT $fAltWriterT0 $fAltStateT $fAltStateT0 $fAltListT $fAltErrorT $fAltMaybeT $fAltReaderT$fAltIdentityT$fAltWrappedApplicative $fAltNonEmpty$fAltSeq $fAltIntMap$fAltMap$fAltWrappedArrow$fAltWrappedMonad $fAltOption $fAltMaybe$fAlt[] $fAltEitherempty $fPlusRWST $fPlusRWST0 $fPlusWriterT$fPlusWriterT0 $fPlusStateT $fPlusStateT0 $fPlusListT $fPlusErrorT $fPlusMaybeT $fPlusReaderT$fPlusIdentityT$fPlusWrappedApplicative $fPlusSeq $fPlusIntMap $fPlusMap$fPlusWrappedArrow$fPlusWrappedMonad $fPlusOption $fPlusMaybe$fPlus[]$fPlusIO$fArrowChoiceStatic$fArrowPlusStatic$fArrowZeroStatic $fArrowStatic$fCategoryStatic$fSemigroupoidStatic$fComonadStatic$fExtendStatic$fApplicativeStatic $fPlusStatic $fAltStatic $fApplyStatic$fFunctorStatic