[mercury-users] existential types

Simon Taylor stayl at cs.mu.OZ.AU
Tue Jun 18 17:39:35 AEST 2002


On 18-Jun-2002, Michael Day <mikeday at bigpond.net.au> wrote:
> Can anyone explain what is wrong with this code:
> 
> :- type builder
>     --->    some [S, T] builder(S, node(T), doc(T)) => builder(S).
> 
> :- func new_builder(S, node(T), doc(T)) = builder <= builder(S).
> 
> new_builder(S, Node, Doc) = 'new builder'(S, Node, Doc).
> 
> : In clause for `new_builder(in, in, in) = out':
> :   in function result term of clause head:
> :   mode error: variable `TypeInfo_9' has instantiatedness `free',
> :   expected instantiatedness was `ground'.

After adding trivial definitions for types `node' and `doc' and class
`builder' this compiles without errors for me.

Simon.
--------------------------------------------------------------------------
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