#2102: Typeclass membership doesn't bring coercion superclass requirements into
scope
-------------------------------------------------+--------------------------
  Reporter:  ryani                               |          Owner:  chak        
         
      Type:  bug                                 |         Status:  closed      
         
  Priority:  low                                 |      Milestone:  7.2.1       
         
 Component:  Compiler (Type checker)             |        Version:  7.1         
         
Resolution:  fixed                               |       Keywords:  superclass 
equalities
  Testcase:  indexed_types/should_compile/T2102  |      Blockedby:              
         
Difficulty:  Unknown                             |             Os:  
Unknown/Multiple     
  Blocking:                                      |   Architecture:  
Unknown/Multiple     
   Failure:  Compile-time crash                  |  
-------------------------------------------------+--------------------------
Changes (by simonpj):

  * status:  new => closed
  * testcase:  => indexed_types/should_compile/T2102
  * resolution:  => fixed


Comment:

 Hurrah!  We now have superclass equalities. I've added this example as a
 test.
 {{{
 commit 940d1309e58382c889c2665227863fd790bdb21c
 Author: Simon Peyton Jones <simo...@microsoft.com>
 Date:   Wed Jun 22 17:37:47 2011 +0100

     Add equality superclasses

     Hurrah.  At last we can write

        class (F a ~ b) => C a b where { ... }

     This fruit of the fact that equalities are now values,
     and all evidence is handled uniformly.

     The main tricky point is that when translating to Core
     an evidence variable 'v' is represented either as
       either   Var v
       or       Coercion (CoVar v)
     depending on whether or not v is an equality.  This leads
     to a few annoying calls to 'varToCoreExpr'.

  compiler/basicTypes/MkId.lhs      |    4 +-
  compiler/deSugar/DsExpr.lhs       |   18 +++++++-
  compiler/iface/BuildTyCl.lhs      |   50 ++++++++++------------
  compiler/typecheck/TcInstDcls.lhs |   85
 +++++++++++++++++-------------------
  compiler/typecheck/TcMType.lhs    |    9 +----
  compiler/types/Class.lhs          |   21 ++++------
  6 files changed, 92 insertions(+), 95 deletions(-)
 }}}

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

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to