Hello functional programmers,
a trivial, maybe common, probably blasphemous question.
Is it possible to declare FFI functions with side effects (i.e. IO functions or mutations) without using effects/monads?
I’m wondering if we can use PureScript in a way similar to Reason, Gleam, Grain, F# and so on. Purity is wonderful but sometimes we just don’t need it, yet we could still take advantage of the great PureScript type system.
I suppose that the compiler, assuming referential transparency, could rewrite the transpiled code in an unexpected way, producing a wrong program. In such case is there a way to disable these optimizations?
I’m mainly interested to the Purerl project, I would like to have the option to write Erlang code in type safe manner without having an huge cognitive effort.
Thanks in advance.