hirarchical modules

Malcolm Wallace Malcolm.Wallace@cs.york.ac.uk
Thu, 29 May 2003 18:59:52 +0100


Iavor Diatchki <diatchki@cse.ogi.edu> writes:

> i am aware that there have been previous discussions on the subject,
> but they seem to have had no results (who are the powers that be? :-). 

The "powers that be" are the compiler maintainers.  If you can't
persuade them (all) to adopt your proposal, then de facto it won't fly.
But by-and-large, we are reasonable people.  :-)  You just need to
be sufficiently persuasive.

> suggestions on how to rewrite the imports/exports above more concisely 
> are welcome.

The exports at least can be made shorter as follows.

     module Control.Monad.Experimental.State
       (State,
       ,runState
       ,runStateS
       ,module T) where
    
     import           Control.Monad.Experimental.Identity
     import qualified Control.Monad.Experimental.StateT as S
     import qualified Control.Monad.Experimental.Trans as T
    
     type State s  = S.StateT s Identity
    
     runState      :: s -> State s a -> a
     runState s m  = runIdentity (S.runState s m)
    
     runStateS     :: s -> State s a -> (a,s)
     runStateS s m = runIdentity (S.runStateS s m)

Regards,
  Malcolm