| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Traq.Compiler.Unitary
Synopsis
- lowerProgramU :: forall ext size prec. (CompileU ext, Show prec, Floating prec, HasFreeVars ext, prec ~ PrecType ext, size ~ SizeType ext, TypeInferrable ext size) => Program ext -> Either String (Program size)
- class (TypeInferrable ext (SizeType ext), Integral (SizeType ext)) => CompileU ext where
- allocAncillaWithPref :: (size ~ SizeType ext, Eq size) => Ident -> VarType size -> CompilerT ext Ident
- allocAncilla :: (size ~ SizeType ext, Eq size) => VarType size -> CompilerT ext Ident
- withTag :: ParamTag -> [(Ident, VarType a)] -> [(Ident, ParamTag, VarType a)]
- compileU1 :: forall ext m. (CompileU1 f, CompileU ext, TypeInferrable ext (SizeType ext), m ~ CompilerT ext) => CompileArgs f ext -> f ext -> m (CompileResult f ext)
Documentation
lowerProgramU :: forall ext size prec. (CompileU ext, Show prec, Floating prec, HasFreeVars ext, prec ~ PrecType ext, size ~ SizeType ext, TypeInferrable ext size) => Program ext -> Either String (Program size) #
Lower a full program into a unitary QPL program.
Class
class (TypeInferrable ext (SizeType ext), Integral (SizeType ext)) => CompileU ext where #
Methods
compileU :: forall ext' m. (m ~ CompilerT ext', SizeType ext ~ SizeType ext', PrecType ext ~ PrecType ext') => ext -> [Ident] -> m (UStmt (SizeType ext)) #
Instances
| (TypingReqs size, Integral size) => CompileU (AnnFailProb (Core size prec)) # | |
Defined in Traq.Compiler.Unitary | |
| (TypeCheckPrim prim (SizeType prim), TypingReqs (SizeType prim), UnitaryCompilePrim prim (SizeType prim) (PrecType prim), Integral (SizeType prim)) => CompileU (AnnFailProb (Primitive prim)) # | |
Defined in Traq.Primitives.Class | |
| (TypingReqs size, Integral size) => CompileU (Core size prec) # | |
Helpers
allocAncillaWithPref :: (size ~ SizeType ext, Eq size) => Ident -> VarType size -> CompilerT ext Ident #
Allocate an ancilla register, and update the typing context.
allocAncilla :: (size ~ SizeType ext, Eq size) => VarType size -> CompilerT ext Ident #
Allocate an ancilla register aux_, and update the typing context.