All,

I am having a problem with a derived class. I define:

class (Monad m) => InstrumentMonad m where
        yuck :: a -> m a

Then I define:

instance InstrumentMonad Vi where                  (Line 30)
        return a = Vi (\s -> (s, a))
        Vi sf0 >>= f =
                Vi $ \s0 -> 
                        let
                                (s1, a1) = sf0 s0
                                Vi sf1 = f a1
                                (s2, a2) = sf1 s1
                        in (s2, a2)

And when I compile, I get the error:

Vi.hs:30:
    No instance for `Monad Vi'
    arising from an instance declaration at Vi.hs:30

Vi.hs:31: Class `InstrumentMonad' does not have a method `return'

Vi.hs:32: Class `InstrumentMonad' does not have a method `>>='

I am not sure what is going on here.

Mike


Reply via email to