Safe Haskell  SafeInferred 

Synopsis
 type TypedFunction = RealTime.RealTime > ScoreT.Typed Signal.Y
 type Function = RealTime.RealTime > Signal.Y
 newtype DefaultReal = DefaultReal {}
 newtype DefaultScore = DefaultScore {}
 real :: RealTime.RealTime > DefaultReal
 score :: ScoreTime.ScoreTime > DefaultScore
 newtype Positive a = Positive {
 positive :: a
 newtype NonNegative a = NonNegative {
 non_negative :: a
 newtype Normalized = Normalized {
 normalized :: Double
 newtype NormalizedBipolar = NormalizedBipolar {}
 newtype DefaultDiatonic = DefaultDiatonic {}
 diatonic :: Double > DefaultDiatonic
 typecheck :: forall a. Typecheck a => Text > ScoreTime.ScoreTime > DeriveT.Val > Derive.Deriver a
 typecheck_simple :: forall a. Typecheck a => DeriveT.Val > Either Text a
 data Checked a
 = Val (Result a)
  Eval (RealTime.RealTime > Derive.Deriver (Maybe a))
 data Result a
 = Failure
  Success !a
  Derive !(Derive.Context Derive.Tagged > a)
 success :: a > Checked a
 failure :: Checked a
 class Typecheck a where
 from_val :: DeriveT.Val > Checked a
 to_type :: Proxy a > ValType.Type
 from_subtrack :: SubT.Track > Maybe a
 from_val_eval :: Typecheck a => ScoreTime.ScoreTime > DeriveT.Val > Derive.Deriver (Maybe a)
 from_val_simple :: Typecheck a => DeriveT.Val > Maybe a
 type TEnum a = (ShowVal.ShowVal a, Bounded a, Enum a)
 class ToVal a where
 to_val :: a > DeriveT.Val
 to_type_symbol :: ShowVal.ShowVal a => [a] > ValType.Type
 from_val_symbol :: Map Text a > DeriveT.Val > Checked a
 num_to_type :: TypecheckNum a => Proxy a > ValType.Type
 class Typecheck a => TypecheckNum a where
 num_type :: Proxy a > ValType.NumType
 num_to_scalar :: (ScoreT.Typed Signal.Y > Maybe a) > DeriveT.Val > Checked a
 data TimeType
 time_type :: TimeType > ScoreT.Type > Maybe TimeType
 data TransposeType
 transpose_type :: TransposeType > ScoreT.Type > Maybe TransposeType
 to_transpose :: TransposeType > Double > Pitch.Transpose
 transpose_control :: TransposeType > ScoreT.Control
 to_typed_function :: DeriveT.ControlRef > Derive.Deriver TypedFunction
 to_function :: DeriveT.ControlRef > Derive.Deriver Function
 convert_to_function :: DeriveT.ControlRef > Either (ScoreT.Typed Signal.Control) DeriveT.ControlFunction > Derive.Deriver TypedFunction
 to_signal_or_function :: DeriveT.ControlRef > Derive.Deriver (Either (ScoreT.Typed Signal.Control) DeriveT.ControlFunction)
 pitch_at :: RealTime.RealTime > DeriveT.PControlRef > Derive.Deriver DeriveT.Pitch
signal functions
type TypedFunction = RealTime.RealTime > ScoreT.Typed Signal.Y Source #
type Function = RealTime.RealTime > Signal.Y Source #
type wrappers
newtype DefaultReal Source #
Either RealTime or ScoreTime, but untyped defaults to RealTime. This has a short accessor to make unwrapping more concise.
Instances
Show DefaultReal Source #  
Defined in Derive.Typecheck showsPrec :: Int > DefaultReal > ShowS # show :: DefaultReal > String # showList :: [DefaultReal] > ShowS #  
Eq DefaultReal Source #  
Defined in Derive.Typecheck (==) :: DefaultReal > DefaultReal > Bool # (/=) :: DefaultReal > DefaultReal > Bool #  
Internal.Time DefaultReal Source #  
Defined in Derive.Typecheck  
ShowVal.ShowVal DefaultReal Source #  
Defined in Derive.Typecheck show_val :: DefaultReal > Text Source #  
ToVal DefaultReal Source #  
Defined in Derive.Typecheck to_val :: DefaultReal > DeriveT.Val Source #  
Typecheck DefaultReal Source #  
Defined in Derive.Typecheck from_val :: DeriveT.Val > Checked DefaultReal Source # to_type :: Proxy DefaultReal > ValType.Type Source #  
TypecheckNum DefaultReal Source #  
Defined in Derive.Typecheck 
newtype DefaultScore Source #
Same as DefaultReal
but untyped defaults to ScoreTime.
This has a short accessor to make unwrapping more concise.
Instances
Show DefaultScore Source #  
Defined in Derive.Typecheck showsPrec :: Int > DefaultScore > ShowS # show :: DefaultScore > String # showList :: [DefaultScore] > ShowS #  
Eq DefaultScore Source #  
Defined in Derive.Typecheck (==) :: DefaultScore > DefaultScore > Bool # (/=) :: DefaultScore > DefaultScore > Bool #  
Internal.Time DefaultScore Source #  
Defined in Derive.Typecheck  
ShowVal.ShowVal DefaultScore Source #  
Defined in Derive.Typecheck show_val :: DefaultScore > Text Source #  
ToVal DefaultScore Source #  
Defined in Derive.Typecheck to_val :: DefaultScore > DeriveT.Val Source #  
Typecheck DefaultScore Source #  
Defined in Derive.Typecheck  
TypecheckNum DefaultScore Source #  
Defined in Derive.Typecheck 
real :: RealTime.RealTime > DefaultReal Source #
Create DefaultReal and DefaultScores for use in Derive.Sig signatures for default values. It would be nice to use literals and let type inference do its thing, but there's no good definition for the rest of the methods in Integral and Fractional.
An annotation that says this value must be >0. Instances only exist for numeric types.
This is an instance of Num just so numeric literals work. Of course that means you also have () which can make it not positive, but this is only intended to be a type tag for signatures, unwrapped as soon as it gets passed to the call.
Instances
Num a => Num (Positive a) Source #  
Defined in Derive.Typecheck  
Fractional a => Fractional (Positive a) Source #  
Show a => Show (Positive a) Source #  
Eq a => Eq (Positive a) Source #  
ShowVal.ShowVal a => ShowVal.ShowVal (Positive a) Source #  
ToVal a => ToVal (Positive a) Source #  
Defined in Derive.Typecheck to_val :: Positive a > DeriveT.Val Source #  
TypecheckNum a => Typecheck (Positive a) Source #  
Defined in Derive.Typecheck from_val :: DeriveT.Val > Checked (Positive a) Source # to_type :: Proxy (Positive a) > ValType.Type Source # from_subtrack :: SubT.Track > Maybe (Positive a) Source # 
newtype NonNegative a Source #
Like Positive, but also includes 0.
NonNegative  

Instances
newtype Normalized Source #
0 <= x <= 1
Instances
Show Normalized Source #  
Defined in Derive.Typecheck showsPrec :: Int > Normalized > ShowS # show :: Normalized > String # showList :: [Normalized] > ShowS #  
Eq Normalized Source #  
Defined in Derive.Typecheck (==) :: Normalized > Normalized > Bool # (/=) :: Normalized > Normalized > Bool #  
ShowVal.ShowVal Normalized Source #  
Defined in Derive.Typecheck show_val :: Normalized > Text Source #  
ToVal Normalized Source #  
Defined in Derive.Typecheck to_val :: Normalized > DeriveT.Val Source #  
Typecheck Normalized Source #  
Defined in Derive.Typecheck from_val :: DeriveT.Val > Checked Normalized Source # to_type :: Proxy Normalized > ValType.Type Source #  
Pretty Normalized Source #  
Defined in Derive.Typecheck pretty :: Normalized > Text Source # format :: Normalized > Doc Source # formatList :: [Normalized] > Doc Source # 
newtype NormalizedBipolar Source #
 1 <= x <= 1
Instances
Show NormalizedBipolar Source #  
Defined in Derive.Typecheck showsPrec :: Int > NormalizedBipolar > ShowS # show :: NormalizedBipolar > String # showList :: [NormalizedBipolar] > ShowS #  
Eq NormalizedBipolar Source #  
Defined in Derive.Typecheck (==) :: NormalizedBipolar > NormalizedBipolar > Bool # (/=) :: NormalizedBipolar > NormalizedBipolar > Bool #  
ShowVal.ShowVal NormalizedBipolar Source #  
Defined in Derive.Typecheck show_val :: NormalizedBipolar > Text Source #  
ToVal NormalizedBipolar Source #  
Defined in Derive.Typecheck  
Typecheck NormalizedBipolar Source #  
Defined in Derive.Typecheck  
Pretty NormalizedBipolar Source #  
Defined in Derive.Typecheck pretty :: NormalizedBipolar > Text Source # format :: NormalizedBipolar > Doc Source # formatList :: [NormalizedBipolar] > Doc Source # 
newtype DefaultDiatonic Source #
Normally Transpose will default to Chromatic if the val is untyped, but some calls would prefer to default to Diatonic.
Instances
Show DefaultDiatonic Source #  
Defined in Derive.Typecheck showsPrec :: Int > DefaultDiatonic > ShowS # show :: DefaultDiatonic > String # showList :: [DefaultDiatonic] > ShowS #  
Eq DefaultDiatonic Source #  
Defined in Derive.Typecheck (==) :: DefaultDiatonic > DefaultDiatonic > Bool # (/=) :: DefaultDiatonic > DefaultDiatonic > Bool #  
ShowVal.ShowVal DefaultDiatonic Source #  
Defined in Derive.Typecheck show_val :: DefaultDiatonic > Text Source #  
ToVal DefaultDiatonic Source #  
Defined in Derive.Typecheck to_val :: DefaultDiatonic > DeriveT.Val Source #  
Typecheck DefaultDiatonic Source #  But some calls want to default to diatonic, not chromatic. 
Defined in Derive.Typecheck  
TypecheckNum DefaultDiatonic Source #  
Defined in Derive.Typecheck 
diatonic :: Double > DefaultDiatonic Source #
typecheck
typecheck :: forall a. Typecheck a => Text > ScoreTime.ScoreTime > DeriveT.Val > Derive.Deriver a Source #
Typecheck a single Val, and throw if it's the wrong type.
typecheck_simple :: forall a. Typecheck a => DeriveT.Val > Either Text a Source #
Typecheck a simple value, with no evaluation. This means you can't get a deriver or coerce signal to a number.
Val (Result a)  
Eval (RealTime.RealTime > Derive.Deriver (Maybe a))  This val needs to be evaluated to know if it will typecheck. The argument is the call start time. This is needed when coercing a function to a scalar, because I only know the value to check after calling the function. 
Failure  
Success !a  
Derive !(Derive.Context Derive.Tagged > a)  This is a {Note,Control,Pitch}Deriver, which needs a Context to
evaluate. 
class Typecheck a where Source #
This is the class of values which can be converted to a Checked
. ToVal
is
the inverse transformation.
Nothing
from_val :: DeriveT.Val > Checked a Source #
to_type :: Proxy a > ValType.Type Source #
from_subtrack :: SubT.Track > Maybe a Source #
Instances
from_val_eval :: Typecheck a => ScoreTime.ScoreTime > DeriveT.Val > Derive.Deriver (Maybe a) Source #
from_val
, but evaluate if it's an Eval.
from_val_simple :: Typecheck a => DeriveT.Val > Maybe a Source #
type TEnum a = (ShowVal.ShowVal a, Bounded a, Enum a) Source #
I can automatically derive a Typecheck for enum types. So a simple enum can get a Typecheck by "just" deriving these plus Typecheck.
This is the inverse of Typecheck's from_val
.
Nothing
to_val :: a > DeriveT.Val Source #
default to_val :: TEnum a => a > DeriveT.Val Source #
Instances
to_type_symbol :: ShowVal.ShowVal a => [a] > ValType.Type Source #
from_val_symbol :: Map Text a > DeriveT.Val > Checked a Source #
num_to_type :: TypecheckNum a => Proxy a > ValType.Type Source #
class Typecheck a => TypecheckNum a where Source #
num_type :: Proxy a > ValType.NumType Source #
Instances
numeric types
num_to_scalar :: (ScoreT.Typed Signal.Y > Maybe a) > DeriveT.Val > Checked a Source #
Coerce any numeric value to a ScoreT.Typed Signal.Y, and check it against the given function.
util
data TransposeType Source #
Instances
Show TransposeType Source #  
Defined in Derive.Typecheck showsPrec :: Int > TransposeType > ShowS # show :: TransposeType > String # showList :: [TransposeType] > ShowS #  
Eq TransposeType Source #  
Defined in Derive.Typecheck (==) :: TransposeType > TransposeType > Bool # (/=) :: TransposeType > TransposeType > Bool #  
Pretty TransposeType Source #  
Defined in Derive.Typecheck pretty :: TransposeType > Text Source # format :: TransposeType > Doc Source # formatList :: [TransposeType] > Doc Source # 
to_transpose :: TransposeType > Double > Pitch.Transpose Source #
to_typed_function
to_typed_function :: DeriveT.ControlRef > Derive.Deriver TypedFunction Source #
Convert a DeriveT.ControlRef
to a function.
If a signal exists but doesn't have a type, the type will be inherited from the default. This way a call can cause a signal parameter to default to a certain type.
convert_to_function :: DeriveT.ControlRef > Either (ScoreT.Typed Signal.Control) DeriveT.ControlFunction > Derive.Deriver TypedFunction Source #
to_signal_or_function :: DeriveT.ControlRef > Derive.Deriver (Either (ScoreT.Typed Signal.Control) DeriveT.ControlFunction) Source #
pitch_at :: RealTime.RealTime > DeriveT.PControlRef > Derive.Deriver DeriveT.Pitch Source #
This is the pitch signal version of to_signal_or_function
, except
simpler because there's no pitch equivalent of ControlFunction.
I could actually have a pitch version of Function
, which I guess would be
called PitchFunction, except be unlike ControlFunction, in that it actually
is a function, where ControlFunction isn't. What a mess, I wish I could
get rid of ControlFunction...