The famous Monad is well known for handling effect in a functionally pure manner (e.g. IO Monad).

On the other hand, in some application, runtime performance is the utmost interest and the compile time cost wouldn't matter. For those applications 'constant' or compile time evaluation is useful in many programming languages. In functional programming, I believe it would be beta-reductions in compile time.

It would be kind of ideal if all the possible reductions are conducted in compile-time and only minimal computation (IO-dependent) could be done in run-time.

For these kind of work, it would be necessary to preserve order of effects.

My question is what conditions or restriction on the reduction and evaluation would preserve the order of monadic effects? Is there any related concept or material for further study?



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.