Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#2165 closed bug (invalid)

Type checker for Type families

Reported by: hpacheco Owned by: chak
Priority: normal Milestone:
Component: Compiler (Type checker) Version: 6.9
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

For a type family and a class definition:

type family F a x :: *

class FunctorF x where

fmapF
d -> (a -> b) -> F x a -> F x b

Curiously if I have

fff a = fmapF a id

it compiles correctly. But if I infer the type signature of fff I get

fff :: forall d x. (FunctorF d) => d -> F d x -> F d x

On the other side, a similar problem as before arises when

fff :: forall d x. (FunctorF d) => d -> F d x -> F d x
fff a = fmapF a id

This follows up from http://hackage.haskell.org/trac/ghc/ticket/2157

On Tue, Mar 18, 2008 at 7:03 PM, Ryan Ingram <ryani.spam@…> wrote:
Interestingly, this works when you also give a type signature to "id":

fff :: forall d x. (FunctorF d) => d -> F d x -> F d x
fff a = fmapF a (id :: x -> x)

compiles for me (ghc6.8.2). There's probably a bug in the type
checker; inference is working with no type signatures, but checking
fails.

Change History (4)

comment:1 Changed 6 years ago by chak

  • Owner set to chak

This is not a bug as I just explained in #2157.

comment:2 Changed 6 years ago by chak

  • Resolution set to invalid
  • Status changed from new to closed

comment:3 Changed 6 years ago by simonmar

  • Architecture changed from Unknown to Unknown/Multiple

comment:4 Changed 6 years ago by simonmar

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