[mercury-users] Why is --infer-all not the deafult?

Ian MacLarty maclarty at cs.mu.OZ.AU
Fri Jul 16 14:48:21 AEST 2004


On 16 Jul 2004, at 10:50, Peter Schachte wrote:
>
> But worse still is that equivalence types don't actually provide the
> abstraction they would seem to.  For example, the function call
>
> 	concat(Filename, ".m")
>
> would also be allowed.  This means you can't later redefine the
> filename type to be, for example,
>
> 	:- type filename ---> filename(directory, basename, extension).
>
> This makes equivalence types much less attractive from a software
> engineering point of view.
>
In this case you should use an abstract type to achieve the abstraction  
you want.  The abstract type could be implemented as an equivalence  
type or a discriminated union, but any module using the type would  
never know this.  See  
http://www.cs.mu.oz.au/research/mercury/information/doc-release/ 
reference_manual_3.html#SEC31.

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