So far, we’ve used a static model. We use SceneRel and Cache (in backends) to implement effects-by-interpreters. That is about to change.
Instead of compiling the whole model into a renderer, we’ll stream model objects to sinks the same way pipes does. That provides a huge flexibility. That is the logical way to go on since our Renderer module, in Core, already embeds such a way of doing.
Implementation details
Manage, Managed and H
H stands for handle. That type is used to represent some objects. No one can build H values except photon itself.
That is done through a typeclass: Manage. This typeclass exports two methods: manage and drop:
class Manage a e where
manage :: a -> H -> e
drop :: Managed a -> e
data Managed a = Managed {
handle :: H
, managed :: a
} deriving (Eq,Show)
class (Monad m) => Effect e m where
effect :: e -> m ()
Introducing effectful streaming
So far, we’ve used a static model. We use
SceneRel
andCache
(in backends) to implement effects-by-interpreters. That is about to change.Instead of compiling the whole model into a renderer, we’ll stream model objects to sinks the same way pipes does. That provides a huge flexibility. That is the logical way to go on since our
Renderer
module, inCore
, already embeds such a way of doing.Implementation details
Manage, Managed and H
H
stands for handle. That type is used to represent some objects. No one can buildH
values except photon itself.That is done through a typeclass:
Manage
. This typeclass exports two methods:manage
anddrop
: