#1834: No instance for <type family result type> in ghci command line
---------------------------------------------------------+------------------
    Reporter:  guest                                     |       Owner:         
        Type:  bug                                       |      Status:  new    
    Priority:  normal                                    |   Component:  GHCi   
     Version:  6.9                                       |    Severity:  normal 
    Keywords:  type family function class instance ghci  |    Testcase:         
Architecture:  Unknown                                   |          Os:  Unknown
---------------------------------------------------------+------------------
 In the following code, {{{Pred ()}}} no longer matches the instance for
 {{{()}}} from the GHCi command line, even though {{{Pred () ~ ()}}}.

 In 6.9.20071015 it still works, in 6.9.20071103 it no longer does.

 {{{
 {-# LANGUAGE TypeFamilies #-}
 module Test where

 x = reify (() :: Pred ())

 type family Pred a
 type instance Pred a = a

 class Reify a where
     reify :: a -> ()

 instance Reify () where
     reify _ = ()
 }}}

 The exact results:
 {{{
 GHCi, version 6.9.20071015:
 *Test> x
 ()
 *Test> reify (() :: Pred ())
 ()


 GHCi, version 6.9.20071103:
 *Test> x
 ()
 *Test> reify (() :: Pred ())

 <interactive>:1:0:
     No instance for (Reify (Pred ()))
       arising from a use of `reify' at <interactive>:1:0-20
     Possible fix: add an instance declaration for (Reify (Pred ()))
     In the expression: reify (() :: Pred ())
     In the definition of `it': it = reify (() :: Pred ())
 }}}

 And, just for completeness, 6.8 shows the same regression:
 {{{
 GHCi, version 6.8.0.20071002:
 *Test> x
 ()
 *Test> reify (() :: Pred ())
 ()


 GHCi, version 6.8.1.20071031:
 *Test> x
 ()
 *Test> reify (() :: Pred ())

 <interactive>:1:0:
     No instance for (Reify (Pred ()))
       arising from a use of `reify' at <interactive>:1:0-20
     Possible fix: add an instance declaration for (Reify (Pred ()))
     In the expression: reify (() :: Pred ())
     In the definition of `it': it = reify (() :: Pred ())
 }}}

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

Reply via email to