
Apparently the answer is to `:set FlexibleContexts` in GHCi in addition to
enabling the language extension in a source file. I was unaware it wasn't
enabled by default on interpreting the source.
On Mon, Dec 20, 2010 at 5:54 PM, dan portin
I recently discovered that class and instance declarations in Haskell are Horn clauses. So I encoded the arithmetic operations from the first chapter of *Art of Prolog* into Haskell, in the standar
fac(0,s(0)). fac(s(N),F) :- fac(N,X), mult(s(N),X,F).
class Fac x y | x -> y instance Fac Z (S Z) instance (Fac n x, Mult (S n) x f) => Fac (S n) f
I don't understand, however, to make Haskell instantiate values for variables in a proof. I.e., I don't understand what the Haskell equivalent of
?- fac(X,Y)
would be for some value of X.