Karya, built on 2018-05-31T02:46:59 (patch 0a1a35479c514820d77330ae8a978975ba22a47a)

Safe HaskellNone

Derive.Library

Contents

Description

Utilities for the Library type.

Synopsis

make

type Library = ScopesT (MkScope Generator) (MkScope Transformer) (MkScope TrackCall) [Entry ValCall] Source #

The holds the libary of statically-declared calls. It gets compiled to Builtins by compile.

library :: ToLibrary call => [(Expr.Symbol, call)] -> Library 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.

class ToLibrary call Source #

Minimal complete definition

to_library

Instances
ToLibrary ValCall # 
Instance details

Defined in Derive.Library

ToLibrary (Transformer Pitch) # 
Instance details

Defined in Derive.Library

ToLibrary (Transformer Control) # 
Instance details

Defined in Derive.Library

ToLibrary (Transformer Note) # 
Instance details

Defined in Derive.Library

ToLibrary (Generator Pitch) # 
Instance details

Defined in Derive.Library

ToLibrary (Generator Control) # 
Instance details

Defined in Derive.Library

ToLibrary (Generator Note) # 
Instance details

Defined in Derive.Library

ToLibrary (TrackCall Pitch) # 
Instance details

Defined in Derive.Library

ToLibrary (TrackCall Control) # 
Instance details

Defined in Derive.Library

ToLibrary (TrackCall Note) # 
Instance details

Defined in Derive.Library

data Entry call Source #

Constructors

Single !Expr.Symbol !call 
Pattern !(PatternCall call) 
Instances
Show Library # 
Instance details

Defined in Derive.Library

Pretty (Entry call) # 
Instance details

Defined in Derive.Library

Methods

pretty :: Entry call -> Text Source #

format :: Entry call -> Doc Source #

formatList :: [Entry call] -> Doc Source #

data Calls d Source #

Bundle a generator and transformer together, so I can define them together. Functions to create these are in Derive.Call.Make.

Constructors

Calls 

Fields

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.

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.