On Sat, Oct 16, 2004 at 05:54:46AM +0000, [EMAIL PROTECTED] wrote:
> > data Bar a m = forall t. (MonadTrans t, Monad (t m)) =>
> >              Bar (t m a -> m a) (t m Int)
> >
> > data Foo = Foo (forall a m. Monad m => Bar a m)

Is it true that I cannot have a function

    foo run op = Foo (Bar run op)

because it does not have an expressible type?  Or is there some way to
make ghc accept this?  Obviously, this expression can be used in the
context of a larger expression.

> > myFoo :: Int -> Foo
> > myFoo i = Foo (Bar run op) where
> >   run :: Monad m => StateT Int m a -> m a
> >   run prog  = do  (a, s) <- runStateT prog i
> >                 return a
> >   op :: Monad m => StateT Int m Int
> >   op        = get

Andrew
_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to