Hi GHC users,
I've been trying to create a instance for Maybe type in the Storable class. I need to override the peek and poke methods, but I'm having some difficulties. I was intended to do something like this:
instance Storable t =>Storable (Maybe t) where
peek ptr = maybePeek peek ptr
poke ptr valMaybe = do
ptr<-maybeNew (new) valMaybe
return()
poke ptr valMaybe = do
ptr<-maybeNew (new) valMaybe
return()
Obviously, there is a type error on the definition of peek, because the type of prt is (Ptr a), not (Ptr (Maybe a)) . I don't know how to fix it and, at the same time, keep using instanciation.
I would be grateful for suggestions,
Regards,
_________________________________________________
Nivia Cruz Quental
Gradua��o em Eng. Computa��o - UPE
Gradua��o em Eng. Computa��o - UPE
T�cnica em Telecomunica��es - CEFET-PE - Brasil
Crie seu Yahoo! Mail, agora com 100MB de espa�o, anti-spam e antiv�rus gr�tis!
_______________________________________________ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
