
27 Dec
2007
27 Dec
'07
5:30 p.m.
Alfonso Acosta wrote:
2) Think of a change in the internal representation of signals which made polymorphic processes possible. Polymorphic processes don't have to be necessarily definable by the user. They should be happy enough with a few polymorphic primitives (mapSnd would be one of them).
I am not sure if this is applicable to your problem, but in GHC you can wrap polymorphic values in a newtype using higher-rank polymorphism, like in newtype WrapId = WrapId { unWrapId :: (forall a. a -> a) } deriving Typeable You can then use toDyn . WrapId to wrap 'id' into a Dynamic and unWrapId . flip fromDyn (error "wrong type") to unwrap it. Cheers Ben