Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Main types
Synopsis
- type E = Fix RatedExp
- data RatedExp a = RatedExp {
- ratedExpHash :: !ByteString
- ratedExpRate :: !(Maybe Rate)
- ratedExpDepends :: !(Maybe LineNum)
- ratedExpExp :: !(Exp a)
- isEmptyExp :: E -> Bool
- ratedExp :: Maybe Rate -> Exp E -> E
- noRate :: Exp E -> E
- withRate :: Rate -> Exp E -> E
- setRate :: Rate -> E -> E
- toArrRate :: Rate -> Rate
- removeArrRate :: Rate -> Rate
- type Exp a = MainExp (PrimOr a)
- toPrimOr :: E -> PrimOr E
- toPrimOrTfm :: Rate -> E -> PrimOr E
- newtype PrimOr a = PrimOr {}
- data MainExp a
- = EmptyExp
- | ExpPrim !Prim
- | Tfm Info ![a]
- | ConvertRate !Rate !(Maybe Rate) !a
- | Select !Rate !Int !a
- | If !IfRate !(CondInfo a) !a !a
- | ExpBool !(BoolExp a)
- | ExpNum !(NumExp a)
- | InitVar !Var !a
- | ReadVar !Var
- | WriteVar !Var !a
- | InitArr !Var !(ArrSize a)
- | ReadArr !Var !(ArrIndex a)
- | WriteArr !Var !(ArrIndex a) !a
- | WriteInitArr !Var !(ArrIndex a) !a
- | TfmArr !IsArrInit !Var !Info ![a]
- | InitPureArr !Rate !IfRate ![a]
- | ReadPureArr !Rate !IfRate !a !a
- | IfBlock !IfRate !(CondInfo a) (CodeBlock a)
- | IfElseBlock !IfRate !(CondInfo a) (CodeBlock a) (CodeBlock a)
- | IfBegin !IfRate !(CondInfo a)
- | ElseBegin
- | IfEnd
- | UntilBlock !IfRate !(CondInfo a) (CodeBlock a)
- | UntilBegin !IfRate !(CondInfo a)
- | UntilEnd
- | WhileBlock !IfRate !(CondInfo a) (CodeBlock a)
- | WhileBegin !IfRate !(CondInfo a)
- | WhileRefBlock !Var !(CodeBlock a)
- | WhileRefBegin !Var
- | WhileEnd
- | Verbatim !Text
- | Starts
- | Seq a a
- | Ends a
- | InitMacrosInt !Text !Int
- | InitMacrosDouble !Text !Double
- | InitMacrosString !Text !Text
- | ReadMacrosInt !Text
- | ReadMacrosDouble !Text
- | ReadMacrosString !Text
- type Name = Text
- data InstrId
- = InstrId {
- instrIdFrac :: !(Maybe Int)
- instrIdCeil :: !Int
- | InstrLabel Text
- = InstrId {
- intInstrId :: Int -> InstrId
- ratioInstrId :: Int -> Int -> InstrId
- stringInstrId :: Text -> InstrId
- data VarType
- data Var
- data Info = Info {
- infoName :: !Name
- infoSignature :: !Signature
- infoOpcFixity :: !OpcFixity
- data OpcFixity
- data Rate
- newtype CodeBlock a = CodeBlock a
- data Signature
- = SingleRate !(Map Rate [Rate])
- | MultiRate {
- outMultiRate :: ![Rate]
- inMultiRate :: ![Rate]
- isInfix :: Info -> Bool
- isPrefix :: Info -> Bool
- data Prim
- = P !Int
- | PString !Int
- | PrimInt !Int
- | PrimDouble !Double
- | PrimString !Text
- | PrimInstrId !InstrId
- | PrimVar {
- primVarTargetRate :: !Rate
- primVar :: !Var
- data Gen = Gen {}
- data GenId
- = IntGenId !Int
- | StringGenId !Text
- data Inline op arg = Inline {}
- data InlineExp op
- = InlinePrim !Int
- | InlineExp !op ![InlineExp op]
- data PreInline a b = PreInline !a ![b]
- type BoolExp a = PreInline CondOp a
- type CondInfo a = Inline CondOp a
- data CondOp
- = TrueOp
- | FalseOp
- | And
- | Or
- | Equals
- | NotEquals
- | Less
- | Greater
- | LessEquals
- | GreaterEquals
- isTrue :: CondInfo a -> Bool
- isFalse :: CondInfo a -> Bool
- type NumExp a = PreInline NumOp a
- data NumOp
- type Note = [Prim]
- type MultiOut a = Int -> a
- type IsArrInit = Bool
- type ArrSize a = [a]
- type ArrIndex a = [a]
- data IfRate
- fromIfRate :: IfRate -> Rate
- hashE :: E -> ByteString
- rehashE :: E -> E
Documentation
RatedExp | |
|
Instances
isEmptyExp :: E -> Bool Source #
removeArrRate :: Rate -> Rate Source #
toPrimOr :: E -> PrimOr E Source #
Constructs PrimOr values from the expressions. It does inlining in case of primitive values.
toPrimOrTfm :: Rate -> E -> PrimOr E Source #
Constructs PrimOr values from the expressions. It does inlining in case of primitive values.
It's a primitive value or something else. It's used for inlining of the constants (primitive values).
Instances
EmptyExp | |
ExpPrim !Prim | Primitives |
Tfm Info ![a] | Application of the opcode: we have opcode information (Info) and the arguments [a] |
ConvertRate !Rate !(Maybe Rate) !a | Rate conversion |
Select !Rate !Int !a | Selects a cell from the tuple, here argument is always a tuple (result of opcode that returns several outputs) |
If !IfRate !(CondInfo a) !a !a | if-then-else |
ExpBool !(BoolExp a) | Boolean expressions (rendered in infix notation in the Csound) |
ExpNum !(NumExp a) | Numerical expressions (rendered in infix notation in the Csound) |
InitVar !Var !a | Reading/writing a named variable |
ReadVar !Var | |
WriteVar !Var !a | |
InitArr !Var !(ArrSize a) | Arrays |
ReadArr !Var !(ArrIndex a) | |
WriteArr !Var !(ArrIndex a) !a | |
WriteInitArr !Var !(ArrIndex a) !a | |
TfmArr !IsArrInit !Var !Info ![a] | |
InitPureArr !Rate !IfRate ![a] | inits 1-dimensional read only array (uses fillaray) args: rateOfTheOutput processingRate initValues |
ReadPureArr !Rate !IfRate !a !a | Reads read only array with index args: rateOfTheOutput processingRate array index |
IfBlock !IfRate !(CondInfo a) (CodeBlock a) | Imperative If-then-else |
IfElseBlock !IfRate !(CondInfo a) (CodeBlock a) (CodeBlock a) | |
IfBegin !IfRate !(CondInfo a) | |
ElseBegin | |
IfEnd | |
UntilBlock !IfRate !(CondInfo a) (CodeBlock a) | looping constructions |
UntilBegin !IfRate !(CondInfo a) | |
UntilEnd | |
WhileBlock !IfRate !(CondInfo a) (CodeBlock a) | |
WhileBegin !IfRate !(CondInfo a) | |
WhileRefBlock !Var !(CodeBlock a) | |
WhileRefBegin !Var | |
WhileEnd | |
Verbatim !Text | Verbatim stmt |
Starts | Dependency tracking |
Seq a a | |
Ends a | |
InitMacrosInt !Text !Int | read macros arguments |
InitMacrosDouble !Text !Double | |
InitMacrosString !Text !Text | |
ReadMacrosInt !Text | |
ReadMacrosDouble !Text | |
ReadMacrosString !Text |
Instances
An instrument identifier
InstrId | |
| |
InstrLabel Text |
Instances
Generic InstrId Source # | |
Show InstrId Source # | |
Serialize InstrId Source # | |
Eq InstrId Source # | |
Ord InstrId Source # | |
type Rep InstrId Source # | |
Defined in Csound.Dynamic.Types.Exp type Rep InstrId = D1 ('MetaData "InstrId" "Csound.Dynamic.Types.Exp" "csound-expression-dynamic-0.3.9.1-1cJbmtshgbjKoGghhay83W" 'False) (C1 ('MetaCons "InstrId" 'PrefixI 'True) (S1 ('MetaSel ('Just "instrIdFrac") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Int)) :*: S1 ('MetaSel ('Just "instrIdCeil") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "InstrLabel" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) |
intInstrId :: Int -> InstrId Source #
Constructs an instrument id with the integer.
stringInstrId :: Text -> InstrId Source #
Constructs an instrument id with the string label.
Instances
Generic Var Source # | |
Show Var Source # | |
Serialize Var Source # | |
Eq Var Source # | |
Ord Var Source # | |
type Rep Var Source # | |
Defined in Csound.Dynamic.Types.Exp type Rep Var = D1 ('MetaData "Var" "Csound.Dynamic.Types.Exp" "csound-expression-dynamic-0.3.9.1-1cJbmtshgbjKoGghhay83W" 'False) (C1 ('MetaCons "Var" 'PrefixI 'True) (S1 ('MetaSel ('Just "varType") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 VarType) :*: (S1 ('MetaSel ('Just "varRate") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Rate) :*: S1 ('MetaSel ('Just "varName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Name))) :+: C1 ('MetaCons "VarVerbatim" 'PrefixI 'True) (S1 ('MetaSel ('Just "varRate") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Rate) :*: S1 ('MetaSel ('Just "varName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Name))) |
Info | |
|
Instances
Generic Info Source # | |
Show Info Source # | |
Serialize Info Source # | |
Eq Info Source # | |
Ord Info Source # | |
type Rep Info Source # | |
Defined in Csound.Dynamic.Types.Exp type Rep Info = D1 ('MetaData "Info" "Csound.Dynamic.Types.Exp" "csound-expression-dynamic-0.3.9.1-1cJbmtshgbjKoGghhay83W" 'False) (C1 ('MetaCons "Info" 'PrefixI 'True) (S1 ('MetaSel ('Just "infoName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Name) :*: (S1 ('MetaSel ('Just "infoSignature") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Signature) :*: S1 ('MetaSel ('Just "infoOpcFixity") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 OpcFixity)))) |
Instances
Generic OpcFixity Source # | |
Show OpcFixity Source # | |
Serialize OpcFixity Source # | |
Eq OpcFixity Source # | |
Ord OpcFixity Source # | |
Defined in Csound.Dynamic.Types.Exp | |
type Rep OpcFixity Source # | |
Defined in Csound.Dynamic.Types.Exp type Rep OpcFixity = D1 ('MetaData "OpcFixity" "Csound.Dynamic.Types.Exp" "csound-expression-dynamic-0.3.9.1-1cJbmtshgbjKoGghhay83W" 'False) (C1 ('MetaCons "Prefix" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Infix" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Opcode" 'PrefixI 'False) (U1 :: Type -> Type))) |
The Csound rates.
Instances
Instances
SingleRate !(Map Rate [Rate]) | |
MultiRate | |
|
Instances
Generic Signature Source # | |
Show Signature Source # | |
Serialize Signature Source # | Can be infinite so fe just ignore the value |
Eq Signature Source # | |
Ord Signature Source # | |
Defined in Csound.Dynamic.Types.Exp | |
type Rep Signature Source # | |
Defined in Csound.Dynamic.Types.Exp type Rep Signature = D1 ('MetaData "Signature" "Csound.Dynamic.Types.Exp" "csound-expression-dynamic-0.3.9.1-1cJbmtshgbjKoGghhay83W" 'False) (C1 ('MetaCons "SingleRate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map Rate [Rate]))) :+: C1 ('MetaCons "MultiRate" 'PrefixI 'True) (S1 ('MetaSel ('Just "outMultiRate") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Rate]) :*: S1 ('MetaSel ('Just "inMultiRate") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Rate]))) |
P !Int | |
PString !Int | |
PrimInt !Int | |
PrimDouble !Double | |
PrimString !Text | |
PrimInstrId !InstrId | |
PrimVar | |
|
Instances
Instances
Generic Gen Source # | |
Show Gen Source # | |
Eq Gen Source # | |
Ord Gen Source # | |
type Rep Gen Source # | |
Defined in Csound.Dynamic.Types.Exp type Rep Gen = D1 ('MetaData "Gen" "Csound.Dynamic.Types.Exp" "csound-expression-dynamic-0.3.9.1-1cJbmtshgbjKoGghhay83W" 'False) (C1 ('MetaCons "Gen" 'PrefixI 'True) ((S1 ('MetaSel ('Just "genSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "genId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GenId)) :*: (S1 ('MetaSel ('Just "genArgs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Double]) :*: S1 ('MetaSel ('Just "genFile") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Text))))) |
Instances
Generic GenId Source # | |
Show GenId Source # | |
Eq GenId Source # | |
Ord GenId Source # | |
type Rep GenId Source # | |
Defined in Csound.Dynamic.Types.Exp type Rep GenId = D1 ('MetaData "GenId" "Csound.Dynamic.Types.Exp" "csound-expression-dynamic-0.3.9.1-1cJbmtshgbjKoGghhay83W" 'False) (C1 ('MetaCons "IntGenId" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "StringGenId" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text))) |
Instances
Generic1 (Inline op :: Type -> Type) Source # | |
Foldable (Inline op) Source # | |
Defined in Csound.Dynamic.Types.Exp fold :: Monoid m => Inline op m -> m # foldMap :: Monoid m => (a -> m) -> Inline op a -> m # foldMap' :: Monoid m => (a -> m) -> Inline op a -> m # foldr :: (a -> b -> b) -> b -> Inline op a -> b # foldr' :: (a -> b -> b) -> b -> Inline op a -> b # foldl :: (b -> a -> b) -> b -> Inline op a -> b # foldl' :: (b -> a -> b) -> b -> Inline op a -> b # foldr1 :: (a -> a -> a) -> Inline op a -> a # foldl1 :: (a -> a -> a) -> Inline op a -> a # toList :: Inline op a -> [a] # length :: Inline op a -> Int # elem :: Eq a => a -> Inline op a -> Bool # maximum :: Ord a => Inline op a -> a # minimum :: Ord a => Inline op a -> a # | |
Eq op => Eq1 (Inline op) Source # | |
Ord op => Ord1 (Inline op) Source # | |
Defined in Csound.Dynamic.Types.Exp | |
Show op => Show1 (Inline op) Source # | |
Traversable (Inline op) Source # | |
Defined in Csound.Dynamic.Types.Exp | |
Functor (Inline op) Source # | |
Generic (Inline op arg) Source # | |
(Show op, Show arg) => Show (Inline op arg) Source # | |
(Serialize a, Serialize b) => Serialize (Inline a b) Source # | |
(Eq op, Eq arg) => Eq (Inline op arg) Source # | |
(Ord op, Ord arg) => Ord (Inline op arg) Source # | |
Defined in Csound.Dynamic.Types.Exp compare :: Inline op arg -> Inline op arg -> Ordering # (<) :: Inline op arg -> Inline op arg -> Bool # (<=) :: Inline op arg -> Inline op arg -> Bool # (>) :: Inline op arg -> Inline op arg -> Bool # (>=) :: Inline op arg -> Inline op arg -> Bool # | |
type Rep1 (Inline op :: Type -> Type) Source # | |
Defined in Csound.Dynamic.Types.Exp type Rep1 (Inline op :: Type -> Type) = D1 ('MetaData "Inline" "Csound.Dynamic.Types.Exp" "csound-expression-dynamic-0.3.9.1-1cJbmtshgbjKoGghhay83W" 'False) (C1 ('MetaCons "Inline" 'PrefixI 'True) (S1 ('MetaSel ('Just "inlineExp") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (InlineExp op)) :*: S1 ('MetaSel ('Just "inlineEnv") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec1 IntMap))) | |
type Rep (Inline op arg) Source # | |
Defined in Csound.Dynamic.Types.Exp type Rep (Inline op arg) = D1 ('MetaData "Inline" "Csound.Dynamic.Types.Exp" "csound-expression-dynamic-0.3.9.1-1cJbmtshgbjKoGghhay83W" 'False) (C1 ('MetaCons "Inline" 'PrefixI 'True) (S1 ('MetaSel ('Just "inlineExp") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (InlineExp op)) :*: S1 ('MetaSel ('Just "inlineEnv") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (IntMap arg)))) |
InlinePrim !Int | |
InlineExp !op ![InlineExp op] |
Instances
Generic (InlineExp op) Source # | |
Show op => Show (InlineExp op) Source # | |
Serialize a => Serialize (InlineExp a) Source # | |
Eq op => Eq (InlineExp op) Source # | |
Ord op => Ord (InlineExp op) Source # | |
Defined in Csound.Dynamic.Types.Exp | |
type Rep (InlineExp op) Source # | |
Defined in Csound.Dynamic.Types.Exp type Rep (InlineExp op) = D1 ('MetaData "InlineExp" "Csound.Dynamic.Types.Exp" "csound-expression-dynamic-0.3.9.1-1cJbmtshgbjKoGghhay83W" 'False) (C1 ('MetaCons "InlinePrim" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "InlineExp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 op) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [InlineExp op]))) |
PreInline !a ![b] |
Instances
Instances
Generic CondOp Source # | |
Show CondOp Source # | |
Serialize CondOp Source # | |
Eq CondOp Source # | |
Ord CondOp Source # | |
type Rep CondOp Source # | |
Defined in Csound.Dynamic.Types.Exp type Rep CondOp = D1 ('MetaData "CondOp" "Csound.Dynamic.Types.Exp" "csound-expression-dynamic-0.3.9.1-1cJbmtshgbjKoGghhay83W" 'False) (((C1 ('MetaCons "TrueOp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FalseOp" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "And" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Or" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Equals" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "NotEquals" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Less" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Greater" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "LessEquals" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "GreaterEquals" 'PrefixI 'False) (U1 :: Type -> Type))))) |
Instances
Generic NumOp Source # | |
Show NumOp Source # | |
Serialize NumOp Source # | |
Eq NumOp Source # | |
Ord NumOp Source # | |
type Rep NumOp Source # | |
Defined in Csound.Dynamic.Types.Exp type Rep NumOp = D1 ('MetaData "NumOp" "Csound.Dynamic.Types.Exp" "csound-expression-dynamic-0.3.9.1-1cJbmtshgbjKoGghhay83W" 'False) ((C1 ('MetaCons "Add" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Sub" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Neg" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Mul" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Div" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Pow" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Mod" 'PrefixI 'False) (U1 :: Type -> Type)))) |
type MultiOut a = Int -> a Source #
Multiple output. Specify the number of outputs to get the result.
Rate of if-then-else conditional. It can run at Ir or Kr
fromIfRate :: IfRate -> Rate Source #
hashE :: E -> ByteString Source #