You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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...