Safe Haskell | Safe-Inferred |
---|
Utilities for the Library type.
Synopsis
- type Library = ScopesT (Scope [Entry (Generator Note)] [Entry (Generator Control)] [Entry (Generator Pitch)]) (Scope [Entry (Transformer Note)] [Entry (Transformer Control)] [Entry (Transformer Pitch)]) (Scope [Entry (TrackCall Note)] [Entry (TrackCall Control)] [Entry (TrackCall Pitch)]) [Entry ValCall]
- library :: ToLibrary call => [(Expr.Symbol, call)] -> Library
- generators :: ToLibrary (Generator call) => [(Expr.Symbol, Generator call)] -> Library
- transformers :: ToLibrary (Transformer call) => [(Expr.Symbol, Transformer call)] -> Library
- vals :: [(Expr.Symbol, ValCall)] -> Library
- pattern :: ToLibrary call => PatternCall call -> Library
- class ToLibrary call
- data Entry call
- = Single !Expr.Symbol !call
- | Pattern !(PatternCall call)
- data Calls d = Calls {
- generator :: !(Generator d)
- transformer :: !(Transformer d)
- both :: (ToLibrary (Generator d), ToLibrary (Transformer d)) => [(Expr.Symbol, Calls d)] -> Library
- poly_generators :: (forall d. CallableExpr d => [(Expr.Symbol, Generator d)]) -> Library
- poly_transformers :: (forall d. CallableExpr d => [(Expr.Symbol, Transformer d)]) -> Library
- type Shadowed = ((Text, Module.Module), [Expr.Symbol])
- compile :: Library -> (Builtins, [Shadowed])
- compile_log :: Log.LogMonad m => Library -> m Builtins
make
type Library = ScopesT (Scope [Entry (Generator Note)] [Entry (Generator Control)] [Entry (Generator Pitch)]) (Scope [Entry (Transformer Note)] [Entry (Transformer Control)] [Entry (Transformer Pitch)]) (Scope [Entry (TrackCall Note)] [Entry (TrackCall Control)] [Entry (TrackCall Pitch)]) [Entry ValCall] Source #
generators :: ToLibrary (Generator call) => [(Expr.Symbol, Generator call)] -> Library Source #
This is just a specialization of library
, just for documentation.
transformers :: ToLibrary (Transformer call) => [(Expr.Symbol, Transformer call)] -> Library Source #
This is just a specialization of library
, just for documentation.
vals :: [(Expr.Symbol, ValCall)] -> Library Source #
This is just a specialization of library
, just for documentation.
to_library
Instances
ToLibrary ValCall Source # | |
Defined in Derive.Library to_library :: [Entry ValCall] -> Library -> Library | |
ToLibrary (Generator Control) Source # | |
Defined in Derive.Library | |
ToLibrary (Generator Note) Source # | |
Defined in Derive.Library | |
ToLibrary (Generator Pitch) Source # | |
Defined in Derive.Library | |
ToLibrary (TrackCall Control) Source # | |
Defined in Derive.Library | |
ToLibrary (TrackCall Note) Source # | |
Defined in Derive.Library | |
ToLibrary (TrackCall Pitch) Source # | |
Defined in Derive.Library | |
ToLibrary (Transformer Control) Source # | |
Defined in Derive.Library to_library :: [Entry (Transformer Control)] -> Library -> Library | |
ToLibrary (Transformer Note) Source # | |
Defined in Derive.Library to_library :: [Entry (Transformer Note)] -> Library -> Library | |
ToLibrary (Transformer Pitch) Source # | |
Defined in Derive.Library to_library :: [Entry (Transformer Pitch)] -> Library -> Library |
Single !Expr.Symbol !call | |
Pattern !(PatternCall call) |
Bundle a generator and transformer together, so I can define them together. Functions to create these are in Derive.Call.Make.
Calls | |
|
both :: (ToLibrary (Generator d), ToLibrary (Transformer d)) => [(Expr.Symbol, Calls d)] -> Library Source #
poly_generators :: (forall d. CallableExpr d => [(Expr.Symbol, Generator d)]) -> Library Source #
Add a polymorphic generator to all call types.
The Callable constraint is not needed here, but callers will have it, and for some reason you can't coerce a parametric variable into a constrained one.
poly_transformers :: (forall d. CallableExpr d => [(Expr.Symbol, Transformer d)]) -> Library Source #
compile
type Shadowed = ((Text, Module.Module), [Expr.Symbol]) Source #
Warnings for shadowed symbols. ((call_type, module), symbols)
compile :: Library -> (Builtins, [Shadowed]) Source #
Convert Library to Builtins. This indexes by module and also gives me a place to emit warnings about duplicate symbol names.
compile_log :: Log.LogMonad m => Library -> m Builtins Source #