Safe Haskell | None |
---|---|
Language | Haskell2010 |
Text.Ginger.Run.VM
Synopsis
- withLocalState :: (Monad m, MonadState s m) => m a -> m a
- withLocalScope :: forall (m :: Type -> Type) p h a. Monad m => Run p m h a -> Run p m h a
- withEncoder :: forall h (m :: Type -> Type) p a. (ContextEncodable h, Monad m) => (GVal (Run p m h) -> h) -> Run p m h a -> Run p m h a
- setVar :: forall (m :: Type -> Type) p h. Monad m => VarName -> GVal (Run p m h) -> Run p m h ()
- getVar :: forall (m :: Type -> Type) p h. Monad m => VarName -> Run p m h (GVal (Run p m h))
- clearCapture :: forall h (m :: Type -> Type) p. (Monoid h, Monad m) => Run p m h ()
- appendCapture :: forall h (m :: Type -> Type) p. (Monoid h, Monad m) => h -> Run p m h ()
- fetchCapture :: forall (m :: Type -> Type) p h. Monad m => Run p m h h
Documentation
withLocalState :: (Monad m, MonadState s m) => m a -> m a Source #
Helper function to run a State action with a temporary state, reverting to the old state after the action has finished.
withLocalScope :: forall (m :: Type -> Type) p h a. Monad m => Run p m h a -> Run p m h a Source #
Helper function to run a Scope action with a temporary scope, reverting to the old scope after the action has finished.
withEncoder :: forall h (m :: Type -> Type) p a. (ContextEncodable h, Monad m) => (GVal (Run p m h) -> h) -> Run p m h a -> Run p m h a Source #
Override the encoder used for converting GVal
s to the output type.
This can be used for things like temporarily disabling HTML encoding.
setVar :: forall (m :: Type -> Type) p h. Monad m => VarName -> GVal (Run p m h) -> Run p m h () Source #