Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gershomb
GHC
Commits
c8231408
Commit
c8231408
authored
7 years ago
by
Ryan Scott
Browse files
Options
Downloads
Patches
Plain Diff
Add regression test for #13758
parent
7fce4cbc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
testsuite/tests/deriving/should_compile/T13758.hs
+57
-0
57 additions, 0 deletions
testsuite/tests/deriving/should_compile/T13758.hs
testsuite/tests/deriving/should_compile/all.T
+2
-1
2 additions, 1 deletion
testsuite/tests/deriving/should_compile/all.T
with
59 additions
and
1 deletion
testsuite/tests/deriving/should_compile/T13758.hs
0 → 100644
+
57
−
0
View file @
c8231408
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# Language ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
module
T13758
where
import
Data.Coerce
import
GHC.Generics
import
Data.Semigroup
-----
class
Monoid'
f
where
mempty'
::
f
x
mappend'
::
f
x
->
f
x
->
f
x
instance
Monoid'
U1
where
mempty'
=
U1
mappend'
U1
U1
=
U1
instance
Monoid
a
=>
Monoid'
(
K1
i
a
)
where
mempty'
=
K1
mempty
mappend'
(
K1
x
)
(
K1
y
)
=
K1
(
x
`
mappend
`
y
)
instance
Monoid'
f
=>
Monoid'
(
M1
i
c
f
)
where
mempty'
=
M1
mempty'
mappend'
(
M1
x
)
(
M1
y
)
=
M1
(
x
`
mappend'
`
y
)
instance
(
Monoid'
f
,
Monoid'
h
)
=>
Monoid'
(
f
:*:
h
)
where
mempty'
=
mempty'
:*:
mempty'
mappend'
(
x1
:*:
y1
)
(
x2
:*:
y2
)
=
mappend'
x1
x2
:*:
mappend'
y1
y2
memptydefault
::
(
Generic
a
,
Monoid'
(
Rep
a
))
=>
a
memptydefault
=
to
mempty'
mappenddefault
::
(
Generic
a
,
Monoid'
(
Rep
a
))
=>
a
->
a
->
a
mappenddefault
x
y
=
to
(
mappend'
(
from
x
)
(
from
y
))
-----
newtype
GenericMonoid
a
=
GenericMonoid
a
instance
(
Generic
a
,
Monoid'
(
Rep
a
))
=>
Semigroup
(
GenericMonoid
a
)
where
(
<>
)
=
coerce
(
mappenddefault
::
a
->
a
->
a
)
instance
(
Generic
a
,
Monoid'
(
Rep
a
))
=>
Monoid
(
GenericMonoid
a
)
where
mempty
=
coerce
(
memptydefault
::
a
)
mappend
=
coerce
(
mappenddefault
::
a
->
a
->
a
)
data
Urls
=
Urls
String
String
String
deriving
(
Show
,
Generic
)
newtype
UrlsDeriv
=
UD
(
GenericMonoid
Urls
)
deriving
(
Semigroup
,
Monoid
)
This diff is collapsed.
Click to expand it.
testsuite/tests/deriving/should_compile/all.T
+
2
−
1
View file @
c8231408
def
just_the_deriving
(
msg
):
return
msg
[
0
:
msg
.
find
('
Filling in method body
')]
test
('
drv001
',
normal
,
compile
,
[''])
test
('
drv002
',
normal
,
compile
,
[''])
test
('
drv003
',
normal
,
compile
,
[''])
...
...
@@ -88,5 +88,6 @@ test('T12814', normal, compile, ['-Wredundant-constraints'])
test
('
T13272
',
normal
,
compile
,
[''])
test
('
T13272a
',
normal
,
compile
,
[''])
test
('
T13297
',
normal
,
compile
,
[''])
test
('
T13758
',
normal
,
compile
,
[''])
test
('
drv-empty-data
',
[
normalise_errmsg_fun
(
just_the_deriving
)],
compile
,
['
-ddump-deriv -dsuppress-uniques
'])
test
('
drv-phantom
',
[
normalise_errmsg_fun
(
just_the_deriving
)],
compile
,
['
-ddump-deriv -dsuppress-uniques
'])
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment