Simplifying Core pretty-printing via GHC API?

2013-05-01 Thread Conal Elliott
I'm using the GHC API to compile Haskell source code to Core. I'd like to pretty-print the result with the sort of simplifications I get with -dsuppress-type-applications, -dsuppress-uniques, etc (used in combination with -ddump-simpl on ghc's command line). How can I set these options via the GHC

Re: Simplifying Core pretty-printing via GHC API?

2013-05-01 Thread Johan Tibell
On Wed, May 1, 2013 at 2:13 PM, Conal Elliott co...@conal.net wrote: I'm using the GHC API to compile Haskell source code to Core. I'd like to pretty-print the result with the sort of simplifications I get with -dsuppress-type-applications, -dsuppress-uniques, etc (used in combination with

Re: Simplifying Core pretty-printing via GHC API?

2013-05-01 Thread Conal Elliott
I think I found an answer: invoke parseStaticFlagshttp://www.haskell.org/ghc/docs/7.4.1/html/libraries/ghc/GHC.html#v:parseStaticFlags, passing in the flags specified as if on the ghc command line. For instance: parseStaticFlags $ noLoc $ [-dsuppress-uniques, -dsuppress-type-applications,