What is the point of using Monad in a program?

Say I'm creating an image processing library using Haskell. I have defined several of my own data types.

When should I declare some of my data types as Monad (or functor or application functor, etc.)? And what is the use of this?

I understand that if some data types can be "mapped", I can declare it an instance of a functor. But if I do so, then what is the use?

This may be a really stupid question, but I'm still trying to get into the field of functional programming.

+4
source share
1 answer

, OO; , , , .

, - Monad, , , . , , , , , , ; , , .

/ Monad, , , , . , , Monads, , , , Monad. , OO; OO, , , , , OO . , - - , , , .

- , . Haskell, , . , .

+6

Source: https://habr.com/ru/post/1534719/


All Articles