[mercury-users] the closure constructor

Dave Slutzkin dave_slutzkin at yahoo.com
Thu Jan 3 20:36:41 AEDT 2002


Hi guys.

Just a quick question about 'closure'.  I presume this
is the type constructor for a closure - but I can't
find it anywhere in the docs.

For instance, in some of Fergus' lazy evaluation code:

        :- inst lazy == lazy(ground). 
        :- inst lazy(I) ---> value(I) ; closure((func)
= out(I) is det). 

        :- implementation. 
        :- type lazy(T) ---> value(T) ; closure((func)
= T). 

        val(X) = value(X). 
        delay(X) = closure(X). 
        force(value(X)) = X. 
        force(closure(F)) = apply(F). 

Is it just a simple type constructor?

Thanks, 

Dave

http://my.yahoo.com.au - My Yahoo!
- It's My Yahoo! Get your own!
--------------------------------------------------------------------------
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