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:
open Baseat the top of a .mly file, I can use Base throughout the code that I write. However, having
Baseopened breaks things in the generated code, because Menhir uses functions like
Printf.printfthat no longer exist. I can get around this with stuff like
module 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 inspread 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.