| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Traq.Primitives.Class.Compile
Synopsis
- data PrimCompileEnv shape size = PrimCompileEnv {
- mk_ucall :: shape (UCallBuilder size)
- mk_call :: shape (CallBuilder size)
- mk_meas :: shape (CallBuilder size)
- uproc_aux_types :: shape [VarType size]
- prim_ret_types :: [VarType size]
- class (size ~ SizeType prim, prec ~ PrecType prim, ValidPrimShape (PrimFnShape prim)) => UnitaryCompilePrim prim size prec | prim -> size prec where
- compileUPrim :: forall ext' m shape. (m ~ PrimCompileMonad ext' prim, size ~ SizeType ext', prec ~ PrecType ext', shape ~ PrimFnShape prim) => prim -> FailProb prec -> m (ProcDef size)
- class (size ~ SizeType prim, prec ~ PrecType prim, ValidPrimShape (PrimFnShape prim)) => QuantumCompilePrim prim size prec | prim -> size prec where
- compileQPrim :: forall ext' m shape. (m ~ PrimCompileMonad ext' prim, size ~ SizeType ext', prec ~ PrecType ext', shape ~ PrimFnShape prim) => prim -> FailProb prec -> m (ProcDef size)
- type PrimCompileMonad ext prim = ReaderT (PrimCompileEnv (PrimFnShape prim) (SizeType prim)) (CompilerT ext)
Documentation
data PrimCompileEnv shape size #
Helpers to compile a primitive.
Constructors
| PrimCompileEnv | |
Fields
| |
class (size ~ SizeType prim, prec ~ PrecType prim, ValidPrimShape (PrimFnShape prim)) => UnitaryCompilePrim prim size prec | prim -> size prec where #
Compile a primitive to a uproc
Minimal complete definition
Nothing
Methods
compileUPrim :: forall ext' m shape. (m ~ PrimCompileMonad ext' prim, size ~ SizeType ext', prec ~ PrecType ext', shape ~ PrimFnShape prim) => prim -> FailProb prec -> m (ProcDef size) #
default compileUPrim :: forall ext' m shape. (Generic prim, GUnitaryCompilePrim (Rep prim) size prec, m ~ PrimCompileMonad ext' prim, size ~ SizeType ext', prec ~ PrecType ext', shape ~ PrimFnShape prim) => prim -> FailProb prec -> m (ProcDef size) #
Instances
class (size ~ SizeType prim, prec ~ PrecType prim, ValidPrimShape (PrimFnShape prim)) => QuantumCompilePrim prim size prec | prim -> size prec where #
Compile a primitive to a cq-proc
Minimal complete definition
Nothing
Methods
compileQPrim :: forall ext' m shape. (m ~ PrimCompileMonad ext' prim, size ~ SizeType ext', prec ~ PrecType ext', shape ~ PrimFnShape prim) => prim -> FailProb prec -> m (ProcDef size) #
default compileQPrim :: forall ext' m shape. (Generic prim, GQuantumCompilePrim (Rep prim) size prec, m ~ PrimCompileMonad ext' prim, size ~ SizeType ext', prec ~ PrecType ext', shape ~ PrimFnShape prim) => prim -> FailProb prec -> m (ProcDef size) #
Instances
type PrimCompileMonad ext prim = ReaderT (PrimCompileEnv (PrimFnShape prim) (SizeType prim)) (CompilerT ext) #