[GHC] #7036: StableNames in presence of class constraints / monadic functions

GHC cvs-ghc at haskell.org
Fri Jun 29 19:51:25 CEST 2012


#7036: StableNames in presence of class constraints / monadic functions
---------------------------------+------------------------------------------
    Reporter:  ifigueroap        |       Owner:                  
        Type:  feature request   |      Status:  new             
    Priority:  normal            |   Milestone:                  
   Component:  GHC API           |     Version:  7.4.2           
    Keywords:                    |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown    
  Difficulty:  Unknown           |    Testcase:                  
   Blockedby:                    |    Blocking:                  
     Related:                    |  
---------------------------------+------------------------------------------

Comment(by ifigueroap):

 Replying to [comment:3 ifigueroap]:

 Sorry I think one encoding could be something like

 {{{
 data MyFun a b = MyFun (a->b) Unique
 mkMyFun f = MyFun f newUnique
 }}}

 and to apply functions
 {{{
 app :: MyFun (a -> b) -> a -> b
 app (MyFun f _) a = f a
 }}}

 and comparison would be trivially

 {{{
 eq :: MyFun a b -> My Fun a b -> Bool
 eq (MyFun _ id1) (MyFun _ id2) = id1 == id2
 }}}

 and by "losing language support" I mean for instance having to wrap every
 function, and having to use app instead of normal application everywhere;
 and in general being unable to reuse all the existing goodies for
 functions.

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



More information about the Glasgow-haskell-bugs mailing list