shintuku
shintuku

Reputation: 233

Approaches to a `Render` function in functional reactive programming

You have a signal function PointlessButton which inhabits Signal (Maybe Unit) -> ? that represents a button that does nothing, and a rendering function, Render that inhabits ? -> Signal (ScreenDimensions -> RGB), where ScreenDimensions = Nat × Nat and RGB = Nat × Nat × Nat, that takes the entire FRP circuit and maps each pixel of the screen to an RGB value. PointlessButton is associated to two possible renderings corresponding to when it is clicked or not, which are inhabitants of Nat × Nat -> Maybe RGB that return None when given pixels over which the button is not defined.

My question is, what exactly is the relationship between PointlessButton and Render? Or more precisely,

  1. What should be in charge of passing the two renderings to Render, so that it can make use of them?
  2. What datatype is passed to Render, so that it knows which of these is the one that should be used at a particular moment in time?

My work on the question in the comments. Hints, references, comments highly appreciated!

Upvotes: 0

Views: 44

Answers (0)

Related Questions