indigo-0.2.2: Convenient imperative eDSL over Lorentz.
Safe HaskellNone
LanguageHaskell2010

Indigo.Internal.Lookup

Description

This module contains the logic to lookup Vars 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

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 #

Given a stack with a list of Operations on its bottom, updates it by appending the Operation on the top.

Vinyl manipulation helpers

rtake :: Sing n -> Rec any s -> Rec any (Take n s) Source #

rdrop :: Sing n -> Rec any s -> Rec any (Drop n s) Source #