This commit is contained in:
Miloslav Ciz 2024-08-27 22:53:54 +02:00
parent 3816e78230
commit 1ed9079ad4
50 changed files with 1892 additions and 1863 deletions

View file

@ -2,7 +2,7 @@
{ This is my poor understanding of a monad. I am not actually sure if it's correct lol :D TODO: get back to this. ~drummyfish }
Monad is a [mathematical](math.md) concept which has become useful in [functional programming](functional.md) and is one of the very basic [design patterns](design_pattern.md) in this paradigm. A monad basically wraps some [data type](data_type) into an "envelope" type and gives a way to operate with these wrapped data types which greatly simplifies things like error checking or abstracting [input/output](io.md) side effects.
Monad is a [mathematical](math.md) concept which has become useful in [functional programming](functional.md) and is one of the very basic [design patterns](design_pattern.md) in this paradigm. A monad basically wraps some [data type](data_type.md) into an "envelope" type and gives a way to operate with these wrapped data types which greatly simplifies things like error checking or abstracting [input/output](io.md) side effects.
A typical example is a **maybe** monad which wraps a type such as integer to handle exceptions such as division by zero. A maybe monad consists of: