Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
6a70b5ac
Commit
6a70b5ac
authored
Dec 23, 2011
by
Simon Peyton Jones
Browse files
Test Trac #5719
parent
fd9bfbd5
Changes
3
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/indexed-types/should_run/T5719.hs
0 → 100644
View file @
6a70b5ac
{-# LANGUAGE ConstraintKinds, TypeFamilies, FlexibleInstances #-}
module
Main
where
import
GHC.Prim
(
Constraint
)
import
Prelude
hiding
(
Functor
,
fmap
)
import
Data.Set
(
Set
)
import
qualified
Data.Set
as
S
(
map
,
fromList
)
class
Functor
f
where
type
C
f
a
::
Constraint
type
C
f
a
=
()
fmap
::
(
C
f
a
,
C
f
b
)
=>
(
a
->
b
)
->
f
a
->
f
b
instance
Functor
Set
where
type
C
Set
a
=
Ord
a
fmap
=
S
.
map
instance
Functor
[]
where
fmap
=
map
-- type C [] a = ()
testList
=
fmap
(
+
1
)
[
1
,
2
,
3
]
testSet
=
fmap
(
+
1
)
(
S
.
fromList
[
1
,
2
,
3
])
main
=
do
{
print
testList
;
print
testSet
}
testsuite/tests/indexed-types/should_run/T5719.stdout
0 → 100644
View file @
6a70b5ac
[2,3,4]
fromList [2,3,4]
testsuite/tests/indexed-types/should_run/all.T
View file @
6a70b5ac
...
...
@@ -6,3 +6,4 @@ test('T4235', normal, compile_and_run, [''])
test
('
GMapAssoc
',
normal
,
compile_and_run
,
['
-package containers
'])
test
('
GMapTop
',
normal
,
compile_and_run
,
['
-package containers
'])
test
('
T5719
',
normal
,
compile_and_run
,
[''])
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment