From 794b8749deb27b23229cdab97c3eca249032936d Mon Sep 17 00:00:00 2001 From: "Kai(luo) Wang" Date: Thu, 9 Mar 2017 10:02:19 -0500 Subject: [PATCH 1/2] added `MonadError` and `ApplicativeError` to hierarchy diagram --- docs/src/main/tut/typeclasses/typeclasses.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/src/main/tut/typeclasses/typeclasses.md b/docs/src/main/tut/typeclasses/typeclasses.md index 1435422656..af89f0fb4f 100644 --- a/docs/src/main/tut/typeclasses/typeclasses.md +++ b/docs/src/main/tut/typeclasses/typeclasses.md @@ -221,9 +221,7 @@ val result = Monoid[Int].combine(sumLeft, sumRight) Cats provides laws for type classes via the `kernel-laws` and `laws` modules which makes law checking type class instances easy. -## Further reading -* [Returning the "Current" Type in Scala][fbounds] - +## Typeclass Hierarchy ![Typeclass hierarchy](http://g.gravizo.com/g? digraph G { size ="6,6"; @@ -243,10 +241,15 @@ type class instances easy. CoflatMap [group=g5] Comonad [group=g5] Bimonad [group=g5] + MonadError [group=g6] + ApplicativeError [group=g6] Functor -> Apply -> Applicative -> Monad -> MonadFilter -> MonadCombine Applicative -> Alternative -> MonadCombine MonoidK -> Alternative Functor -> CoflatMap + ApplicativeError -> MonadError + Monad -> MonadError + Applicative -> ApplicativeError subgraph cluster_s3{ Invariant -> Contravariant graph[style=dotted,label="functor"] @@ -268,5 +271,10 @@ type class instances easy. } ) +## Further reading +* [Returning the "Current" Type in Scala][fbounds] + + + [fbounds]: http://tpolecat.github.io/2015/04/29/f-bounds.html "Returning the "Current" Type in Scala" [simulacrum]: https://github.com/mpilquist/simulacrum "First class syntax support for type classes in Scala" From ac9059cf40e26e4181ea91cba8de542b2d963f44 Mon Sep 17 00:00:00 2001 From: "Kai(luo) Wang" Date: Thu, 9 Mar 2017 10:04:33 -0500 Subject: [PATCH 2/2] minor - simplify the paths --- docs/src/main/tut/typeclasses/typeclasses.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/src/main/tut/typeclasses/typeclasses.md b/docs/src/main/tut/typeclasses/typeclasses.md index af89f0fb4f..ab75a14b46 100644 --- a/docs/src/main/tut/typeclasses/typeclasses.md +++ b/docs/src/main/tut/typeclasses/typeclasses.md @@ -247,9 +247,8 @@ type class instances easy. Applicative -> Alternative -> MonadCombine MonoidK -> Alternative Functor -> CoflatMap - ApplicativeError -> MonadError + Applicative -> ApplicativeError -> MonadError Monad -> MonadError - Applicative -> ApplicativeError subgraph cluster_s3{ Invariant -> Contravariant graph[style=dotted,label="functor"]