We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents eb48931 + 8b5dd43 commit 43b6eb3Copy full SHA for 43b6eb3
src/Prelude.js
@@ -210,7 +210,20 @@ exports.showNumberImpl = function (n) {
210
};
211
212
exports.showCharImpl = function (c) {
213
- return c === "'" ? "'\\''" : "'" + c + "'";
+ var code = c.charCodeAt(0);
214
+ if (code < 0x20 || code === 0x7F) {
215
+ switch (c) {
216
+ case "\a": return "'\\a'";
217
+ case "\b": return "'\\b'";
218
+ case "\f": return "'\\f'";
219
+ case "\n": return "'\\n'";
220
+ case "\r": return "'\\r'";
221
+ case "\t": return "'\\t'";
222
+ case "\v": return "'\\v'";
223
+ }
224
+ return "'\\" + code.toString(10) + "'";
225
226
+ return c === "'" || c === "\\" ? "'\\" + c + "'" : "'" + c + "'";
227
228
229
exports.showStringImpl = function (s) {
0 commit comments