Skip to content

Instantly share code, notes, and snippets.

@mattroberts297
Created August 3, 2017 13:03
Show Gist options
  • Save mattroberts297/8e733546023894a9f4b14232c057f3a7 to your computer and use it in GitHub Desktop.
Save mattroberts297/8e733546023894a9f4b14232c057f3a7 to your computer and use it in GitHub Desktop.
Cats class diagrams
@startuml
skinparam monochrome true
skinparam classFontSize 16
skinparam classFontStyle "Regular"
skinparam classFontName "Gill Sans"
skinparam classAttributeFontSize 14
skinparam classAttributeFontStyle "Regular"
skinparam classAttributeFontName "Gill Sans"
interface "Functor[F[_]]" {
map[A, B](fa: F[A])(f: A => B): F[B]
}
interface "Cartesian[F[_]]" {
product[A, B](fa: F[A], fb: F[B]): F[(A, B)]
}
interface "Apply[F[_]]" {
ap[A, B](ff: F[A => B])(fa: F[A]): F[B]
}
interface "Applicative[F[_]]" {
pure[A](x: A): F[A]
}
interface "FlatMap[F[_]]" {
flatMap[A, B](fa: F[A])(f: A => F[B]): F[B]
}
interface "Monad[F[_]]" {
map[A, B](fa: F[A])(f: A => B): F[B]
}
"Functor[F[_]]" <|-- "Apply[F[_]]"
"Cartesian[F[_]]" <|-- "Apply[F[_]]"
"Apply[F[_]]" <|-- "Applicative[F[_]]"
"Apply[F[_]]" <|-- "FlatMap[F[_]]"
"FlatMap[F[_]]" <|-- "Monad[F[_]]"
"Applicative[F[_]]" <|-- "Monad[F[_]]"
@enduml
@mattroberts297
Copy link
Author

mattroberts297 commented Aug 3, 2017

Monad.png

monad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment