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

Gibbon.Language.Syntax

Synopsis

Datatype definitions

type DDefs a = Map Var (DDef a) Source #

type Tag = Word8 Source #

data DDef a Source #

Data type definitions.

Monomorphism: In the extreme case we can strip packed datatypes of all type parameters, or we can allow them to retain type params but require that they always be fully instantiated to monomorphic types in the context of our monomorphic programs.

Here we allow individual to be marked with whether or not they should be boxed. We say that a regular, pointer-based datatype has all-boxed fields, whereas a fully serialized datatype has no boxed fields.

Constructors

DDef 

Fields

Instances

Instances details
Functor DDef Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

fmap :: (a -> b) -> DDef a -> DDef b Source #

(<$) :: a -> DDef b -> DDef a Source #

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

Defined in Gibbon.Language.Syntax

Methods

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

doc :: DDef a -> Doc Source #

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

Generic (DDef a) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Associated Types

type Rep (DDef a) :: Type -> Type Source #

Methods

from :: DDef a -> Rep (DDef a) x Source #

to :: Rep (DDef a) x -> DDef a Source #

Read a => Read (DDef a) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Show a => Show (DDef a) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

showsPrec :: Int -> DDef a -> ShowS Source #

show :: DDef a -> String Source #

showList :: [DDef a] -> ShowS Source #

NFData a => NFData (DDef a) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

rnf :: DDef a -> () Source #

Eq a => Eq (DDef a) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

(==) :: DDef a -> DDef a -> Bool Source #

(/=) :: DDef a -> DDef a -> Bool Source #

Ord a => Ord (DDef a) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

compare :: DDef a -> DDef a -> Ordering Source #

(<) :: DDef a -> DDef a -> Bool Source #

(<=) :: DDef a -> DDef a -> Bool Source #

(>) :: DDef a -> DDef a -> Bool Source #

(>=) :: DDef a -> DDef a -> Bool Source #

max :: DDef a -> DDef a -> DDef a Source #

min :: DDef a -> DDef a -> DDef a Source #

Pretty ex => Pretty (DDef ex) Source # 
Instance details

Defined in Gibbon.Pretty

type Rep (DDef a) Source # 
Instance details

Defined in Gibbon.Language.Syntax

type Rep (DDef a) = D1 ('MetaData "DDef" "Gibbon.Language.Syntax" "gibbon-0.3-inplace" 'False) (C1 ('MetaCons "DDef" 'PrefixI 'True) (S1 ('MetaSel ('Just "tyName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Var) :*: (S1 ('MetaSel ('Just "tyArgs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TyVar]) :*: S1 ('MetaSel ('Just "dataCons") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(DataCon, [(IsBoxed, a)])]))))

lookupDDef :: Out a => DDefs a -> TyCon -> DDef a Source #

Lookup a ddef in its entirety

getConOrdering :: Out a => DDefs a -> TyCon -> [DataCon] Source #

Get the canonical ordering for data constructors, currently based on ordering in the original source code. Takes a TyCon as argument.

getTyOfDataCon :: Out a => DDefs a -> DataCon -> TyCon Source #

Lookup the name of the TyCon that goes with a given DataCon. Must be unique!

lookupDataCon :: Out a => DDefs a -> DataCon -> [a] Source #

Lookup the arguments to a data contstructor.

lkp :: Out a => DDefs a -> DataCon -> (Var, (DataCon, [(IsBoxed, a)])) Source #

Lookup a Datacon. Return (TyCon, (DataCon, [flds]))

lookupDataCon' :: Out a => DDef a -> DataCon -> [a] Source #

Like lookupDataCon but lookup arguments to a data contstructor for a specific instance of a datatype.

lookupDataCon' (Maybe Int) Just = [Int]

insertDD :: DDef a -> DDefs a -> DDefs a Source #

isVoidDDef :: DDef a -> Bool Source #

Is this an empty type (like 'data Void' in Haskell) ?

Function definitions

class (Out (ArrowTy ty), Show (ArrowTy ty)) => FunctionTy ty where Source #

A type family describing function types.

Associated Types

type ArrowTy ty Source #

Methods

inTys :: ArrowTy ty -> [ty] Source #

outTy :: ArrowTy ty -> ty Source #

Instances

Instances details
FunctionTy Ty0 Source # 
Instance details

Defined in Gibbon.L0.Syntax

Associated Types

type ArrowTy Ty0 Source #

FunctionTy Ty1 Source # 
Instance details

Defined in Gibbon.L1.Syntax

Associated Types

type ArrowTy Ty1 Source #

FunctionTy Ty2 Source #

Function types know about locations and traversal effects.

Instance details

Defined in Gibbon.L2.Syntax

Associated Types

type ArrowTy Ty2 Source #

FunctionTy Ty2 Source #

Function types know about locations and traversal effects.

Instance details

Defined in Gibbon.NewL2.Syntax

Associated Types

type ArrowTy Ty2 Source #

type FunDefs ex = Map Var (FunDef ex) Source #

A set of top-level recursive function definitions.

data FunDef ex Source #

A function definiton indexed by a type and expression.

Constructors

FunDef 

Fields

Instances

Instances details
(Generic (ArrowTy (TyOf ex)), Out ex, Out (ArrowTy (TyOf ex))) => Out (FunDef ex) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

docPrec :: Int -> FunDef ex -> Doc Source #

doc :: FunDef ex -> Doc Source #

docList :: [FunDef ex] -> Doc Source #

Generic (FunDef ex) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Associated Types

type Rep (FunDef ex) :: Type -> Type Source #

Methods

from :: FunDef ex -> Rep (FunDef ex) x Source #

to :: Rep (FunDef ex) x -> FunDef ex Source #

(Read ex, Read (ArrowTy (TyOf ex))) => Read (FunDef ex) Source # 
Instance details

Defined in Gibbon.Language.Syntax

(Show ex, Show (ArrowTy (TyOf ex))) => Show (FunDef ex) Source # 
Instance details

Defined in Gibbon.Language.Syntax

(Generic (ArrowTy (TyOf ex)), NFData ex, NFData (ArrowTy (TyOf ex))) => NFData (FunDef ex) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

rnf :: FunDef ex -> () Source #

(Eq ex, Eq (ArrowTy (TyOf ex))) => Eq (FunDef ex) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

(==) :: FunDef ex -> FunDef ex -> Bool Source #

(/=) :: FunDef ex -> FunDef ex -> Bool Source #

(Ord ex, Ord (ArrowTy (TyOf ex))) => Ord (FunDef ex) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

compare :: FunDef ex -> FunDef ex -> Ordering Source #

(<) :: FunDef ex -> FunDef ex -> Bool Source #

(<=) :: FunDef ex -> FunDef ex -> Bool Source #

(>) :: FunDef ex -> FunDef ex -> Bool Source #

(>=) :: FunDef ex -> FunDef ex -> Bool Source #

max :: FunDef ex -> FunDef ex -> FunDef ex Source #

min :: FunDef ex -> FunDef ex -> FunDef ex Source #

HasPretty ex => Pretty (FunDef ex) Source # 
Instance details

Defined in Gibbon.Pretty

type Rep (FunDef ex) Source # 
Instance details

Defined in Gibbon.Language.Syntax

data FunMeta Source #

Constructors

FunMeta 

Instances

Instances details
Out FunMeta Source # 
Instance details

Defined in Gibbon.Language.Syntax

Generic FunMeta Source # 
Instance details

Defined in Gibbon.Language.Syntax

Associated Types

type Rep FunMeta :: Type -> Type Source #

Read FunMeta Source # 
Instance details

Defined in Gibbon.Language.Syntax

Show FunMeta Source # 
Instance details

Defined in Gibbon.Language.Syntax

NFData FunMeta Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

rnf :: FunMeta -> () Source #

Eq FunMeta Source # 
Instance details

Defined in Gibbon.Language.Syntax

Ord FunMeta Source # 
Instance details

Defined in Gibbon.Language.Syntax

Pretty FunMeta Source # 
Instance details

Defined in Gibbon.Pretty

type Rep FunMeta Source # 
Instance details

Defined in Gibbon.Language.Syntax

type Rep FunMeta = D1 ('MetaData "FunMeta" "Gibbon.Language.Syntax" "gibbon-0.3-inplace" 'False) (C1 ('MetaCons "FunMeta" 'PrefixI 'True) (S1 ('MetaSel ('Just "funRec") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FunRec) :*: (S1 ('MetaSel ('Just "funInline") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FunInline) :*: S1 ('MetaSel ('Just "funCanTriggerGC") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))

data FunRec Source #

Constructors

Rec 
NotRec 
TailRec 

Instances

Instances details
Out FunRec Source # 
Instance details

Defined in Gibbon.Language.Syntax

Generic FunRec Source # 
Instance details

Defined in Gibbon.Language.Syntax

Associated Types

type Rep FunRec :: Type -> Type Source #

Read FunRec Source # 
Instance details

Defined in Gibbon.Language.Syntax

Show FunRec Source # 
Instance details

Defined in Gibbon.Language.Syntax

NFData FunRec Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

rnf :: FunRec -> () Source #

Eq FunRec Source # 
Instance details

Defined in Gibbon.Language.Syntax

Ord FunRec Source # 
Instance details

Defined in Gibbon.Language.Syntax

Pretty FunRec Source # 
Instance details

Defined in Gibbon.Pretty

type Rep FunRec Source # 
Instance details

Defined in Gibbon.Language.Syntax

type Rep FunRec = D1 ('MetaData "FunRec" "Gibbon.Language.Syntax" "gibbon-0.3-inplace" 'False) (C1 ('MetaCons "Rec" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "NotRec" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TailRec" 'PrefixI 'False) (U1 :: Type -> Type)))

data FunInline Source #

Constructors

Inline 
NoInline 
Inlineable 

Instances

Instances details
Out FunInline Source # 
Instance details

Defined in Gibbon.Language.Syntax

Generic FunInline Source # 
Instance details

Defined in Gibbon.Language.Syntax

Associated Types

type Rep FunInline :: Type -> Type Source #

Read FunInline Source # 
Instance details

Defined in Gibbon.Language.Syntax

Show FunInline Source # 
Instance details

Defined in Gibbon.Language.Syntax

NFData FunInline Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

rnf :: FunInline -> () Source #

Eq FunInline Source # 
Instance details

Defined in Gibbon.Language.Syntax

Ord FunInline Source # 
Instance details

Defined in Gibbon.Language.Syntax

Pretty FunInline Source # 
Instance details

Defined in Gibbon.Pretty

type Rep FunInline Source # 
Instance details

Defined in Gibbon.Language.Syntax

type Rep FunInline = D1 ('MetaData "FunInline" "Gibbon.Language.Syntax" "gibbon-0.3-inplace" 'False) (C1 ('MetaCons "Inline" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "NoInline" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Inlineable" 'PrefixI 'False) (U1 :: Type -> Type)))

insertFD :: FunDef ex -> FunDefs ex -> FunDefs ex Source #

Insert a FunDef into FunDefs. Raise an error if a function with the same name already exists.

fromListFD :: [FunDef ex] -> FunDefs ex Source #

 

Programs

data Prog ex Source #

Complete programs include datatype definitions:

For evaluating a complete program, main's type will be an Int or a datatype. For running a pass benchmark, main will be Nothing and we will expect a "benchmark" function definition which consumes an appropriate packed AST datatype.

Constructors

Prog 

Fields

Instances

Instances details
(Generic (ArrowTy (TyOf ex)), Out (ArrowTy (TyOf ex)), Out (TyOf ex), Out ex) => Out (Prog ex) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

docPrec :: Int -> Prog ex -> Doc Source #

doc :: Prog ex -> Doc Source #

docList :: [Prog ex] -> Doc Source #

Generic (Prog ex) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Associated Types

type Rep (Prog ex) :: Type -> Type Source #

Methods

from :: Prog ex -> Rep (Prog ex) x Source #

to :: Rep (Prog ex) x -> Prog ex Source #

(Read (TyOf ex), Read ex, Read (ArrowTy (TyOf ex))) => Read (Prog ex) Source # 
Instance details

Defined in Gibbon.Language.Syntax

(Show (TyOf ex), Show ex, Show (ArrowTy (TyOf ex))) => Show (Prog ex) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

showsPrec :: Int -> Prog ex -> ShowS Source #

show :: Prog ex -> String Source #

showList :: [Prog ex] -> ShowS Source #

(NFData (TyOf ex), NFData (ArrowTy (TyOf ex)), NFData ex, Generic (ArrowTy (TyOf ex))) => NFData (Prog ex) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

rnf :: Prog ex -> () Source #

(Eq (TyOf ex), Eq ex, Eq (ArrowTy (TyOf ex))) => Eq (Prog ex) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

(==) :: Prog ex -> Prog ex -> Bool Source #

(/=) :: Prog ex -> Prog ex -> Bool Source #

(Ord (TyOf ex), Ord ex, Ord (ArrowTy (TyOf ex))) => Ord (Prog ex) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

compare :: Prog ex -> Prog ex -> Ordering Source #

(<) :: Prog ex -> Prog ex -> Bool Source #

(<=) :: Prog ex -> Prog ex -> Bool Source #

(>) :: Prog ex -> Prog ex -> Bool Source #

(>=) :: Prog ex -> Prog ex -> Bool Source #

max :: Prog ex -> Prog ex -> Prog ex Source #

min :: Prog ex -> Prog ex -> Prog ex Source #

HasPretty ex => Pretty (Prog ex) Source # 
Instance details

Defined in Gibbon.Pretty

type Rep (Prog ex) Source # 
Instance details

Defined in Gibbon.Language.Syntax

type Rep (Prog ex) = D1 ('MetaData "Prog" "Gibbon.Language.Syntax" "gibbon-0.3-inplace" 'False) (C1 ('MetaCons "Prog" 'PrefixI 'True) (S1 ('MetaSel ('Just "ddefs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (DDefs (TyOf ex))) :*: (S1 ('MetaSel ('Just "fundefs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (FunDefs ex)) :*: S1 ('MetaSel ('Just "mainExp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (ex, TyOf ex))))))

progToEnv :: Prog a -> Env2 (TyOf a) Source #

Abstract some of the differences of top level program types, by having a common way to extract an initial environment. The initial environment has types only for functions.

getFunTy :: Var -> Prog ex -> ArrowTy (TyOf ex) Source #

Look up the input/output type of a top-level function binding.

Environments

type TyEnv a = Map Var a Source #

A simple type environment

data Env2 a Source #

A common currency for a two part environment consisting of function bindings and regular value bindings.

Constructors

Env2 

Fields

Instances

Instances details
(Out a, Out (ArrowTy a)) => Out (Env2 a) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

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

doc :: Env2 a -> Doc Source #

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

Generic (Env2 a) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Associated Types

type Rep (Env2 a) :: Type -> Type Source #

Methods

from :: Env2 a -> Rep (Env2 a) x Source #

to :: Rep (Env2 a) x -> Env2 a Source #

(Read (TyOf a), Read a, Read (ArrowTy a)) => Read (Env2 a) Source # 
Instance details

Defined in Gibbon.Language.Syntax

(Show (TyOf a), Show a, Show (ArrowTy a)) => Show (Env2 a) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

showsPrec :: Int -> Env2 a -> ShowS Source #

show :: Env2 a -> String Source #

showList :: [Env2 a] -> ShowS Source #

(Eq (TyOf a), Eq a, Eq (ArrowTy a)) => Eq (Env2 a) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

(==) :: Env2 a -> Env2 a -> Bool Source #

(/=) :: Env2 a -> Env2 a -> Bool Source #

type Rep (Env2 a) Source # 
Instance details

Defined in Gibbon.Language.Syntax

type Rep (Env2 a) = D1 ('MetaData "Env2" "Gibbon.Language.Syntax" "gibbon-0.3-inplace" 'False) (C1 ('MetaCons "Env2" 'PrefixI 'True) (S1 ('MetaSel ('Just "vEnv") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TyEnv a)) :*: S1 ('MetaSel ('Just "fEnv") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TyEnv (ArrowTy a)))))

extendVEnv :: Var -> a -> Env2 a -> Env2 a Source #

Extend non-function value environment.

extendsVEnv :: Map Var a -> Env2 a -> Env2 a Source #

Extend multiple times in one go.

lookupVEnv :: Out a => Var -> Env2 a -> a Source #

extendFEnv :: Var -> ArrowTy a -> Env2 a -> Env2 a Source #

Extend function type environment.

Expresssions and thier types

data PreExp (ext :: Type -> Type -> Type) loc dec Source #

The source language. It has pointer-based sums and products, as well as packed algebraic datatypes.

  1. It is parameterized by an a potential extension point.
  2. It is parameterized by loc, the type of locations.
  3. It is parameterized by a decoration, d, attached to every binder.

Constructors

VarE Var

Variable reference

LitE Int

Numeric literal

CharE Char

A character literal

FloatE Double

Floating point literal

LitSymE Var

A quoted symbol literal

AppE Var [loc] [PreExp ext loc dec]

Apply a top-level / first-order function. Instantiate its type schema by providing location-variable arguments, if applicable.

PrimAppE (Prim dec) [PreExp ext loc dec]

Primitive applications don't manipulate locations.

LetE (Var, [loc], dec, PreExp ext loc dec) (PreExp ext loc dec)

One binding at a time. Allows binding a list of implicit *location* return vales from the RHS, plus a single "real" value. This list of implicit returnsb

IfE (PreExp ext loc dec) (PreExp ext loc dec) (PreExp ext loc dec) 
MkProdE [PreExp ext loc dec]

Tuple construction

ProjE Int (PreExp ext loc dec)

Tuple projection.

CaseE (PreExp ext loc dec) [(DataCon, [(Var, loc)], PreExp ext loc dec)]

Case on a datatype. Each bound, unpacked variable lives at a fixed, read-only location.

DataConE loc DataCon [PreExp ext loc dec]

Construct data that may unpack some fields. The location argument, if applicable, is the byte location at which to write the tag for the sum type.

TimeIt (PreExp ext loc dec) dec Bool

The boolean being true indicates this TimeIt is really (iterate _) This iterate form is used for criterion-style benchmarking.

WithArenaE Var (PreExp ext loc dec) 
SpawnE Var [loc] [PreExp ext loc dec] 
SyncE 
MapE (Var, dec, PreExp ext loc dec) (PreExp ext loc dec) 
FoldE 

Fields

Ext (ext loc dec)

Extension point for downstream language extensions.

Instances

Instances details
Interp Store Exp2 Source # 
Instance details

Defined in Gibbon.L2.Interp

Interp () Exp0 Source # 
Instance details

Defined in Gibbon.L0.Interp

Interp () Exp1 Source # 
Instance details

Defined in Gibbon.L1.Interp

InterpProg Store Exp2 Source # 
Instance details

Defined in Gibbon.L2.Interp

InterpProg () Exp0 Source # 
Instance details

Defined in Gibbon.L0.Interp

InterpProg () Exp1 Source # 
Instance details

Defined in Gibbon.L1.Interp

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

Defined in Gibbon.L2.Interp

InterpExt () Exp0 (E0Ext Ty0 Ty0) Source # 
Instance details

Defined in Gibbon.L0.Interp

InterpExt () Exp1 (E1Ext () Ty1) Source # 
Instance details

Defined in Gibbon.L1.Interp

Pretty (PreExp e l d) => Pretty [PreExp e l d] Source # 
Instance details

Defined in Gibbon.Pretty

Methods

pprintWithStyle :: PPStyle -> [PreExp e l d] -> Doc Source #

pprint :: [PreExp e l d] -> Doc Source #

Foldable (ext loc) => Foldable (PreExp ext loc) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

fold :: Monoid m => PreExp ext loc m -> m Source #

foldMap :: Monoid m => (a -> m) -> PreExp ext loc a -> m Source #

foldMap' :: Monoid m => (a -> m) -> PreExp ext loc a -> m Source #

foldr :: (a -> b -> b) -> b -> PreExp ext loc a -> b Source #

foldr' :: (a -> b -> b) -> b -> PreExp ext loc a -> b Source #

foldl :: (b -> a -> b) -> b -> PreExp ext loc a -> b Source #

foldl' :: (b -> a -> b) -> b -> PreExp ext loc a -> b Source #

foldr1 :: (a -> a -> a) -> PreExp ext loc a -> a Source #

foldl1 :: (a -> a -> a) -> PreExp ext loc a -> a Source #

toList :: PreExp ext loc a -> [a] Source #

null :: PreExp ext loc a -> Bool Source #

length :: PreExp ext loc a -> Int Source #

elem :: Eq a => a -> PreExp ext loc a -> Bool Source #

maximum :: Ord a => PreExp ext loc a -> a Source #

minimum :: Ord a => PreExp ext loc a -> a Source #

sum :: Num a => PreExp ext loc a -> a Source #

product :: Num a => PreExp ext loc a -> a Source #

Traversable (ext loc) => Traversable (PreExp ext loc) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> PreExp ext loc a -> f (PreExp ext loc b) Source #

sequenceA :: Applicative f => PreExp ext loc (f a) -> f (PreExp ext loc a) Source #

mapM :: Monad m => (a -> m b) -> PreExp ext loc a -> m (PreExp ext loc b) Source #

sequence :: Monad m => PreExp ext loc (m a) -> m (PreExp ext loc a) Source #

Functor (ext loc) => Functor (PreExp ext loc) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

fmap :: (a -> b) -> PreExp ext loc a -> PreExp ext loc b Source #

(<$) :: a -> PreExp ext loc b -> PreExp ext loc a Source #

(Out loc, Out dec, Out (ext loc dec)) => Out (PreExp ext loc dec) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

docPrec :: Int -> PreExp ext loc dec -> Doc Source #

doc :: PreExp ext loc dec -> Doc Source #

docList :: [PreExp ext loc dec] -> Doc Source #

Generic (PreExp ext loc dec) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Associated Types

type Rep (PreExp ext loc dec) :: Type -> Type Source #

Methods

from :: PreExp ext loc dec -> Rep (PreExp ext loc dec) x Source #

to :: Rep (PreExp ext loc dec) x -> PreExp ext loc dec Source #

(Read loc, Read dec, Read (ext loc dec)) => Read (PreExp ext loc dec) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

readsPrec :: Int -> ReadS (PreExp ext loc dec) Source #

readList :: ReadS [PreExp ext loc dec] Source #

readPrec :: ReadPrec (PreExp ext loc dec) Source #

readListPrec :: ReadPrec [PreExp ext loc dec] Source #

(Show loc, Show dec, Show (ext loc dec)) => Show (PreExp ext loc dec) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

showsPrec :: Int -> PreExp ext loc dec -> ShowS Source #

show :: PreExp ext loc dec -> String Source #

showList :: [PreExp ext loc dec] -> ShowS Source #

(NFData loc, NFData dec, NFData (ext loc dec)) => NFData (PreExp ext loc dec) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

rnf :: PreExp ext loc dec -> () Source #

(Eq loc, Eq dec, Eq (ext loc dec)) => Eq (PreExp ext loc dec) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

(==) :: PreExp ext loc dec -> PreExp ext loc dec -> Bool Source #

(/=) :: PreExp ext loc dec -> PreExp ext loc dec -> Bool Source #

(Ord loc, Ord dec, Ord (ext loc dec)) => Ord (PreExp ext loc dec) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

compare :: PreExp ext loc dec -> PreExp ext loc dec -> Ordering Source #

(<) :: PreExp ext loc dec -> PreExp ext loc dec -> Bool Source #

(<=) :: PreExp ext loc dec -> PreExp ext loc dec -> Bool Source #

(>) :: PreExp ext loc dec -> PreExp ext loc dec -> Bool Source #

(>=) :: PreExp ext loc dec -> PreExp ext loc dec -> Bool Source #

max :: PreExp ext loc dec -> PreExp ext loc dec -> PreExp ext loc dec Source #

min :: PreExp ext loc dec -> PreExp ext loc dec -> PreExp ext loc dec Source #

(Out l, Show l, Show d, Out d, Expression (e l d)) => Expression (PreExp e l d) Source # 
Instance details

Defined in Gibbon.Language

Associated Types

type TyOf (PreExp e l d) Source #

type LocOf (PreExp e l d) Source #

Methods

isTrivial :: PreExp e l d -> Bool Source #

FlattenDeps e l d => Flattenable (PreExp e l d) Source # 
Instance details

Defined in Gibbon.Passes.Flatten

Methods

gFlattenExp :: DDefs (TyOf (PreExp e l d)) -> Env2 (TyOf (PreExp e l d)) -> PreExp e l d -> PassM (PreExp e l d) Source #

gFlattenGatherBinds :: DDefs (TyOf (PreExp e l d)) -> Env2 (TyOf (PreExp e l d)) -> PreExp e l d -> PassM ([Binds (PreExp e l d)], PreExp e l d) Source #

FreeVars (e l d) => FreeVars (PreExp e l d) Source #

Free data variables. Does not include function variables, which currently occupy a different namespace. Does not include location/region variables.

Instance details

Defined in Gibbon.Language

Methods

gFreeVars :: PreExp e l d -> Set Var Source #

HasRenamable e l d => Renamable (PreExp e l d) Source # 
Instance details

Defined in Gibbon.Language

Methods

gRename :: Map Var Var -> PreExp e l d -> PreExp e l d Source #

HasSimplifiable e l d => Simplifiable (PreExp e l d) Source # 
Instance details

Defined in Gibbon.Passes.InlineTriv

Methods

gInlineTrivExp :: Map Var (PreExp e l d) -> PreExp e l d -> PreExp e l d Source #

HasSubstitutable e l d => Substitutable (PreExp e l d) Source # 
Instance details

Defined in Gibbon.Language

Methods

gSubst :: Var -> PreExp e l d -> PreExp e l d -> PreExp e l d Source #

gSubstE :: PreExp e l d -> PreExp e l d -> PreExp e l d -> PreExp e l d Source #

Typeable (PreExp E2Ext LocVar (UrTy LocVar)) Source #

The gRecoverType instance defined in Language.Syntax is incorrect for L2. For the AppE case, it'll just return the type with with the function was defined. However, we want the recovered type to have the locations actually used at the callsites! For example,

add1 :: Tree a -> Tree b add1 = _

... (add1 [loc1, loc2] tr1) ..

in this case, we want the type of (add1 tr1) to be (Tree loc2) and NOT (Tree b). We have to do something similar for variables bound by a pattern match.

Instance details

Defined in Gibbon.L2.Syntax

Out (E2Ext LocArg Ty2) => Typeable (PreExp E2Ext LocArg Ty2) Source #

The gRecoverType instance defined in Language.Syntax is incorrect for L2. For the AppE case, it'll just return the type with with the function was defined. However, we want the recovered type to have the locations actually used at the callsites! For example,

add1 :: Tree a -> Tree b add1 = _

... (add1 [loc1, loc2] tr1) ..

in this case, we want the type of (add1 tr1) to be (Tree loc2) and NOT (Tree b). We have to do something similar for variables bound by a pattern match.

Instance details

Defined in Gibbon.NewL2.Syntax

(Show (), Out (), TyOf (e () (UrTy ())) ~ TyOf (PreExp e () (UrTy ())), FunctionTy (UrTy ()), Typeable (e () (UrTy ()))) => Typeable (PreExp e () (UrTy ())) Source #

A Typeable instance for L1 and L3 (L2 defines it's own)

Instance details

Defined in Gibbon.Language

Methods

gRecoverType :: DDefs (TyOf (PreExp e () (UrTy ()))) -> Env2 (TyOf (PreExp e () (UrTy ()))) -> PreExp e () (UrTy ()) -> TyOf (PreExp e () (UrTy ())) Source #

HasPrettyToo e l d => Pretty (PreExp e l d) Source # 
Instance details

Defined in Gibbon.Pretty

Methods

pprintWithStyle :: PPStyle -> PreExp e l d -> Doc Source #

pprint :: PreExp e l d -> Doc Source #

Corecursive (PreExp ext loc dec) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

embed :: Base (PreExp ext loc dec) (PreExp ext loc dec) -> PreExp ext loc dec Source #

ana :: (a -> Base (PreExp ext loc dec) a) -> a -> PreExp ext loc dec Source #

apo :: (a -> Base (PreExp ext loc dec) (Either (PreExp ext loc dec) a)) -> a -> PreExp ext loc dec Source #

postpro :: Recursive (PreExp ext loc dec) => (forall b. Base (PreExp ext loc dec) b -> Base (PreExp ext loc dec) b) -> (a -> Base (PreExp ext loc dec) a) -> a -> PreExp ext loc dec Source #

gpostpro :: (Recursive (PreExp ext loc dec), Monad m) => (forall b. m (Base (PreExp ext loc dec) b) -> Base (PreExp ext loc dec) (m b)) -> (forall c. Base (PreExp ext loc dec) c -> Base (PreExp ext loc dec) c) -> (a -> Base (PreExp ext loc dec) (m a)) -> a -> PreExp ext loc dec Source #

Recursive (PreExp ext loc dec) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

project :: PreExp ext loc dec -> Base (PreExp ext loc dec) (PreExp ext loc dec) Source #

cata :: (Base (PreExp ext loc dec) a -> a) -> PreExp ext loc dec -> a Source #

para :: (Base (PreExp ext loc dec) (PreExp ext loc dec, a) -> a) -> PreExp ext loc dec -> a Source #

gpara :: (Corecursive (PreExp ext loc dec), Comonad w) => (forall b. Base (PreExp ext loc dec) (w b) -> w (Base (PreExp ext loc dec) b)) -> (Base (PreExp ext loc dec) (EnvT (PreExp ext loc dec) w a) -> a) -> PreExp ext loc dec -> a Source #

prepro :: Corecursive (PreExp ext loc dec) => (forall b. Base (PreExp ext loc dec) b -> Base (PreExp ext loc dec) b) -> (Base (PreExp ext loc dec) a -> a) -> PreExp ext loc dec -> a Source #

gprepro :: (Corecursive (PreExp ext loc dec), Comonad w) => (forall b. Base (PreExp ext loc dec) (w b) -> w (Base (PreExp ext loc dec) b)) -> (forall c. Base (PreExp ext loc dec) c -> Base (PreExp ext loc dec) c) -> (Base (PreExp ext loc dec) (w a) -> a) -> PreExp ext loc dec -> a Source #

HasSimplifiableExt E1Ext l d => SimplifiableExt (PreExp E1Ext l d) (E1Ext l d) Source # 
Instance details

Defined in Gibbon.L1.Syntax

Methods

gInlineTrivExt :: Map Var (PreExp E1Ext l d) -> E1Ext l d -> E1Ext l d Source #

HasSimplifiableExt E2Ext l d => SimplifiableExt (PreExp E2Ext l d) (E2Ext l d) Source # 
Instance details

Defined in Gibbon.L2.Syntax

Methods

gInlineTrivExt :: Map Var (PreExp E2Ext l d) -> E2Ext l d -> E2Ext l d Source #

HasSimplifiableExt E3Ext l d => SimplifiableExt (PreExp E3Ext l d) (E3Ext l d) Source # 
Instance details

Defined in Gibbon.L3.Syntax

Methods

gInlineTrivExt :: Map Var (PreExp E3Ext l d) -> E3Ext l d -> E3Ext l d Source #

HasSubstitutableExt E0Ext l d => SubstitutableExt (PreExp E0Ext l d) (E0Ext l d) Source # 
Instance details

Defined in Gibbon.L0.Syntax

Methods

gSubstExt :: Var -> PreExp E0Ext l d -> E0Ext l d -> E0Ext l d Source #

gSubstEExt :: PreExp E0Ext l d -> PreExp E0Ext l d -> E0Ext l d -> E0Ext l d Source #

HasSubstitutableExt E0Ext l d => SubstitutableExt (PreExp E0Ext l d) (LinearExt l d) Source # 
Instance details

Defined in Gibbon.L0.Syntax

Methods

gSubstExt :: Var -> PreExp E0Ext l d -> LinearExt l d -> LinearExt l d Source #

gSubstEExt :: PreExp E0Ext l d -> PreExp E0Ext l d -> LinearExt l d -> LinearExt l d Source #

HasSubstitutableExt E1Ext l d => SubstitutableExt (PreExp E1Ext l d) (E1Ext l d) Source # 
Instance details

Defined in Gibbon.L1.Syntax

Methods

gSubstExt :: Var -> PreExp E1Ext l d -> E1Ext l d -> E1Ext l d Source #

gSubstEExt :: PreExp E1Ext l d -> PreExp E1Ext l d -> E1Ext l d -> E1Ext l d Source #

HasSubstitutableExt E2Ext l d => SubstitutableExt (PreExp E2Ext l d) (E2Ext l d) Source # 
Instance details

Defined in Gibbon.L2.Syntax

Methods

gSubstExt :: Var -> PreExp E2Ext l d -> E2Ext l d -> E2Ext l d Source #

gSubstEExt :: PreExp E2Ext l d -> PreExp E2Ext l d -> E2Ext l d -> E2Ext l d Source #

HasSubstitutableExt E3Ext l d => SubstitutableExt (PreExp E3Ext l d) (E3Ext l d) Source # 
Instance details

Defined in Gibbon.L3.Syntax

Methods

gSubstExt :: Var -> PreExp E3Ext l d -> E3Ext l d -> E3Ext l d Source #

gSubstEExt :: PreExp E3Ext l d -> PreExp E3Ext l d -> E3Ext l d -> E3Ext l d Source #

type Rep (PreExp ext loc dec) Source # 
Instance details

Defined in Gibbon.Language.Syntax

type Rep (PreExp ext loc dec) = D1 ('MetaData "PreExp" "Gibbon.Language.Syntax" "gibbon-0.3-inplace" 'False) ((((C1 ('MetaCons "VarE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Var)) :+: C1 ('MetaCons "LitE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) :+: (C1 ('MetaCons "CharE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Char)) :+: (C1 ('MetaCons "FloatE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)) :+: C1 ('MetaCons "LitSymE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Var))))) :+: ((C1 ('MetaCons "AppE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Var) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [loc]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PreExp ext loc dec]))) :+: C1 ('MetaCons "PrimAppE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Prim dec)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PreExp ext loc dec]))) :+: (C1 ('MetaCons "LetE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Var, [loc], dec, PreExp ext loc dec)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PreExp ext loc dec))) :+: (C1 ('MetaCons "IfE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PreExp ext loc dec)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PreExp ext loc dec)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PreExp ext loc dec)))) :+: C1 ('MetaCons "MkProdE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PreExp ext loc dec])))))) :+: (((C1 ('MetaCons "ProjE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PreExp ext loc dec))) :+: C1 ('MetaCons "CaseE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PreExp ext loc dec)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(DataCon, [(Var, loc)], PreExp ext loc dec)]))) :+: (C1 ('MetaCons "DataConE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 loc) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DataCon) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PreExp ext loc dec]))) :+: (C1 ('MetaCons "TimeIt" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PreExp ext loc dec)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 dec) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))) :+: C1 ('MetaCons "WithArenaE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Var) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PreExp ext loc dec)))))) :+: ((C1 ('MetaCons "SpawnE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Var) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [loc]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PreExp ext loc dec]))) :+: C1 ('MetaCons "SyncE" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "MapE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Var, dec, PreExp ext loc dec)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PreExp ext loc dec))) :+: (C1 ('MetaCons "FoldE" 'PrefixI 'True) (S1 ('MetaSel ('Just "initial") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Var, dec, PreExp ext loc dec)) :*: (S1 ('MetaSel ('Just "iterator") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Var, dec, PreExp ext loc dec)) :*: S1 ('MetaSel ('Just "body") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PreExp ext loc dec)))) :+: C1 ('MetaCons "Ext" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ext loc dec))))))))
type LocOf (PreExp e l d) Source # 
Instance details

Defined in Gibbon.Language

type LocOf (PreExp e l d) = l
type TyOf (PreExp e l d) Source # 
Instance details

Defined in Gibbon.Language

type TyOf (PreExp e l d) = d
type Base (PreExp ext loc dec) Source # 
Instance details

Defined in Gibbon.Language.Syntax

type Base (PreExp ext loc dec) = PreExpF ext loc dec

data Prim ty Source #

Some of these primitives are (temporarily) tagged directly with their return types.

Constructors

AddP 
SubP 
MulP

May need more numeric primitives...

DivP 
ModP

Integer division and modulus

ExpP

Exponentiation

RandP

Generate a random number. Translates to 'rand()' in C.

EqIntP

Equality on Int

LtP 
GtP

(and () for Int's

LtEqP 
GtEqP

and=

FAddP 
FSubP 
FMulP 
FDivP 
FExpP 
FRandP 
EqFloatP 
EqCharP 
FLtP 
FGtP 
FLtEqP 
FGtEqP 
FSqrtP 
IntToFloatP 
FloatToIntP 
FTanP

Translates to 'tan()' in C.

EqSymP

Equality on Sym

EqBenchProgP String 
OrP 
AndP 
MkTrue

Zero argument constructor.

MkFalse

Zero argument constructor.

ErrorP String ty

crash and issue a static error message. To avoid needing inference, this is labeled with a return type.

SizeParam 
IsBig

Check the size of constructors with size.

GetNumProcessors

Return the number of processors

PrintInt

Print an integer to standard out

PrintChar

Print a character to standard out

PrintFloat

Print a floating point number to standard out

PrintBool

Print a boolean to standard out

PrintSym

Print a symbol to standard out

ReadInt

Read an int from standard in

DictInsertP ty

takes dict, k,v; annotated with element type

DictLookupP ty

takes dict,k errors if absent; annotated with element type

DictEmptyP ty

annotated with element type to avoid ambiguity

DictHasKeyP ty

takes dict,k; returns a Bool, annotated with element type

SymSetEmpty

Creates an empty set

SymSetInsert

Inserts a symbol into a set of symbols

SymSetContains

Queries if a symbol is in a set

SymHashEmpty

Create empty hash table of symbols

SymHashInsert

Insert a symbol into a hash table

SymHashLookup

Look up a symbol in a hash table (takes default symbol)

SymHashContains

Queries if a symbol is in a hash

IntHashEmpty

Create empty hash table of integers

IntHashInsert

Insert an integer into a hash table

IntHashLookup

Look up a integer in a hash table (takes default integer)

PDictAllocP ty ty

annotated with element type to avoid ambiguity

PDictInsertP ty ty

takes dict, k, v; annotated with element type

PDictLookupP ty ty

takes dict, k. errors if absent; annotated with element type

PDictHasKeyP ty ty

takes dict,k; returns a Bool, annotated with element type

PDictForkP ty ty

takes dict; returns thread safe safe dicts.

PDictJoinP ty ty

takes 2 dicts; returns a merged dict.

LLAllocP ty 
LLIsEmptyP ty 
LLConsP ty 
LLHeadP ty 
LLTailP ty 
LLFreeP ty

Free the list, and it's data.

LLFree2P ty

Free list struct, but not it's data.

LLCopyP ty

Copy the list node.

VAllocP ty

Allocate a vector

VFreeP ty

Free a vector, and it's data.

VFree2P ty

Free the vector struct, but not it's data.

VLengthP ty

Length of the vector

VNthP ty

Fetch the nth element

VSliceP ty

An efficient slice operation

InplaceVUpdateP ty

Update ith element of the vector

VConcatP ty

Flatten a vector

VSortP ty

A sort primop that accepts a function pointer

InplaceVSortP ty

A sort primop that sorts the array in place

VMergeP ty

ASSUMPTION: the vectors being merged have the same underlying mutable array. This assumption is checked at the type level with a Rank-2 type variable. But this evidence is erased (by the desugarer) by the time we get to L0.

Write3dPpmFile FilePath 
ReadPackedFile (Maybe FilePath) TyCon (Maybe Var) ty

Read (mmap) a binary file containing packed data. This must be annotated with the type of the file being read. The Ty tracks the type as the program evolvels (first PackedTy then CursorTy). The TyCon tracks the original type name. The variable represents the region that this file will be mapped to, and is set by InferLocations.

WritePackedFile FilePath ty

Write a packed value to a file. To enable re-reading this packed value with Gibbon, this primitive gets rid of any absolute pointers in the value. First, it inlines (by copying) any regions pointed to by the packed value. Next, random access nodes are eliminated. We could change them to relative pointers (numeric offsets), but for a first version we can simplify things by getting rid of them completely.

ReadArrayFile (Maybe (FilePath, Int)) ty

Parse a file into a Vector. This is decorated with the element type. If the element type is a struct, like (Int, Int) for example, each line must contain 2 numbers separated by a space. The Int is the number of lines in the file.

RequestEndOf

Conveys a demand for the "end of" some packed value, which is fulfilled by Cursorize. N.B. the argument must be a VarE that refers to a packed value.

RequestSizeOf

Like RequestEndOf but gets the size of a packed value. Assume that the value is written in a contiguous region, and size = end_v - v.

Gensym 

Instances

Instances details
Foldable Prim Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

fold :: Monoid m => Prim m -> m Source #

foldMap :: Monoid m => (a -> m) -> Prim a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Prim a -> m Source #

foldr :: (a -> b -> b) -> b -> Prim a -> b Source #

foldr' :: (a -> b -> b) -> b -> Prim a -> b Source #

foldl :: (b -> a -> b) -> b -> Prim a -> b Source #

foldl' :: (b -> a -> b) -> b -> Prim a -> b Source #

foldr1 :: (a -> a -> a) -> Prim a -> a Source #

foldl1 :: (a -> a -> a) -> Prim a -> a Source #

toList :: Prim a -> [a] Source #

null :: Prim a -> Bool Source #

length :: Prim a -> Int Source #

elem :: Eq a => a -> Prim a -> Bool Source #

maximum :: Ord a => Prim a -> a Source #

minimum :: Ord a => Prim a -> a Source #

sum :: Num a => Prim a -> a Source #

product :: Num a => Prim a -> a Source #

Traversable Prim Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> Prim a -> f (Prim b) Source #

sequenceA :: Applicative f => Prim (f a) -> f (Prim a) Source #

mapM :: Monad m => (a -> m b) -> Prim a -> m (Prim b) Source #

sequence :: Monad m => Prim (m a) -> m (Prim a) Source #

Functor Prim Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

fmap :: (a -> b) -> Prim a -> Prim b Source #

(<$) :: a -> Prim b -> Prim a Source #

Out ty => Out (Prim ty) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

docPrec :: Int -> Prim ty -> Doc Source #

doc :: Prim ty -> Doc Source #

docList :: [Prim ty] -> Doc Source #

Generic (Prim ty) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Associated Types

type Rep (Prim ty) :: Type -> Type Source #

Methods

from :: Prim ty -> Rep (Prim ty) x Source #

to :: Rep (Prim ty) x -> Prim ty Source #

Read ty => Read (Prim ty) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Show ty => Show (Prim ty) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

showsPrec :: Int -> Prim ty -> ShowS Source #

show :: Prim ty -> String Source #

showList :: [Prim ty] -> ShowS Source #

NFData ty => NFData (Prim ty) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

rnf :: Prim ty -> () Source #

Eq ty => Eq (Prim ty) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

(==) :: Prim ty -> Prim ty -> Bool Source #

(/=) :: Prim ty -> Prim ty -> Bool Source #

Ord ty => Ord (Prim ty) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

compare :: Prim ty -> Prim ty -> Ordering Source #

(<) :: Prim ty -> Prim ty -> Bool Source #

(<=) :: Prim ty -> Prim ty -> Bool Source #

(>) :: Prim ty -> Prim ty -> Bool Source #

(>=) :: Prim ty -> Prim ty -> Bool Source #

max :: Prim ty -> Prim ty -> Prim ty Source #

min :: Prim ty -> Prim ty -> Prim ty Source #

(Show d, Pretty d, Ord d) => Pretty (Prim d) Source # 
Instance details

Defined in Gibbon.Pretty

Corecursive (Prim ty) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

embed :: Base (Prim ty) (Prim ty) -> Prim ty Source #

ana :: (a -> Base (Prim ty) a) -> a -> Prim ty Source #

apo :: (a -> Base (Prim ty) (Either (Prim ty) a)) -> a -> Prim ty Source #

postpro :: Recursive (Prim ty) => (forall b. Base (Prim ty) b -> Base (Prim ty) b) -> (a -> Base (Prim ty) a) -> a -> Prim ty Source #

gpostpro :: (Recursive (Prim ty), Monad m) => (forall b. m (Base (Prim ty) b) -> Base (Prim ty) (m b)) -> (forall c. Base (Prim ty) c -> Base (Prim ty) c) -> (a -> Base (Prim ty) (m a)) -> a -> Prim ty Source #

Recursive (Prim ty) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

project :: Prim ty -> Base (Prim ty) (Prim ty) Source #

cata :: (Base (Prim ty) a -> a) -> Prim ty -> a Source #

para :: (Base (Prim ty) (Prim ty, a) -> a) -> Prim ty -> a Source #

gpara :: (Corecursive (Prim ty), Comonad w) => (forall b. Base (Prim ty) (w b) -> w (Base (Prim ty) b)) -> (Base (Prim ty) (EnvT (Prim ty) w a) -> a) -> Prim ty -> a Source #

prepro :: Corecursive (Prim ty) => (forall b. Base (Prim ty) b -> Base (Prim ty) b) -> (Base (Prim ty) a -> a) -> Prim ty -> a Source #

gprepro :: (Corecursive (Prim ty), Comonad w) => (forall b. Base (Prim ty) (w b) -> w (Base (Prim ty) b)) -> (forall c. Base (Prim ty) c -> Base (Prim ty) c) -> (Base (Prim ty) (w a) -> a) -> Prim ty -> a Source #

type Rep (Prim ty) Source # 
Instance details

Defined in Gibbon.Language.Syntax

type Rep (Prim ty) = D1 ('MetaData "Prim" "Gibbon.Language.Syntax" "gibbon-0.3-inplace" 'False) ((((((C1 ('MetaCons "AddP" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SubP" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "MulP" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "DivP" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ModP" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ExpP" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "RandP" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EqIntP" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "LtP" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "GtP" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "LtEqP" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "GtEqP" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FAddP" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "FSubP" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "FMulP" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FDivP" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "FExpP" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "FRandP" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EqFloatP" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "EqCharP" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "FLtP" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FGtP" 'PrefixI 'False) (U1 :: Type -> Type)))))) :+: ((((C1 ('MetaCons "FLtEqP" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FGtEqP" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "FSqrtP" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "IntToFloatP" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FloatToIntP" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "FTanP" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "EqSymP" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EqBenchProgP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))) :+: (C1 ('MetaCons "OrP" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "AndP" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MkTrue" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "MkFalse" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)) :+: C1 ('MetaCons "SizeParam" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "IsBig" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "GetNumProcessors" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PrintInt" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "PrintChar" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "PrintFloat" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PrintBool" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "PrintSym" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ReadInt" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DictInsertP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)))))))) :+: (((((C1 ('MetaCons "DictLookupP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)) :+: C1 ('MetaCons "DictEmptyP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty))) :+: (C1 ('MetaCons "DictHasKeyP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)) :+: (C1 ('MetaCons "SymSetEmpty" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SymSetInsert" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "SymSetContains" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "SymHashEmpty" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SymHashInsert" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "SymHashLookup" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "SymHashContains" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "IntHashEmpty" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "IntHashInsert" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "IntHashLookup" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "PDictAllocP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)) :+: (C1 ('MetaCons "PDictInsertP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)) :+: C1 ('MetaCons "PDictLookupP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty))))) :+: ((C1 ('MetaCons "PDictHasKeyP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)) :+: (C1 ('MetaCons "PDictForkP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)) :+: C1 ('MetaCons "PDictJoinP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)))) :+: (C1 ('MetaCons "LLAllocP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)) :+: (C1 ('MetaCons "LLIsEmptyP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)) :+: C1 ('MetaCons "LLConsP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty))))))) :+: ((((C1 ('MetaCons "LLHeadP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)) :+: C1 ('MetaCons "LLTailP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty))) :+: (C1 ('MetaCons "LLFreeP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)) :+: (C1 ('MetaCons "LLFree2P" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)) :+: C1 ('MetaCons "LLCopyP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty))))) :+: ((C1 ('MetaCons "VAllocP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)) :+: (C1 ('MetaCons "VFreeP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)) :+: C1 ('MetaCons "VFree2P" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)))) :+: (C1 ('MetaCons "VLengthP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)) :+: (C1 ('MetaCons "VNthP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)) :+: C1 ('MetaCons "VSliceP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)))))) :+: (((C1 ('MetaCons "InplaceVUpdateP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)) :+: (C1 ('MetaCons "VConcatP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)) :+: C1 ('MetaCons "VSortP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)))) :+: (C1 ('MetaCons "InplaceVSortP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)) :+: (C1 ('MetaCons "VMergeP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)) :+: C1 ('MetaCons "Write3dPpmFile" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath))))) :+: ((C1 ('MetaCons "ReadPackedFile" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe FilePath)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TyCon)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Var)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty))) :+: (C1 ('MetaCons "WritePackedFile" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)) :+: C1 ('MetaCons "ReadArrayFile" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (FilePath, Int))) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ty)))) :+: (C1 ('MetaCons "RequestEndOf" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "RequestSizeOf" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Gensym" 'PrefixI 'False) (U1 :: Type -> Type))))))))
type Base (Prim ty) Source # 
Instance details

Defined in Gibbon.Language.Syntax

type Base (Prim ty) = PrimF ty

data UrTy loc Source #

Types include boxed/pointer-based products as well as unpacked algebraic datatypes. This data is parameterized to allow annotation on Packed types later on.

Constructors

IntTy 
CharTy 
FloatTy 
SymTy

Symbols used in writing compiler passes.

BoolTy 
ProdTy [UrTy loc]

An N-ary tuple

SymDictTy (Maybe Var) (UrTy ())

A map from SymTy to Ty ^ We allow built-in dictionaries from symbols to a value type.

PackedTy TyCon loc

No type arguments to TyCons for now. (No polymorphism.)

VectorTy (UrTy loc)

Vectors are decorated with the types of their elements; which can only include scalars or flat products of scalars.

PDictTy (UrTy loc) (UrTy loc)

Thread safe dictionaries decorated with key and value type.

ListTy (UrTy loc)

Linked lists are decorated with the types of their elements; which can only include scalars or flat products of scalars.

ArenaTy

Collection of allocated, non-packed values

SymSetTy

Set of symbols

SymHashTy

Hash table of symbols

IntHashTy

Hash table of integers

PtrTy

A machine pointer tvo a complete value in memory. This is decorated with the region it points into, which may affect the memory layout.

CursorTy

A cursor for reading or writing, which may point to an unkwown type or to a fraction of a complete value. It is a machine pointer that can point to any byte.

Instances

Instances details
Foldable UrTy Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

fold :: Monoid m => UrTy m -> m Source #

foldMap :: Monoid m => (a -> m) -> UrTy a -> m Source #

foldMap' :: Monoid m => (a -> m) -> UrTy a -> m Source #

foldr :: (a -> b -> b) -> b -> UrTy a -> b Source #

foldr' :: (a -> b -> b) -> b -> UrTy a -> b Source #

foldl :: (b -> a -> b) -> b -> UrTy a -> b Source #

foldl' :: (b -> a -> b) -> b -> UrTy a -> b Source #

foldr1 :: (a -> a -> a) -> UrTy a -> a Source #

foldl1 :: (a -> a -> a) -> UrTy a -> a Source #

toList :: UrTy a -> [a] Source #

null :: UrTy a -> Bool Source #

length :: UrTy a -> Int Source #

elem :: Eq a => a -> UrTy a -> Bool Source #

maximum :: Ord a => UrTy a -> a Source #

minimum :: Ord a => UrTy a -> a Source #

sum :: Num a => UrTy a -> a Source #

product :: Num a => UrTy a -> a Source #

Traversable UrTy Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> UrTy a -> f (UrTy b) Source #

sequenceA :: Applicative f => UrTy (f a) -> f (UrTy a) Source #

mapM :: Monad m => (a -> m b) -> UrTy a -> m (UrTy b) Source #

sequence :: Monad m => UrTy (m a) -> m (UrTy a) Source #

Functor UrTy Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

fmap :: (a -> b) -> UrTy a -> UrTy b Source #

(<$) :: a -> UrTy b -> UrTy a Source #

FunctionTy Ty1 Source # 
Instance details

Defined in Gibbon.L1.Syntax

Associated Types

type ArrowTy Ty1 Source #

FunctionTy Ty2 Source #

Function types know about locations and traversal effects.

Instance details

Defined in Gibbon.L2.Syntax

Associated Types

type ArrowTy Ty2 Source #

Interp Store Exp2 Source # 
Instance details

Defined in Gibbon.L2.Interp

Interp () Exp1 Source # 
Instance details

Defined in Gibbon.L1.Interp

InterpProg Store Exp2 Source # 
Instance details

Defined in Gibbon.L2.Interp

InterpProg () Exp1 Source # 
Instance details

Defined in Gibbon.L1.Interp

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

Defined in Gibbon.L2.Interp

InterpExt () Exp1 (E1Ext () Ty1) Source # 
Instance details

Defined in Gibbon.L1.Interp

Out (ArrowTy2 Ty2) Source # 
Instance details

Defined in Gibbon.L2.Syntax

Out loc => Out (UrTy loc) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

docPrec :: Int -> UrTy loc -> Doc Source #

doc :: UrTy loc -> Doc Source #

docList :: [UrTy loc] -> Doc Source #

Generic (UrTy loc) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Associated Types

type Rep (UrTy loc) :: Type -> Type Source #

Methods

from :: UrTy loc -> Rep (UrTy loc) x Source #

to :: Rep (UrTy loc) x -> UrTy loc Source #

Read loc => Read (UrTy loc) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Show loc => Show (UrTy loc) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

showsPrec :: Int -> UrTy loc -> ShowS Source #

show :: UrTy loc -> String Source #

showList :: [UrTy loc] -> ShowS Source #

NFData loc => NFData (UrTy loc) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

rnf :: UrTy loc -> () Source #

Eq loc => Eq (UrTy loc) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

(==) :: UrTy loc -> UrTy loc -> Bool Source #

(/=) :: UrTy loc -> UrTy loc -> Bool Source #

Ord loc => Ord (UrTy loc) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

compare :: UrTy loc -> UrTy loc -> Ordering Source #

(<) :: UrTy loc -> UrTy loc -> Bool Source #

(<=) :: UrTy loc -> UrTy loc -> Bool Source #

(>) :: UrTy loc -> UrTy loc -> Bool Source #

(>=) :: UrTy loc -> UrTy loc -> Bool Source #

max :: UrTy loc -> UrTy loc -> UrTy loc Source #

min :: UrTy loc -> UrTy loc -> UrTy loc Source #

Renamable a => Renamable (UrTy a) Source # 
Instance details

Defined in Gibbon.Language

Methods

gRename :: Map Var Var -> UrTy a -> UrTy a Source #

Pretty l => Pretty (UrTy l) Source # 
Instance details

Defined in Gibbon.Pretty

Corecursive (UrTy loc) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

embed :: Base (UrTy loc) (UrTy loc) -> UrTy loc Source #

ana :: (a -> Base (UrTy loc) a) -> a -> UrTy loc Source #

apo :: (a -> Base (UrTy loc) (Either (UrTy loc) a)) -> a -> UrTy loc Source #

postpro :: Recursive (UrTy loc) => (forall b. Base (UrTy loc) b -> Base (UrTy loc) b) -> (a -> Base (UrTy loc) a) -> a -> UrTy loc Source #

gpostpro :: (Recursive (UrTy loc), Monad m) => (forall b. m (Base (UrTy loc) b) -> Base (UrTy loc) (m b)) -> (forall c. Base (UrTy loc) c -> Base (UrTy loc) c) -> (a -> Base (UrTy loc) (m a)) -> a -> UrTy loc Source #

Recursive (UrTy loc) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

project :: UrTy loc -> Base (UrTy loc) (UrTy loc) Source #

cata :: (Base (UrTy loc) a -> a) -> UrTy loc -> a Source #

para :: (Base (UrTy loc) (UrTy loc, a) -> a) -> UrTy loc -> a Source #

gpara :: (Corecursive (UrTy loc), Comonad w) => (forall b. Base (UrTy loc) (w b) -> w (Base (UrTy loc) b)) -> (Base (UrTy loc) (EnvT (UrTy loc) w a) -> a) -> UrTy loc -> a Source #

prepro :: Corecursive (UrTy loc) => (forall b. Base (UrTy loc) b -> Base (UrTy loc) b) -> (Base (UrTy loc) a -> a) -> UrTy loc -> a Source #

gprepro :: (Corecursive (UrTy loc), Comonad w) => (forall b. Base (UrTy loc) (w b) -> w (Base (UrTy loc) b)) -> (forall c. Base (UrTy loc) c -> Base (UrTy loc) c) -> (Base (UrTy loc) (w a) -> a) -> UrTy loc -> a Source #

(Show l, Out l) => Flattenable (E3Ext l (UrTy l)) Source # 
Instance details

Defined in Gibbon.L3.Syntax

Methods

gFlattenExp :: DDefs (TyOf (E3Ext l (UrTy l))) -> Env2 (TyOf (E3Ext l (UrTy l))) -> E3Ext l (UrTy l) -> PassM (E3Ext l (UrTy l)) Source #

gFlattenGatherBinds :: DDefs (TyOf (E3Ext l (UrTy l))) -> Env2 (TyOf (E3Ext l (UrTy l))) -> E3Ext l (UrTy l) -> PassM ([Binds (E3Ext l (UrTy l))], E3Ext l (UrTy l)) Source #

Typeable (E1Ext () (UrTy ())) Source # 
Instance details

Defined in Gibbon.L1.Syntax

Methods

gRecoverType :: DDefs (TyOf (E1Ext () (UrTy ()))) -> Env2 (TyOf (E1Ext () (UrTy ()))) -> E1Ext () (UrTy ()) -> TyOf (E1Ext () (UrTy ())) Source #

(Out l, Show l, Typeable (E2 l (UrTy l))) => Typeable (E2Ext l (UrTy l)) Source # 
Instance details

Defined in Gibbon.L2.Syntax

Methods

gRecoverType :: DDefs (TyOf (E2Ext l (UrTy l))) -> Env2 (TyOf (E2Ext l (UrTy l))) -> E2Ext l (UrTy l) -> TyOf (E2Ext l (UrTy l)) Source #

(Out l, Show l, Typeable (PreExp E3Ext l (UrTy l))) => Typeable (E3Ext l (UrTy l)) Source # 
Instance details

Defined in Gibbon.L3.Syntax

Methods

gRecoverType :: DDefs (TyOf (E3Ext l (UrTy l))) -> Env2 (TyOf (E3Ext l (UrTy l))) -> E3Ext l (UrTy l) -> TyOf (E3Ext l (UrTy l)) Source #

(Out l, HasPrettyToo E3Ext l (UrTy l)) => Pretty (E3Ext l (UrTy l)) Source # 
Instance details

Defined in Gibbon.Pretty

Methods

pprintWithStyle :: PPStyle -> E3Ext l (UrTy l) -> Doc Source #

pprint :: E3Ext l (UrTy l) -> Doc Source #

Pretty ([UrTy ()], UrTy ()) Source # 
Instance details

Defined in Gibbon.Pretty

Methods

pprintWithStyle :: PPStyle -> ([UrTy ()], UrTy ()) -> Doc Source #

pprint :: ([UrTy ()], UrTy ()) -> Doc Source #

Typeable (PreExp E2Ext LocVar (UrTy LocVar)) Source #

The gRecoverType instance defined in Language.Syntax is incorrect for L2. For the AppE case, it'll just return the type with with the function was defined. However, we want the recovered type to have the locations actually used at the callsites! For example,

add1 :: Tree a -> Tree b add1 = _

... (add1 [loc1, loc2] tr1) ..

in this case, we want the type of (add1 tr1) to be (Tree loc2) and NOT (Tree b). We have to do something similar for variables bound by a pattern match.

Instance details

Defined in Gibbon.L2.Syntax

(Show (), Out (), TyOf (e () (UrTy ())) ~ TyOf (PreExp e () (UrTy ())), FunctionTy (UrTy ()), Typeable (e () (UrTy ()))) => Typeable (PreExp e () (UrTy ())) Source #

A Typeable instance for L1 and L3 (L2 defines it's own)

Instance details

Defined in Gibbon.Language

Methods

gRecoverType :: DDefs (TyOf (PreExp e () (UrTy ()))) -> Env2 (TyOf (PreExp e () (UrTy ()))) -> PreExp e () (UrTy ()) -> TyOf (PreExp e () (UrTy ())) Source #

type ArrowTy Ty1 Source # 
Instance details

Defined in Gibbon.L1.Syntax

type ArrowTy Ty1 = ([Ty1], Ty1)
type ArrowTy Ty2 Source # 
Instance details

Defined in Gibbon.L2.Syntax

type Rep (UrTy loc) Source # 
Instance details

Defined in Gibbon.Language.Syntax

type Rep (UrTy loc) = D1 ('MetaData "UrTy" "Gibbon.Language.Syntax" "gibbon-0.3-inplace" 'False) ((((C1 ('MetaCons "IntTy" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CharTy" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "FloatTy" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SymTy" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "BoolTy" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ProdTy" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [UrTy loc]))) :+: (C1 ('MetaCons "SymDictTy" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Var)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (UrTy ()))) :+: C1 ('MetaCons "PackedTy" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TyCon) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 loc))))) :+: (((C1 ('MetaCons "VectorTy" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (UrTy loc))) :+: C1 ('MetaCons "PDictTy" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (UrTy loc)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (UrTy loc)))) :+: (C1 ('MetaCons "ListTy" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (UrTy loc))) :+: C1 ('MetaCons "ArenaTy" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "SymSetTy" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SymHashTy" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "IntHashTy" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "PtrTy" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CursorTy" 'PrefixI 'False) (U1 :: Type -> Type))))))
type Base (UrTy loc) Source # 
Instance details

Defined in Gibbon.Language.Syntax

type Base (UrTy loc) = UrTyF loc

Functors for recursion-schemes

data PreExpF (ext :: Type -> Type -> Type) (loc :: Type) (dec :: Type) r Source #

Constructors

VarEF Var 
LitEF Int 
CharEF Char 
FloatEF Double 
LitSymEF Var 
AppEF Var [loc] [r] 
PrimAppEF (Prim dec) [r] 
LetEF (Var, [loc], dec, r) r 
IfEF r r r 
MkProdEF [r] 
ProjEF Int r 
CaseEF r [([Char], [(Var, loc)], r)] 
DataConEF loc [Char] [r] 
TimeItF r dec Bool 
WithArenaEF Var r 
SpawnEF Var [loc] [r] 
SyncEF 
MapEF (Var, dec, r) r 
FoldEF 

Fields

ExtF (ext loc dec) 

Instances

Instances details
Foldable (PreExpF ext loc dec) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

fold :: Monoid m => PreExpF ext loc dec m -> m Source #

foldMap :: Monoid m => (a -> m) -> PreExpF ext loc dec a -> m Source #

foldMap' :: Monoid m => (a -> m) -> PreExpF ext loc dec a -> m Source #

foldr :: (a -> b -> b) -> b -> PreExpF ext loc dec a -> b Source #

foldr' :: (a -> b -> b) -> b -> PreExpF ext loc dec a -> b Source #

foldl :: (b -> a -> b) -> b -> PreExpF ext loc dec a -> b Source #

foldl' :: (b -> a -> b) -> b -> PreExpF ext loc dec a -> b Source #

foldr1 :: (a -> a -> a) -> PreExpF ext loc dec a -> a Source #

foldl1 :: (a -> a -> a) -> PreExpF ext loc dec a -> a Source #

toList :: PreExpF ext loc dec a -> [a] Source #

null :: PreExpF ext loc dec a -> Bool Source #

length :: PreExpF ext loc dec a -> Int Source #

elem :: Eq a => a -> PreExpF ext loc dec a -> Bool Source #

maximum :: Ord a => PreExpF ext loc dec a -> a Source #

minimum :: Ord a => PreExpF ext loc dec a -> a Source #

sum :: Num a => PreExpF ext loc dec a -> a Source #

product :: Num a => PreExpF ext loc dec a -> a Source #

Traversable (PreExpF ext loc dec) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> PreExpF ext loc dec a -> f (PreExpF ext loc dec b) Source #

sequenceA :: Applicative f => PreExpF ext loc dec (f a) -> f (PreExpF ext loc dec a) Source #

mapM :: Monad m => (a -> m b) -> PreExpF ext loc dec a -> m (PreExpF ext loc dec b) Source #

sequence :: Monad m => PreExpF ext loc dec (m a) -> m (PreExpF ext loc dec a) Source #

Functor (PreExpF ext loc dec) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

fmap :: (a -> b) -> PreExpF ext loc dec a -> PreExpF ext loc dec b Source #

(<$) :: a -> PreExpF ext loc dec b -> PreExpF ext loc dec a Source #

data PrimF (ty :: Type) r Source #

Instances

Instances details
Foldable (PrimF ty) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

fold :: Monoid m => PrimF ty m -> m Source #

foldMap :: Monoid m => (a -> m) -> PrimF ty a -> m Source #

foldMap' :: Monoid m => (a -> m) -> PrimF ty a -> m Source #

foldr :: (a -> b -> b) -> b -> PrimF ty a -> b Source #

foldr' :: (a -> b -> b) -> b -> PrimF ty a -> b Source #

foldl :: (b -> a -> b) -> b -> PrimF ty a -> b Source #

foldl' :: (b -> a -> b) -> b -> PrimF ty a -> b Source #

foldr1 :: (a -> a -> a) -> PrimF ty a -> a Source #

foldl1 :: (a -> a -> a) -> PrimF ty a -> a Source #

toList :: PrimF ty a -> [a] Source #

null :: PrimF ty a -> Bool Source #

length :: PrimF ty a -> Int Source #

elem :: Eq a => a -> PrimF ty a -> Bool Source #

maximum :: Ord a => PrimF ty a -> a Source #

minimum :: Ord a => PrimF ty a -> a Source #

sum :: Num a => PrimF ty a -> a Source #

product :: Num a => PrimF ty a -> a Source #

Traversable (PrimF ty) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> PrimF ty a -> f (PrimF ty b) Source #

sequenceA :: Applicative f => PrimF ty (f a) -> f (PrimF ty a) Source #

mapM :: Monad m => (a -> m b) -> PrimF ty a -> m (PrimF ty b) Source #

sequence :: Monad m => PrimF ty (m a) -> m (PrimF ty a) Source #

Functor (PrimF ty) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

fmap :: (a -> b) -> PrimF ty a -> PrimF ty b Source #

(<$) :: a -> PrimF ty b -> PrimF ty a Source #

data UrTyF (loc :: Type) r Source #

Instances

Instances details
Foldable (UrTyF loc) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

fold :: Monoid m => UrTyF loc m -> m Source #

foldMap :: Monoid m => (a -> m) -> UrTyF loc a -> m Source #

foldMap' :: Monoid m => (a -> m) -> UrTyF loc a -> m Source #

foldr :: (a -> b -> b) -> b -> UrTyF loc a -> b Source #

foldr' :: (a -> b -> b) -> b -> UrTyF loc a -> b Source #

foldl :: (b -> a -> b) -> b -> UrTyF loc a -> b Source #

foldl' :: (b -> a -> b) -> b -> UrTyF loc a -> b Source #

foldr1 :: (a -> a -> a) -> UrTyF loc a -> a Source #

foldl1 :: (a -> a -> a) -> UrTyF loc a -> a Source #

toList :: UrTyF loc a -> [a] Source #

null :: UrTyF loc a -> Bool Source #

length :: UrTyF loc a -> Int Source #

elem :: Eq a => a -> UrTyF loc a -> Bool Source #

maximum :: Ord a => UrTyF loc a -> a Source #

minimum :: Ord a => UrTyF loc a -> a Source #

sum :: Num a => UrTyF loc a -> a Source #

product :: Num a => UrTyF loc a -> a Source #

Traversable (UrTyF loc) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> UrTyF loc a -> f (UrTyF loc b) Source #

sequenceA :: Applicative f => UrTyF loc (f a) -> f (UrTyF loc a) Source #

mapM :: Monad m => (a -> m b) -> UrTyF loc a -> m (UrTyF loc b) Source #

sequence :: Monad m => UrTyF loc (m a) -> m (UrTyF loc a) Source #

Functor (UrTyF loc) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

fmap :: (a -> b) -> UrTyF loc a -> UrTyF loc b Source #

(<$) :: a -> UrTyF loc b -> UrTyF loc a Source #

Generic operations

class FreeVars a where Source #

Expression and program types which support a notion of free variables.

Methods

gFreeVars :: a -> Set Var Source #

Return a set of free TERM variables. Does not return location variables.

Instances

Instances details
FreeVars LocExp Source # 
Instance details

Defined in Gibbon.L2.Syntax

FreeVars LocExp Source # 
Instance details

Defined in Gibbon.NewL2.Syntax

FreeVars a => FreeVars (TyEnv a) Source # 
Instance details

Defined in Gibbon.L0.Typecheck

Methods

gFreeVars :: TyEnv a -> Set Var Source #

FreeVars (E0Ext l d) Source # 
Instance details

Defined in Gibbon.L0.Syntax

Methods

gFreeVars :: E0Ext l d -> Set Var Source #

FreeVars (LinearExt l d) Source # 
Instance details

Defined in Gibbon.L0.Syntax

Methods

gFreeVars :: LinearExt l d -> Set Var Source #

FreeVars (E1Ext l d) Source # 
Instance details

Defined in Gibbon.L1.Syntax

Methods

gFreeVars :: E1Ext l d -> Set Var Source #

FreeVars (E2Ext l d) Source # 
Instance details

Defined in Gibbon.L2.Syntax

Methods

gFreeVars :: E2Ext l d -> Set Var Source #

FreeVars (E3Ext l d) Source # 
Instance details

Defined in Gibbon.L3.Syntax

Methods

gFreeVars :: E3Ext l d -> Set Var Source #

FreeVars (e l d) => FreeVars (PreExp e l d) Source #

Free data variables. Does not include function variables, which currently occupy a different namespace. Does not include location/region variables.

Instance details

Defined in Gibbon.Language

Methods

gFreeVars :: PreExp e l d -> Set Var Source #

class (Show e, Out e, FreeVars e) => Expression e where Source #

A generic interface to expressions found in different phases of the compiler.

Associated Types

type TyOf e Source #

The type representation used in this expression.

type LocOf e Source #

The location (variable) representation used in this expression.

Methods

isTrivial :: e -> Bool Source #

Is an expression considered trivial (duplicatable by the compiler)?

Instances

Instances details
(Out l, Out d, Show l, Show d) => Expression (E0Ext l d) Source # 
Instance details

Defined in Gibbon.L0.Syntax

Associated Types

type TyOf (E0Ext l d) Source #

type LocOf (E0Ext l d) Source #

Methods

isTrivial :: E0Ext l d -> Bool Source #

(Out l, Out d, Show l, Show d) => Expression (LinearExt l d) Source # 
Instance details

Defined in Gibbon.L0.Syntax

Associated Types

type TyOf (LinearExt l d) Source #

type LocOf (LinearExt l d) Source #

Methods

isTrivial :: LinearExt l d -> Bool Source #

(Show l, Show d, Out l, Out d) => Expression (E1Ext l d) Source # 
Instance details

Defined in Gibbon.L1.Syntax

Associated Types

type TyOf (E1Ext l d) Source #

type LocOf (E1Ext l d) Source #

Methods

isTrivial :: E1Ext l d -> Bool Source #

(Out l, Out d, Show l, Show d) => Expression (E2Ext l d) Source # 
Instance details

Defined in Gibbon.L2.Syntax

Associated Types

type TyOf (E2Ext l d) Source #

type LocOf (E2Ext l d) Source #

Methods

isTrivial :: E2Ext l d -> Bool Source #

(Out l, Out d, Show l, Show d) => Expression (E3Ext l d) Source # 
Instance details

Defined in Gibbon.L3.Syntax

Associated Types

type TyOf (E3Ext l d) Source #

type LocOf (E3Ext l d) Source #

Methods

isTrivial :: E3Ext l d -> Bool Source #

(Out l, Show l, Show d, Out d, Expression (e l d)) => Expression (PreExp e l d) Source # 
Instance details

Defined in Gibbon.Language

Associated Types

type TyOf (PreExp e l d) Source #

type LocOf (PreExp e l d) Source #

Methods

isTrivial :: PreExp e l d -> Bool Source #

type Binds e = (Var, [LocOf e], TyOf e, e) Source #

class Expression e => Flattenable e where Source #

IRs amenable to flattening

Methods

gFlattenExp :: DDefs (TyOf e) -> Env2 (TyOf e) -> e -> PassM e Source #

Process an expression into a fully-flattened expression which typically includes a larger number of temporary, local variable bindings.

gFlattenGatherBinds :: DDefs (TyOf e) -> Env2 (TyOf e) -> e -> PassM ([Binds e], e) Source #

A private method. Gather the bindings from a subexpression, but do not "discharge" them by creating a let expression. They are in order, so later may depend on earlier.

Instances

Instances details
(Show l, Out l) => Flattenable (E0Ext l Ty0) Source # 
Instance details

Defined in Gibbon.L0.Syntax

(Show l, Out l) => Flattenable (LinearExt l Ty0) Source # 
Instance details

Defined in Gibbon.L0.Syntax

(Show l, Show d, Out l, Out d) => Flattenable (E1Ext l d) Source # 
Instance details

Defined in Gibbon.L1.Syntax

Methods

gFlattenExp :: DDefs (TyOf (E1Ext l d)) -> Env2 (TyOf (E1Ext l d)) -> E1Ext l d -> PassM (E1Ext l d) Source #

gFlattenGatherBinds :: DDefs (TyOf (E1Ext l d)) -> Env2 (TyOf (E1Ext l d)) -> E1Ext l d -> PassM ([Binds (E1Ext l d)], E1Ext l d) Source #

(Typeable (E2Ext l d), Expression (E2Ext l d), Flattenable (E2 l d)) => Flattenable (E2Ext l d) Source # 
Instance details

Defined in Gibbon.L2.Syntax

Methods

gFlattenExp :: DDefs (TyOf (E2Ext l d)) -> Env2 (TyOf (E2Ext l d)) -> E2Ext l d -> PassM (E2Ext l d) Source #

gFlattenGatherBinds :: DDefs (TyOf (E2Ext l d)) -> Env2 (TyOf (E2Ext l d)) -> E2Ext l d -> PassM ([Binds (E2Ext l d)], E2Ext l d) Source #

(Show l, Out l) => Flattenable (E3Ext l (UrTy l)) Source # 
Instance details

Defined in Gibbon.L3.Syntax

Methods

gFlattenExp :: DDefs (TyOf (E3Ext l (UrTy l))) -> Env2 (TyOf (E3Ext l (UrTy l))) -> E3Ext l (UrTy l) -> PassM (E3Ext l (UrTy l)) Source #

gFlattenGatherBinds :: DDefs (TyOf (E3Ext l (UrTy l))) -> Env2 (TyOf (E3Ext l (UrTy l))) -> E3Ext l (UrTy l) -> PassM ([Binds (E3Ext l (UrTy l))], E3Ext l (UrTy l)) Source #

FlattenDeps e l d => Flattenable (PreExp e l d) Source # 
Instance details

Defined in Gibbon.Passes.Flatten

Methods

gFlattenExp :: DDefs (TyOf (PreExp e l d)) -> Env2 (TyOf (PreExp e l d)) -> PreExp e l d -> PassM (PreExp e l d) Source #

gFlattenGatherBinds :: DDefs (TyOf (PreExp e l d)) -> Env2 (TyOf (PreExp e l d)) -> PreExp e l d -> PassM ([Binds (PreExp e l d)], PreExp e l d) Source #

class Expression e => Simplifiable e where Source #

IRs amenable to simplification/inlineTrivs. Note that there's a separate SimplifiableExt for simplifying extensions. Simplifiable is the only class which makes such a distinction -- b/c when it's simplifying an extension point, the type of the environment would still be 'M.Map Var e', where e is a top-level IR. Right now we don't have a class (and probably don't want to have one as well) which ties an extension point with an IR. Keeping these classes separate works out nicely.

Methods

gInlineTrivExp :: Map Var e -> e -> e Source #

Instances

Instances details
HasSimplifiable e l d => Simplifiable (PreExp e l d) Source # 
Instance details

Defined in Gibbon.Passes.InlineTriv

Methods

gInlineTrivExp :: Map Var (PreExp e l d) -> PreExp e l d -> PreExp e l d Source #

class Expression e => SimplifiableExt e ext where Source #

Methods

gInlineTrivExt :: Map Var e -> ext -> ext Source #

Instances

Instances details
HasSimplifiableExt E1Ext l d => SimplifiableExt (PreExp E1Ext l d) (E1Ext l d) Source # 
Instance details

Defined in Gibbon.L1.Syntax

Methods

gInlineTrivExt :: Map Var (PreExp E1Ext l d) -> E1Ext l d -> E1Ext l d Source #

HasSimplifiableExt E2Ext l d => SimplifiableExt (PreExp E2Ext l d) (E2Ext l d) Source # 
Instance details

Defined in Gibbon.L2.Syntax

Methods

gInlineTrivExt :: Map Var (PreExp E2Ext l d) -> E2Ext l d -> E2Ext l d Source #

HasSimplifiableExt E3Ext l d => SimplifiableExt (PreExp E3Ext l d) (E3Ext l d) Source # 
Instance details

Defined in Gibbon.L3.Syntax

Methods

gInlineTrivExt :: Map Var (PreExp E3Ext l d) -> E3Ext l d -> E3Ext l d Source #

class Expression e => Typeable e where Source #

This is NOT a replacement for any typechecker. This only recover type of an expression given a type-environment. Without this, we cannot have truly generic Flattenable, b/c we need to know the type of an expression before we bind it with a LetE.

Methods

gRecoverType :: DDefs (TyOf e) -> Env2 (TyOf e) -> e -> TyOf e Source #

Instances

Instances details
Typeable (E1Ext () (UrTy ())) Source # 
Instance details

Defined in Gibbon.L1.Syntax

Methods

gRecoverType :: DDefs (TyOf (E1Ext () (UrTy ()))) -> Env2 (TyOf (E1Ext () (UrTy ()))) -> E1Ext () (UrTy ()) -> TyOf (E1Ext () (UrTy ())) Source #

Typeable (E2Ext LocArg Ty2) Source # 
Instance details

Defined in Gibbon.NewL2.Syntax

(Out l, Show l, Typeable (E2 l (UrTy l))) => Typeable (E2Ext l (UrTy l)) Source # 
Instance details

Defined in Gibbon.L2.Syntax

Methods

gRecoverType :: DDefs (TyOf (E2Ext l (UrTy l))) -> Env2 (TyOf (E2Ext l (UrTy l))) -> E2Ext l (UrTy l) -> TyOf (E2Ext l (UrTy l)) Source #

(Out l, Show l, Typeable (PreExp E3Ext l (UrTy l))) => Typeable (E3Ext l (UrTy l)) Source # 
Instance details

Defined in Gibbon.L3.Syntax

Methods

gRecoverType :: DDefs (TyOf (E3Ext l (UrTy l))) -> Env2 (TyOf (E3Ext l (UrTy l))) -> E3Ext l (UrTy l) -> TyOf (E3Ext l (UrTy l)) Source #

Typeable (PreExp E2Ext LocVar (UrTy LocVar)) Source #

The gRecoverType instance defined in Language.Syntax is incorrect for L2. For the AppE case, it'll just return the type with with the function was defined. However, we want the recovered type to have the locations actually used at the callsites! For example,

add1 :: Tree a -> Tree b add1 = _

... (add1 [loc1, loc2] tr1) ..

in this case, we want the type of (add1 tr1) to be (Tree loc2) and NOT (Tree b). We have to do something similar for variables bound by a pattern match.

Instance details

Defined in Gibbon.L2.Syntax

Out (E2Ext LocArg Ty2) => Typeable (PreExp E2Ext LocArg Ty2) Source #

The gRecoverType instance defined in Language.Syntax is incorrect for L2. For the AppE case, it'll just return the type with with the function was defined. However, we want the recovered type to have the locations actually used at the callsites! For example,

add1 :: Tree a -> Tree b add1 = _

... (add1 [loc1, loc2] tr1) ..

in this case, we want the type of (add1 tr1) to be (Tree loc2) and NOT (Tree b). We have to do something similar for variables bound by a pattern match.

Instance details

Defined in Gibbon.NewL2.Syntax

(Show (), Out (), TyOf (e () (UrTy ())) ~ TyOf (PreExp e () (UrTy ())), FunctionTy (UrTy ()), Typeable (e () (UrTy ()))) => Typeable (PreExp e () (UrTy ())) Source #

A Typeable instance for L1 and L3 (L2 defines it's own)

Instance details

Defined in Gibbon.Language

Methods

gRecoverType :: DDefs (TyOf (PreExp e () (UrTy ()))) -> Env2 (TyOf (PreExp e () (UrTy ()))) -> PreExp e () (UrTy ()) -> TyOf (PreExp e () (UrTy ())) Source #

class Expression e => Substitutable e where Source #

Generic substitution over expressions.

Methods

gSubst :: Var -> e -> e -> e Source #

gSubstE :: e -> e -> e -> e Source #

Instances

Instances details
HasSubstitutable e l d => Substitutable (PreExp e l d) Source # 
Instance details

Defined in Gibbon.Language

Methods

gSubst :: Var -> PreExp e l d -> PreExp e l d -> PreExp e l d Source #

gSubstE :: PreExp e l d -> PreExp e l d -> PreExp e l d -> PreExp e l d Source #

class Expression e => SubstitutableExt e ext where Source #

Methods

gSubstExt :: Var -> e -> ext -> ext Source #

gSubstEExt :: e -> e -> ext -> ext Source #

Instances

Instances details
HasSubstitutableExt E0Ext l d => SubstitutableExt (PreExp E0Ext l d) (E0Ext l d) Source # 
Instance details

Defined in Gibbon.L0.Syntax

Methods

gSubstExt :: Var -> PreExp E0Ext l d -> E0Ext l d -> E0Ext l d Source #

gSubstEExt :: PreExp E0Ext l d -> PreExp E0Ext l d -> E0Ext l d -> E0Ext l d Source #

HasSubstitutableExt E0Ext l d => SubstitutableExt (PreExp E0Ext l d) (LinearExt l d) Source # 
Instance details

Defined in Gibbon.L0.Syntax

Methods

gSubstExt :: Var -> PreExp E0Ext l d -> LinearExt l d -> LinearExt l d Source #

gSubstEExt :: PreExp E0Ext l d -> PreExp E0Ext l d -> LinearExt l d -> LinearExt l d Source #

HasSubstitutableExt E1Ext l d => SubstitutableExt (PreExp E1Ext l d) (E1Ext l d) Source # 
Instance details

Defined in Gibbon.L1.Syntax

Methods

gSubstExt :: Var -> PreExp E1Ext l d -> E1Ext l d -> E1Ext l d Source #

gSubstEExt :: PreExp E1Ext l d -> PreExp E1Ext l d -> E1Ext l d -> E1Ext l d Source #

HasSubstitutableExt E2Ext l d => SubstitutableExt (PreExp E2Ext l d) (E2Ext l d) Source # 
Instance details

Defined in Gibbon.L2.Syntax

Methods

gSubstExt :: Var -> PreExp E2Ext l d -> E2Ext l d -> E2Ext l d Source #

gSubstEExt :: PreExp E2Ext l d -> PreExp E2Ext l d -> E2Ext l d -> E2Ext l d Source #

HasSubstitutableExt E3Ext l d => SubstitutableExt (PreExp E3Ext l d) (E3Ext l d) Source # 
Instance details

Defined in Gibbon.L3.Syntax

Methods

gSubstExt :: Var -> PreExp E3Ext l d -> E3Ext l d -> E3Ext l d Source #

gSubstEExt :: PreExp E3Ext l d -> PreExp E3Ext l d -> E3Ext l d -> E3Ext l d Source #

class Renamable e where Source #

Alpha renaming, without worrying about name capture -- assuming that Freshen has run before!

Methods

gRename :: Map Var Var -> e -> e Source #

Instances

Instances details
Renamable TyVar Source # 
Instance details

Defined in Gibbon.L0.Syntax

Methods

gRename :: Map Var Var -> TyVar -> TyVar Source #

Renamable Var Source # 
Instance details

Defined in Gibbon.Language

Methods

gRename :: Map Var Var -> Var -> Var Source #

Renamable Ty0 Source # 
Instance details

Defined in Gibbon.L0.Syntax

Methods

gRename :: Map Var Var -> Ty0 -> Ty0 Source #

Renamable () Source # 
Instance details

Defined in Gibbon.L1.Syntax

Methods

gRename :: Map Var Var -> () -> () Source #

Renamable a => Renamable (UrTy a) Source # 
Instance details

Defined in Gibbon.Language

Methods

gRename :: Map Var Var -> UrTy a -> UrTy a Source #

HasRenamable E0Ext l d => Renamable (E0Ext l d) Source # 
Instance details

Defined in Gibbon.L0.Syntax

Methods

gRename :: Map Var Var -> E0Ext l d -> E0Ext l d Source #

HasRenamable E0Ext l d => Renamable (LinearExt l d) Source # 
Instance details

Defined in Gibbon.L0.Syntax

Methods

gRename :: Map Var Var -> LinearExt l d -> LinearExt l d Source #

HasRenamable E1Ext l d => Renamable (E1Ext l d) Source # 
Instance details

Defined in Gibbon.L1.Syntax

Methods

gRename :: Map Var Var -> E1Ext l d -> E1Ext l d Source #

HasRenamable E2Ext l d => Renamable (E2Ext l d) Source # 
Instance details

Defined in Gibbon.L2.Syntax

Methods

gRename :: Map Var Var -> E2Ext l d -> E2Ext l d Source #

HasRenamable E3Ext l d => Renamable (E3Ext l d) Source # 
Instance details

Defined in Gibbon.L3.Syntax

Methods

gRename :: Map Var Var -> E3Ext l d -> E3Ext l d Source #

HasRenamable e l d => Renamable (PreExp e l d) Source # 
Instance details

Defined in Gibbon.Language

Methods

gRename :: Map Var Var -> PreExp e l d -> PreExp e l d Source #

Helpers for writing instances

type HasSimplifiable e l d = (Show l, Out l, Show d, Out d, Expression (e l d), SimplifiableExt (PreExp e l d) (e l d)) Source #

type HasSimplifiableExt e l d = (Show l, Out l, Show d, Out d, Simplifiable (PreExp e l d)) Source #

type HasSubstitutable e l d = (Expression (e l d), SubstitutableExt (PreExp e l d) (e l d), Eq d, Show d, Out d, Eq l, Show l, Out l, Eq (e l d)) Source #

type HasSubstitutableExt e l d = (Eq d, Show d, Out d, Eq l, Show l, Out l, Substitutable (PreExp e l d)) Source #

type HasRenamable e l d = (Renamable l, Renamable d, Renamable (e l d)) Source #

type HasOut ex = (Out ex, Out (TyOf ex), Out (ArrowTy (TyOf ex))) Source #

type HasShow ex = (Show ex, Show (TyOf ex), Show (ArrowTy (TyOf ex))) Source #

type HasEq ex = (Eq ex, Eq (TyOf ex), Eq (ArrowTy (TyOf ex))) Source #

type HasGeneric ex = (Generic ex, Generic (TyOf ex), Generic (ArrowTy (TyOf ex))) Source #

type HasNFData ex = (NFData ex, NFData (TyOf ex), NFData (ArrowTy (TyOf ex))) Source #

Interpreter

class Expression e => Interp s e where Source #

Pure Gibbon programs, at any stage of compilation, should always be evaluatable to a unique value. The only side effects are timing.

Methods

gInterpExp :: RunConfig -> ValEnv e -> DDefs (TyOf e) -> FunDefs e -> e -> InterpM s e (Value e) Source #

Instances

Instances details
Interp Store Exp2 Source # 
Instance details

Defined in Gibbon.L2.Interp

Interp () Exp0 Source # 
Instance details

Defined in Gibbon.L0.Interp

Interp () Exp1 Source # 
Instance details

Defined in Gibbon.L1.Interp

class (Expression e, Expression ext) => InterpExt s e ext where Source #

Methods

gInterpExt :: RunConfig -> ValEnv e -> DDefs (TyOf e) -> FunDefs e -> ext -> InterpM s e (Value e) Source #

Instances

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

Defined in Gibbon.L2.Interp

InterpExt () Exp0 (E0Ext Ty0 Ty0) Source # 
Instance details

Defined in Gibbon.L0.Interp

InterpExt () Exp1 (E1Ext () Ty1) Source # 
Instance details

Defined in Gibbon.L1.Interp

class Interp s e => InterpProg s e where Source #

Minimal complete definition

gInterpProg

Methods

gInterpProg :: s -> RunConfig -> Prog e -> IO (s, Value e, ByteString) Source #

gInterpNoLogs :: s -> RunConfig -> Prog e -> String Source #

Interpret while ignoring timing constructs, and dropping the corresponding output to stdout.

gInterpWithStdout :: s -> RunConfig -> Prog e -> IO (String, [String]) Source #

Interpret and produce a "log" of output lines, as well as a final, printed result. The output lines include timing information.

data Value e Source #

It's a first order language with simple values.

Constructors

VInt Int 
VChar Char 
VFloat Double 
VSym String 
VBool Bool 
VDict (Map (Value e) (Value e)) 
VProd [Value e] 
VList [Value e] 
VPacked DataCon [Value e] 
VLoc 

Fields

VCursor 

Fields

VPtr

Cursor are a pointer into the Store plus an offset into the Buffer.

Fields

VLam [Var] e (ValEnv e) 
VWrapId Int (Value e)

A wrapper for vectors that wraps the value with an "id". All Inplace* operations use this "id" to update the value in ValEnv.

Instances

Instances details
Out e => Out (Value e) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

docPrec :: Int -> Value e -> Doc Source #

doc :: Value e -> Doc Source #

docList :: [Value e] -> Doc Source #

Generic (Value e) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Associated Types

type Rep (Value e) :: Type -> Type Source #

Methods

from :: Value e -> Rep (Value e) x Source #

to :: Rep (Value e) x -> Value e Source #

(Ord e, Read e) => Read (Value e) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Show e => Show (Value e) Source # 
Instance details

Defined in Gibbon.Language.Syntax

NFData e => NFData (Value e) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

rnf :: Value e -> () Source #

Eq e => Eq (Value e) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

(==) :: Value e -> Value e -> Bool Source #

(/=) :: Value e -> Value e -> Bool Source #

Ord e => Ord (Value e) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

compare :: Value e -> Value e -> Ordering Source #

(<) :: Value e -> Value e -> Bool Source #

(<=) :: Value e -> Value e -> Bool Source #

(>) :: Value e -> Value e -> Bool Source #

(>=) :: Value e -> Value e -> Bool Source #

max :: Value e -> Value e -> Value e Source #

min :: Value e -> Value e -> Value e Source #

type Rep (Value e) Source # 
Instance details

Defined in Gibbon.Language.Syntax

type Rep (Value e) = D1 ('MetaData "Value" "Gibbon.Language.Syntax" "gibbon-0.3-inplace" 'False) (((C1 ('MetaCons "VInt" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: (C1 ('MetaCons "VChar" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Char)) :+: C1 ('MetaCons "VFloat" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)))) :+: ((C1 ('MetaCons "VSym" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "VBool" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))) :+: (C1 ('MetaCons "VDict" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map (Value e) (Value e)))) :+: C1 ('MetaCons "VProd" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Value e]))))) :+: ((C1 ('MetaCons "VList" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Value e])) :+: (C1 ('MetaCons "VPacked" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DataCon) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Value e])) :+: C1 ('MetaCons "VLoc" 'PrefixI 'True) (S1 ('MetaSel ('Just "bufID") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Var) :*: S1 ('MetaSel ('Just "offset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))) :+: ((C1 ('MetaCons "VCursor" 'PrefixI 'True) (S1 ('MetaSel ('Just "bufID") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Var) :*: S1 ('MetaSel ('Just "offset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: C1 ('MetaCons "VPtr" 'PrefixI 'True) (S1 ('MetaSel ('Just "bufID") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Var) :*: S1 ('MetaSel ('Just "offset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) :+: (C1 ('MetaCons "VLam" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Var]) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 e) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ValEnv e)))) :+: C1 ('MetaCons "VWrapId" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Value e)))))))

type ValEnv e = Map Var (Value e) Source #

data InterpM s e a Source #

Instances

Instances details
MonadState s (InterpM s e) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

get :: InterpM s e s Source #

put :: s -> InterpM s e () Source #

state :: (s -> (a, s)) -> InterpM s e a Source #

MonadWriter InterpLog (InterpM s e) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

writer :: (a, InterpLog) -> InterpM s e a Source #

tell :: InterpLog -> InterpM s e () Source #

listen :: InterpM s e a -> InterpM s e (a, InterpLog) Source #

pass :: InterpM s e (a, InterpLog -> InterpLog) -> InterpM s e a Source #

MonadFail (InterpM a b) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

fail :: String -> InterpM a b a0 Source #

MonadIO (InterpM s e) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

liftIO :: IO a -> InterpM s e a Source #

Applicative (InterpM s e) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

pure :: a -> InterpM s e a Source #

(<*>) :: InterpM s e (a -> b) -> InterpM s e a -> InterpM s e b Source #

liftA2 :: (a -> b -> c) -> InterpM s e a -> InterpM s e b -> InterpM s e c Source #

(*>) :: InterpM s e a -> InterpM s e b -> InterpM s e b Source #

(<*) :: InterpM s e a -> InterpM s e b -> InterpM s e a Source #

Functor (InterpM s e) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

fmap :: (a -> b) -> InterpM s e a -> InterpM s e b Source #

(<$) :: a -> InterpM s e b -> InterpM s e a Source #

Monad (InterpM s e) Source # 
Instance details

Defined in Gibbon.Language.Syntax

Methods

(>>=) :: InterpM s e a -> (a -> InterpM s e b) -> InterpM s e b Source #

(>>) :: InterpM s e a -> InterpM s e b -> InterpM s e b Source #

return :: a -> InterpM s e a Source #

runInterpM :: InterpM s e a -> s -> IO (a, InterpLog, s) Source #

execAndPrint :: InterpProg s ex => s -> RunConfig -> Prog ex -> IO () Source #