[GHC] #9376: Recursive closed type families fails

GHC ghc-devs at haskell.org
Tue Jul 29 09:00:14 UTC 2014


#9376: Recursive closed type families fails
-------------------------------------+-------------------------------------
              Reporter:              |            Owner:
  MikeIzbicki                        |           Status:  new
                  Type:  bug         |        Milestone:
              Priority:  normal      |          Version:  7.8.2
             Component:  Compiler    |         Keywords:
  (Type checker)                     |     Architecture:  Unknown/Multiple
            Resolution:              |       Difficulty:  Unknown
      Operating System:              |       Blocked By:
  Unknown/Multiple                   |  Related Tickets:
       Type of failure:              |
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by kosmikus):

 Replying to [comment:1 simonpj]:

 Simon, your non-recursive version says:

 > type family OrdRec (f :: * -> *) a b  :: Constraint where
 >     OrdRec f a (f b) = ( Ord a, Ord (f b), Ord (f b) )
 >     OrdRec f a b = ( Ord a, Ord b )

 which indeed fails, but with

 > type family OrdRec (f :: * -> *) a b  :: Constraint where
 >     OrdRec f a (f b) = ( Ord a, Ord (f b) )
 >     OrdRec f a b = ( Ord a, Ord b )

 it compiles. Does GHC somehow recognize that the first line is a special-
 case of the second?

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


More information about the ghc-tickets mailing list