Providing ad-hoc pure code branches (side-effect free)

Hi all.

I was wondering if the possibility to specify pure code branches (no side-effects performed) (doing it like h4nnes says):

would have any interest to be implemented for the OCaml programming language?

Just think of it in the sense of adding ad-hoc lazy code branches:

(as a new user I can only add 2 links to a post)

Interesting approach here.

I doubt OCamlers will want to drown in monads, monad transformers and inefficient data structure, though. There seems to be a stronger movement in the direction of Eff.

Puritas, A journey of a thousand miles towards side-effect free code (just the 29 first slides)

As in many presentations on this topic by people pushing purity, this presentation conflates I/O side effects, which are truly ‘dangerous’, with state-based side effects, which are just a source of additional complexity (and efficiency). I/O side effects can be dealt with by other means, making the argument mostly moot.

1 Like