Simon Peyton-Jones writes:
> > data GenPic = forall pot. (PictureObject pot) => MkGenPic pot
>
> > main :: IO ()
> > main = do
> > putStr $ getPictureName obj
> > where MkGenPic obj = item
> > item = head obj_list
>
> The problem is the pattern binding for MkGenPic. Try
>
> main = case item of
> MkGenPic obj -> do putStr (getPictureName item)
> where
> item = head obj_list
>
> I'll be interested to see if this happens a lot.
>
> Simon
Should be:
MkGenPic obj -> do putStr (getPictureName obj)
I had tried this, it compiles OK but I get a segmentation fault when
I run the resultant executable. The same thing run on Solaris gives a
"Bus error, core dumped". So I guess this is hitting the same bug
that the "DUMPCORE" define is tickling.
Glad to know that I *should* be able to do this!
Hugs disallows the declaration of GenPic:
data GenPic = forall pot. (PictureObject pot) => MkGenPic pot
regards
k