imperative-edsl-0.8.2: Deep embedding of imperative programs with code generation
Safe HaskellNone
LanguageHaskell2010

Language.Embedded.Backend.C.Expression

Synopsis

Documentation

class FreeExp exp => CompExp exp where Source #

General interface for compiling expressions

Methods

compExp :: MonadC m => exp a -> m Exp Source #

Compilation of expressions

Instances

Instances details
CompExp CExp Source # 
Instance details

Defined in Language.Embedded.CExp

Methods

compExp :: MonadC m => CExp a -> m Exp Source #

class (Show a, Eq a, Typeable a) => CType a where Source #

Types supported by C

Minimal complete definition

cType

Methods

cType :: MonadC m => proxy a -> m Type Source #

cLit :: MonadC m => a -> m Exp Source #

default cLit :: (ToExp a, MonadC m) => a -> m Exp Source #

Instances

Instances details
CompTypeClass CType Source # 
Instance details

Defined in Language.Embedded.Backend.C.Expression

Methods

compType :: (CType a, MonadC m) => proxy1 CType -> proxy2 a -> m Type Source #

compLit :: (CType a, MonadC m) => proxy CType -> a -> m Exp Source #

CType Bool Source # 
Instance details

Defined in Language.Embedded.Backend.C.Expression

Methods

cType :: MonadC m => proxy Bool -> m Type Source #

cLit :: MonadC m => Bool -> m Exp Source #

CType Double Source # 
Instance details

Defined in Language.Embedded.Backend.C.Expression

Methods

cType :: MonadC m => proxy Double -> m Type Source #

cLit :: MonadC m => Double -> m Exp Source #

CType Float Source # 
Instance details

Defined in Language.Embedded.Backend.C.Expression

Methods

cType :: MonadC m => proxy Float -> m Type Source #

cLit :: MonadC m => Float -> m Exp Source #

CType Int8 Source # 
Instance details

Defined in Language.Embedded.Backend.C.Expression

Methods

cType :: MonadC m => proxy Int8 -> m Type Source #

cLit :: MonadC m => Int8 -> m Exp Source #

CType Int16 Source # 
Instance details

Defined in Language.Embedded.Backend.C.Expression

Methods

cType :: MonadC m => proxy Int16 -> m Type Source #

cLit :: MonadC m => Int16 -> m Exp Source #

CType Int32 Source # 
Instance details

Defined in Language.Embedded.Backend.C.Expression

Methods

cType :: MonadC m => proxy Int32 -> m Type Source #

cLit :: MonadC m => Int32 -> m Exp Source #

CType Int64 Source # 
Instance details

Defined in Language.Embedded.Backend.C.Expression

Methods

cType :: MonadC m => proxy Int64 -> m Type Source #

cLit :: MonadC m => Int64 -> m Exp Source #

CType Word8 Source # 
Instance details

Defined in Language.Embedded.Backend.C.Expression

Methods

cType :: MonadC m => proxy Word8 -> m Type Source #

cLit :: MonadC m => Word8 -> m Exp Source #

CType Word16 Source # 
Instance details

Defined in Language.Embedded.Backend.C.Expression

Methods

cType :: MonadC m => proxy Word16 -> m Type Source #

cLit :: MonadC m => Word16 -> m Exp Source #

CType Word32 Source # 
Instance details

Defined in Language.Embedded.Backend.C.Expression

Methods

cType :: MonadC m => proxy Word32 -> m Type Source #

cLit :: MonadC m => Word32 -> m Exp Source #

CType Word64 Source # 
Instance details

Defined in Language.Embedded.Backend.C.Expression

Methods

cType :: MonadC m => proxy Word64 -> m Type Source #

cLit :: MonadC m => Word64 -> m Exp Source #

proxyArg :: proxy1 (proxy2 a) -> Proxy a Source #

Remove one layer of a nested proxy

class CompTypeClass ct where Source #

Classes that support reification to C types

Methods

compType :: (ct a, MonadC m) => proxy1 ct -> proxy2 a -> m Type Source #

compLit :: (ct a, MonadC m) => proxy ct -> a -> m Exp Source #

Instances

Instances details
CompTypeClass CType Source # 
Instance details

Defined in Language.Embedded.Backend.C.Expression

Methods

compType :: (CType a, MonadC m) => proxy1 CType -> proxy2 a -> m Type Source #

compLit :: (CType a, MonadC m) => proxy CType -> a -> m Exp Source #

proxyPred :: cmd (Param3 p e pred) a -> Proxy pred Source #

Get the type predicate from an instruction type

freshVar :: forall m ct proxy a. (MonadC m, CompTypeClass ct, ct a) => proxy ct -> m (Val a) Source #

Create and declare a fresh variable