[mercury-users] The Logic of Mercury

Toby Moth tmoth at nortelnetworks.com
Wed Sep 8 19:12:18 AEST 1999



> -----Original Message-----
> From:	Richard A. O'Keefe [SMTP:ok at hermes.otago.ac.nz]
> Sent:	08 September 1999 01:44
> To:	mercury-users at cs.mu.OZ.AU
> Subject:	Re: [mercury-users] The Logic of Mercury
> 
> Haskell and Clean are wonderful languages.
> I find SML's inability to make up its mind about currying vexatious
> (for example, built-in operators like + are NOT curried).
> Lee Naish is a Very Smart Person and one of logic programming's
> long-time Good Guys.
> 
> So it's with some trepidation that I strongly disagree with Lee
> about the desirability of currying in logic programs.
> 
	[Moth, Toby [MDN05:7E44:EXCH]]  I think your main dissatisfaction
	with currying is that you cannot choose the sequence in which you
apply
	some function to it's arguments - you can only halt en route.

	I have played with (but am no expert with) Olabl, an extension of
OCaml
	where you can label arguments. The idea is that you can pick
standard labels,
	say fun:, acc:, buffer:, pos: or len: which you can give to
arguments when you
	want some choice over the sequence. You end up with things like:

	val map : fun: ('a -> 'b) -> 'a -> 'b
	val fold : fun: ('a -> 'b -> 'a) -> acc: 'a -> 'b list -> 'a list

	Now you can construct something like:

	fold acc:0 [1;2;3] 
	which will have type: fun:( int -> int -> int ) -> int list

	If you are interested, check out
	http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/
--------------------------------------------------------------------------
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