3 ms·
> Half the time I let the compiler write the code by using ghc placeholders and playing type golf Is this method documented anywhere? Sounds interesting.
by AlexCoventry 9y ago
> Half the time I let the compiler write the code by using ghc placeholders and playing type golf
Is this method documented anywhere? Sounds interesting.
- tathougies 9y agoJust 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.