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
alexbiehl-gc
GHC
Commits
d5039ed9
Commit
d5039ed9
authored
27 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1997-09-03 23:31:30 by sof]
new test
parent
5ee13466
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/tests/typecheck/should_fail/tcfail076.hs
+33
-0
33 additions, 0 deletions
ghc/tests/typecheck/should_fail/tcfail076.hs
with
33 additions
and
0 deletions
ghc/tests/typecheck/should_fail/tcfail076.hs
0 → 100644
+
33
−
0
View file @
d5039ed9
{-
From: Ralf Hinze <ralf@uran.informatik.uni-bonn.de>
Date: Fri, 15 Aug 1997 15:20:51 +0200 (MET DST)
I *suppose* that there is a bug in GHC's type checker. The following
program, which I think is ill-typed, passes silently the type checker.
Needless to say that it uses some of GHC's arcane type extensions.
-}
{-# OPTIONS -fglasgow-exts #-}
module
Test
(
module
Test
)
where
import
GlaExts
data
ContT
m
a
=
KContT
((
All
res
)
=>
(
a
->
m
res
)
->
m
res
)
unKContT
(
KContT
x
)
=
x
callcc
::
((
a
->
ContT
m
b
)
->
ContT
m
a
)
->
ContT
m
a
callcc
f
=
KContT
(
\
cont
->
unKContT
(
f
(
\
a
->
KContT
(
\
cont'
->
cont
a
)))
cont
)
{-
`ContT' is a continuation monad transformer. Note that we locally
qualify over the result type `res' (sometimes called answer or
output). IMHO this make it impossible to define control constructs
like `callcc'. Let's have a closer look: the code of `callcc' contains
the subexpression `KContT (\cont' -> cont a)'. To be well-typed the
argument of `KContT' must have the type `(All res) => (a -> m res) -> m
res'. Quantification is not possible, however, since the type variable
in `cont's type cannot be forall'd, since it also appears at an outer
level. Right? Or wrong?
-}
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