From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.6 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE, HTML_MESSAGE,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 4DF0EBC69 for ; Fri, 20 Oct 2006 17:19:36 +0200 (CEST) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.186]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id k9KFJZqo021951 for ; Fri, 20 Oct 2006 17:19:36 +0200 Received: by nf-out-0910.google.com with SMTP id g2so1519266nfe for ; Fri, 20 Oct 2006 08:19:35 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=OlUpUEyPcEk1Nl8CK20AZtn95trIm3NWAHbOcISK8UjMcSZtmIU4fsnMPm2T3cr/x/Xm1fYW/0/EfgTD3YdNKtBN0ycEDWbKkgszjOXSsuUPuqTxbaBic2dkjvxIKnlXERIoq0DQY2C6M9Cd7w38xKD4XdIOImr03pOMAYP2BqY= Received: by 10.82.136.4 with SMTP id j4mr615344bud; Fri, 20 Oct 2006 08:19:35 -0700 (PDT) Received: by 10.49.32.12 with HTTP; Fri, 20 Oct 2006 08:19:35 -0700 (PDT) Message-ID: Date: Fri, 20 Oct 2006 17:19:35 +0200 From: Tom To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Haskell parser combinators in OCaml? In-Reply-To: <20061019220131.GA18656@hex.no> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_200943_20683487.1161357575296" References: <20061019220131.GA18656@hex.no> X-j-chkmail-Score: MSGID : 4538E907.000 on discorde : j-chkmail score : X : 0/20 1 X-Miltered: at discorde with ID 4538E907.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; haskell:01 parser:01 combinators:01 ocaml:01 ocaml:01 toplevel:01 toploop:01 compiler:01 compiler:01 infers:01 stack:01 stack:01 toplevel:01 toploop:01 infers:01 X-Attachments: cset="UTF-8" cset="UTF-8" ------=_Part_200943_20683487.1161357575296 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline OCaml is able to infer types by itself, so what I suggest is that you don't declare any local types, but only the global types (no (a:int) type expressions, but only toplevel type 'a t = 'a -> 'a * 'a). Also, try declaring only some of your types and define only some of your functions at a time (using the toploop, interactive compiler) to see what are the appropriate types the compiler infers. Besides, you seem to have some errors in the code... for example: let succeed f = > let parse cont stack errors input = cont (stack f) errors input in > mkparser (End {parse=parse}) > ;; there is no End constructor declared. Have fun, Tom ------=_Part_200943_20683487.1161357575296 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline
OCaml is able to infer types by itself, so what I suggest is that you don't declare any local types, but only the global types (no (a:int) type expressions, but only toplevel type 'a t = 'a -> 'a * 'a). Also, try declaring only some of your types and define only some of your functions at a time (using the toploop, interactive compiler) to see what are the appropriate types the compiler infers.

Besides, you seem to have some errors in the code... for example:

  let succeed f =
      let parse cont stack errors input = cont (stack f) errors input in
      mkparser (End {parse=parse})
  ;;


there is no End constructor declared.

Have fun, Tom
------=_Part_200943_20683487.1161357575296--