From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.6.10/8.6.6) id UAA19831 for caml-redistribution; Wed, 12 Jun 1996 20:31:19 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.6.10/8.6.6) with ESMTP id MAA10157 for ; Wed, 12 Jun 1996 12:31:44 +0200 Received: from heaton.cl.cam.ac.uk (exim@heaton.cl.cam.ac.uk [128.232.0.11]) by concorde.inria.fr (8.7.1/8.7.1) with SMTP id MAA26166 for ; Wed, 12 Jun 1996 12:31:40 +0200 (MET DST) Received: from cl.cam.ac.uk [128.232.0.93] (mj211) by heaton.cl.cam.ac.uk with esmtp (Exim 0.52 #1) id E0uTnCw-00060C-00; Wed, 12 Jun 1996 11:31:26 +0100 X-Mailer: exmh version 1.6.4+cl+patch 10/10/95 To: caml-list@pauillac.inria.fr Subject: Perplexing type error. Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 12 Jun 1996 11:31:25 +0200 From: Michael Jones Message-Id: Sender: weis Tres petit(e) abstract en Francais: Il y a une "type error" que je ne comprende pas. While tweaking a preterm parser for type expressions in a proof assistant written in caml, I came across the following perplexing type error. At first, it looked like a type inference problem so I specified the types in the generic function definitions and got a new error: #Toplevel input: > and parse_pretypepred src = P_APPLY Pred (parse_preterm) src > ^^^^^^^^^^^^^ This expression has type lexcode list -> preterm * lexcode list, but is used with type lexcode list -> preterm * lexcode list. # _ So. Any ideas why this is an error and how I can fix it? I'm stumped. The line with the error in it is part of a larger mutualy recursive function. I am using caml-light-0.71 on a sun workstation and didn't see anything similar in the known bugs file. Some more detail about the line of code: P_APPLY is a parser combinater that takes a function (Pred in this case) and applies it to the parser result. Pred is a type constructor for making pretypes out of preterms. parse_preterm is the parser and src is the output of the lex. analyzer. regards, mike.