Thanks @milesfrain !
I’ve made the changes you proposed in the example - not sure how that slipped through (I have a document where I check the compilation) - it must have been when I was editing the paper. It’d be so cool if LaTeX supported compiling inline PS snippets - perhaps it already does through some toolchain. We did a lot of this with the LilyPond project to support musicology texts, and it made it easy to avoid compilation errors.
I’ve added the types of subscribe
and makeEvent
as you recommend - hopefully that will make it more readable. I agree that it is difficult to follow. It is a tough balancing act, as the reviewers of the paper noted, even in the favorable reviews, that the examples were too expansive. In making them terse, I likely swung too far to the other end of the pendulum.
I’m still confused about how that event initially fires.
The implementation of subscribe is:
subscribe ::
forall r a.
Event a ->
(a -> Effect r) ->
Effect (Effect Unit)
subscribe (Event e) k = e (void <<< k)
All it does is pass the function k
to the event constructor. In the example above, log
is k
and is fed "hello"
.
The term event is indeed ambiguous. In the case of the Event
type, it means “a collection of things occurring.” In common parlance, though, it usually means “one of those occurances”. It may be clearer if the name of the type were Events
. For example, when talking about meteorological events (ie El Niño), a single El Niño is called “an El Niño event” where as the ensemble is referred to as “events”, but El Niño itself is never referred to as an event.
Another version that might be even clearer for beginners is the following:
This is really nice. I’ll see if there’s a good spot to work it into the paper.
Not sure if that’s still the case: farewell-to-frp
.
Yikes! Shows you how much I follow that project… I have changed the language to past-tense to reflect that this is no longer the case.
I hope you enjoy the paper! The most fun part, and what I’ll spend most of my time presenting at the actual conference, are the examples. Just yesterday I put together this in a few minutes & threw it into the examples folder. I find that in general, the library is easier to use and more expressive than its antecedent purescript-audio-behaviors
.