Ticket #1772 (closed bug: fixed)
GHC doesn't like 'inline' type function applications
| Reported by: | jpbernardy | Owned by: | chak |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.10 branch |
| Component: | Compiler (Type checker) | Version: | 6.9 |
| Keywords: | Cc: | ||
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | Difficulty: | Unknown | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
{-# 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.
Change History
Note: See
TracTickets for help on using
tickets.
