Restricted Data Types

Bulat Ziganshin bulatz at
Tue Feb 7 03:12:40 EST 2006

Hello John,

Tuesday, February 07, 2006, 4:23:36 AM, you wrote:

data Eq a => Set a = Set (List a)

that is a sort of extension i will be glad to see. in my Streams
library, it's a typical beast and i forced to move all these contexts
to the instances/functions definitions:

data BufferedMemoryStream h = MBuf {-MemoryStream-} h ...
-- | Create BufferedMemoryStream from any MemoryStream
bufferMemoryStream :: (MemoryStream IO h) => h -> IO (BufferedMemoryStream h)
instance (MemoryStream IO h) => Stream IO (BufferedMemoryStream h) where

with RDT, that should shorten to the:

data (MemoryStream IO h) => BufferedMemoryStream h = MBuf h ...
bufferMemoryStream :: h -> IO (BufferedMemoryStream h)
instance Stream IO (BufferedMemoryStream h) where

what the Hugs ang GHC implementors think about this extension?

Best regards,
 Bulat                            mailto:bulatz at

More information about the Haskell-prime mailing list