Is it possible to query the ghci for the type it inferred for a function inside another function?
相关问题
- Extracting from a Union Type when some have identi
- Understanding do notation for simple Reader monad:
- Making Custom Instances of PersistBackend
- Haskell: What is the differrence between `Num [a]
- applying a list to an entered function to check fo
相关文章
- Is it possible to write pattern-matched functions
- Haskell underscore vs. explicit variable
- Top-level expression evaluation at compile time
- How do I get from a type to the TryParse method?
- Stuck in the State Monad
- foldr vs foldr1 usage in Haskell
- Java Generics: How to specify a Class type for a g
- List of checkboxes with digestive-functors
This is a quick and ugly hack, but what I usually do is just use the function in the wrong way and read the error message:
GHCi output:
Although this leaves out the context
Num t =>
, this usually does provide me with enough information to continue.You might try doing it by setting a breakpoint on it, so the function is in scope from the debugger.
Also I think that EclipseFP can tell you the types of things when you mouse over them, at least some of the time.
With GHC 7.8+, just append
`asTypeOf` _
to the expression.See Find out the type of an expression/function with typed holes for a detailed explanation.