I'm trying to get the GHC to warn me whenever I write a new function and forget to use it anywhere. I've added the following function in my Main.hs:
unused :: () -> ()
unused _ = ()
and of course not used it.
I have the following in my *.cabal file:
ghc-options:
-W
-Wall
-Werror
-Wcompat
-Wincomplete-uni-patterns
-Wincomplete-record-updates
-Wredundant-constraints
-Wpartial-fields
-Wunused-binds
I've specifically added -Wunused-binds to try to force the compiler to fail on this but it does not report any warning about an unused function.
Any idea what am I doing wrong here?
EDIT
Just to give a bigger picture, here is the beggining of the main file:
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Main where
import Apecs
import Linear ( V2(..) )
import Control.Monad
import Control.Monad.IO.Class
import Control.Monad.Catch
import qualified System.Terminal as T
import System.Terminal.Internal
import qualified Data.Map as M
import System.Random