copilot-core-0.2.3: An intermediate representation for Copilot.

Safe HaskellSafe-Infered

Copilot.Core.Expr

Synopsis

Documentation

type Id = IntSource

A stream identifier.

type Name = StringSource

A name of a trigger, an external variable, or an external function.

data Expr a whereSource

Constructors

Const :: Type a -> a -> Expr a 
Drop :: Type a -> DropIdx -> Id -> Expr a 
Local :: Type a -> Type b -> Name -> Expr a -> Expr b -> Expr b 
Var :: Type a -> Name -> Expr a 
ExternVar :: Type a -> Name -> Maybe [a] -> Expr a 
ExternFun :: Type a -> Name -> [UExpr] -> Maybe (Expr a) -> Maybe Tag -> Expr a 
ExternArray :: Integral a => Type a -> Type b -> Name -> Int -> Expr a -> Maybe [[b]] -> Maybe Tag -> Expr b 
Op1 :: Op1 a b -> Expr a -> Expr b 
Op2 :: Op2 a b c -> Expr a -> Expr b -> Expr c 
Op3 :: Op3 a b c d -> Expr a -> Expr b -> Expr c -> Expr d 

data UExpr Source

A untyped expression (no phantom type).

Constructors

forall a . UExpr 

Fields

uExprType :: Type a
 
uExprExpr :: Expr a
 

type DropIdx = Word16Source

An index for the drop operator.

type Tag = IntSource

A unique tag for external arrays/function calls.