Top "Monads" questions

A monad in programming is a composable computation description.

Why are Promises Monads?

I've been learning about functional programming and have come across Monads, Functors and Applicatives. From my understanding the following definitions …

javascript functional-programming monads es6-promise functor
Functional design patterns

There are a lot of functional idioms: monads, applicatives, arrows, etc. They are documented in different articles but unfortunately I …

scala haskell functional-programming monads
When is it OK to use an IORef?

One thing that has always confused me is whether or not it's an okay time to use an IORef. Are …

haskell state monads ioref
How to convert this map/flatMap into a for comprehension in Scala?

How to convert this map/flatMap into a for comprehension, and please explain how it works, thanks. def compute2(maybeFoo: …

scala monads for-comprehension
Un-optioning an optioned Option

Say I have a val s: Option[Option[String]]. It can thus have the following values: Some(Some("foo")) Some(…

scala join option monads flatten
What is the point of the class Option[T]?

I am not able to understand the point of Option[T] class in Scala. I mean, I am not able …

java scala null functional-programming monads
Why is the use of Maybe/Option not so pervasive in Clojure?

Why does Clojure, despite such an emphasis on functional paradigm, not use the Maybe/ Option monad to represent optional values? …

functional-programming clojure option monads maybe
Why do we have map, fmap and liftM?

map :: (a -> b) -> [a] -> [b] fmap :: Functor f => (a -> b) -&…

list haskell monads redundancy functor
How and why does the Haskell Cont monad work?

This is how the Cont monad is defined: newtype Cont r a = Cont { runCont :: (a -> r) -> …

haskell monads continuations
Is Java 8 missing an OptionalBoolean?

As a primitive version of Optional*, Java 1.8 provides OptionalInt, OptionalLong and OptionalDouble. But I cannot find the equivalent OptionalBoolean class. …

java boolean monads java-8 optional