Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions docs/src/main/tut/typeclasses/parallel.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
digraph parallel {
node [shape=none, fontname=courier]
edge [fontname=courier]

label=<Parallel[<font color="red3">M</font>[_]] { type <font color="green3">F</font>[_] }<br/><br/>>
labelloc=top
fontname="courier-bold"

subgraph cluster_parallel {
label=""
color=white

F [label=<<font color="green3">F</font>[_]>]
M [label=<<font color="red3">M</font>[_]>]

M:ne -> F:nw [label="parallel", fontcolor=green3]
F -> M:se [label="sequential", fontcolor=red3]

{ rank=same M F }
}

subgraph cluster_tc {
label=""
color=white

Ap [label=<Applicative[<font color="green3">F</font>&#93;>]
Monad [label=<Monad[<font color="red3">M</font>&#93;>]
}

F -> Ap [style=dotted dir=none]
M -> Monad [style=dotted dir=none]

{ rank=same Monad Ap }
}
2 changes: 2 additions & 0 deletions docs/src/main/tut/typeclasses/parallel.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ trait Parallel[M[_]] {
```
Where `M[_]` has to have an instance of `Monad` and `F[_]` an instance of `Applicative`.

![The `Parallel` typeclass transforms between `Monad` `M[_]` and `Applicative` `F[_]`.](../img/parallel.png)

Recall that `~>` is just an alias for [`FunctionK`](../datatypes/functionk.html).
This allows us to get rid of most of our boilerplate from earlier:

Expand Down