This is proposed as a simplified alternative to https://gist.github.com/mgold/f3527359996fdf295843 - what if instead of renaming Mailbox
, we just didn't have a name for that thing?
Rationale:
- From an API perspective, it's important that the function for instantiating a
Signal
returns two distinct values: theSignal
and a way to send aMessage
to it. Mailbox
(and alternativelyDispatcher
) give a type alias to that return value.- In practice, we never compose Mailboxes or Dispatchers directly; we simply read the two values out of them and then immediately discard them.
- Despite this, I hear people saying things like "Do I need a Mailbox for that?" when the real question is "I want to create a Signal; how do I do that?" The type alias seems to be a red herring that leads people down the wrong path.
- I've gotten the best results from telling people "Focus on the Signal. Do you need to create a new Signal out of thin air? If so, here's the function that does that." (Currently that fun