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
jberryman
GHC
Commits
a7f5d123
Commit
a7f5d123
authored
Aug 08, 2001
by
simonmar
Browse files
[project @ 2001-08-08 14:28:08 by simonmar]
Fix parse error and remove ^Ms (an untested test?)
parent
598b2974
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/tests/typecheck/should_compile/tc124.hs
View file @
a7f5d123
{-# OPTIONS -fglasgow-exts #-}
--!!!
Rank
2
polymorphism
-- Both f and g are rejected by Hugs [April 2001]
module
Foo
where
data
T
=
T
{
t1
::
forall
a
.
a
->
a
,
t2
::
forall
a
b
.
a
->
b
->
b
}
-- Test pattern bindings for polymorphic fields
f
::
T
->
(
Int
,
Char
)
f
t
=
let
T
{
t1
=
my_t1
}
=
t
in
(
my_t1
3
,
my_t1
'c'
)
-- Test record update with polymorphic fields
g
::
T
->
T
g
t
=
t
{
t2
=
\
x
y
->
y
}
{-# OPTIONS -fglasgow-exts #-}
--
!!! Rank 2 polymorphism
-- Both f and g are rejected by Hugs [April 2001]
module
Foo
where
data
T
=
T
{
t1
::
forall
a
.
a
->
a
,
t2
::
forall
a
b
.
a
->
b
->
b
}
-- Test pattern bindings for polymorphic fields
f
::
T
->
(
Int
,
Char
)
f
t
=
let
T
{
t1
=
my_t1
}
=
t
in
(
my_t1
3
,
my_t1
'c'
)
-- Test record update with polymorphic fields
g
::
T
->
T
g
t
=
t
{
t2
=
\
x
y
->
y
}
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