[m-dev.] help with polymorphic modes
novalazy at gmail.com
Tue Sep 2 15:30:28 AEST 2014
On Tue, 2 Sep 2014 15:19:44 +1000, Peter Wang <novalazy at gmail.com> wrote:
> Just to make sure, this is mode incorrect, yes?
> :- pred p(pred(T), T).
> :- mode p(pred(in(I =< ground)) is det, in) is det.
> p(P, X) :- P(X).
That doesn't make sense. Then what about this?
:- type fruit ---> apple ; orange.
:- inst apple ---> apple.
:- pred apple_only(fruit).
:- mode apple_only(in(I =< apple)) is det.
test :- p(apple_only, orange).
More information about the developers