Ticket #1772 (closed bug: fixed)

Opened 4 years ago

Last modified 3 years ago

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

Changed 4 years ago by chak

  • owner set to chak

Changed 4 years ago by simonmar

  • milestone changed from 6.8.1 to 6.10 branch

We're not advertising type functions as part of 6.8.

Changed 4 years ago by chak

  • status changed from new to closed
  • resolution set to fixed

Works now in the HEAD.

Changed 3 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 3 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.