Module
Concur.Core.FRP
- Package
- purescript-concur-core
- Repository
- purescript-concur/purescript-concur-core
#SignalT Source
type SignalT :: (Type -> Type) -> Type -> Type
type SignalT m a = Cofree m a
Poor man's FRP implementation for Concur. I am experimenting with the smallest possible amount of FRP which can still be useful. A Widget can be considered to be a one-shot Event. (There is no stream of events in Concur). Signals then are never-ending widget loops that allow access to their last return value. This last produced value allows composition with other widgets even for never-ending widgets.
#justEffect Source
justEffect :: forall m a b. MonadEffect m => Monad m => Alternative m => b -> Effect a -> (a -> SignalT m b) -> SignalT m b
Run an effectful computation, and do something with the result
#foldp Source
foldp :: forall m a b. Functor m => (a -> b -> a) -> a -> SignalT m b -> SignalT m a
Loop a signal so that the return value is passed to the beginning again.
Folding signals. Similar to how signals used to work in Elm.
This can be used to implement simple stateful Signals.
e.g. counter = fold (\n _ -> n+1) 0 clicks
#demandLoop Source
demandLoop :: forall m a s. Monad m => Alternative m => s -> (s -> SignalT m (Either s a)) -> m a
#stateLoopS Source
stateLoopS :: forall m a s. Monad m => Alternative m => s -> (s -> SignalT m (Either s a)) -> SignalT m (Maybe a)
- Modules
- Concur.
Core - Concur.
Core. DOM - Concur.
Core. DevTools - Concur.
Core. Discharge - Concur.
Core. ElementBuilder - Concur.
Core. FRP - Concur.
Core. Gen - Concur.
Core. IsWidget - Concur.
Core. LiftWidget - Concur.
Core. Patterns - Concur.
Core. Props - Concur.
Core. Types - Control.
Cofree - Control.
MonadFix - Control.
MultiAlternative - Control.
ShiftMap