[GHC] #5267: Arrow command combinators
GHC
cvs-ghc at haskell.org
Wed Oct 12 12:13:39 CEST 2011
#5267: Arrow command combinators
----------------------------------------+-----------------------------------
Reporter: peteg | Owner:
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):
> Bug: moving ite_perm out of the where block works.
This one:
{{{
ite' cA tA eA = proc x ->
do c <- cA -< x
(| ite_perm (returnA -< c) |)
where ite_perm i = ite i tA eA
}}}
works for me in 7.0.1, 7.0.4 and HEAD, but not 6.12.2.
> Bug: we can't write the type signature we want.
{{{
ite' :: ArrowChoice (~>) => A (~>) env Bool -> A (~>) env d -> A (~>) env
d -> A (~>) env d
ite' cA tA eA = proc x ->
do c <- cA -< x
(| (ite_perm tA eA) (returnA -< c) |)
ite_perm :: ArrowChoice (~>) => A (~>) env d -> A (~>) env d -> (env ~>
Bool) -> A (~>) env d
ite_perm tA eA i = ite i tA eA
}}}
We have {{{ite_perm tA eA :: (env ~> Bool) -> A (~>) env d}}}, and the
compiler can't generalize {{{env}}} as required by the banana brackets,
because it occurs in the type environment. So it's following the rules;
the question is whether the rules can be safely relaxed.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5267#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list