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

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

 # Methods # Methods # Methods # This should be the inverse of p_str and p_unquoted_str. Methods # Methods # Methods # Methods # This relies on the presence of a pitch val call. Methods # Methods # Methods # Methods # Methods # Methods # Methods # Methods # Methods # Methods # Not parseable. Methods # 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. Methods # 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. Methods # 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 # 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 # Methods # Methods # Methods # Methods # Methods # Methods # Methods # Methods # Methods # Methods # Methods # Methods # Methods # Methods # Methods # Methods # Methods # Methods # Methods # Methods # Methods # Methods # Methods # Methods ShowVal a => ShowVal [a] # Methodsshow_val :: [a] -> Text Source # ShowVal a => ShowVal (Maybe a) # Methodsshow_val :: Maybe a -> Text Source # # Methods ShowVal val => ShowVal (Term val) # Methodsshow_val :: Term val -> Text Source # ShowVal val => ShowVal (Call val) # Methodsshow_val :: Call val -> Text Source # ShowVal val => ShowVal (Expr val) # Methodsshow_val :: Expr val -> Text Source # # Pitches have no literal syntax, but I have to print something. Methods # Methods ShowVal a => ShowVal (NonNegative a) # Methods ShowVal a => ShowVal (Positive a) # Methods (ShowVal a, ShowVal b) => ShowVal (Either a b) # Methodsshow_val :: Either a b -> 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.