Skip to content

Commit

Permalink
Merge pull request #566 from philwills/kleisli-doc-tweaks
Browse files Browse the repository at this point in the history
Edit Kleisli intro for brevity
  • Loading branch information
non committed Oct 12, 2015
2 parents 57f4ccb + 61654f8 commit a7b845e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions docs/src/main/tut/kleisli.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ source: "https://github.com/non/cats/blob/master/core/src/main/scala/cats/data/K
scaladoc: "#cats.data.Kleisli"
---
# Kleisli
Kleisli is a data type that will come in handy often, especially if you are working with monadic functions.
Monadic functions are functions that return a monadic value - for instance, a function may return an
`Option[Int]` or an `Xor[String, List[Double]]`.

How then do we compose these functions together nicely? We cannot use the usual `compose` or `andThen` methods
without having functions take an `Option` or `Xor` as a parameter, which can be strange and unwieldy.
Kleisli enables composition of functions that return a monadic value, for instance an `Option[Int]`
or a `Xor[String, List[Double]]`, without having functions take an `Option` or `Xor` as a parameter,
which can be strange and unwieldy.

We may also have several functions which depend on some environment and want a nice way to compose these functions
to ensure they all receive the same environment. Or perhaps we have functions which depend on their own "local"
Expand Down

0 comments on commit a7b845e

Please sign in to comment.