newlandsvalley / purescript-midi

MIDI and Web MIDI support
MIT License
10 stars 1 forks source link

Upgrade to Signal #1

Closed newlandsvalley closed 6 years ago

newlandsvalley commented 6 years ago

The FFI interface (for Web-Midi) is completely new in the latest AFF

newlandsvalley commented 6 years ago

Unfortunately, this is much more work than it seemed to be originally. The web-midi support in 1.0.0 subverts Aff 3 by (quite successfully) returning multiple results (e.g. keyboard presses) after the original registration call. Clients of the library that use Pux could then listen to this stream of messages produced by Aff.

Although very straightforward, this subverts the intention of both Aff and Pux. Instead I think we should probably follow the Elm 0.17 approach. Use Eff for the foreign interface, bundle into an FRP stream using Signal and then allow Pux clients to subscribe by means of a Pux input.

None of this seems to be properly documented:

newlandsvalley commented 6 years ago

Fixed via b02c673d954017016307e45b52a34031ae615020