1 Jul 2011 09:09
Re: #4459: Polymorphic Data.Dynamic
GHC <cvs-ghc <at> haskell.org>
2011-07-01 07:09:53 GMT
2011-07-01 07:09:53 GMT
#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):
I too am very hazy about what this ticket is asking for. The existing
`Data.Dynamic` looks like this
{{{
data Dynamic = Dynamic TypeRep Obj -- Obj is like HValue; GHC is
inconsistent
toDyn :: Typeable a => a -> Dynamic
fromDynamic :: Typeable a => Dynamic -> Maybe a
dynApply :: Dynamic -> Dynamic -> Maybe Dynamic
}}}
I think that `Dynamic` is what you call `TypedAny`.
In the existing setup you cannot put a polymorphic value in a `Dynamic`.
So if `sort :: Ord a => [a] -> [a]`, you can say
{{{
toDyn (sort :: [Int] -> [Int])
toDyn (sort :: [Bool] -> [Bool])
(Continue reading)
RSS Feed