yesodweb/shakespeare — pull request #113 by gbwey (2013-10-04 22:32:50+00:00)
Title: filter out carriage returns for quasiquotes

There is a consistency problem when handling carriage returns across Shakespeare and Shelly.
In windows, 'st' returns \r\n but 'textFile' returns \n.

Shelly.readfile returns \r\n but Data.Text.IO.readFile retuns \n. I will add a pull request for Shelly.

(interpolated-string-perl6 'q' and 'qc' return \n only)

I think most consistent behavior is to just drop the '\r' across the board when reading and leave the writing the way it is. This is consistent with Data.Text.IO readFile writeFile.

https://gist.github.com/gbwey/6833805
from the above gist: this is what we have now:
*Test6> main
120 13 10 121 :st
120 10 121 :interpolated string perl6
120 13 13 10 121 :Shelly.writefile st as abc then Shelly.readfile
120 10 10 121 :T.readFile abc
120 10 10 121 :textFile abc

120 13 10 121 :Shelly.readfile ab
120 10 121 :T.readFile ab
120 10 121 :textFile ab

and after the changes for the two pull requests:

*Test6> main
120 10 121 :st
120 10 121 :interpolated string perl6
120 10 121 :Shelly.writefile st as abc then Shelly.readfile
120 10 121 :T.readFile abc
120 10 121 :textFile abc

120 10 121 :Shelly.readfile ab
120 10 121 :T.readFile ab
120 10 121 :textFile ab