I’ve been using Menhir a bit recently with Jane Street’s libraries. With Core_kernel, things work as I want them to. However, if I instead use Base, I run into the following dilemma:
-
If I
open Base
at the top of a .mly file, I can use Base throughout the code that I write. However, havingBase
opened breaks things in the generated code, because Menhir uses functions likePrintf.printf
that no longer exist. I can get around this with stuff likemodule Printf = struct include Printf let fprintf = Stdio.Out_channel.fprintf
, but that’s ugly and requires manually catching the missing functions. -
I can instead just open Base locally in the expressions where I actually want to use it, but having
let open Base in
spread around is a bit clunky, given that Base is supposed to be functioning as a standard library.
I’m curious to know if anyone else has dealt with this issue, and how they’ve solved it.