Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Interpreter reducing L2 programs to values.
Synopsis
- interp :: SizeEnv -> RunConfig -> ValEnv Exp2 -> DDefs Ty2 -> Map Var (FunDef Exp2) -> Exp2 -> InterpM Store Exp2 (Value Exp2, Size)
- interpExt :: SizeEnv -> RunConfig -> ValEnv Exp2 -> DDefs Ty2 -> Map Var (FunDef Exp2) -> E2Ext LocVar Ty2 -> InterpM Store Exp2 (Value Exp2, Size)
- clk :: Clock
- strToInt :: String -> Int
- newtype Store = Store (Map Var Buffer)
- emptyStore :: Store
- insertIntoStore :: Var -> Buffer -> InterpM Store Exp2 ()
- lookupInStore :: Var -> InterpM Store Exp2 (Maybe Buffer)
- lookupInStore' :: Var -> Store -> Maybe Buffer
- newtype Buffer = Buffer (Seq SerializedVal)
- emptyBuffer :: Buffer
- insertAtBuffer :: Int -> SerializedVal -> Buffer -> Buffer
- dropInBuffer :: Int -> Buffer -> Buffer
- data SerializedVal
- byteSize :: SerializedVal -> Int
- byteSizeOfTy :: UrTy d -> Maybe Int
- deserialize :: Out ty => DDefs ty -> Store -> Buffer -> Value Exp2
- data Size
- type SizeEnv = Map Var Size
- sizeToInt :: Size -> Int
- appendSize :: Size -> Size -> Size
Documentation
interp :: SizeEnv -> RunConfig -> ValEnv Exp2 -> DDefs Ty2 -> Map Var (FunDef Exp2) -> Exp2 -> InterpM Store Exp2 (Value Exp2, Size) Source #
interpExt :: SizeEnv -> RunConfig -> ValEnv Exp2 -> DDefs Ty2 -> Map Var (FunDef Exp2) -> E2Ext LocVar Ty2 -> InterpM Store Exp2 (Value Exp2, Size) Source #
A store is an address space full of buffers.
emptyStore :: Store Source #
Instances
Out Buffer Source # | |
Generic Buffer Source # | |
Read Buffer Source # | |
Show Buffer Source # | |
Eq Buffer Source # | |
Ord Buffer Source # | |
Defined in Gibbon.L2.Interp | |
type Rep Buffer Source # | |
Defined in Gibbon.L2.Interp type Rep Buffer = D1 ('MetaData "Buffer" "Gibbon.L2.Interp" "gibbon-0.3-inplace" 'True) (C1 ('MetaCons "Buffer" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Seq SerializedVal)))) |
emptyBuffer :: Buffer Source #
insertAtBuffer :: Int -> SerializedVal -> Buffer -> Buffer Source #
Insert a value at a particular index in the buffer
data SerializedVal Source #
SerTag Word8 DataCon | |
SerInt Int | |
SerChar Char | |
SerBool Int | |
SerFloat Double | |
SerPtr | |
SerPad | Used to make values artificially occupy more cells in the buffer.
For example, everywhere else we assume that Ints occupy 8 cells.
But |
Instances
byteSize :: SerializedVal -> Int Source #
deserialize :: Out ty => DDefs ty -> Store -> Buffer -> Value Exp2 Source #
Code to read a final answer back out.
Instances
Out Size Source # | |
Generic Size Source # | |
Read Size Source # | |
Show Size Source # | |
Eq Size Source # | |
Ord Size Source # | |
type Rep Size Source # | |
Defined in Gibbon.L2.Interp type Rep Size = D1 ('MetaData "Size" "Gibbon.L2.Interp" "gibbon-0.3-inplace" 'False) (C1 ('MetaCons "SOne" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: C1 ('MetaCons "SMany" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Size]))) |