Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell's Monad vs. APL's Monad

In APL and Haskell, does the term monad mean two totally different things, or the same thing viewed from two different perspectives.

I'm rather new to both languages and trying to make sense of the higher-level concepts.

like image 827
Alex Shroyer Avatar asked May 06 '14 03:05

Alex Shroyer


2 Answers

Totally different, in Haskell a monad is anything equipped with two functions

bind :: m a -> (a -> m b) -> m b
return :: a -> m a

And a few rules about how they play together. It's actually a construction from category theory.

In APL a monad is just a term for describing how many arguments a function (verb) takes. It appears that in "monad" may be used as a synonym for "unary function" and is a term commonly found in logic and linguistics.

like image 136
Daniel Gratzer Avatar answered Sep 28 '22 07:09

Daniel Gratzer


Two completely different things! Monad often goes in series with "Dyad" and "Triad" simply meaning "of one", "of two", "of three". In the case of APL it indicates "of one argument".

Monads in Haskell are completely different. They probably take their etymology from "monoid" and "operad" both of which also being completely different.

like image 33
J. Abrahamson Avatar answered Sep 28 '22 08:09

J. Abrahamson