[m-dev.] type classes and the color blue
Fergus Henderson
fjh at cs.mu.OZ.AU
Sat Jan 15 10:34:48 AEDT 2000
On 14-Jan-2000, Michael Day <mcda at cat.cs.mu.OZ.AU> wrote:
>
> So really I do want:
>
> :- typeclass thing(T) where
> [
> pred is_blue(T),
> mode is_blue(in) is semidet
> ].
>
> even if is_blue never actually examines its argument explicitly, it
> requires the argument to get the typeclass_info to know which is_blue to
> call. Or something along those lines, albeit better phrased.
If is_blue never actually examines its argument, then you can
declare the argument to have mode `unused'. Then you can
pass an underscore variable, qualified with the appropriate type
is_blue(_ : int) % XXX the `term : type' syntax is
% not yet supported
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list