Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2006-10-20 (15:19)
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