[darcs-users] darcs patch: do not use concatenation in src/Context.hs

Trent W. Buck trentbuck at gmail.com
Thu Jan 8 01:00:28 UTC 2009


Eric Kow <kowey at darcs.net> writes:

> Content-Description: A darcs patch for your repository!
>> +  putStrLn $ varname ++ " =\"" ++ concatMap escape ls ++ "\""
>> +    where
>> +      escape '\n' = "\\n\\\n\\"
>> +      escape '"'  = "\\\""
>> +      escape '\\' = "\\\\"
>> +      escape c = [c]
>
> All those backslashes confuse me, although I (think I) get the idea
> that you're trying to doubly-protect them, once for this code and once
> for the generated code.

Would (show) or (show . show) help here?



More information about the darcs-users mailing list