Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
6077c7d6
Commit
6077c7d6
authored
Mar 07, 2005
by
simonpj
Browse files
[project @ 2005-03-07 17:12:05 by simonpj]
Test recursive dictionaries
parent
cd8d1929
Changes
5
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/ghc-regress/typecheck/should_run/all.T
View file @
6077c7d6
...
...
@@ -37,6 +37,8 @@ test('tcrun028', expect_fail_for(['extcore','optextcore']), compile_and_run, [''
test
('
tcrun029
',
normal
,
compile_and_run
,
[''])
test
('
tcrun030
',
normal
,
compile_and_run
,
[''])
test
('
tcrun031
',
only_compiler_types
(['
ghc
']),
compile_and_run
,
[''])
test
('
tcrun032
',
only_compiler_types
(['
ghc
']),
compile_and_run
,
[''])
test
('
tcrun033
',
only_compiler_types
(['
ghc
']),
compile_and_run
,
[''])
test
('
church
',
normal
,
compile_and_run
,
[''])
test
('
testeq2
',
normal
,
compile_and_run
,
[''])
testsuite/tests/ghc-regress/typecheck/should_run/tcrun032.hs
0 → 100644
View file @
6077c7d6
{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-}
-- This tests the recursive-dictionary stuff.
--
-- The derived instance needs
module
Main
where
data
Fix
f
=
In
(
f
(
Fix
f
))
deriving
(
Show
,
Eq
)
data
L
x
=
Nil
|
Cons
Int
x
deriving
(
Show
,
Eq
)
main
=
do
{
print
(
In
Nil
);
print
(
In
Nil
==
In
Nil
)
}
testsuite/tests/ghc-regress/typecheck/should_run/tcrun032.stdout
0 → 100644
View file @
6077c7d6
In Nil
True
testsuite/tests/ghc-regress/typecheck/should_run/tcrun033.hs
0 → 100644
View file @
6077c7d6
{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-}
-- This test made GHC 6.3 build a superclass loop, in
-- the instance ClassA a String declaration
module
Main
where
class
(
Sat
(
a
->
b
->
String
),
ClassB
b
)
=>
ClassA
a
b
class
ClassB
a
where
fun
::
a
->
String
class
Sat
x
where
sat
::
x
instance
ClassA
a
b
=>
Sat
(
a
->
b
->
String
)
where
sat
=
const
fun
instance
ClassA
a
String
-- Badness was that the ClassB superclass dict was loopy
--
-- Needs Sat (a -> String -> String), ClassB String
-- --> ClassA a String, ClassB String
-- and adding ClassA gives superclass ClassB.
instance
ClassB
String
where
fun
=
id
main
=
print
((
sat
::
Int
->
String
->
String
)
3
"hello"
)
testsuite/tests/ghc-regress/typecheck/should_run/tcrun033.stdout
0 → 100644
View file @
6077c7d6
"hello"
Write
Preview
Markdown
is supported
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