3 ms·
Since Haskell is non-strict, it has "dataflow", and deprecates "call/return" to some extent. (Parent poster might not have known that.) Function "calls" can be
by gowld 8y ago
Since Haskell is non-strict, it has "dataflow", and deprecates "call/return" to some extent. (Parent poster might not have known that.)
Function "calls" can be passed around but not executed unless needed. Monads like Maybe take advantage of this.
Haskell functions always return something if they are called. Every Haskell program is "main :: IO ()", returning an IO action executed by the runtime, but in the Maybe monad that something can be Nothing.
- klodolph 8y agoWith monadic structure the non-strictness is not actually necessary. Haskell is a research language with a lot of features dumped into it, the fact that it’s non-strict has forced people to be more aware of whether their code is pure, and purity has motivated the research into things like monads. But you can do the same data flow programming even in an eager version of Haskell, it’s just that in eager languages programmers are more tempted to write impure functions in the first place.
- mpweiher 8y agoHmm...using the Maybe monad as counterexample to "call/return languages need a value to represent Nothing, because they need to return something" seems odd at best. "This is not a sentence."