#2110: Rules to eliminate casted id's
---------------------------------+------------------------------------------
    Reporter:  igloo             |       Owner:                  
        Type:  feature request   |      Status:  new             
    Priority:  lowest            |   Milestone:  7.6.2           
   Component:  Compiler          |     Version:  6.8.2           
    Keywords:                    |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown    
  Difficulty:  Unknown           |    Testcase:                  
   Blockedby:                    |    Blocking:                  
     Related:                    |  
---------------------------------+------------------------------------------

Comment(by nomeata):

 Looking at

 Replying to [comment:5 simonpj]:
 > {{{
 >   RULE "map/cast" forall (a::*) (b::*) (c::*)
 >                          (co :: (a->b ~ a->c))
 >                          (f::a->b)
 >                   map a c (f |> co) = map a b f |> [right co]
 >
 >   RULE "map/id" forall (a::*) map a a id = id
 > }}}

 I wonder whether it is realistic to have the types inferred here, e.g.
 {{{
 {-# RULES "map/cast" forall f co. map (f `cast` co) = map f `cast` right
 co
           "map/id" map id = id
   #-}
 }}}

 This way, the current issue can be solved independently from #2600, and
 the remaining question is how to expose the Core expressions cast and
 right to the RULES parser – it seems that they are currently not exported
 as Haskell values.

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