4 ms·
I don't know Haskell but if I understand correctly it uses the Hindley-Milner type system, which itself uses unification as a type-checker? If so, maybe that's
by YeGoblynQueenne 4y ago
I don't know Haskell but if I understand correctly it uses the Hindley-Milner
type system, which itself uses unification as a type-checker? If so, maybe
that's the similarity you see?
As far as I understand a functional programming language is one where functions
are first-class citizens and hopefully the lambada calculus is the top-level
abstraction. That's not the case with Prolog, which doesn't even have functions
but (like dreamcompiler says) relations which are generalisations of functions,
that don't "evaluate" to anything but "relate" objects.
I think you're trying to understand Prolog using the abstractions you already
know which is, I guess, the way of science. But you have to be careful about
applying the wrong abstractions. For example, a language can't be "functional"
if it doesn't even have functions. In Prolog everything is a definite clause,
and clauses are first-order logic formulae, not functions. The wikipedia article
on definite clauses is I think clear and to the point:
https://en.wikipedia.org/wiki/Horn_clause https://en.wikipedia.org/wiki/Horn_clause
Actually that's the article on Horn clauses, of which definite clauses are a
subset, but that's useful to understand, also. For me, a lot of confusion was
cleared up when I found a good explanation of what is a definite clause.