packages feed

ghc-exactprint-0.5.1.0: tests/examples/ghc8/WCompatWarningsOff.hs

-- Test purpose:
-- Ensure that using -Wno-compat does not switch on warnings

-- {-# OPTIONS_GHC -Wcompat #-}
{-# OPTIONS_GHC -Wno-compat #-}

module WCompatWarningsOff where

import qualified Data.Semigroup as Semi

monadFail :: Monad m => m a
monadFail = do
    Just _ <- undefined
    undefined

(<>) = undefined -- Semigroup warnings

-- -fwarn-noncanonical-monoid-instances
newtype S = S Int

instance Semi.Semigroup S where
  (<>) = mappend

instance Semi.Monoid S where
  S a `mappend` S b = S (a+b)
  mempty = S 0