Comonads famously project computations into future contexts. But what if the future is uncertain? What if, like in Demolition Man, the computation wakes up in a hostile, dystopian 2032? Instead, we’d like the computation to wake up in a place more like Encino Man, or at least An American Pickle.
This was the starting point for purescript-wags, a web audio engine that projects future audio states onto the mutable and referentially opaque Web Audio API. In this talk, I’ll show how existential types can be used inside of cofree comonads to add a modicum of type safety to a mutable-state model, and I’ll also show how linear types can be grafted onto comonads as a zero-cost abstraction to tame the volatile Web Audio API.
At the end, I’ll show how this facilitates the rendering of complex audio graphs in a sub-fifteen-millisecond deadline, allowing for low-latency MIDI and audio applications in the browser like https://wags.fm/, https://whatis.wags.fm/ and https://yap.wags.fm/.
https://hasgeek.com/FP-Juspay/pureconf/
Watch video The Hills Are Alive With the Sound of Comonads online, duration hours minute second in high quality that is uploaded to the channel Hasgeek TV 24 February 2022. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 194 times and liked it 10 visitors.