Sujin Shrestha
Sujin Shrestha

Reputation: 1253

What is Monad in kotlin arrow functional programming?

Can someone explain the concept of Monad in Arrow functional programming?

https://arrow-kt.io/docs/datatypes/option/

Upvotes: 3

Views: 821

Answers (1)

Alexey Soshin
Alexey Soshin

Reputation: 17731

Here's a good explanation from the documentation:

In Arrow terms, a Monad is an interface with two operations: a constructor just, and flatMap

Arrow provides both documentation for Monad and a longer Monad Explanation.

In a short and very non-academic way, though, Monad can be viewed as a design pattern to safely chain calls. If you used Stream API in Java, you've used monads. If you've used promises in JavaScript, you've used monads.

Upvotes: 6

Related Questions