wires icon indicating copy to clipboard operation
wires copied to clipboard

Undocumented instance semantics

Open deepfire opened this issue 7 years ago • 2 comments

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..

deepfire avatar Mar 05 '17 16:03 deepfire

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 (<!> ?)

deepfire avatar Mar 05 '17 17:03 deepfire

Yes, that needs more documentation. Until it's written, here is the summary:

  • Apply and Bind follow intersection semantics for obvious reasons (application can only happen when both events occur simultaneously).

  • Alt and Plus follow left-biased union semantics.

  • Align follows unbiased union semantics.

esoeylemez avatar Mar 05 '17 19:03 esoeylemez