[GHC] #8073: TransformListComp weird type error

GHC ghc-devs at haskell.org
Thu Jul 18 17:08:54 CEST 2013


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

 {{{
 Prelude> :set -XTransformListComp
 Prelude> import Data.List
 Prelude Data.List> [ x | x <- ['a'..'z'], then sort]

 <interactive>:5:29:
     No instance for (Ord a) arising from a use of `sort'
     Possible fix:
       add (Ord a) to the context of
         a type expected by the context: [a] -> [a]
     In the expression: sort
     In a stmt of a list comprehension: then sort
     In the expression: [x | x <- ['a' .. 'z'], then sort]
 }}}

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




More information about the ghc-tickets mailing list