Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve docs to better explain monads #956

Merged
merged 34 commits into from Aug 1, 2018
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
cdae386
Redo intro to typeclasses to embed better on glossary
Jul 28, 2018
ad45074
Rephrase comprehensions to explain things before introducing Monad
Jul 28, 2018
519f7fe
Add Monad docs
Jul 28, 2018
322ff7b
First pass at the mword tutorial
Jul 28, 2018
db28f3e
Translate snippets
Jul 28, 2018
39b756a
Some tweaks here and there
Jul 28, 2018
42a125f
Add menu entry
Jul 28, 2018
1fba857
Add linkback to mword from comprehensions
Jul 28, 2018
a1c70f8
Proper brackets
Jul 28, 2018
67effee
Fix Future class
Jul 28, 2018
be39c6a
Fix flatMap
Jul 28, 2018
65822e3
Fix casing
Jul 28, 2018
c25aca3
Add new section on typeclasses. Rename folder to monads
Jul 28, 2018
baec9a4
Wording
Jul 28, 2018
0ef582b
Add clarification that typeclasses are lingua franca
Jul 28, 2018
68eeeca
Fix menu entry for Monads
Jul 28, 2018
2779aa2
Fixes in code review
Jul 28, 2018
c8ee7da
Typo
Jul 28, 2018
47f6351
Typos
Jul 28, 2018
9314838
Merge branch 'master' into paco-docsafterhadi
pakoito Jul 29, 2018
c946945
Improve task example
Jul 29, 2018
056d4ec
Merge remote-tracking branch 'origin/paco-docsafterhadi' into paco-do…
Jul 29, 2018
ae5b11d
Fix wording for flatten
Jul 29, 2018
66d1589
Merge branch 'master' into paco-docsafterhadi
pakoito Jul 29, 2018
d2c4607
Close lambdas. Improve comprehensions.
Jul 29, 2018
4adc3dc
Fix wrong API
Jul 29, 2018
7dbe192
Fix Eugenio's concerns
Jul 31, 2018
1c75ffc
More of Eugenio's fixes
Jul 31, 2018
f4ade89
Merge branch 'master' into paco-docsafterhadi
pakoito Jul 31, 2018
03a20c7
Merge branch 'master' into paco-docsafterhadi
Jul 31, 2018
b637ad3
Fix Hadi's concerns
Aug 1, 2018
8103d3e
Fix Hadi's concerns
Aug 1, 2018
41f03d5
Add paragraph about what monads are available
Aug 1, 2018
25b84f0
Merge branch 'master' into paco-docsafterhadi
pakoito Aug 1, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Expand Up @@ -7,7 +7,11 @@
[![codecov](https://codecov.io/gh/arrow-kt/arrow/branch/master/graph/badge.svg)](https://codecov.io/gh/arrow-kt/arrow)

Λrrow is a library for Typed Functional Programming in Kotlin.
It includes the most popular data types, type classes and abstractions such as `Option`, `Try`, `Either`, `IO`, `Functor`, `Applicative`, `Monad` and many more empowering users to define pure FP apps and libraries built atop higher order abstractions. Use the below list to learn more about Λrrow's main features.

Arrow aims to provide a *lingua franca* of interfaces and abstractions across Kotlin libraries.
Copy link
Contributor

@Takhion Takhion Jul 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[same as this]

For this, it includes the most popular data types, type classes and abstractions such as `Option`, `Try`, `Either`, `IO`, `Functor`, `Applicative`, `Monad` to empower users to define pure FP apps and libraries built atop higher order abstractions.

Use the list below to learn more about Λrrow's main features.

- [Documentation](http://arrow-kt.io)
- [Patterns](http://arrow-kt.io/docs/patterns/glossary/): tutorials and approaches to day-to-day challenges using FP
Expand Down
28 changes: 14 additions & 14 deletions infographic/arrow-infographic.txt
Expand Up @@ -17,20 +17,29 @@
[<typeclasses>Monad]<-[<typeclasses>MonadError]
[<typeclasses>Applicative]<-[<typeclasses>Monad]
[<typeclasses>Semigroup]<-[<typeclasses>Monoid]
[<typeclasses>Functor]<-[<typeclasses>Traverse]
[<typeclasses>Foldable]<-[<typeclasses>Traverse]
[<typeclasses>Async]<-[<instances>Async Instances|IOAsyncInstance|DeferredKAsyncInstance|FluxKAsyncInstance|MonoKAsyncInstance|FlowableKAsyncInstance|MaybeKAsyncInstance|ObservableKAsyncInstance|SingleKAsyncInstance]
[<typeclasses>Effect]<-[<instances>Effect Instances|IOEffectInstance|DeferredKEffectInstance|FluxKEffectInstance|MonoKEffectInstance|FlowableKEffectInstance|MaybeKEffectInstance|ObservableKEffectInstance|SingleKEffectInstance]
[<typeclasses>MonadDefer]<-[<instances>MonadDefer Instances|IOMonadDeferInstance|DeferredKMonadDeferInstance|FluxKMonadDeferInstance|MonoKMonadDeferInstance|FlowableKMonadDeferInstance|MaybeKMonadDeferInstance|ObservableKMonadDeferInstance|SingleKMonadDeferInstance]
[<typeclasses>Monad]<-[<typeclasses>Bimonad]
[<typeclasses>Comonad]<-[<typeclasses>Bimonad]
[<typeclasses>Functor]<-[<typeclasses>Comonad]
[<typeclasses>Functor]<-[<typeclasses>Traverse]
[<typeclasses>Foldable]<-[<typeclasses>Traverse]
[<typeclasses>SemigroupK]<-[<typeclasses>MonoidK]
[<typeclasses>MonoidK]<-[<instances>MonoidK Instances|ListKMonoidKInstance|OptionTMonoidKInstance|SequenceKMonoidKInstance|SetKMonoidKInstance|WriterTMonoidKInstance]
[<typeclasses>SemigroupK]<-[<instances>SemigroupK Instances|EitherSemigroupKInstance|ListKSemigroupKInstance|NonEmptyListSemigroupKInstance|OptionTSemigroupKInstance|SequenceKSemigroupKInstance|SetKSemigroupKInstance|StateTSemigroupKInstance|ValidatedSemigroupKInstance|WriterTSemigroupKInstance]
[<typeclasses>Bimonad]<-[<instances>Bimonad Instances|EvalBimonadInstance|Function0BimonadInstance|IdBimonadInstance|NonEmptyListBimonadInstance]
[<typeclasses>Foldable]<-[<instances>Foldable Instances|ConstFoldableInstance|EitherFoldableInstance|IdFoldableInstance|OptionFoldableInstance|TryFoldableInstance|Tuple2FoldableInstance|CoproductFoldableInstance|IorFoldableInstance|ListKFoldableInstance|MapKFoldableInstance|NonEmptyListFoldableInstance|OptionTFoldableInstance|SequenceKFoldableInstance|SetKFoldableInstance|SortedMapKFoldableInstance|ValidatedFoldableInstance]
[<typeclasses>Traverse]<-[<instances>Traverse Instances|ConstTraverseInstance|EitherTraverseInstance|IdTraverseInstance|OptionTraverseInstance|TryTraverseInstance|Tuple2TraverseInstance|CoproductTraverseInstance|IorTraverseInstance|ListKTraverseInstance|MapKTraverseInstance|NonEmptyListTraverseInstance|OptionTTraverseInstance|SequenceKTraverseInstance|SortedMapKTraverseInstance|ValidatedTraverseInstance]
[<typeclasses>Eq]<-[<instances>Eq Instances|ConstEqInstance|EitherEqInstance|IdEqInstance|OptionEqInstance|TryEqInstance|Tuple10EqInstance|Tuple2EqInstance|Tuple3EqInstance|Tuple4EqInstance|Tuple5EqInstance|Tuple6EqInstance|Tuple7EqInstance|Tuple8EqInstance|Tuple9EqInstance|IorEqInstance|ListKEqInstance|MapKEqInstance|NonEmptyListEqInstance|SequenceKEqInstance|SetKEqInstance|ValidatedEqInstance]
[<typeclasses>Show]<-[<instances>Show Instances|ConstShowInstance|EitherShowInstance|IdShowInstance|OptionShowInstance|TryShowInstance|Tuple10ShowInstance|Tuple2ShowInstance|Tuple3ShowInstance|Tuple4ShowInstance|Tuple5ShowInstance|Tuple6ShowInstance|Tuple7ShowInstance|Tuple8ShowInstance|Tuple9ShowInstance|IorShowInstance|ListKShowInstance|MapKShowInstance|NonEmptyListShowInstance|SequenceKShowInstance|SetKShowInstance|SortedMapKShowInstance|ValidatedShowInstance]
[<typeclasses>Monoid]<-[<instances>Monoid Instances|IOMonoidInstance|ConstMonoidInstance|EitherMonoidInstance|OptionMonoidInstance|TryMonoidInstance|Tuple2MonoidInstance|ListKMonoidInstance|MapKMonoidInstance|SequenceKMonoidInstance|SetKMonoidInstance|SortedMapKMonoidInstance]
[<typeclasses>Semigroup]<-[<instances>Semigroup Instances|IOMonoidInstance|IOSemigroupInstance|ConstSemigroupInstance|EitherSemigroupInstance|OptionSemigroupInstance|TrySemigroupInstance|ListKSemigroupInstance|MapKSemigroupInstance|NonEmptyListSemigroupInstance|SequenceKSemigroupInstance|SetKSemigroupInstance|SortedMapKSemigroupInstance]
[<typeclasses>Foldable]<-[<instances>Foldable Instances|FluxKFoldableInstance|FlowableKFoldableInstance|MaybeKFoldableInstance|ObservableKFoldableInstance|ConstFoldableInstance|EitherFoldableInstance|IdFoldableInstance|OptionFoldableInstance|TryFoldableInstance|Tuple2FoldableInstance|CoproductFoldableInstance|IorFoldableInstance|ListKFoldableInstance|MapKFoldableInstance|NonEmptyListFoldableInstance|OptionTFoldableInstance|SequenceKFoldableInstance|SetKFoldableInstance|SortedMapKFoldableInstance|ValidatedFoldableInstance]
[<typeclasses>Traverse]<-[<instances>Traverse Instances|FluxKTraverseInstance|FlowableKTraverseInstance|ObservableKTraverseInstance|ConstTraverseInstance|EitherTraverseInstance|IdTraverseInstance|OptionTraverseInstance|TryTraverseInstance|Tuple2TraverseInstance|CoproductTraverseInstance|IorTraverseInstance|ListKTraverseInstance|MapKTraverseInstance|NonEmptyListTraverseInstance|OptionTTraverseInstance|SequenceKTraverseInstance|SortedMapKTraverseInstance|ValidatedTraverseInstance]
[<typeclasses>ApplicativeError]<-[<instances>ApplicativeError Instances|IOApplicativeErrorInstance|DeferredKApplicativeErrorInstance|FluxKApplicativeErrorInstance|MonoKApplicativeErrorInstance|FlowableKApplicativeErrorInstance|MaybeKApplicativeErrorInstance|ObservableKApplicativeErrorInstance|SingleKApplicativeErrorInstance|EitherApplicativeErrorInstance|OptionApplicativeErrorInstance|TryApplicativeErrorInstance|KleisliApplicativeErrorInstance|StateTApplicativeErrorInstance|ValidatedApplicativeErrorInstance]
[<typeclasses>MonadError]<-[<instances>MonadError Instances|IOMonadErrorInstance|DeferredKMonadErrorInstance|FluxKMonadErrorInstance|MonoKMonadErrorInstance|FlowableKMonadErrorInstance|MaybeKMonadErrorInstance|ObservableKMonadErrorInstance|SingleKMonadErrorInstance|EitherMonadErrorInstance|OptionMonadErrorInstance|TryMonadErrorInstance|KleisliMonadErrorInstance|StateTMonadErrorInstance]
[<typeclasses>Comonad]<-[<instances>Comonad Instances|EvalComonadInstance|Function0ComonadInstance|IdComonadInstance|Tuple2ComonadInstance|CofreeComonadInstance|CoproductComonadInstance|NonEmptyListComonadInstance]
[<typeclasses>Applicative]<-[<instances>Applicative Instances|IOApplicativeInstance|DeferredKApplicativeInstance|FluxKApplicativeInstance|MonoKApplicativeInstance|FlowableKApplicativeInstance|MaybeKApplicativeInstance|ObservableKApplicativeInstance|SingleKApplicativeInstance|ConstApplicativeInstance|EitherApplicativeInstance|EvalApplicativeInstance|Function0ApplicativeInstance|Function1ApplicativeInstance|IdApplicativeInstance|OptionApplicativeInstance|TryApplicativeInstance|Tuple2ApplicativeInstance|FreeApplicativeApplicativeInstance|FreeApplicativeInstance|IorApplicativeInstance|KleisliApplicativeInstance|ListKApplicativeInstance|NonEmptyListApplicativeInstance|OptionTApplicativeInstance|SequenceKApplicativeInstance|StateTApplicativeInstance|ValidatedApplicativeInstance|WriterTApplicativeInstance]
[<typeclasses>Monad]<-[<instances>Monad Instances|IOMonadInstance|DeferredKMonadInstance|FluxKMonadInstance|MonoKMonadInstance|FlowableKMonadInstance|MaybeKMonadInstance|ObservableKMonadInstance|SingleKMonadInstance|EitherMonadInstance|EvalMonadInstance|Function0MonadInstance|Function1MonadInstance|IdMonadInstance|OptionMonadInstance|TryMonadInstance|Tuple2MonadInstance|FreeMonadInstance|IorMonadInstance|KleisliMonadInstance|ListKMonadInstance|NonEmptyListMonadInstance|OptionTMonadInstance|SequenceKMonadInstance|StateTMonadInstance|WriterTMonadInstance]
[<typeclasses>Monad]<-[<typeclasses>MonadReader]
[<typeclasses>MonadReader]<-[<instances>MonadReader Instances|Function1MonadReaderInstance|KleisliMonadReaderInstance]
[<typeclasses>Functor]<-[<typeclasses>FunctorFilter]
Expand All @@ -57,13 +66,4 @@
[<typeclasses>Birecursive]<-[<instances>Birecursive Instances|FixBirecursiveInstance|MuBirecursiveInstance|NuBirecursiveInstance]
[<typeclasses>Corecursive]<-[<instances>Corecursive Instances|FixCorecursiveInstance|MuCorecursiveInstance|NuCorecursiveInstance]
[<typeclasses>Recursive]<-[<instances>Recursive Instances|FixRecursiveInstance|MuRecursiveInstance|NuRecursiveInstance]
[<typeclasses>Async]<-[<instances>Async Instances|IOAsyncInstance]
[<typeclasses>Effect]<-[<instances>Effect Instances|IOEffectInstance]
[<typeclasses>MonadDefer]<-[<instances>MonadDefer Instances|IOMonadDeferInstance]
[<typeclasses>ApplicativeError]<-[<instances>ApplicativeError Instances|IOApplicativeErrorInstance|EitherApplicativeErrorInstance|OptionApplicativeErrorInstance|TryApplicativeErrorInstance|KleisliApplicativeErrorInstance|StateTApplicativeErrorInstance|ValidatedApplicativeErrorInstance]
[<typeclasses>MonadError]<-[<instances>MonadError Instances|IOMonadErrorInstance|EitherMonadErrorInstance|OptionMonadErrorInstance|TryMonadErrorInstance|KleisliMonadErrorInstance|StateTMonadErrorInstance]
[<typeclasses>Monoid]<-[<instances>Monoid Instances|IOMonoidInstance|ConstMonoidInstance|EitherMonoidInstance|OptionMonoidInstance|TryMonoidInstance|Tuple2MonoidInstance|ListKMonoidInstance|MapKMonoidInstance|SequenceKMonoidInstance|SetKMonoidInstance|SortedMapKMonoidInstance]
[<typeclasses>Semigroup]<-[<instances>Semigroup Instances|IOMonoidInstance|IOSemigroupInstance|ConstSemigroupInstance|EitherSemigroupInstance|OptionSemigroupInstance|TrySemigroupInstance|ListKSemigroupInstance|MapKSemigroupInstance|NonEmptyListSemigroupInstance|SequenceKSemigroupInstance|SetKSemigroupInstance|SortedMapKSemigroupInstance]
[<typeclasses>Applicative]<-[<instances>Applicative Instances|IOApplicativeInstance|ConstApplicativeInstance|EitherApplicativeInstance|EvalApplicativeInstance|Function0ApplicativeInstance|Function1ApplicativeInstance|IdApplicativeInstance|OptionApplicativeInstance|TryApplicativeInstance|Tuple2ApplicativeInstance|FreeApplicativeApplicativeInstance|FreeApplicativeInstance|IorApplicativeInstance|KleisliApplicativeInstance|ListKApplicativeInstance|NonEmptyListApplicativeInstance|OptionTApplicativeInstance|SequenceKApplicativeInstance|StateTApplicativeInstance|ValidatedApplicativeInstance|WriterTApplicativeInstance]
[<typeclasses>Functor]<-[<instances>Functor Instances|IOFunctorInstance|ConstFunctorInstance|EitherFunctorInstance|EvalFunctorInstance|Function0FunctorInstance|Function1FunctorInstance|IdFunctorInstance|OptionFunctorInstance|TryFunctorInstance|Tuple2FunctorInstance|CofreeFunctorInstance|CoyonedaFunctorInstance|FreeApplicativeFunctorInstance|FreeFunctorInstance|YonedaFunctorInstance|CoproductFunctorInstance|IorFunctorInstance|KleisliFunctorInstance|ListKFunctorInstance|MapKFunctorInstance|NonEmptyListFunctorInstance|OptionTFunctorInstance|SequenceKFunctorInstance|SortedMapKFunctorInstance|StateTFunctorInstance|ValidatedFunctorInstance|WriterTFunctorInstance]
[<typeclasses>Monad]<-[<instances>Monad Instances|IOMonadInstance|EitherMonadInstance|EvalMonadInstance|Function0MonadInstance|Function1MonadInstance|IdMonadInstance|OptionMonadInstance|TryMonadInstance|Tuple2MonadInstance|FreeMonadInstance|IorMonadInstance|KleisliMonadInstance|ListKMonadInstance|NonEmptyListMonadInstance|OptionTMonadInstance|SequenceKMonadInstance|StateTMonadInstance|WriterTMonadInstance]
[<typeclasses>Functor]<-[<instances>Functor Instances|IOFunctorInstance|DeferredKFunctorInstance|FluxKFunctorInstance|MonoKFunctorInstance|FlowableKFunctorInstance|MaybeKFunctorInstance|ObservableKFunctorInstance|SingleKFunctorInstance|ConstFunctorInstance|EitherFunctorInstance|EvalFunctorInstance|Function0FunctorInstance|Function1FunctorInstance|IdFunctorInstance|OptionFunctorInstance|TryFunctorInstance|Tuple2FunctorInstance|CofreeFunctorInstance|CoyonedaFunctorInstance|FreeApplicativeFunctorInstance|FreeFunctorInstance|YonedaFunctorInstance|CoproductFunctorInstance|IorFunctorInstance|KleisliFunctorInstance|ListKFunctorInstance|MapKFunctorInstance|NonEmptyListFunctorInstance|OptionTFunctorInstance|SequenceKFunctorInstance|SortedMapKFunctorInstance|StateTFunctorInstance|ValidatedFunctorInstance|WriterTFunctorInstance|IntListPatternFunctorInstance]
3 changes: 3 additions & 0 deletions modules/docs/arrow-docs/docs/_data/menu.yml
Expand Up @@ -28,6 +28,9 @@ options:
- title: Dependency Injection
url: /docs/patterns/dependency_injection/

- title: The Monad Tutorial
url: /docs/patterns/monads/

- title: Monad Comprehensions
url: /docs/patterns/monad_comprehensions/

Expand Down
5 changes: 4 additions & 1 deletion modules/docs/arrow-docs/docs/docs/README.md
Expand Up @@ -12,7 +12,10 @@ NOTE: The docs are currently at around 60% completion. They're the present prior
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)

Λrrow is a library for Typed Functional Programming in Kotlin.
It includes the most popular data types, type classes and abstractions such as `Option`, `Try`, `Either`, `IO`, `Functor`, `Applicative`, `Monad` to empower users to define pure FP apps and libraries built atop higher order abstractions.

Arrow aims to provide a *lingua franca* of interfaces and abstractions across Kotlin libraries.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to add the following and/or a link to Wikipedia:

lingua franca (i.e. a common/universal language)

For this, it includes the most popular data types, type classes and abstractions such as `Option`, `Try`, `Either`, `IO`, `Functor`, `Applicative`, `Monad` to empower users to define pure FP apps and libraries built atop higher order abstractions.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't use the term 'define'. I'd replace it with create and write

'to empower users to create pure FP applications and libraries built using higher order abstractions

Use the list below to learn more about Λrrow's main features.

- [Patterns](http://arrow-kt.io/docs/patterns/glossary/): tutorials and approaches to day-to-day challenges using FP
Expand Down
Expand Up @@ -28,7 +28,7 @@ You can read more about all the [datatypes]({{ '/docs/datatypes/intro' | relativ

### Typeclasses

Typeclasses define a set of functions associated to one type.
Typeclasses define a set of extension functions associated to one type.
This behavior is checked by a test suite called the "laws" for that typeclass.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also talking about implementation detail (test suite) and then talking about laws, without introducing the laws. Maybe it just makes sense to put the paragraph of learning more about typeclasses at the start.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rewritten!


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

believe this is an implementation detail or how it would be defined in Kotlin, as it's using the term extension function. I think it would be better to first introduce what the concept of typeclasses are.

You can use typeclasses as a DSL to add new free functionality to an existing type
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd explain what you mean by the use of "free" functionality.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added!

Expand All @@ -46,6 +46,9 @@ One example, the typeclass `Eq` parametrized to `F` defines equality between two
```kotlin
interface Eq<F> {
fun F.eqv(b: F): Boolean

fun F.neqv(b: F): Boolean =
!eqv(b)
}
```

Expand Down
Expand Up @@ -9,7 +9,7 @@ permalink: /docs/patterns/monad_comprehensions/
{:.intermediate}
intermediate

Monad comprehension is the name for a programming idiom available in multiple languages.
Monad comprehension is the name for a programming idiom available in multiple languages like JavaScript, F#, Scala, or Haskell.
The purpose of monad comprehensions is to compose sequential chains of actions in a style that feels natural for programmers of all backgrounds.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either "a monad comprehension is" or "monad comprehensions are"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!


### Synchronous sequences of actions
Expand Down Expand Up @@ -37,12 +37,15 @@ They allow us to write sequenced code that can be run asynchronously over multip

### Asynchronous sequences of actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don't see a lead in here from Monad Comprehensions....

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added one


The general representation of sequenced execution in code is called a [`Monad`]({{ '/docs/typeclasses/monad' | relative_url }}). This typeclass is a short API for sequencing code, summarised in a single function `flatMap`.
It takes as a parameter one function to be called after the current operation completes, and that function has to return another [`Monad`]({{ '/docs/typeclasses/monad' | relative_url }}) to continue the operation with.
A common renaming of `flatMap` is `andThen`. Go to the documentation page to see a deep dive on the Monad API.

The abstraction of sequencing execution of code is summarised in a single function that in Arrow is called `flatMap`,
although you may find it in other languages referred as `andThen`, `then`, `bind`, or `SelectMany`.
It takes as a parameter one function to be called after the current operation completes, and that function has to return another value to continue the operation with.
With knowledge of `flatMap` we can write sequential expressions that are ran asynchronously, even over multiple threads.
Implementations of `Monad` are available for internal types like `Try` and also integrations like [RxJava 2]({{ '/docs/integrations/rx2' | relative_url }}) and [kotlinx.coroutines]({{ '/docs/integrations/kotlinxcoroutines' | relative_url }}).

The [typeclass]({{ '/docs/typeclasses/intro' | relative_url }}) interface that abstracts sequenced execution of code via `flatMap` is called a [`Monad`]({{ '/docs/typeclasses/monad' | relative_url }}),
for which we also have a [tutorial]({{ '/docs/patterns/monads' | relative_url }}).

Implementations of [`Monad`]({{ '/docs/typeclasses/monad' | relative_url }}) are available for internal types like `Try` and also integrations like [RxJava 2]({{ '/docs/integrations/rx2' | relative_url }}) and [kotlinx.coroutines]({{ '/docs/integrations/kotlinxcoroutines' | relative_url }}).
Let's see one example using a [`Monad`]({{ '/docs/typeclasses/monad' | relative_url }}) called [`IO`]({{ '/docs/effects/io' | relative_url }}), where we fetch from a database the information about the dean of university some student attends:

```kotlin
Expand Down