module Data.EventList.Relative.BodyBody
(T,
concatMapMonoid, traverse, mapM,
) where
import Data.EventList.Relative.BodyBodyPrivate
import qualified Data.AlternatingList.List.Uniform as Uniform
import Control.Applicative (Applicative, WrappedMonad(WrapMonad, unwrapMonad), liftA, )
import Data.Monoid (Monoid, )
import Prelude hiding (mapM)
concatMapMonoid :: Monoid m =>
(time -> m) -> (body -> m) ->
T time body -> m
concatMapMonoid f g = Uniform.concatMapMonoid f g . decons
traverse :: Applicative m =>
(time0 -> m time1) -> (body0 -> m body1) ->
T time0 body0 -> m (T time1 body1)
traverse f g =
liftA Cons . Uniform.traverse f g . decons
mapM :: Monad m =>
(time0 -> m time1) -> (body0 -> m body1) ->
T time0 body0 -> m (T time1 body1)
mapM f g =
unwrapMonad . traverse (WrapMonad . f) (WrapMonad . g)