Version française
Home     About     Download     Resources     Contact us    
Browse thread
Haskell parser combinators in OCaml?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Tom <tom.primozic@g...>
Subject: Re: [Caml-list] Haskell parser combinators in OCaml?
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