úÎAø=QI      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHNoneAT\A typeclass to ensure people don't dispatch events to states which shouldn't accept them.[To allow dispatching events in an action over your state simply define the empty instance:  instance HasEvents MyState where- Don't need anything here.+Represents a state which can be extended.  is a I which points to the state's 0A map of extension types to their current value.JBA wrapper to allow storing differing extensions in the same place.dA polymorphic lens which accesses extensions in the extension state. It returns the default value (K") if a state has not yet been set.JLJLSafe          None29;<=DIORT"#$MN%&'()*+,-"#$%&'()&$%'()"#"#$MN%&'()*+,-None9;<=AT01010101None%&AOT OBThis is a type alias to make defining your functions for use with AŒ easier; It represents the function your event provider function will be passed to allow dispatching events. Using this type requires the  RankNTypes language pragma.P!Store the listeners in extensionsQ:A map of event types to a list of listeners for that event2wAn opaque reverence to a specific registered event-listener. A ListenerId is used only to remove listeners later with ?.3:A wrapper around event listeners so they can be stored in Q.4DRegisters an action to be performed during the Initialization phase.ÿ This phase occurs exactly ONCE when the app starts up. Though arbitrary actions may be performed in the configuration block; it's recommended to embed such actions in the onInit event listener so that all event listeners are registered before any dispatches occur.6<Registers an action to be performed BEFORE each event phase.8<Registers an action to be performed BEFORE each event phase.@ÿThis function takes an IO which results in some event, it runs the IO asynchronously and dispatches the event. Note that any listeners which are registered for the resulting event will still be run syncronously, only the code which generates the event is asynchronous.ReThis extracts all event listeners from a map of listeners which match the type of the provided event.S5Extract the listener function from eventType listenerAQThis allows long-running IO processes to provide Events to the App asyncronously.JDon't let the type signature confuse you; it's much simpler than it seems.Let's break it down: Using the O+ type with asyncEventProvider requires the  RankNTypes language pragma.;This type as a whole represents a function which accepts a O and returns an T-; the dispatcher itself accepts data of ANY U type and emits it as an event.When you call A( you pass it a function which accepts a dispatchU function as an argument and then calls it with various events within the resulting T.XNote that this function calls forkIO internally, so there's no need to do that yourself. Here's an example which fires a Timer event every second. Ø{-# language RankNTypes #-} data Timer = Timer myTimer :: Dispatcher -> IO () myTimer dispatch = forever $ dispatch Timer >> threadDelay 1000000 myAction :: Action s () myAction = onInit $ asyncEventProvider myTimerOPVQ2W3X456789:;<=>?@YRSABCD23456789:;<=>?@A;<@=>?A456789:32OPVQ2W3X456789:;<=>?@YRSABCDNoneZàThis is the main event loop, it runs recursively forever until something sets the exit status. It runs the pre-event listeners, then checks if any async events have finished, then runs the post event listeners and repeats.GZGGGZNone%'(0123456789:;<=>?@AGG%;<@0=>?456789:1A32'(NoneH"#H"#HH[      !"#$$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPMQRSTUVWXYZ[\]T34^_`eve-0.1.0-R87CXHfOTxIw6Du7wEoVpEve.Internal.ExtensionsEve.Internal.EventsEve.Internal.ActionsEve.Internal.AsyncEve.Internal.ListenersEve.Internal.RunEve.Internal.TestingEve HasEventsHasExtsextsExtsext $fShowExtExit AfterEvent BeforeEvent AfterInitInitAction getActionActionF LiftActionAppState _baseExts _asyncQueueApp$fFunctorAction$fApplicativeAction $fMonadAction$fMonadIOAction$fMonadStateAction$fMonadFreeAction$fFunctorActionF$fApplicativeActionFExiting asyncQueue liftActionexecApp runActionexit isExiting$fDefaultExiting$fZoomActionActionst$fHasEventsAppState$fHasExtsAppState $fShowExiting $fEqExitingdispatchActionAsyncasyncActionProvider ListenerIdListeneronInit afterInit beforeEvent beforeEvent_ afterEvent afterEvent_onExit dispatchEventdispatchEvent_ addListener addListener_removeListenerdispatchEventAsyncasyncEventProvider$fDefaultLocalListeners$fEqListenerId$fShowListener$fShowListenerId$fShowLocalListenerseve noEventTest"lens-4.15.1-75ICqM0X19YDHpsB5vklPDControl.Lens.TypeLens'Ext1data-default-class-0.1.2.0-FYQpjIylblBDctdkHAFeXAData.Default.ClassdefbaseExtsunLift DispatcherLocalListeners ListenersmatchingListeners getListenerghc-prim GHC.TypesIObaseData.Typeable.InternalTypeablelocalListeners eventLoop