Interactive programs without callbacks or side-effects. Functional Reactive Programming (FRP) uses composable events and time-varying values to describe interactive systems as pure functions. Just like other pure functional code, functional reactive code is easier to get right on the first try, maintain, and reuse.
It looks like something I could make use of but I'm having a hard time wrapping my head around it.
Would it be something like this for the pure implementation?
instance ( Enum t, HasTrie t, Ord t, t' ~ Pure t
) => Adjustable (Pure t) ((->) t) where
runWithReplace :: (t -> a) -> Event t' (t -> b) -> t -> (a, Event t' b)
runWithReplace ma (Event e) from = (ma from, Event (fmap ($ from) . e))
It looks like something I could make use of but I'm having a hard time wrapping my head around it.
Would it be something like this for the pure implementation?