[mercury-users] map__foldl2

Tyson Dowd trd at cs.mu.OZ.AU
Fri Dec 17 15:40:18 AEDT 1999


On 17-Dec-1999, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> 
>     But allowing different code for different modes (in Mercury,
>     rather than only when using the C interface) would make this
>     kind of thing much simpler.  There'd be a bit of code duplication,
>     with the only difference between the code in different modes
>     being the mode annotations on the higher-order terms, but still
>     it wouldn't be too bad.  And that feature would be easy to add.
>     There's probably a good chance that support for different code
>     in different modes will it into Mercury 1.0.

I think it would be a good idea to do different code in different
modes using the purity delcarations.  So when you introduce a predicate
with different code for different modes, it is by default impure. 
You need to promise that it is pure at some point.

I'm not sure what a good syntax would be for writing code for different
modes would be.

-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't eveyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
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