# LANGUAGE FunctionalDependencies #

module Main where

-- | Something.
class (MonadReader r s, MonadWriter w m) => MonadState s m | m -> s where
  get :: m s
  put :: s -> m ()

  | ' MonadParsec '
class
  ( Stream s -- Token streams
  , MonadPlus m -- Potential for failure
  ) =>
  MonadParsec e s m
    | m -> e s
  where
  -- | 'getState' returns state
  getState
    :: m s

  | ' putState ' sets state
  putState
    :: s
    -> m ()

 | Something.
 Token streams
 Potential for failure
 | 'getState' returns state
# LANGUAGE FunctionalDependencies #

module Main where

class (MonadReader r s, MonadWriter w m) => MonadState s m | m -> s where
  get :: m s
  put :: s -> m ()

  | ' MonadParsec '
class
  ) =>
  MonadParsec e s m
    | m -> e s
  where
  getState
    :: m s

  | ' putState ' sets state
  putState
    :: s
    -> m ()
