[m-users.] Impurity needed?

Volker Wysk post at volker-wysk.de
Tue Feb 14 00:24:52 AEDT 2023


Hi again.

The type of the odbc.transaction predicate is:

:- pred odbc.transaction(data_source::in, user_name::in, password::in,
     transaction(T)::transaction, odbc.result(T)::out, io::di, io::uo) 
is det.


Would it be possible to just change the transaction type from this:

:- type odbc.transaction(T) ==  pred(T, odbc.state, odbc.state).
:- mode odbc.transaction ==  (pred(out, di, uo) is det).


To this:


:- type odbc.transaction(T) ==  
     pred(T, odbc.state, odbc.state, io.state, io.state).
:- mode odbc.transaction ==  (pred(out, di, uo, di, uo) is det).


So the transaction predicate can do IO, when called. This looks rather easy,
but I'm not sure I've understood correctly.

Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.mercurylang.org/archives/users/attachments/20230213/4548103d/attachment.sig>


More information about the users mailing list