module Data.EventList.Relative.BodyBodyPrivate where
import qualified Data.AlternatingList.List.Uniform as Uniform
import qualified Control.Monad as Monad
import Test.QuickCheck (Arbitrary(..))
newtype T time body = Cons {decons :: Uniform.T time body}
deriving (Eq, Ord)
instance (Show time, Show body) => Show (T time body) where
showsPrec p = Uniform.format " /. " " ./ " p . decons
instance (Arbitrary time, Arbitrary body) =>
Arbitrary (T time body) where
arbitrary = Monad.liftM Cons arbitrary
coarbitrary = undefined
infixl 5 $**
($**) :: (Uniform.T time body -> a) -> (T time body -> a)
($**) f = f . decons
lift ::
(Uniform.T time0 body0 -> Uniform.T time1 body1) ->
(T time0 body0 -> T time1 body1)
lift f = Cons . f . decons
liftM :: Monad m =>
(Uniform.T time0 body0 -> m (Uniform.T time1 body1)) ->
(T time0 body0 -> m (T time1 body1))
liftM f = Monad.liftM Cons . f . decons
unlift ::
(T time0 body0 -> T time1 body1) ->
(Uniform.T time0 body0 -> Uniform.T time1 body1)
unlift f = decons . f . Cons