Suggest how to enable a language extension in the repl
Motivation
When using a feature that requires a language extension in a repl it would be nice for ghci to suggest how to enable that extension. Currently it will show:
ghci> data family GMap k :: * -> *
<interactive>:1:1: error:
• Illegal family declaration for ‘GMap’
Enable TypeFamilies to allow indexed type families
• In the data family declaration for ‘GMap’
Even though I've been using haskell for a while I frequently forget what it is (I probably also just have terrible memory).
For instance I just tried this out :set -xTypeFamilies
forgetting that x needs to be uppercased.
Proposal
ghci> data family GMap k :: * -> *
<interactive>:1:1: error:
• Illegal family declaration for ‘GMap’
Enable TypeFamilies to allow indexed type families
• In the data family declaration for ‘GMap’
Perhaps try enabling the language extension with:
:set -XTypeFamilies
Or something like that.