[m-users.] Mode and inst confusion in ODBC library

Volker Wysk post at volker-wysk.de
Wed Aug 9 04:15:24 AEST 2023


Hi

In the ODBC extra library, there's this:

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

% ...

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

The mode of the fourth argument of the predicate is a (higher order) inst,
not a mode - ?? According to Ralph Becket's Mercury tutorial, the mode of an
argument is a mapping from the instantiation before the call to after the
call of the predicate. And it's written "Before >> After" (or defined this
way).

Cheers,
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/20230808/952d7e6f/attachment.sig>


More information about the users mailing list