Florent Becker <[email protected]> writes:

> Trent W. Buck wrote:
>
>> Eric Kow <[email protected]> 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?
>
> I don't think so, the problem is to get the character/string escaped, but
> not surrounded by quotes.

take (n-1) . drop 1 . show? ;-)

_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to