caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* obscur error message
@ 2010-01-26  8:06 Tiphaine Turpin
  0 siblings, 0 replies; only message in thread
From: Tiphaine Turpin @ 2010-01-26  8:06 UTC (permalink / raw)
  To: caml-list

Hi,

I'm puzzled about the type error returned with the following code (fix :
remove "fs"). Assuming value "mgu" and constructor "Var" are defined, is
it reasonable to report a type error about "subst" rather than the
unbound value "fs" ? I would expect the type-checker to first
successfully type the folded function, (with type (var_name * term) list
-> var_name * term -> (var_name * term) list) and then complain about
unbound value fs.

Tiphaine

let genereal_unify subst eqs =
  List.fold_left (fun subst (x, t) -> mgu subst (Var x) t) subst fs eqs

File "prolog.ml", line 475, characters 42-47: (* i.e., second occurrence
of subst *))
Error: This expression has type 'a -> 'b but is here used with type
         (var_name * term) list


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-01-26  8:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-26  8:06 obscur error message Tiphaine Turpin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).