John Meacham wrote:

newtype Eq a => Set a = Set (List a)
singleton :: Eq a => a -> Set a
class Monad m where
        return :: a -> m a

instance Monad Set where
        return x = singleton x

okay, our goal is to make this typesafe.

You shouldn't be able to, should you? Monad makes a promise that Set can't keep. In particular:

 returnid :: (Monad m) => m (a -> a)
 returnid = return id

 bad :: Set (a -> a)
 bad = returnid

_______________________________________________
Haskell-prime mailing list
[email protected]
http://haskell.org/mailman/listinfo/haskell-prime

Reply via email to