[Hugs-users] another bug in Hugs

Bulat Ziganshin bulatz at HotPOP.com
Fri Jan 6 07:00:05 EST 2006


Hello

another Hugs error. seem that this `instance BlockStream IO h` forces
Higs to think that all BlockStream instances will belong to an IO
monad. as in the previous case, all works fine with GHC

{-# OPTIONS_GHC -fglasgow-exts -fallow-undecidable-instances #-}
class (Monad m) => Stream m h | h -> m where
class (Stream m h) => CharStream m h where
class (Stream m h) => BlockStream m h where
    vPutBuf :: h -> m ()

instance (CharStream IO h) => BlockStream IO h where
    vPutBuf h = return ()

test :: (BlockStream m h) => h -> m ()
test file = vPutBuf file

    
ERROR file:.\a.hs:11 - Inferred type is not general enough
*** Expression    : test
*** Expected type : BlockStream a b => b -> a ()
*** Inferred type : BlockStream IO a => a -> IO ()

    

-- 
Best regards,
 Bulat                          mailto:bulatz at HotPOP.com





More information about the Hugs-Users mailing list