21 Dec 12:13
Re: Dynamic typing of polymorphic functions
Alfonso Acosta <alfonso.acosta <at> gmail.com>
2007-12-21 11:13:35 GMT
2007-12-21 11:13:35 GMT
Hi Oleg! Thanks a lot for your answer, you turn out to end up solving every problem I get stuck in :) This bit was the essential part of it. On Dec 20, 2007 11:47 AM, <oleg <at> okmij.org> wrote: > -- it is important to give the signature to (,) below: we pack the cons > -- function of the right type! > cons :: forall a b. (Typeable a, Typeable b) => > Signal a -> Signal b -> Signal (a,b) > cons (Signal sig1) (Signal sig2) = > Signal (PrimSignal (Cons (toDyn ((,)::a->b->(a,b))) sig1 sig2)) > > mapSnd :: (Typeable a, Typeable b) => Signal (b, a) -> Signal a > mapSnd = mapSY snd >
RSS Feed