Find inferred type for local function
ghci, haskell, type-inference
Solution
I don't know of any way of doing it from GHCi.
However, if you're using an editor like Emacs or Vim, you can try ghc-mod. This is an external tool that plugs into an editor and gives you some IDE-like functionality for Haskell programs, including the ability to get the type of an arbitrary expression, including a local definition.
In Emacs, you would use `C-c C-t` to find the type of an expression.
If you're not using Emacs or Vim, you could probably wrap ghc-mod as a GHCi extension or something, but I think that would be somewhat awkward. I can't imagine a good way to do it without having an editor-like UI. However, ghc-mod itself is just a standalone command-line tool, so it's easy to work with. If you can think of a good user interface for it that's independent of an existing text editor, go for it!
Of course, if you're not using Emacs or Vim, you probably should :P.
Problem
Is there a way in ghci (or ghc) to find what the inferred type of a local function is? E.g. if I have a function ``` f l = map f' l where f' = (+1) ``` is there a `:t`-like way in ghci to see what the inferred type for `f'` is?