You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Signals that already fired are now stored in the EventInfo:
data EventInfoN n = forall a. (Typeable a, Show a) =>
EventInfo {_eventNumber :: EventNumber,
event :: EventM n a,
handler :: (EventNumber, a) -> n (),
_evStatus :: Status,
_env :: [SignalOccurence]}
The signals are stored in a list of SignalOccurence, together with the SignalAddress:
data SignalOccurence = SignalOccurence {_signalOccData :: SignalData,
_signalOccAddress :: SignalAddress}
data SignalData = forall s a. (Typeable s, Typeable a, Show s, Show a, Eq s) =>
SignalData {signal :: Signal s a,
signalData :: a}
data Signal s a where
Signal :: s -> Signal s a
SignalAddress is a list of directions in the Event tree:
It is necessary that the signal occurrence points to the right signal in the event tree, otherwise one signal occurrence could fire several signals in the event tree.
An alternative design is to assign a number to the Signals in the event tree, and to use this number when storing the signal occurrence. However it is necessary to assign numbers to signals in the event tree, when receiving the event.
Advantages of the current design:
the Event tree can be received/stored without modification.
no internal is leaked toward the user (such as signal number placeholder)
Inconvenient:
the Signal address is clumsy and complexify the traversals
the Signal address is dependent on the Event tree format
Advantages of the alternative design:
simpler
Inconvenient:
need to modify the event tree before storing
the number can be tampered with
more error prone (need to check the unicity of numbers)
possibly exposes some internal
The text was updated successfully, but these errors were encountered:
The Signals that already fired are now stored in the EventInfo:
The signals are stored in a list of SignalOccurence, together with the SignalAddress:
SignalAddress is a list of directions in the Event tree:
It is necessary that the signal occurrence points to the right signal in the event tree, otherwise one signal occurrence could fire several signals in the event tree.
An alternative design is to assign a number to the Signals in the event tree, and to use this number when storing the signal occurrence. However it is necessary to assign numbers to signals in the event tree, when receiving the event.
Advantages of the current design:
Inconvenient:
Advantages of the alternative design:
Inconvenient:
The text was updated successfully, but these errors were encountered: