let codeGenRule b i first = function
| Rule _ as x ->
    ibprintf b i "%s " <| if first then "let rec" else "and"
    codeGen b i x
| x -> failwithf "Cannot generate code for %A" x