-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A basic `reflex` host for backend work -- -- A basic reflex host for backend work. @package reflex-basic-host @version 0.2 -- | BasicGuest provides instances that most reflex -- programs need: -- --
-- basicHostForever guest = basicHostWithQuit $ never <$ guest --basicHostForever :: (forall t m. BasicGuestConstraints t m => BasicGuest t m ()) -> IO () -- | Augment a BasicGuest with an action that is repeatedly run -- until the provided Event fires. Each time the action completes, -- the returned Event will fire. -- -- Example - providing a 'tick' Event to a network -- --
-- myNetwork -- :: (Reflex t, MonadHold t m, MonadFix m) -- => Event t () -- -> m (Dynamic t Int) -- myNetwork = count -- -- myGuest :: BasicGuestConstraints t m => BasicGuest t m (Event t ()) -- myGuest = mdo -- eTick <- repeatUntilQuit (void $ threadDelay 1000000) eQuit -- let -- eCountUpdated = updated dCount -- eQuit = () <$ ffilter (==5) eCountUpdated -- dCount <- myNetwork eTick -- -- performEvent_ $ liftIO . print <$> eCountUpdated -- pure eQuit -- -- main :: IO () -- main = basicHostWithQuit myGuest --repeatUntilQuit :: BasicGuestConstraints t m => IO a -> Event t () -> BasicGuest t m (Event t a) -- | Like repeatUntilQuit, but it doesn't do anything with the -- result of the action. May be a little more efficient if you don't need -- it. repeatUntilQuit_ :: BasicGuestConstraints t m => IO a -> Event t () -> BasicGuest t m () instance Reflex.Host.Class.ReflexHost t => Control.Monad.Fix.MonadFix (Reflex.Host.Basic.BasicGuest t m) instance Reflex.Host.Class.ReflexHost t => GHC.Base.Monad (Reflex.Host.Basic.BasicGuest t m) instance Reflex.Host.Class.ReflexHost t => GHC.Base.Applicative (Reflex.Host.Basic.BasicGuest t m) instance Reflex.Host.Class.ReflexHost t => GHC.Base.Functor (Reflex.Host.Basic.BasicGuest t m) instance (Reflex.Host.Class.ReflexHost t, Control.Monad.IO.Class.MonadIO (Reflex.Host.Class.HostFrame t)) => Control.Monad.IO.Class.MonadIO (Reflex.Host.Basic.BasicGuest t m) instance Reflex.Host.Class.ReflexHost t => Reflex.Class.MonadSample t (Reflex.Host.Basic.BasicGuest t m) instance (Reflex.Host.Class.ReflexHost t, Reflex.Class.MonadHold t m) => Reflex.Class.MonadHold t (Reflex.Host.Basic.BasicGuest t m) instance Reflex.Host.Class.ReflexHost t => Reflex.PostBuild.Class.PostBuild t (Reflex.Host.Basic.BasicGuest t m) instance (Reflex.Host.Class.ReflexHost t, Control.Monad.Ref.MonadRef (Reflex.Host.Class.HostFrame t), Control.Monad.Ref.Ref (Reflex.Host.Class.HostFrame t) Data.Type.Equality.~ Control.Monad.Ref.Ref GHC.Types.IO) => Reflex.TriggerEvent.Class.TriggerEvent t (Reflex.Host.Basic.BasicGuest t m) instance (Reflex.Host.Class.ReflexHost t, Control.Monad.Ref.Ref m Data.Type.Equality.~ Control.Monad.Ref.Ref GHC.Types.IO, Control.Monad.Ref.MonadRef (Reflex.Host.Class.HostFrame t), Control.Monad.Ref.Ref (Reflex.Host.Class.HostFrame t) Data.Type.Equality.~ Control.Monad.Ref.Ref GHC.Types.IO, Control.Monad.IO.Class.MonadIO (Reflex.Host.Class.HostFrame t), Control.Monad.Primitive.PrimMonad (Reflex.Host.Class.HostFrame t), Control.Monad.IO.Class.MonadIO m) => Reflex.PerformEvent.Class.PerformEvent t (Reflex.Host.Basic.BasicGuest t m) instance (Reflex.Host.Class.ReflexHost t, Control.Monad.Ref.Ref m Data.Type.Equality.~ Control.Monad.Ref.Ref GHC.Types.IO, Reflex.Class.MonadHold t m, Control.Monad.Primitive.PrimMonad (Reflex.Host.Class.HostFrame t)) => Reflex.Adjustable.Class.Adjustable t (Reflex.Host.Basic.BasicGuest t m) instance Reflex.Host.Class.ReflexHost t => Reflex.NotReady.Class.NotReady t (Reflex.Host.Basic.BasicGuest t m)