module CSPM.Compiler.Events (
Event(..),
EventSet
) where
import qualified CSPM.Compiler.Map as M
import qualified CSPM.Compiler.Set as S
import Util.PrettyPrint
data Event =
Tau
| Tick
| UserEvent String
deriving (Eq, Ord)
instance PrettyPrintable Event where
prettyPrint Tau = char 'τ'
prettyPrint Tick = char '✓'
prettyPrint (UserEvent s) = text s
instance Show Event where
show ev = show (prettyPrint ev)
type EventSet = S.Set Event
type EventMap = M.Map Event Event
instance PrettyPrintable EventSet where
prettyPrint s = braces (list (map prettyPrint (S.toList s)))