Hello glasgow-haskell-users,

i've rather complicated class structure:

class BufferData a where
instance (FastBufferData a) => BufferData a where

class FastBufferData a where
instance (Storable a) => FastBufferData a where

of course, it's compiled with -fallow-undecidable-instances
-fallow-overlapping-instances -fallow-incoherent-instances

BufferData class includes procedure `write`:

class BufferData a where
  write :: OutStream -> a -> IO ()

there is writeAll procedure which uses this `write` and therefore
should be able to write any BufferData instance:

writeAll receiveBuf sendBuf cleanup x =
  bracket (create receiveBuf sendBuf cleanup) (closeOut)
    (\buf -> write buf x)

it works great in 6.6.1 but in 6.8.2 GHC infers that writeAll can
write only Storable instances, so i was forced to add signature to
writeAll:

writeAll :: (BufferData a) =>  RecvBuf -> SendBuf -> Cleanup -> a -> IO ()

the same problems raised many times when i switched from 6.6.1 to
6.8.2 - lots of procedures need to add signatures because by default
6.8.2 decided that they are restricted to Storable

does GHC developers interested in minimal test case for this problem?

-- 
Best regards,
 Bulat                          mailto:[EMAIL PROTECTED]

_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to