3 ms·
> [1] Yes, Conal Elliots arguments are very relevant here. > A function with minimal side-effects Clarification, what I mean with “minimizing the use of side
by rmgk 2y ago
> [1]
Yes, Conal Elliots arguments are very relevant here.
> A function with minimal side-effects
Clarification, what I mean with “minimizing the use of side effects” is not about within a function, but in a program.
Exaggerated example: You could write Haskell in a style where everything returns an IO and mutates some global state.
Not doing that, and having most things pure is useful due to the simplified reasoning in the pure parts.
> There's two important steps that you've rolled into one.
Have I?
What I want to say is that I do believe the syntactic distinction between calling side-effecting functions vs pure functions is useful.
Do I need to care about how the compiler enforces that? Does the specific encoding need to be part of the language semantics? Do I need to be able to model it monadically within the language?
> This is where you get your nice functional properties meaning that your compiler won't let you mix them up.
I may have formulated this a bit flippantly, but I think you mean the same here as I did when I said that “marked with an ! so they are easier to spot” I did have in mind that this is checked by the compiler.
And I think we also agree that this separation is a good thing.