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

Zoltan Somogyi zs at cs.mu.OZ.AU
Fri Jul 16 13:20:41 AEST 2004

On 16-Jul-2004, Peter Schachte <schachte at cs.mu.OZ.AU> wrote:
> On Thu, Jul 15, 2004 at 12:00:45PM +1000, Ralph Becket wrote:
> > :- type filename == string.
> > :- type timestamp == int.
> > 
> > There's no need for wrapping/unwrapping of these values.  The new type
> > names give the reader more information about what a particular argument
> > is supposed to represent (although you don't get the same level of type
> > safety as you would using a wrapper type.)
> The loss of type safety here is troubling.

I find that an interesting comment from an old Prolog hacker. The loss
compared to what?

Yes, as you demonstrate, using equivalence types loses some type safety
compared to using no-tag types. As a Mercury programmer, you can choose
whether or not you want maximum type safety at the cost of writing
wrapping/unwrapping code. However, both alternatives give you far more
safety than Prolog does.

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