hsc3-rw-0.14: hsc3 re-writing

Safe HaskellSafe-Inferred

Sound.SC3.RW.ID

Contents

Description

Rewrite character ifdentifiers for UGen.ID graphs.

Synopsis

Greek letters

greek_letters :: [(Char, Char, String)]Source

Table of greek letters (upper-case,lower-case,name).

 length greek_letters == 24
 (['Α' .. 'Ρ'] ++ ['Σ' .. 'Ω']) == map (\(c,_,_) -> c) greek_letters
 (['α' .. 'ρ'] ++ ['σ' .. 'ω']) == map (\(_,c,_) -> c) greek_letters

type Name_Supply = [Char]Source

Indefinite sequence of character identifiers.

greek_letters_nm :: Name_SupplySource

greek_letters as Name_Supply.

 take 4 greek_letters_nm == ['α' .. 'δ']

Rewriters

rewrite :: Name_Supply -> String -> StringSource

Rewrite each haskell letter character literal at string l with values from the character supply s.

 rewrite ['α'..] "'a',' ',foldl','a'" == "'α',' ',foldl','β'"

hsc3_id_rewrite :: String -> StringSource

rewrite greek_letters_nm.

 hsc3_id_rewrite "'a','.','a'" == "'α','.','β'"

hsc3_id_clear :: String -> StringSource

rewrite repeat α.

 hsc3_id_clear "'α','.','β'" == "'α','.','α'"

IO

hsc3_id_rewrite_preprocessor :: FilePath -> FilePath -> FilePath -> IO ()Source

File based (haskell pre-processor) variant of hsc3_id_rewrite.

hsc3_id_rewrite_inplace :: FilePath -> IO ()Source

File based (inplace) variant of hsc3_id_rewrite. Copies file to ~ suffix and replaces initial file.

 let fn = "/home/rohan/sw/hsc3-graphs/gr/resonant-dust.hs"
 in hsc3_id_rewrite_file fn