gibbon-0.3: A compiler for operating on serialized data
Safe HaskellSafe-Inferred
LanguageHaskell2010

Gibbon.L2.Interp

Description

Interpreter reducing L2 programs to values.

Synopsis

Documentation

newtype Store Source #

A store is an address space full of buffers.

Constructors

Store (Map Var Buffer) 

Instances

Instances details
Out Store Source # 
Instance details

Defined in Gibbon.L2.Interp

Generic Store Source # 
Instance details

Defined in Gibbon.L2.Interp

Associated Types

type Rep Store :: Type -> Type Source #

Methods

from :: Store -> Rep Store x Source #

to :: Rep Store x -> Store Source #

Read Store Source # 
Instance details

Defined in Gibbon.L2.Interp

Show Store Source # 
Instance details

Defined in Gibbon.L2.Interp

Eq Store Source # 
Instance details

Defined in Gibbon.L2.Interp

Methods

(==) :: Store -> Store -> Bool Source #

(/=) :: Store -> Store -> Bool Source #

Ord Store Source # 
Instance details

Defined in Gibbon.L2.Interp

Interp Store Exp2 Source # 
Instance details

Defined in Gibbon.L2.Interp

InterpProg Store Exp2 Source # 
Instance details

Defined in Gibbon.L2.Interp

InterpExt Store Exp2 (E2Ext LocVar Ty2) Source # 
Instance details

Defined in Gibbon.L2.Interp

type Rep Store Source # 
Instance details

Defined in Gibbon.L2.Interp

type Rep Store = D1 ('MetaData "Store" "Gibbon.L2.Interp" "gibbon-0.3-inplace" 'True) (C1 ('MetaCons "Store" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map Var Buffer))))

newtype Buffer Source #

Constructors

Buffer (Seq SerializedVal) 

Instances

Instances details
Out Buffer Source # 
Instance details

Defined in Gibbon.L2.Interp

Generic Buffer Source # 
Instance details

Defined in Gibbon.L2.Interp

Associated Types

type Rep Buffer :: Type -> Type Source #

Read Buffer Source # 
Instance details

Defined in Gibbon.L2.Interp

Show Buffer Source # 
Instance details

Defined in Gibbon.L2.Interp

Eq Buffer Source # 
Instance details

Defined in Gibbon.L2.Interp

Ord Buffer Source # 
Instance details

Defined in Gibbon.L2.Interp

type Rep Buffer Source # 
Instance details

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))))

insertAtBuffer :: Int -> SerializedVal -> Buffer -> Buffer Source #

Insert a value at a particular index in the buffer

data SerializedVal Source #

Constructors

SerTag Word8 DataCon 
SerInt Int 
SerChar Char 
SerBool Int 
SerFloat Double 
SerPtr 

Fields

SerPad

Used to make values artificially occupy more cells in the buffer. For example, everywhere else we assume that Ints occupy 8 cells. But SerInt only occupies a single cell. To make SerInt occupy 8 cells, we add 7 SerPads after it.

Instances

Instances details
Out SerializedVal Source # 
Instance details

Defined in Gibbon.L2.Interp

Generic SerializedVal Source # 
Instance details

Defined in Gibbon.L2.Interp

Associated Types

type Rep SerializedVal :: Type -> Type Source #

Read SerializedVal Source # 
Instance details

Defined in Gibbon.L2.Interp

Show SerializedVal Source # 
Instance details

Defined in Gibbon.L2.Interp

NFData SerializedVal Source # 
Instance details

Defined in Gibbon.L2.Interp

Methods

rnf :: SerializedVal -> () Source #

Eq SerializedVal Source # 
Instance details

Defined in Gibbon.L2.Interp

Ord SerializedVal Source # 
Instance details

Defined in Gibbon.L2.Interp

type Rep SerializedVal Source # 
Instance details

Defined in Gibbon.L2.Interp

byteSizeOfTy :: UrTy d -> Maybe Int Source #

Everything occupies a single cell in the Buffer.

deserialize :: Out ty => DDefs ty -> Store -> Buffer -> Value Exp2 Source #

Code to read a final answer back out.

data Size Source #

Constructors

SOne Int 
SMany [Size] 

Instances

Instances details
Out Size Source # 
Instance details

Defined in Gibbon.L2.Interp

Methods

docPrec :: Int -> Size -> Doc Source #

doc :: Size -> Doc Source #

docList :: [Size] -> Doc Source #

Generic Size Source # 
Instance details

Defined in Gibbon.L2.Interp

Associated Types

type Rep Size :: Type -> Type Source #

Methods

from :: Size -> Rep Size x Source #

to :: Rep Size x -> Size Source #

Read Size Source # 
Instance details

Defined in Gibbon.L2.Interp

Show Size Source # 
Instance details

Defined in Gibbon.L2.Interp

Eq Size Source # 
Instance details

Defined in Gibbon.L2.Interp

Methods

(==) :: Size -> Size -> Bool Source #

(/=) :: Size -> Size -> Bool Source #

Ord Size Source # 
Instance details

Defined in Gibbon.L2.Interp

type Rep Size Source # 
Instance details

Defined in Gibbon.L2.Interp

Orphan instances

Out a => Out (Seq a) Source # 
Instance details

Methods

docPrec :: Int -> Seq a -> Doc Source #

doc :: Seq a -> Doc Source #

docList :: [Seq a] -> Doc Source #