#5022: Arrow desugarer generates Core Lint error
-------------------------------+--------------------------------------------
Reporter: serpentologist | Owner: ross
Type: bug | Status: new
Priority: high | Milestone: 7.4.1
Component: Compiler | Version: 7.0.2
Keywords: infinite loop | Os: Linux
Architecture: x86_64 (amd64) | Failure: None/Unknown
Difficulty: | Testcase:
Blockedby: | Blocking:
Related: |
-------------------------------+--------------------------------------------
Comment(by ross@…):
commit 4c8e03075ab8719f3753c1a2e4f05ef21be193ac
{{{
Author: Ross Paterson <[email protected]>
Date: Mon Dec 19 23:44:33 2011 +0000
fix #5022: polymorphic definitions inside arrow rec
This is quite tricky, with examples like this:
import Control.Arrow
pRepeat :: a -> [a]
pRepeat =
proc x -> do
rec
s <- returnA -< f_rec x:s -- f_rec is monomorphic here
let f_later y = y -- f_later is polymorphic here
_ <- returnA -< (f_later True, f_later 'a')
let f_rec y = y -- f_rec is polymorphic here
returnA -< f_later s -- f_later is monomorphic here
Fixed the typechecking of arrow RecStmt to track changes to the monad
version. It was simplest to add a field recS_later_rets corresponding
to recS_rec_rets. It's only used for the arrow version, and always
empty for the monad version. But I think it would be cleaner to put
the rec_ids and later_ids in a single list with supplementary info
saying how they're used.
Also fixed several glitches in the desugaring of arrow RecStmt. The
fact
that the monomorphic variables shadow their polymorphic counterparts
is a
major pain. Also a bit of general cleanup of DsArrows while I was
there.
compiler/deSugar/DsArrows.lhs | 238
+++++++++++++++++++++++---------------
compiler/hsSyn/HsExpr.lhs | 9 +-
compiler/hsSyn/HsUtils.lhs | 2 +-
compiler/typecheck/TcArrows.lhs | 27 +++--
compiler/typecheck/TcHsSyn.lhs | 9 +-
compiler/typecheck/TcMatches.lhs | 3 +-
6 files changed, 174 insertions(+), 114 deletions(-)
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5022#comment:17>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs