| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Indigo.Internal.Var
Synopsis
- data Var a = Var RefId
- data RefId
- data StackVars (stk :: [Type]) where
- StkElements :: Rec StkEl stk -> StackVars stk
- FailureStack :: StackVars stk
- type StackVars' stk = Rec StkEl stk
- data StkEl a where
- NoRef :: KnownValue a => StkEl a
- Ref :: KnownValue a => RefId -> StkEl a
- emptyStack :: StackVars '[]
- assignVarAt :: (KnownValue a, a ~ At n inp, RequireLongerThan inp n) => Var a -> StackVars inp -> Sing n -> StackVars inp
- pushRef :: KnownValue a => Var a -> StackVars inp -> StackVars (a ': inp)
- pushNoRef :: KnownValue a => StackVars inp -> StackVars (a ': inp)
- popNoRef :: StackVars (a ': inp) -> StackVars inp
- type Ops = [Operation]
- type HasSideEffects = Given (Var Ops)
- operationsVar :: HasSideEffects => Var Ops
- type HasStorage st = (Given (Var st), KnownValue st)
- storageVar :: HasStorage st => Var st
Variables
A variable referring to an element in the stack.
Reference id to a stack cell
Instances
| Bounded RefId Source # | |
| Eq RefId Source # | |
| Num RefId Source # | |
| Ord RefId Source # | |
| Real RefId Source # | |
Defined in Indigo.Internal.Var Methods toRational :: RefId -> Rational # | |
| Show RefId Source # | |
| Generic RefId Source # | |
| Buildable RefId Source # | |
Defined in Indigo.Internal.Var | |
| type Rep RefId Source # | |
Defined in Indigo.Internal.Var | |
data StackVars (stk :: [Type]) where Source #
Stack of the symbolic interpreter.
Constructors
| StkElements :: Rec StkEl stk -> StackVars stk | |
| FailureStack :: StackVars stk |
type StackVars' stk = Rec StkEl stk Source #
Stack element of the symbolic interpreter.
It holds either a reference index that refers to this element
or just NoRef, indicating that there are no references
to this element.
Constructors
| NoRef :: KnownValue a => StkEl a | |
| Ref :: KnownValue a => RefId -> StkEl a |
Instances
| TestEquality StkEl Source # | |
Defined in Indigo.Internal.Var | |
Stack operations
emptyStack :: StackVars '[] Source #
assignVarAt :: (KnownValue a, a ~ At n inp, RequireLongerThan inp n) => Var a -> StackVars inp -> Sing n -> StackVars inp Source #
pushRef :: KnownValue a => Var a -> StackVars inp -> StackVars (a ': inp) Source #
Push a new stack element with a reference to it, given the variable.
pushNoRef :: KnownValue a => StackVars inp -> StackVars (a ': inp) Source #
Push a new stack element without a reference to it.
popNoRef :: StackVars (a ': inp) -> StackVars inp Source #
Remove the top element of the stack. It's supposed that no variable refers to this element.
Operations/Storage variables
operationsVar :: HasSideEffects => Var Ops Source #
Return a variable which refers to a stack cell with operations
type HasStorage st = (Given (Var st), KnownValue st) Source #
Allows to get a variable with storage
storageVar :: HasStorage st => Var st Source #
Return a variable which refers to a stack cell with storage