Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
d039b7eb
Commit
d039b7eb
authored
Sep 08, 2006
by
simonpj
Browse files
Alter source code of test, now that result type signatures do not bind type variables
parent
9b7a5c9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/ghc-regress/lib/Generics/reify/Main.hs
View file @
d039b7eb
...
...
@@ -324,25 +324,27 @@ depthOfConstr p (t::TypeVal a) c
------------------------------------------------------------------------------
shallowTerm
::
(
forall
a
.
Data
a
=>
Maybe
a
)
->
(
forall
b
.
Data
b
=>
b
)
shallowTerm
cust
::
b
=
maybe
gdefault
id
cust
where
-- The worker, also used for type disambiguation
gdefault
::
b
gdefault
=
case
con
of
Just
(
con
,
Just
_
)
->
fromConstrB
(
shallowTerm
cust
)
con
_
->
error
"no shallow term!"
-- The type to be constructed
typeVal
::
TypeVal
b
typeVal
=
val2type
gdefault
-- The most shallow constructor if any
con
::
Maybe
(
Constr
,
Maybe
Int
)
con
=
depthOfType
(
const
True
)
typeVal
shallowTerm
cust
=
result
where
result
::
forall
b
.
Data
b
=>
b
-- Need a type signature here to bring 'b' into scope
result
=
maybe
gdefault
id
cust
where
-- The worker, also used for type disambiguation
gdefault
::
b
gdefault
=
case
con
of
Just
(
con
,
Just
_
)
->
fromConstrB
(
shallowTerm
cust
)
con
_
->
error
"no shallow term!"
-- The type to be constructed
typeVal
::
TypeVal
b
typeVal
=
val2type
gdefault
-- The most shallow constructor if any
con
::
Maybe
(
Constr
,
Maybe
Int
)
con
=
depthOfType
(
const
True
)
typeVal
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment