In my cabal file I have a bunch of language extensions enabled. Let's say I have
- TemplateHaskell
- QuasiQuotes
- CPP
Is there a way to start GHCi with these enabled automatically? instead of manually doing
ghci -XTemplateHaskell -XQuasiQuotes -XCPP
Specify the extensions in a pragma at the top of the source files:
{-# LANGUAGE TemplateHaskell, QuasiQuotes, CPP #-}
For ghc options that are not within the scope of the language pragma, you can also use the OPTIONS_GHC pragma (and you could write {-# OPTIONS_GHC -XTemplateHaskell -XQuasiQuotes -XCPP #-}
(note the lack of commas), but the language pragma is preferred where possible, as it is portable to other compilers that support the extensions).