New answers tagged

0

I think you need to use the State monad from scalaz -> http://eed3si9n.com/learning-scalaz/State.html The data type would be State[Stage, Data] where Stage consists of your stages and data the value that accompanies the current stage. case class Stage(id: String, someStateInfo: String) case class Data(someData: String, anotherData: String) Create a ...


4

There's multiple reasons: Some functions will return tuples and it's useful to compose such functions directly with other functions that accept tuples. Often when values are bundled in a tuple they're conceptually one unit, i.e. you almost always pass all of them together. In other words, there's certain functions you wouldn't curry often. It's trivial to ...


5

I think you are creating a bit of a false dichotomy here. Haskell has monad comprehensions built into the language. One reason for that is the use of monads for imperative-style I/O. Therefore, the designers of Haskell decided to make it look mostly like a code block in a generic C-style language, complete with curly braces, semicolons and even return. The ...


2

I don't have much background on why Scala designers made that particular wording choice, but in F#, local "do notation" equivalent is called a "computation expression". The reasoning behind that word choice is one of PR and marketing rather than any concrete technical reason. Haskell has a hard-earned reputation of being a language for academics, rocket ...



Top 50 recent answers are included