> #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 simonpj):
>
>  Maybe we should move this thread to ghc-users?  You are programming with
>  the GHC API, which is great, but it's not now about changing GHC itself I
>  think.
>

It is possible to implement `dynApply :: Dynamic -> Dynamic -> Dyn (Maybe
Dynamic)` and `dynLoad :: [DFlags] -> String -> String -> Dyn Dynamic` by
using the GHC API, however, `toDynamic` and `fromDynamic` (the first point
in simonpj's earlier comment) requires a modification to GHC.

* There needs to be a primitive `typeOf :: a -> Type` that demotes a type to
a value (this primitive has to use the same type for `Type` as the compiler,
which is the difference between this and the monomorphic `Typeable`.  It
seems to me that this could be implemented as a pass over type-checked code?

* Also, exposing a function that typechecks and does not rename would
require an addition to the API.

Vivian
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to