Instances for Storable

Nivia Q. niviaquental at
Thu Jun 24 13:39:42 EDT 2004

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
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,

Nivia Cruz Quental
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!
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Glasgow-haskell-users mailing list