
Hi,
On 15. Oct 2019, at 16:59, Benjamin Redelings
I'm wondering if people could point me to some background on explicitly representing lazy effects in Haskell? The only effect I am concerned about at this point is `seq`. If there is a way to do this with monads, that would be great. (I know that a lot of people hate lazy effects. However, I think this is an orthogonal issue to the question of how to *represent* lazy effects explicitly.)
if you’re explicitly interested in sharing computations (rather than only modelling non-strictness) then the following approach by Fisher, Kiselyov and Shan might be of interest. http://homes.sice.indiana.edu/ccshan/rational/S0956796811000189a.pdf (Purely functional lazy nondeterministic programming) The are modelling the functional logic language Curry, but have also some remarks about modelling a lazy probabilistic language with their approach. If you’re not interested in the sharing part of laziness, the paper might be a good first starting point nonetheless. They use a deep monadic embedding that you can use to model non-strictness. Other papers that use such an encoding are the following. http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.192.7153&rep=rep1&type=pdf#page=8 (Transforming Functional Logic Programs into Monadic Functional Programs) http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.134.9706&rep=rep1&type=pdf (Verifying Haskell Programs Using Constructive Type Theory) Best regards Sandra