Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where to add GHC options? #109

Open
tsoernes opened this issue Mar 15, 2017 · 1 comment
Open

Where to add GHC options? #109

tsoernes opened this issue Mar 15, 2017 · 1 comment

Comments

@tsoernes
Copy link

tsoernes commented Mar 15, 2017

I want to suppress unused top level functions. I have added
let g:ghcmod_ghc_options = ['-Wno-unused-top-binds']
to .vimrc, and to the ghcmod.vim files in
ghcmod-vim/after/ftplugin/lhaskell, ghcmod-vim/autoload and ghcmod-vim/plugin/, but it does not seem to work.

@DanielG
Copy link

DanielG commented Mar 17, 2017

You can also add these options to your cabal file or in an annotation directly into the haskell file(s) you want this to apply to.

For cabal:

ghc-options: -Wno-unused-top-binds

If you don't want this to apply to real builds you could add a flag, see https://www.haskell.org/cabal/users-guide/developing-packages.html#example-using-explicit-braces-rather-than-indentation-for-layout .

In a haskell file add this before module XXX where :

{-# OPTIONS_GHC -Wno-unused-top-binds #-}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants