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

Safe HaskellSafe
LanguageHaskell2010

Copilot.Core.Expr

Synopsis

Documentation

type Id = Int Source #

A stream identifier.

type Name = String Source #

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

data Expr a where Source #

Constructors

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

data UExpr Source #

A untyped expression (no phantom type).

Constructors

Typeable a => UExpr 

Fields

type DropIdx = Word32 Source #

An index for the drop operator.

type Tag = Int Source #

A unique tag for external arrays/function calls.