Yes, I've added a paragraph about the ST trick there. Another possible use case would be callback functions that receive data from your API:
withHook: (forall a. IsApiData a => a -> IO ()) -> IO ()
This allows withHook to send any data to the callback that implements the IsApiData type class
I'm confused, isn't this ad-hoc (or 'first-rank' I guess) as it only quantifies over a?
No, as you can see the forall is in the parenthesis, the scope does not go until the return type
herp derp, realized it myself just now, ∀x(P(x))->Q ≠ ∀x(P(x)->Q).
∀x(P(x))->Q ≠ ∀x(P(x)->Q)
So this would require an an ad-hoc polymorphic function as argument, yes?
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.