wires
wires copied to clipboard
Undocumented instance semantics
While the non-typeclass-implied methods are somewhat explained, the semantics of typeclass-implied methods are far less obvious (event to someone familiar with the type classes themselves!) and require reading and understanding source code, as well as a certain freedom of philosophizing..
The core motivation here is the lack of clarity on how to combine events:
- making a combined event that fires when both events have fired, combining the "slower" event with:
- the first occurence of the "faster" event
- the last occurence of the "faster" event
- making an event producing an
Either a b
as soon as any event fires - making an event ignoring the right or the left one (
<!>
?)
Yes, that needs more documentation. Until it's written, here is the summary:
-
Apply
andBind
follow intersection semantics for obvious reasons (application can only happen when both events occur simultaneously). -
Alt
andPlus
follow left-biased union semantics. -
Align
follows unbiased union semantics.