[mercury-users] Subtyping for Mercury?

David Glen JEFFERY dgj at cs.mu.oz.au
Tue Apr 15 16:53:20 AEST 1997


Tyson Richard DOWD wrote:
> >     % T must be in the class `foo'. `foo' methods can be used upon things of
> >     % type T.
> > :- pred baz(T::in, int::out) is det.
> > 
> >     % T must be in the class `bar'. `bar' methods can be used upon things of
> >     % type T, as can `foo' (because of the class hierarchy).
> > :- pred kabam(T::in, int::out) is semidet.
> > 
> 
> Did I miss something? Where is the context? (I realize this is just
> syntax, but the syntax appears to be missing).

Ahem... um, yes. It is slightly missing. This is what its meant to say:

    % T must be in the class `foo'. `foo' methods can be used upon things of
    % type T.
:- pred foo(T) ---> baz(T::in, int::out) is det.

    % T must be in the class `bar'. `bar' methods can be used upon things of
    % type T, as can `foo' (because of the class hierarchy).
:- pred bar(T) ---> kabam(T::in, int::out) is semidet.

Oops.


love and cuddles,
dgj
-- 



This .sig deliberately left blank






More information about the users mailing list