Skip to content
Coot edited this page Oct 9, 2016 · 1 revision

Limitations

In Haskell you can do this with arrays (yes arrays are monads)

  do {
    x <- [1,2,3]
    return (x + 1)
  }

which is equivalent to [1,2,3].map(x => x + 1) in JavaScript. This type of monads are not possible to code with generators. Unless there is a way to copy a generator with its state and use it multiple times...

Clone this wiki locally