[GHC] #4459: Polymorphic Data.Dynamic

GHC cvs-ghc at haskell.org
Fri Jul 1 10:59:19 CEST 2011


#4459: Polymorphic Data.Dynamic
-----------------------------------------------------+----------------------
    Reporter:  vivian                                |        Owner:  vivian      
        Type:  feature request                       |       Status:  new         
    Priority:  normal                                |    Milestone:  7.4.1       
   Component:  GHC API                               |      Version:  7.1         
    Keywords:  polymorphic, dynamic, class, linking  |     Testcase:              
   Blockedby:                                        |   Difficulty:              
          Os:  Unknown/Multiple                      |     Blocking:  4316        
Architecture:  Unknown/Multiple                      |      Failure:  None/Unknown
-----------------------------------------------------+----------------------

Comment(by vivian):

 Replying to [comment:14 simonpj]:
 > I think this polymorphism issue is what you are trying to solve.
 Exactly.

 > I don't think it's easy:
 >  * A `Dynamic` contains a `TypeRep`, so you'd need to elaborate
 `TypeRep` to represent polymorphic types.
 I don't think it is easy either.  I was thinking of using the `Type` data
 type which is what GHC/GHCi use.

 >  * When unwrapping an overloaded polymorphic value at runtime, you'd
 need to build a suitable dictionary to apply it to.  This is no easy
 matter: you might need the dictionary for `(Ord (Tree [Maybe Int]))`, say.
 That is, you need to invoke the full type-constraint solver, in the
 correct type environment.

 Yes, which is using the type-checker at run-time, correct?

 > Before embarking on such a project I think it would be good to learn
 from the Clean experience, try out their system, and (especially)
 articulate use cases. So that you know exactly what it is that you want to
 build.  Perhaps start a fresh wiki page articulating (a) the motivation
 (b) use cases (c) the design as seen by the programmer.

 Good idea.  I've got a couple of papers about ad-hoc polymorphic dynamic
 types in Clean.  I'll follow your suggestion about looking at Clean and
 also creating a wiki page.

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



More information about the Glasgow-haskell-bugs mailing list