Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

Safe HaskellNone

Derive.ShowVal

Synopsis

Documentation

class ShowVal a where Source #

Instances of ShowVal can be turned back into tracklang syntax. Everything produced by show_val should be parseable by Derive.ParseBs, except values that have no literal syntax, such as VPitch.

At least one place that relies on this is inverting.

Minimal complete definition

show_val

Methods

show_val :: a -> Text Source #

Instances

ShowVal Bool # 

Methods

show_val :: Bool -> Text Source #

ShowVal Double # 

Methods

show_val :: Double -> Text Source #

ShowVal Int # 

Methods

show_val :: Int -> Text Source #

ShowVal Text #

This should be the inverse of p_str and p_unquoted_str.

Methods

show_val :: Text -> Text Source #

ShowVal Key # 

Methods

show_val :: Key -> Text Source #

ShowVal Transpose # 
ShowVal NoteNumber # 
ShowVal Pitch #

This relies on the presence of a pitch val call.

Methods

show_val :: Pitch -> Text Source #

ShowVal ScoreTime # 
ShowVal RealTime # 
ShowVal TypedVal # 
ShowVal PControl # 
ShowVal Control # 
ShowVal Instrument # 
ShowVal Str # 

Methods

show_val :: Str -> Text Source #

ShowVal Symbol # 

Methods

show_val :: Symbol -> Text Source #

ShowVal Attributes # 
ShowVal ControlFunction #

Not parseable.

ShowVal PControlRef #

There's no way to convert a pitch back into the expression that produced it, so this is the best I can do.

Similar to ShowVal ControlRef, there's no signal literal so I use the value at 0. A pitch can be turned into an expression, but not necessarily accurately since it doesn't take things like pitch interpolation into account.

ShowVal ControlRef #

This can only represent constant signals, since there's no literal for an arbitrary signal. Non-constant signals will turn into a constant of whatever was at 0.

ShowVal Quoted #

Unlike Exprs in general, a Quoted Expr should be representable with show_val. This is because a Quoted has only been parsed, not evaluated, so it shouldn't have anything unshowable, like pitches.

Methods

show_val :: Quoted -> Text Source #

ShowVal Val #

This instance is actually invalid due to showing VPitch, which has no literal, and for Val, showing PControlRef, which amounts to the same thing. I use this to treat any Val as a Str to re-evaluate it. Being invalid means that a VPitch or VPControlRef with a default will cause a parse failure, but I'll have to see if this becomes a problem in practice.

Methods

show_val :: Val -> Text Source #

ShowVal Duration # 
ShowVal Var # 

Methods

show_val :: Var -> Text Source #

ShowVal Term # 

Methods

show_val :: Term -> Text Source #

ShowVal Call # 

Methods

show_val :: Call -> Text Source #

ShowVal Expr # 

Methods

show_val :: Expr -> Text Source #

ShowVal ControlType # 
ShowVal NotGiven # 
ShowVal TransposeFunctionNn # 
ShowVal TransposeFunctionChromatic # 
ShowVal TransposeFunctionDiatonic # 
ShowVal DefaultRealTimeFunction # 
ShowVal DefaultDiatonic # 
ShowVal Normalized # 
ShowVal DefaultScore # 
ShowVal DefaultReal # 
ShowVal UpDown # 

Methods

show_val :: UpDown -> Text Source #

ShowVal Stroke # 

Methods

show_val :: Stroke -> Text Source #

ShowVal Distribution # 
ShowVal Tuning # 

Methods

show_val :: Tuning -> Text Source #

ShowVal Speed # 

Methods

show_val :: Speed -> Text Source #

ShowVal KotekanStyle # 
ShowVal NorotStyle # 
ShowVal Adjust # 

Methods

show_val :: Adjust -> Text Source #

ShowVal Direction # 
ShowVal a => ShowVal [a] # 

Methods

show_val :: [a] -> Text Source #

ShowVal a => ShowVal (Maybe a) # 

Methods

show_val :: Maybe a -> Text Source #

ShowVal (Typed Control) # 
ShowVal val => ShowVal (Term val) # 

Methods

show_val :: Term val -> Text Source #

ShowVal val => ShowVal (Call val) # 

Methods

show_val :: Call val -> Text Source #

ShowVal val => ShowVal (Expr val) # 

Methods

show_val :: Expr val -> Text Source #

ShowVal (RawPitch a) #

Pitches have no literal syntax, but I have to print something.

Methods

show_val :: RawPitch a -> Text Source #

ShowVal (Merger a) # 

Methods

show_val :: Merger a -> Text Source #

ShowVal a => ShowVal (NonNegative a) # 
ShowVal a => ShowVal (Positive a) # 

Methods

show_val :: Positive a -> Text Source #

(ShowVal a, ShowVal b) => ShowVal (Either a b) # 

Methods

show_val :: Either a b -> Text Source #

show_hex_val :: Double -> Text Source #

VNums have hex and decimal literals, and show_val produces the decimal one. So I need a way to produce the hex literal.

doc :: ShowVal a => a -> Doc.Doc Source #

Show a val for inclusion into CallDoc.