[GHC] #8073: TransformListComp weird type error

GHC ghc-devs at haskell.org
Fri Jul 19 09:38:05 CEST 2013


#8073: TransformListComp weird type error
----------------------------------------------+----------------------------
        Reporter:  simonmar                   |            Owner:
            Type:  bug                        |           Status:  new
        Priority:  normal                     |        Milestone:  7.8.1
       Component:  Compiler (Type checker)    |          Version:  7.6.3
      Resolution:                             |         Keywords:
Operating System:  Unknown/Multiple           |     Architecture:
 Type of failure:  GHC rejects valid program  |  Unknown/Multiple
       Test Case:                             |       Difficulty:  Unknown
        Blocking:                             |       Blocked By:
                                              |  Related Tickets:
----------------------------------------------+----------------------------

Comment (by simonmar):

 Ok, I guess that makes sense if we're typechecking the concrete syntax
 before desugaring.  But I was using `MonadComprehensions`, and hence was
 looking at that section of the documentation which says

 {{{
 [ x+y | x <- [1..10], y <- [1..x], then take 2 ]

 This translates to:

 do (x,y) <- take 2 (do x <- [1..10]
                        y <- [1..x]
                        return (x,y))
    return (x+y)
 }}}

 So I found the behaviour quite surprising.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8073#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler




More information about the ghc-tickets mailing list