|
definition: |
replaceNonIdChars :: String -> String -> String -> String
replaceNonIdChars pfxNonOp pfxOp str = case strings of
[] -> error "replaceNonIdChars: empty identifier"
[s] -> if isAlphaNum (head str)
then pfxNonOp ++ s
else pfxOp ++ s
_ -> pfxOp ++ intercalate "_" strings
where strings = separateAndReplace isIdentChar showOpChar str
isIdentChar c = isAlphaNum c || c == '_' || c == '\''
|
|
demand: |
no demanded arguments |
|
deterministic: |
deterministic operation |
|
documentation: |
| replaces characters that are not valid haskell identifiers, | if there were no characters replaced, the first prefix, | otherwise the snd prefix ist prepended |
|
failfree: |
(_, _, {:})
|
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{(_,_,_) |-> _}
|
|
name: |
replaceNonIdChars |
|
precedence: |
no precedence defined |
|
result-values: |
_ |
|
signature: |
String -> String -> String -> String |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
possibly non-terminating |
|
totally-defined: |
possibly non-reducible on same data term |