Setting compiler options for intero in emacs

107 views Asked by At

When I am developing I like to have -fdefer-type-errors and -XPartialTypeSignatures enabled. Currently I just add

{-# LANGUAGE PartialTypeSignatures #-}
{-# OPTIONS_GHC -fdefer-type-errors #-}

to the top of the file I am working with. However this is not ideal as I often forget to remove these lines once I am done. Is there an option to pass these to intero in emacs?

2

There are 2 answers

0
Julia Path On BEST ANSWER

This can now be archived by setting intero-extra-ghc-options and intero-extra-ghci-options.

2
Matt On

Updating your cabal file to specify the relevant extensions and ghc-options should work, i.e.:

...
lib
  hs-source-dirs:      src
  ghc-options:         -fdefer-type-errors
  extensions:          PartialTypeSignatures