testsuite: Deduplicate source in wcompat-warnings test
[ghc.git] / testsuite / tests / wcompat-warnings / Template.hs
1 {-# LANGUAGE NoMonadFailDesugaring #-}
2
3 module WCompatWarningsOnOff where
4
5 import qualified Data.Semigroup as Semi
6
7 monadFail :: Monad m => m a
8 monadFail = do
9 Just _ <- undefined
10 undefined
11
12 (<>) = undefined -- Semigroup warnings
13
14 -- -fwarn-noncanonical-monoid-instances
15 newtype S = S Int
16
17 instance Semi.Semigroup S where
18 (<>) = mappend
19
20 instance Monoid S where
21 S a `mappend` S b = S (a+b)
22 mempty = S 0
23