-
Notifications
You must be signed in to change notification settings - Fork 14
Blank Canvas Remote
andygill edited this page Oct 6, 2014
·
6 revisions
The Remote
data is a immutable remote expression.
data Remote :: * -> * where
Value :: a -> Remote a
Remote :: Unique -> Remote a -- a handle to a client value
Prim :: Text -> Remote a
instance Applicative Remote where
The idea is that all commands that return values return Remote values.
isPointInPath :: () -> Canvas (Remote Bool)
Then we have some commands that operate over Remote
get :: Remote a -> Canvas a
pure :: a -> Remote a
And then we can add some control flow commands.
ifB :: (Remote Bool) -> Canvas (Remote a) -> Canvas (Remote a) -> Canvas (Remote a)
whileB :: a -> (Remote a -> Remote Bool) -> (Remote a -> Canvas (Remote a)) -> Canvas (Remote a)
This might also help us support requestAnimationFrame
.