3 ms·
Just put in an underscore where you want to write code. If you compile the code, GHC outputs an error with the expected type as well as all bindings in scope. T
by tathougies 9y ago
Just put in an underscore where you want to write code. If you compile the code, GHC outputs an error with the expected type as well as all bindings in scope. Then, just work backwards. If you use intero, then all type errors are underlined, including placeholders.
The general feature is called 'typed holes', and there's a wiki page here: https://wiki.haskell.org/GHC/Typed_holes https://wiki.haskell.org/GHC/Typed_holes
- AlexCoventry 9y agoThanks.