[GHC] #5267: Arrow command combinators
GHC
cvs-ghc at haskell.org
Sun Nov 6 18:37:00 CET 2011
#5267: Arrow command combinators
----------------------------------------+-----------------------------------
Reporter: peteg | Owner: ross
Type: bug | Status: new
Priority: normal | Milestone: 7.4.1
Component: Compiler | Version: 7.0.3
Resolution: | Keywords:
Testcase: | Blockedby:
Difficulty: | Os: Unknown/Multiple
Blocking: | Architecture: Unknown/Multiple
Failure: GHC rejects valid program |
----------------------------------------+-----------------------------------
Comment(by ross):
It does seem to make sense to handle the scope issues in the renamer, but
I think there's another issue here beyond holey scopes. Here's the type
rule for ArrForm, just in the unary case (fixing a typo, which wouldn't
help):
{{{
G |-b c : [s1 .. sm] s
pop(G) |- e : forall w. b ((w,s1) .. sm) s -> a ((w,t1) .. tn) t
w \not\in (s, s1..sm, t, t1..tn)
----------------------------------------------
G |-a (| e c |) : [t1 .. tn] t
}}}
So e is checked in the outer scope, but you also need to be able to
generalize over the type variable w, so it can't occur free in pop(G)
(which it does in the first example above). This is part of ensuring that
operators like e are oblivious to the way we plumb the environment through
the arrows. The rest is the constraint on w in the above rule. The si
and ti are checked by the fragment you mention above. The check on t
seems to have disappeared in 7.0, as seen in the second example I gave.
It seems the check on s was never implemented: the following is wrongly
accepted even by 6.12:
{{{
should_fail_too x = proc y -> (| bad_op (returnA -< x) |)
where
bad_op :: Arrow a => a env env -> a env Bool
bad_op _ = arr (const True)
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5267#comment:11>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list