
17 Dec
2006
17 Dec
'06
6:19 p.m.
On 12/17/06, David Roundy
Hello fellow haskellers,
I am wondering if anyone has an idea whether I'd run into trouble if I rebound >>= in order to provide a more restricted monad. My idea is to define a class:
. . .
which seems rather heavy. Can anyone think of syntax-light way to allow my hypothesized rebound do-notation to also work with ordinary monads?
You could try something like this:
import Prelude hiding (Monad (..)) import qualified Prelude (Monad (..)) as P
class WitnessMonad wm where ...
data M m w w' c = M (m c)
instance P.Monad m => WitnessMonad (M m) where ...
Then if everything works out, you should end up with M IO and such as WitnessMonads.