>Amr A Sabry <[EMAIL PROTECTED]> wrote:
>>Because of the additional type constraint (FinSet a =>) we cannot make the
>>type Vec an instance of the class Monad, and hence we cannot use the
>>do-notation to express our computations.
>
>You can to do this with GADTs:
>
>data MyVec a where
> MkMyVec :: (FinSet a) => Vec a -> MyVec a
>
>instance Monad MyVec where
> return a = MkMyVec (vreturn a)
> etc.
Bug #1097046 aside, I don't see how this can possibly work. There's nothing to prevent return from being passed an argument for which there's no FinSet instance.
-- Ben
_______________________________________________ Haskell mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell
