[Haskell-cafe] casting a into Maybe a

Joerg Fritsch fritsch at joerg.cc
Sat Jul 27 13:05:43 CEST 2013


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





More information about the Haskell-Cafe mailing list