[m-users.] Can I turn an impure function into a semi-det pure function
charles.shuller at gmail.com
Sat Jun 27 06:24:43 AEST 2015
Is there an accepted technique, or techniques for converting an impure
function into a pure function in Mercury? If so, can someone point me at
the relevant docs??
I know there is some cleverness with the io state variables, but I don't
recall reading anything about how to generalize the technique for use in
More specifically, I want to fetch something from a web-server.
If I understand things correctly, this is a very impure thing to do, since
the results don't really depend much on the parameters. For instance, the
contend returned can change between requests.
But if this function is impure, then it seems my entire program must also
be impure, which I would really rather avoid.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the users