diff options
author | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2020-05-01 20:26:45 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-05-28 16:23:58 -0400 |
commit | 5f621a78217237a4bdfb299b68827da6cc8f357e (patch) | |
tree | e1418ff44cbb5d4796400df7a12e4f2a8fc43562 /testsuite/tests/th | |
parent | 1f393e1e0a2998fe67cfd06501e35f495758b98f (diff) | |
download | haskell-5f621a78217237a4bdfb299b68827da6cc8f357e.tar.gz |
Add Semigroup/Monoid for Q (#18123)
Diffstat (limited to 'testsuite/tests/th')
-rw-r--r-- | testsuite/tests/th/T18123.hs | 13 | ||||
-rw-r--r-- | testsuite/tests/th/all.T | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/th/T18123.hs b/testsuite/tests/th/T18123.hs new file mode 100644 index 0000000000..e705ec4480 --- /dev/null +++ b/testsuite/tests/th/T18123.hs @@ -0,0 +1,13 @@ +{-# LANGUAGE TemplateHaskell, StandaloneDeriving #-} +module T18123 where + +import Language.Haskell.TH + +data Point = MkPoint { _x, _y :: Double } +data Rect = MkRect { _p1, _p2 :: Point } + +let + deriveEq :: Name -> DecsQ + deriveEq name = [d| deriving instance Eq $(conT name) |] + in + foldMap deriveEq [ ''Point, ''Rect ] diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index af0774d0a9..83844ad396 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -507,3 +507,4 @@ test('TH_PprStar', normal, compile, ['-v0 -dsuppress-uniques']) test('TH_StringLift', normal, compile, ['']) test('TH_BytesShowEqOrd', normal, compile_and_run, ['']) test('T18121', normal, compile, ['']) +test('T18123', normal, compile, ['']) |