All pastes #626111 Raw Edit

Something

public text v1 · immutable
·published 2007-07-19 12:17 UTC
rendered paste body
class (Monad m) => MonadGraph m graphtype | m -> graphtype  where 
 modify_graph::  (graphtype -> graphtype) -> m ()
 current_graph ::  m graphtype
 put_graph :: graphtype -> m ()

MonadGraph also should support the MonadState operations.

newtype GraphMonadT graphtype m result =
     GraphMonadT {
       state:: StateT graphtype m result}
        deriving (Monad, Monoid, MonadCont, MonadTrans, MonadFix, Functor, MonadPlus) 

data GraphState graphtype s =
 GraphState
   {
   graph::graphtype,
   other_state::s
  }