[m-users.] Adding impurity to Mercury code: Backtracking in IO states
Paul Bone
paul at bone.id.au
Mon Jun 29 11:07:26 AEST 2015
On Mon, Jun 29, 2015 at 01:52:57AM +0200, Tomas By wrote:
> On Mon, June 29, 2015 01:43, Paul Bone wrote:
> > On Sun, Jun 28, 2015 at 01:32:12PM +0200, Tomas By wrote:
> >> On Sun, June 28, 2015 07:34, Left Right wrote:
> >> > In particular,
> >> > io.write_string needs its third argument to be instantiated as
> >> > "unique" (this is a Mercury's way of saying it has to be obtained from
> >> > doing some other I/O).
> >>
> >> I think it is just an historical accident that Mercury only uses unique
> >> modes for I/O.
> >
> > No it's deliberate.
>
>
> Hmm, yes, but I guess there once was an ambition to use unique modes for
> various other data structures also?
>
> (stress on "only" in my comment)
Ah yes, on that count you are correct, and I sew what you meant earlier.
As I understand it uniqueness would also be good for general use: arrays
would be easier to work with, as well as things such as structure re-use.
--
Paul Bone
http://www.bone.id.au
More information about the users
mailing list