Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module contains the logic to lookup Var
s in a stack and the actions to
manipulate it.
For efficiency, actions are implemented using Lorentz macros. To do so every necessary constraint is checked at runtime.
Synopsis
- varActionGet :: forall a stk. KnownValue a => RefId -> StackVars stk -> stk :-> (a & stk)
- varActionSet :: forall a stk. KnownValue a => RefId -> StackVars stk -> (a & stk) :-> stk
- varActionUpdate :: forall a b stk. (KnownValue a, KnownValue b) => RefId -> StackVars stk -> ('[b, a] :-> '[a]) -> (b ': stk) :-> stk
- varActionOperation :: HasSideEffects => StackVars stk -> (Operation ': stk) :-> stk
- rtake :: Sing n -> Rec any s -> Rec any (Take n s)
- rdrop :: Sing n -> Rec any s -> Rec any (Drop n s)
Variable Lookup Actions
varActionGet :: forall a stk. KnownValue a => RefId -> StackVars stk -> stk :-> (a & stk) Source #
Puts a copy of the value for the given Var
on top of the stack
varActionSet :: forall a stk. KnownValue a => RefId -> StackVars stk -> (a & stk) :-> stk Source #
Sets the value for the given Var
to the topmost value on the stack
varActionUpdate :: forall a b stk. (KnownValue a, KnownValue b) => RefId -> StackVars stk -> ('[b, a] :-> '[a]) -> (b ': stk) :-> stk Source #
Updates the value for the given Var
with the topmost value on the stack
using the given binary instruction.
varActionOperation :: HasSideEffects => StackVars stk -> (Operation ': stk) :-> stk Source #