[mercury-users] threading states

Michael Day mcda at students.cs.mu.oz.au
Wed Jul 26 21:13:11 AEST 2000

If an argument similar to io:state is threaded through code to ensure a
particular order of operation, can the passing and copying of this
argument be optimised away completely if the state is a "unit" type?

:- type state ---> state.

:- pred transform(args ... , state, state).
:- mode transform(modes ... , di, uo) is det.

Can the compiler optimise away the state argument altogether? It seems
like this could be useful for interfacing with some foreign language
libraries that maintain their state externally anyway but require calls in
a particular order and cannot be backtracked over.

mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe

More information about the users mailing list