Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Derive.ShowVal

Description

The show_val method turns haskell values back to tracklang expressions. It should be the inverse of from_val . parse_val.

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.Parse, except values that have no literal syntax, such as VPitch.

At least one place that relies on this is inverting.

Minimal complete definition

Nothing

Methods

show_val :: a -> Text Source #

default show_val :: (Show a, Enum a, Bounded a) => a -> Text Source #

Instances

Instances details
ShowVal Attributes Source # 
Instance details

Defined in Derive.Attrs

ShowVal KotekanStyle Source # 
Instance details

Defined in Derive.C.Bali.Gangsa

ShowVal NorotStyle Source # 
Instance details

Defined in Derive.C.Bali.Gangsa

ShowVal Stroke Source # 
Instance details

Defined in Derive.C.India.Mridangam

Methods

show_val :: Stroke -> Text Source #

ShowVal HarmonicType Source # 
Instance details

Defined in Derive.C.Prelude.Articulation

ShowVal Adjust Source # 
Instance details

Defined in Derive.C.Prelude.Trill

Methods

show_val :: Adjust -> Text Source #

ShowVal Direction Source # 
Instance details

Defined in Derive.C.Prelude.Trill

ShowVal Hand Source # 
Instance details

Defined in Derive.Call

Methods

show_val :: Hand -> Text Source #

ShowVal UpDown Source # 
Instance details

Defined in Derive.Call

Methods

show_val :: UpDown -> Text Source #

ShowVal Speed Source # 
Instance details

Defined in Derive.Call.Speed

Methods

show_val :: Speed -> Text Source #

ShowVal CFunction Source #

TODO this isn't a real ShowVal, I'd have to record the whole expression.

Instance details

Defined in Derive.DeriveT

ShowVal ControlRef Source # 
Instance details

Defined in Derive.DeriveT

ShowVal Duration Source # 
Instance details

Defined in Derive.DeriveT

ShowVal PControlRef Source #

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.DeriveT

ShowVal PFunction Source # 
Instance details

Defined in Derive.DeriveT

ShowVal PSignal Source # 
Instance details

Defined in Derive.DeriveT

ShowVal Quoted Source #

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.DeriveT

Methods

show_val :: Quoted -> Text Source #

ShowVal Val Source #

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.DeriveT

Methods

show_val :: Val -> Text Source #

ShowVal ControlDeriver Source # 
Instance details

Defined in Derive.Deriver.Monad

ShowVal Merger Source # 
Instance details

Defined in Derive.Deriver.Monad

Methods

show_val :: Merger -> Text Source #

ShowVal NoteDeriver Source #

This is an invalid instance, because a deriver has no literal syntax. But this lets me put a deriver in a defaulted argument, and get documentation for it.

Instance details

Defined in Derive.Deriver.Monad

ShowVal PitchDeriver Source # 
Instance details

Defined in Derive.Deriver.Monad

ShowVal MiniVal Source # 
Instance details

Defined in Derive.Expr

ShowVal Str Source # 
Instance details

Defined in Derive.Expr

Methods

show_val :: Str -> Text Source #

ShowVal Symbol Source # 
Instance details

Defined in Derive.Expr

Methods

show_val :: Symbol -> Text Source #

ShowVal Call Source # 
Instance details

Defined in Derive.Parse.Ky

Methods

show_val :: Call -> Text Source #

ShowVal Expr Source # 
Instance details

Defined in Derive.Parse.Ky

Methods

show_val :: Expr -> Text Source #

ShowVal Term Source # 
Instance details

Defined in Derive.Parse.Ky

Methods

show_val :: Term -> Text Source #

ShowVal Var Source # 
Instance details

Defined in Derive.Parse.Ky

Methods

show_val :: Var -> Text Source #

ShowVal ControlType Source # 
Instance details

Defined in Derive.ParseTitle

ShowVal Val Source # 
Instance details

Defined in Derive.REnv

Methods

show_val :: Val -> Text Source #

ShowVal Tuning Source # 
Instance details

Defined in Derive.Scale.BaliScales

Methods

show_val :: Tuning -> Text Source #

ShowVal Control Source # 
Instance details

Defined in Derive.ScoreT

ShowVal Instrument Source # 
Instance details

Defined in Derive.ScoreT

ShowVal PControl Source # 
Instance details

Defined in Derive.ScoreT

ShowVal Type Source # 
Instance details

Defined in Derive.ScoreT

Methods

show_val :: Type -> Text Source #

ShowVal DefaultDiatonic Source # 
Instance details

Defined in Derive.Typecheck

ShowVal DefaultReal Source # 
Instance details

Defined in Derive.Typecheck

ShowVal DefaultScore Source # 
Instance details

Defined in Derive.Typecheck

ShowVal Normalized Source # 
Instance details

Defined in Derive.Typecheck

ShowVal NormalizedBipolar Source # 
Instance details

Defined in Derive.Typecheck

ShowVal FreeCodePosition Source # 
Instance details

Defined in Perform.Lilypond.Constants

ShowVal Key Source # 
Instance details

Defined in Perform.Pitch

Methods

show_val :: Key -> Text Source #

ShowVal NoteNumber Source # 
Instance details

Defined in Perform.Pitch

ShowVal Pitch Source #

This relies on the presence of a pitch val call.

Instance details

Defined in Perform.Pitch

Methods

show_val :: Pitch -> Text Source #

ShowVal Transpose Source # 
Instance details

Defined in Perform.Pitch

ShowVal RealTime Source # 
Instance details

Defined in Perform.RealTime

ShowVal Highlight Source # 
Instance details

Defined in Derive.C.Prelude.Highlight

ShowVal Rank Source # 
Instance details

Defined in Derive.Typecheck

Methods

show_val :: Rank -> Text Source #

ShowVal ScoreTime Source # 
Instance details

Defined in Ui.ScoreTime

ShowVal Text Source #

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

Defined in Derive.ShowVal

Methods

show_val :: Bool -> Text Source #

ShowVal Double Source # 
Instance details

Defined in Derive.ShowVal

Methods

show_val :: Double -> Text Source #

ShowVal Int Source # 
Instance details

Defined in Derive.ShowVal

Methods

show_val :: Int -> Text Source #

ShowVal (Ratio.Ratio Int) Source # 
Instance details

Defined in Derive.ShowVal

ShowVal a => ShowVal (Set a) Source # 
Instance details

Defined in Derive.ShowVal

Methods

show_val :: Set a -> Text Source #

ShowVal (Position CodePosition) Source # 
Instance details

Defined in Derive.Call.Ly

ShowVal (RawPitch a) Source #

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

Instance details

Defined in Derive.DeriveT

Methods

show_val :: RawPitch a -> Text Source #

ShowVal (Call Val) Source # 
Instance details

Defined in Derive.DeriveT

Methods

show_val :: Call Val -> Text Source #

ShowVal (Call MiniVal) Source # 
Instance details

Defined in Derive.Expr

ShowVal (Call Text) Source # 
Instance details

Defined in Derive.Expr

Methods

show_val :: Call Text -> Text Source #

ShowVal (Expr Val) Source # 
Instance details

Defined in Derive.DeriveT

Methods

show_val :: Expr Val -> Text Source #

ShowVal (Expr MiniVal) Source # 
Instance details

Defined in Derive.Expr

ShowVal (Expr Text) Source # 
Instance details

Defined in Derive.Expr

Methods

show_val :: Expr Text -> Text Source #

ShowVal (Term Val) Source # 
Instance details

Defined in Derive.DeriveT

Methods

show_val :: Term Val -> Text Source #

ShowVal (Term MiniVal) Source # 
Instance details

Defined in Derive.Expr

ShowVal (Term Text) Source # 
Instance details

Defined in Derive.Expr

Methods

show_val :: Term Text -> Text Source #

ShowVal (Typed Control) Source # 
Instance details

Defined in Derive.ScoreT

ShowVal (Typed Control) Source # 
Instance details

Defined in Derive.DeriveT

ShowVal (Typed Y) Source # 
Instance details

Defined in Derive.ScoreT

Methods

show_val :: Typed Y -> Text Source #

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

Defined in Derive.Typecheck

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

Defined in Derive.Typecheck

Methods

show_val :: Positive a -> Text Source #

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

Defined in Derive.ShowVal

Methods

show_val :: Maybe a -> Text Source #

ShowVal a => ShowVal [a] Source # 
Instance details

Defined in Derive.ShowVal

Methods

show_val :: [a] -> Text Source #

(ShowVal a, ShowVal b) => ShowVal (Either a b) Source # 
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.