Safe Haskell | Safe-Inferred |
---|
Rewrite character ifdentifiers for UGen.ID
graphs.
- greek_letters :: [(Char, Char, String)]
- type Name_Supply = [Char]
- greek_letters_nm :: Name_Supply
- rewrite :: Name_Supply -> String -> String
- hsc3_id_rewrite :: String -> String
- hsc3_id_clear :: String -> String
- hsc3_id_rewrite_preprocessor :: FilePath -> FilePath -> FilePath -> IO ()
- hsc3_id_rewrite_inplace :: FilePath -> IO ()
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
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
hsc3_id_rewrite "'a','.','a'" == "'α','.','β'"
hsc3_id_clear :: String -> StringSource
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