#2101: Allow some form of type-level lemma
--------------------------------+-------------------------------------------
    Reporter:  guest            |        Owner:         
        Type:  feature request  |       Status:  new    
    Priority:  normal           |    Milestone:         
   Component:  Compiler         |      Version:  6.8.2  
    Severity:  normal           |   Resolution:         
    Keywords:                   |     Testcase:         
Architecture:  Unknown          |           Os:  Unknown
--------------------------------+-------------------------------------------
Comment (by ryani):

 Replying to [comment:1 Isaac Dupree]:
 > can `cat_nil` already be optimized away by `ghc -O`? Or might it return
 `_|_`? (is it possible for its recursion not to terminate?)

 I am pretty sure that cat_nil cannot be optimized away.  Consider the
 following additions to the program:

 {{{
 type instance Cat [a] () = [(a,a)]

 unsoundCoerce :: Exp (Cat [a] ()) -> Exp [a]
 unsoundCoerce = coerce undefined
 }}}

 If cat_nil is optimized away then unsoundCoerce exp does an invalid
 conversion from Exp [(a,a)] to Exp [a].

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2101#comment:2>
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