{-
 -      ``Control/Monad/Event/Internal/Types''
 -}
{-# LANGUAGE
        ExistentialQuantification,
        KindSignatures
  #-}

module Control.Monad.Event.Internal.Types
    ( module Control.Monad.Event.Internal.Types
    , module Control.Monad.Event.Internal.EventID
    ) where

import {-# SOURCE #-} Control.Monad.Event.Classes
import Control.Monad.Event.Internal.EventID

import Text.Printf -- for the benefit of haddock

-- | An existential wrapper containing an event which can be executed in the
-- monad 'm'.
-- 
-- I would like to existentially quantify the time parameter too, since it's
-- uniquely determined according to the functional dependencies of 'MonadTime',
-- but GHC doesn't unify it with its actual type in pattern matches - I was
-- not able to use it as a 'PrintfArg' in:
-- 
-- > instance MonadEvent (EventT Double IO) (EventDescriptor (EventT Double IO))
data EventDescriptor (m :: * -> *) t = forall e. ScheduleEvent m t e => EventDescriptor 
        { eventId       :: EventID
        , eventTime     :: t
        , event         :: e
        }