[m-dev.] :- type (type).

Julien Fischer juliensf at cs.mu.OZ.AU
Tue Jun 28 21:23:39 AEST 2005


On Tue, 28 Jun 2005, Mark Brown wrote:

> On 27-Jun-2005, Mark Brown <mark at cs.mu.OZ.AU> wrote:
> > So here's the main types I propose to (re)define.
> >
> > :- type (type)
> > 	--->	variable(tvar, kind)
> > 			% A type variable.
> >
> > 	;	defined(sym_name, list(type), kind)
> > 			% A user defined type constructor.
> >
> > 	;	builtin(builtin_type)
> > 			% These are all known to have kind `star'.
> >
> > 	% The above three functors should be kept as the first three, since
> > 	% they will be the most commonly used and therefore we want them to
> > 	% get the primary tags on an x86.  (I believe this is the right way
> > 	% to achieve that.)
> >
> > 	;	pred_type(list(type))
> > 			% A type for higher-order pred values.  The kind is
> > 			% always `star'.
> >
> > 	;	func_type(list(type), (type))
> > 			% A type for higher_order func values.  The second
> > 			% argument is the result type.  The kind is always
> > 			% `star'.
>
> Another alternative, suggested by Zoltan, would be to merge the above two
> functors into one:
>
> 	;	higher_order(list(type), maybe(type))
> 			% A type for higher order values.  If the second
> 			% argument is yes(T) then the values are functions
> 			% returning T, otherwise they are predicates.  The
> 			% kind is always `star'.
>
I agree with this one, although either alternative is better than the
status quo.

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