The next step of the MonadFail Proposal broke nofib's lambda benchmark.
This commit fixes that in an unintrusive way.
Ah, now I see what you mean. I didn't realize that State Env and Id were also instances of EvalEnvMonad, so adding a MonadFail superclass would force them to have MonadFail instances as well. Ugh.
Instead of doing that, perhaps a more straightforward fix would be to replace those two failable traverseTerm lines with an auxiliary function like:
traverseCon u = do u' <- traverseTerm u case u' of Con c -> return c _ -> error $ "traverseCon: " ++ show u'
This looks like a step forward, but I'm getting
Main.hs:183:9: error: • No instance for (Control.Monad.Fail.MonadFail Id) arising from a do statement with the failable pattern ‘Con v'’ • In a stmt of a 'do' block: Con v' <- simpleEval env v In the expression: do Con u' <- simpleEval env u Con v' <- simpleEval env v return (Con (u' + v'))