| Safe Haskell | Safe-Inferred |
|---|
Derive.ValType
Description
Type descriptions of the Val.
This is in its own module so Derive.Deriver.Monad can import it without importing Derive.Typecheck.
Synopsis
- data Type
- = TVal
- | TSignal NumType NumValue
- | TPSignal
- | TAttributes
- | TControlRef
- | TPControlRef
- | TPitch
- | TNotePitch
- | TStr (Maybe [Text])
- | TControl
- | TPControl
- | TNotGiven
- | TSeparator
- | TMaybe Type
- | TEither Type Type
- | TPair Type Type
- | TQuoted
- | TCFunction
- | TPFunction
- | TList Type
- | TDeriver Text
- | TOther Text
- data NumType
- data NumValue
- general_type_of :: Val -> Type
- specific_type_of :: Val -> Type
Documentation
Constructors
| TVal | This is the "any" type. |
| TSignal NumType NumValue | |
| TPSignal | |
| TAttributes | |
| TControlRef | |
| TPControlRef | |
| TPitch | |
| TNotePitch | |
| TStr (Maybe [Text]) | Text string, with enum values if it's an enum. |
| TControl | |
| TPControl | |
| TNotGiven | |
| TSeparator | |
| TMaybe Type | |
| TEither Type Type | |
| TPair Type Type | Two types in sequence. This has no corresponding Typecheck instance since it doesn't correspond to a single Val, but is used by Derive.Sig for documentation. |
| TQuoted | A |
| TCFunction | |
| TPFunction | |
| TList Type | |
| TDeriver Text | |
| TOther Text | Typecheck instances that don't correspond directly to a Val type get this, as a plain description. |
Some of these are subtypes of others (TTranspose includes TDefaultDiatonic), but since they're just documentation, it shouldn't matter.
Constructors
| TUntyped | |
| TInt | |
| TTranspose | |
| TDefaultDiatonic | |
| TDefaultChromatic | |
| TNoteNumber | |
| TTime | |
| TDefaultReal | |
| TDefaultScore | |
| TRealTime | |
| TScoreTime |
Numeric subtypes.
Constructors
| TAny | |
| TNonNegative | =0 |
| TPositive | 0 |
| TNormalized | 0 <= a <= 1 |
| TNormalizedBipolar |
|
general_type_of :: Val -> Type Source #
Infer a general type. This is also for type errors, but for env type
check errors, which use types_equal, which doesn't check the
value.
specific_type_of :: Val -> Type Source #
Infer the most specific type possible, looking at the value inside. This is for documentation (e.g. type error messages) for values.