Changeset 3740 for src/Pugs/Internals.hs

Show
Ignore:
Timestamp:
05/23/05 16:57:32 (4 years ago)
Author:
autrijus
svk:copy_cache_prev:
5329
Message:

* move enterEvalContext to Monads.hs so Prim can use it.
* introduce the maybeM abstraction that lifts fmapM into monads.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Internals.hs

    r3690 r3740  
    2323    module Data.Dynamic, 
    2424    module Data.Unique, 
     25    module Data.FunctorM, 
    2526    module Control.Exception, 
    2627    module System.Environment, 
     
    6667    unsafePerformSTM, 
    6768    possiblyFixOperatorName, 
     69    maybeM, 
    6870) where 
    6971 
     
    98100import Data.Maybe 
    99101import Data.Either 
     102import Data.FunctorM 
    100103import Data.List ( 
    101104    (\\), find, genericLength, insert, sortBy, intersperse, 
     
    184187-- instance MonadIO STM where 
    185188--     liftIO = unsafeIOToSTM 
     189 
     190maybeM :: (FunctorM f, Monad m) => m (f a) -> (a -> m b) -> m (f b) 
     191maybeM f m = fmapM m =<< f 
    186192 
    187193{-|