[Haskell-cafe] casting a into Maybe a

Niklas Hambüchen mail at nh2.me
Sat Jul 27 13:42:46 CEST 2013


Put a Just around it?

transMit s now key (Just newmsgs) q m

On Sat 27 Jul 2013 20:05:43 JST, Joerg Fritsch wrote:
> If I have the following type signature
> transMit :: Serialize a => Socket -> POSIXTime -> KEY -> Maybe a -> TPSQ -> TMap a -> IO ()
>
>
> And the function is called with
> transMit s now key newmsgs q m
> where newmsgs is whatever type a I get but _not_ a Maybe a
>
> then I get the error
> Could not deduce (a ~ Maybe a)
> from the context (Serialize a)
>
> Can I somehow when I call transmit cast newmsgs into a Maybe newmsgs or so so that the function call fits the type signature?
>
> --Joerg
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe




More information about the Haskell-Cafe mailing list