It's currently impossible to render a class from a ReactT. This should be possible with locally or something.
In the best of all worlds you could do something like:
div_ $ do
someClass
span_ "this is not a class"
There are a few problems though...
someClass is not ReactT so we can't use do notation here. Okay, we could use RebindableSyntax to make this possible, but I think that's a bad idea. Instead, why not extend locally to take either a ReactT or a ReactClass.
- The meaning of a class is not super clear. In the current formulation it's where state is stored in an
IORef, but that's an implementation detail, not a means of abstraction. Maybe we don't need classes. Maybe we can figure out a clearer meaning for them. createClass also feels really weird. It's stateful in an unclear way and lives in the IO monad.
It's currently impossible to render a class from a
ReactT. This should be possible withlocallyor something.In the best of all worlds you could do something like:
There are a few problems though...
someClassis notReactTso we can't use do notation here. Okay, we could useRebindableSyntaxto make this possible, but I think that's a bad idea. Instead, why not extendlocallyto take either aReactTor aReactClass.IORef, but that's an implementation detail, not a means of abstraction. Maybe we don't need classes. Maybe we can figure out a clearer meaning for them.createClassalso feels really weird. It's stateful in an unclear way and lives in the IO monad.