mparser icon indicating copy to clipboard operation
mparser copied to clipboard

example usage with dune

Open nrolland opened this issue 6 years ago • 4 comments

it would be helpful to have a sample project using dune to play with

nrolland avatar Nov 09 '18 16:11 nrolland

naively pasting the example I had some error with non-interactive code

Error: The type of this expression, (_[> Binop of _[> Add | Div | Mul | Sub ] * 'a * 'a | Int of int ] as 'a, '_weak1) operator list list, contains type variables that cannot be generalized

which seems to indicate that some type annotation is required as in common error message

nrolland avatar Nov 09 '18 16:11 nrolland

it would be helpful to have a sample project using dune to play with

Request taken!

I've never found time to get into dune (although I wanted to), so this is a good opportunity to get familiar with it.

murmour avatar Nov 10 '18 16:11 murmour

naively pasting the example I had some error with non-interactive code

Hmm. This wasn't an issue in earlier versions of OCaml. I'll rework the provided example. Thanks for reporting!

murmour avatar Nov 10 '18 16:11 murmour

It's my mistake : I did not use all of the example, and the missing part caused a pb with variant record, to which the interactive version was more lenient (hence my confusion).

here's a very simple example using dune : https://github.com/nrolland/oparser

nrolland avatar Nov 14 '18 10:11 nrolland