I've been working with the new parser entry points - they have been
Ostensibly the new parser entry points are pure functions but they
require a copy of DynFlags. As far as I can work out there's no pure
way to reliably construct DynFlags but it also seems that the Parser
doesn't use any of the impure mutable parts of it. This makes it
tricky to write pure functions such as "parseExprFromString :: String
-> LHsExpr RdrName" which would use some sort of dummy configuration.
So far I've tried using "unsafeGlobalDynFlags" which (expectedly)
fails occasionally. I've found a more reliable method to be the
following which relies on unsafePerformIO.