[Haskell-cafe] RE: Wikipedia on first-class object
Ben Franksen
ben.franksen at online.de
Mon Jan 7 16:38:43 EST 2008
Peter Verswyvelen wrote:
> Jerzy wrote:
>> The relational syntax of Prolog is more "universal" than the functional
>> notation, since you have logic variables and logical-non-determinism, and
>
> Isn't this just because mathematically, a function *is* a relation, but
> not vice versa? A relation being just a subset of a Cartesian product of
> sets, while a function being a special kind of relation for which each
> element in the domain has exactly one image? So relations are inherently
> much more universal than functions, but they are not that practical to
> work with (for a computer and/or human?).
You can as well regard a relation as a special sort of function, i.e. define
relation ~ as a function A x B -> Bool by (a,b) |-> a ~ b.
Cheers
Ben
More information about the Haskell-Cafe
mailing list