3 ms·
I glanced at the example code and it looked like it allowed side effects, but maybe I was wrong. I haven't had much time to mess with it and seemed to be able
by Eji1700 3y ago
I glanced at the example code and it looked like it allowed side effects, but maybe I was wrong. I haven't had much time to mess with it and seemed to be able to hard crash the repl doing some testing so it's something i'll have to look at later.
- ReleaseCandidat 3y agoWell, yes, if there are no type annotations because all types are inferred, you don't see the effect "types". https://www.roc-lang.org/tutorial#tasks https://www.roc-lang.org/tutorial#tasks
- Eji1700 3y agoThen to my limited understanding that's less "pure" than haskell isn't it, which doesn't allow side effects and thus forces monads?
- whizzter 3y agoHonestly it looks like basically the same as getline/putStrLen from the tutorial(1) in the link below, just not written in an intentionally obtuse language. Considering how much more approachable this Roc documentation/naming is, I'm wondering if it isn't so that the people writing Wikipedia's math pages are probably the same people that are drawn to and writes Haskell/monad "tutorials". 1: http://learnyouahaskell.com/input-and-output http://learnyouahaskell.com/input-and-output
- bhansconnect 3y agoRoc doesn't allow side effects. All effects are wrapped and returned from a function. So this is just as pure as haskell. Though it may not be exposed in the same way as haskell, effects still boil down to something akin to monads and callbacks.