summaryrefslogtreecommitdiff
path: root/testsuite/tests/semigroup/SemigroupWarnings.hs
blob: 83ae2cf1807105556a7d56f4c84657f26e11ffa4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
-- Test purpose:
-- Ensure that missing semigroup warnings are issued
-- correctly if the warning flag is enabled

{-# OPTIONS_GHC -fwarn-semigroup #-}

module SemigroupWarnings where



import Data.Semigroup



-- Bad instance, should complain about missing Semigroup parent
data LacksSemigroup
instance Monoid LacksSemigroup where
    mempty = undefined
    mappend = undefined



-- Correct instance, should not warn
data HasSemigroup
instance Semigroup HasSemigroup where
    (<>) = undefined
instance Monoid HasSemigroup where
    mempty = undefined
    mappend = undefined



-- Should issue a Prelude clash warning
(<>) = undefined