This is just saying that the type of less is any function that takes two a's as parameters and returns a Bool result. This appears to be a formalization of the Ord (ordered) data type, where less would be used to compare two ordered values and return a Bool result, either True or False.

Just a note that the data declaration above is missing a constructor name. It should probably be something like:

data Ord a = Ord { less :: a -> a -> Bool }


Cheers,
Darren



On Wed, Feb 20, 2013 at 1:18 PM, Emanuel Koczwara <poczta@emanuelkoczwara.pl> wrote:
Hi,

I'm watching Philip Wadler "Faith, Evolution, and Programming
Languages" (very cool by the way):
http://www.youtube.com/watch?v=8frGknO8rIg

At 00:24:14 there is strange thing on the slide:

data Ord a = { less :: a -> a -> Bool }

It's first time I see function type (and where is definition?) in record
syntax. Can somebody explain this?

Emanuel



_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners