[Haskell-cafe] Display an inferred type during compilation

Gwern Branwen gwern at gwern.net
Sat Apr 27 19:03:10 CEST 2013


On Sat, Apr 27, 2013 at 12:55 PM, Corentin Dupont
<corentin.dupont at gmail.com> wrote:
> can I ask the compiler to display the type of an inferred value during
> compile time?
> It would be great if I can output a string during compilation with the type.
> A little bit like running :type in GHCi, but without GHCi... Because running
> GHCi is sometime painful (I have to clean my code first).

You could try floating a value to the top level; then I believe -Wall
will make ghc print out the inferred type since you didn't give a type
signature.

-- 
gwern
http://www.gwern.net



More information about the Haskell-Cafe mailing list