Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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.

From what I can tell, they’re different things. If APL’s monad is just a verb having a single argument (as this page would have me believe; I don’t know APL), it is very different from Haskell’s monad, which comes from category theory, and has nothing to do with the arity of functions.

APL programmers and APL documentation rarely use the term "monad". Instead they will refer to a "monadic function" (a function that accepts only a single argument) or "a function called monadicly" (one that omits an optional argument). Neither of these is at all similar to the Haskell use of the term "Monad".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top