Closed
Description
In the current implementation of web-workers, worker # postMessage a accepts any type for a.
But, in the documentation, it is said that the posted message must be serializable which is equivalent to be a correct input of
structuredClone.
So I propose to implement a type class Serializable
and replace the signature of postMessage with
forall a. Serializable a => a -> Worker -> Effect Unit
@natefaubion said that it implemented something similar in
https://github.com/natefaubion/purescript-node-workerbees/blob/main/src/Node/WorkerBees.purs#L112-L150