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

Safe HaskellNone

Derive.ShowVal

Description

The show_val method turns haskell values back to tracklang expressions. It's similar to the opposite of Typecheck.

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 # 
Instance details

Defined in Derive.ShowVal

Methods

show_val :: Bool -> Text Source #

ShowVal Double # 
Instance details

Defined in Derive.ShowVal

Methods

show_val :: Double -> Text Source #

ShowVal Int # 
Instance details

Defined in Derive.ShowVal

Methods

show_val :: Int -> Text Source #

ShowVal Text #

This should be the inverse of p_str and p_unquoted_str.

Instance details

Defined in Derive.ShowVal

Methods

show_val :: Text -> Text Source #

ShowVal Highlight # 
Instance details

Defined in Derive.C.Prelude.Highlight

ShowVal ScoreTime # 
Instance details

Defined in Ui.ScoreTime

ShowVal RealTime # 
Instance details

Defined in Perform.RealTime

ShowVal Attributes # 
Instance details

Defined in Derive.Attrs

ShowVal Key # 
Instance details

Defined in Perform.Pitch

Methods

show_val :: Key -> Text Source #

ShowVal Transpose # 
Instance details

Defined in Perform.Pitch

ShowVal NoteNumber # 
Instance details

Defined in Perform.Pitch

ShowVal Pitch #

This relies on the presence of a pitch val call.

Instance details

Defined in Perform.Pitch

Methods

show_val :: Pitch -> Text Source #

ShowVal RankName # 
Instance details

Defined in Derive.Typecheck

ShowVal PControl # 
Instance details

Defined in Derive.ScoreTypes

ShowVal Control # 
Instance details

Defined in Derive.ScoreTypes

ShowVal Instrument # 
Instance details

Defined in Derive.ScoreTypes

ShowVal MiniVal # 
Instance details

Defined in Derive.Expr

ShowVal Str # 
Instance details

Defined in Derive.Expr

Methods

show_val :: Str -> Text Source #

ShowVal Symbol # 
Instance details

Defined in Derive.Expr

Methods

show_val :: Symbol -> Text Source #

ShowVal ControlFunction #

Not parseable.

Instance details

Defined in Derive.BaseTypes

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.

Instance details

Defined in Derive.BaseTypes

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.

Instance details

Defined in Derive.BaseTypes

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.

Instance details

Defined in Derive.BaseTypes

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.

Instance details

Defined in Derive.BaseTypes

Methods

show_val :: Val -> Text Source #

ShowVal Duration # 
Instance details

Defined in Derive.BaseTypes

ShowVal Var # 
Instance details

Defined in Derive.Parse

Methods

show_val :: Var -> Text Source #

ShowVal Term # 
Instance details

Defined in Derive.Parse

Methods

show_val :: Term -> Text Source #

ShowVal Call # 
Instance details

Defined in Derive.Parse

Methods

show_val :: Call -> Text Source #

ShowVal Expr # 
Instance details

Defined in Derive.Parse

Methods

show_val :: Expr -> Text Source #

ShowVal ControlType # 
Instance details

Defined in Derive.ParseTitle

ShowVal Merger # 
Instance details

Defined in Derive.Deriver.Monad

Methods

show_val :: Merger -> Text Source #

ShowVal NotGiven # 
Instance details

Defined in Derive.Typecheck

ShowVal TransposeFunctionNn # 
Instance details

Defined in Derive.Typecheck

ShowVal TransposeFunctionChromatic # 
Instance details

Defined in Derive.Typecheck

ShowVal TransposeFunctionDiatonic # 
Instance details

Defined in Derive.Typecheck

ShowVal DefaultRealTimeFunction # 
Instance details

Defined in Derive.Typecheck

ShowVal DefaultDiatonic # 
Instance details

Defined in Derive.Typecheck

ShowVal Normalized # 
Instance details

Defined in Derive.Typecheck

ShowVal DefaultScore # 
Instance details

Defined in Derive.Typecheck

ShowVal DefaultReal # 
Instance details

Defined in Derive.Typecheck

ShowVal Function # 
Instance details

Defined in Derive.Typecheck

ShowVal TypedFunction # 
Instance details

Defined in Derive.Typecheck

ShowVal FreeCodePosition # 
Instance details

Defined in Perform.Lilypond.Constants

ShowVal UpDown # 
Instance details

Defined in Derive.Call

Methods

show_val :: UpDown -> Text Source #

ShowVal Speed # 
Instance details

Defined in Derive.Call.Speed

Methods

show_val :: Speed -> Text Source #

ShowVal Distribution # 
Instance details

Defined in Derive.C.Prelude.ControlFunction

ShowVal Stroke # 
Instance details

Defined in Derive.C.India.Mridangam

Methods

show_val :: Stroke -> Text Source #

ShowVal KotekanStyle # 
Instance details

Defined in Derive.C.Bali.Gangsa

ShowVal NorotStyle # 
Instance details

Defined in Derive.C.Bali.Gangsa

ShowVal Tuning # 
Instance details

Defined in Derive.Scale.BaliScales

Methods

show_val :: Tuning -> Text Source #

ShowVal HarmonicType # 
Instance details

Defined in Derive.C.Prelude.Articulation

ShowVal Adjust # 
Instance details

Defined in Derive.C.Prelude.Trill

Methods

show_val :: Adjust -> Text Source #

ShowVal Direction # 
Instance details

Defined in Derive.C.Prelude.Trill

ShowVal a => ShowVal [a] # 
Instance details

Defined in Derive.ShowVal

Methods

show_val :: [a] -> Text Source #

ShowVal a => ShowVal (Maybe a) # 
Instance details

Defined in Derive.ShowVal

Methods

show_val :: Maybe a -> Text Source #

ShowVal (Ratio.Ratio Int) # 
Instance details

Defined in Derive.ShowVal

ShowVal (Typed Y) # 
Instance details

Defined in Derive.ScoreTypes

Methods

show_val :: Typed Y -> Text Source #

ShowVal (Typed Control) # 
Instance details

Defined in Derive.ScoreTypes

ShowVal val => ShowVal (Term val) # 
Instance details

Defined in Derive.Expr

Methods

show_val :: Term val -> Text Source #

ShowVal val => ShowVal (Call val) # 
Instance details

Defined in Derive.Expr

Methods

show_val :: Call val -> Text Source #

ShowVal val => ShowVal (Expr val) # 
Instance details

Defined in Derive.Expr

Methods

show_val :: Expr val -> Text Source #

ShowVal (RawPitch a) #

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

Instance details

Defined in Derive.BaseTypes

Methods

show_val :: RawPitch a -> Text Source #

ShowVal a => ShowVal (NonNegative a) # 
Instance details

Defined in Derive.Typecheck

ShowVal a => ShowVal (Positive a) # 
Instance details

Defined in Derive.Typecheck

Methods

show_val :: Positive a -> Text Source #

ShowVal (Position CodePosition) # 
Instance details

Defined in Derive.Call.Ly

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

Defined in Derive.ShowVal

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.