[Haskell-cafe] Re: Dynamic typing of polymorphic functions

Alfonso Acosta alfonso.acosta at gmail.com
Fri Dec 21 06:13:35 EST 2007


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
>


More information about the Haskell-Cafe mailing list