#1772: GHC doesn't like 'inline' type function applications
--------------------------------------+-------------------------------------
  Reporter:  jpbernardy               |          Owner:         
      Type:  bug                      |         Status:  new    
  Priority:  normal                   |      Milestone:  6.8.1  
 Component:  Compiler (Type checker)  |        Version:  6.9    
  Severity:  normal                   |       Keywords:         
Difficulty:  Unknown                  |             Os:  Unknown
  Testcase:                           |   Architecture:  Unknown
--------------------------------------+-------------------------------------
 {{{
 {-# LANGUAGE TypeFamilies #-}

 import Prelude hiding (foldl, foldr, foldl1, foldr1, mapM_, sequence_,
                 elem, notElem, concat, concatMap, and, or, any, all,
                 sum, product, maximum, minimum)
 import Data.Monoid

 type family Element t

 class Foldable t where
         foldMap :: Monoid m => (Element t -> m) -> t -> m

         foldr :: (Element t -> b -> b) -> b -> t -> b
         -- foldr :: Element t ~ a => (a -> b -> b) -> b -> t -> b
         foldr f z t = appEndo (foldMap (Endo . f) t) z
 }}}
 GHC chokes on the above module. If the signature of foldr is replaced by
 the commented one, GHC is happy. It seems to me that the two expressions
 should be equivalent.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1772>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to