Newest at the top
| 2026-04-06 21:55:25 +0000 | <mauke> | https://tio.run/##y0gszk7Nyfn/PzO3IL@oRMElsSRRzzkjsUhBI78oRZOLKzcxM0/BykrB019BQxPCs1VIyedSAIJiBRtdhfTUEp/MvFSwQEFRZl6JgkZuYoECULdCseb//@bGMYZGBqaWRjFqRjYxhsbGRuamAA |
| 2026-04-06 21:54:11 +0000 | <c_wraith> | Here's the question you need to answer: Do you have a String that you want to represent at run time, or a String literal that you want to embed in the source code? |
| 2026-04-06 21:52:38 +0000 | <c_wraith> | Haskell chose a common convention, going back at least as far as C, to use \ as the escape character indicating that something special is going on. |
| 2026-04-06 21:52:34 +0000 | <mauke> | we're talking about Haskell source code. that's not input |
| 2026-04-06 21:52:18 +0000 | <_JusSx_> | the input is given. i can't change it |
| 2026-04-06 21:52:02 +0000 | target_i | (~target_i@user/target-i/x-6023099) (Quit: leaving) |
| 2026-04-06 21:51:49 +0000 | <lambdabot> | True |
| 2026-04-06 21:51:48 +0000 | <mauke> | > '\n' == chr 10 |
| 2026-04-06 21:51:33 +0000 | <c_wraith> | Because literals are embedded in a larger document, they can't be totally freeform. |
| 2026-04-06 21:51:14 +0000 | <c_wraith> | String literals are source code. A String value exist when the program is running. |
| 2026-04-06 21:51:12 +0000 | <mauke> | that's a single character, not a two-character sequence |
| 2026-04-06 21:51:07 +0000 | <_JusSx_> | so the func will never find a \ |
| 2026-04-06 21:50:59 +0000 | <lambdabot> | 1 |
| 2026-04-06 21:50:57 +0000 | <mauke> | > length "\n" |
| 2026-04-06 21:50:40 +0000 | <mauke> | you don't have a \ |
| 2026-04-06 21:50:30 +0000 | <mauke> | no |
| 2026-04-06 21:50:27 +0000 | merijn | (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds) |
| 2026-04-06 21:50:24 +0000 | <_JusSx_> | so i need to code a func that put a `\' when it find \ |
| 2026-04-06 21:50:08 +0000 | <TMA> | jreicher: that being said, those languages might not need an OS or rather they ARE the OS like Lisp Machine Lisp or Sinclair BASIC |
| 2026-04-06 21:48:47 +0000 | <mauke> | _JusSx_: you need to write \\ to get a single \ character in a string |
| 2026-04-06 21:47:43 +0000 | <TMA> | jreicher: I know. I did even write an OS as an assignment in a course. |
| 2026-04-06 21:47:38 +0000 | divlamir_ | divlamir |
| 2026-04-06 21:47:38 +0000 | divlamir | (~divlamir@user/divlamir) (Ping timeout: 252 seconds) |
| 2026-04-06 21:46:13 +0000 | merijn | (~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn |
| 2026-04-06 21:46:10 +0000 | divlamir_ | (~divlamir@user/divlamir) divlamir |
| 2026-04-06 21:43:01 +0000 | <c_wraith> | You could do something with a fancy quasiquoter to get closer to raw strings, but they still need some sort of delimiter. Probably the easiest answer is to move those strings outside of source. Put them in a separate text file, so they're never treated as Haskell source. |
| 2026-04-06 21:40:22 +0000 | <c_wraith> | string literals have escape sequences. But that's a property of string literals in source, not strings themselves. |
| 2026-04-06 21:40:06 +0000 | jmcantrell_ | (~weechat@user/jmcantrell) (Ping timeout: 246 seconds) |
| 2026-04-06 21:39:51 +0000 | <c_wraith> | Ah. The issue you're running into, then, is that string literals are not raw |
| 2026-04-06 21:39:33 +0000 | <_JusSx_> | \ should be \ |
| 2026-04-06 21:39:21 +0000 | <_JusSx_> | \ is \ |
| 2026-04-06 21:39:15 +0000 | <_JusSx_> | i need to conver every single char in the string in ASCII |
| 2026-04-06 21:38:34 +0000 | <c_wraith> | are you asking how to convert them to a sequence of bytes? |
| 2026-04-06 21:38:21 +0000 | <_JusSx_> | ok. i agree |
| 2026-04-06 21:37:27 +0000 | <c_wraith> | so... yeah, there are strings that aren't lists of ascii codes |
| 2026-04-06 21:37:12 +0000 | <c_wraith> | Char isn't limited to ascii |
| 2026-04-06 21:36:19 +0000 | divlamir_ | divlamir |
| 2026-04-06 21:36:19 +0000 | divlamir | (~divlamir@user/divlamir) (Ping timeout: 264 seconds) |
| 2026-04-06 21:35:46 +0000 | <_JusSx_> | https://paste.tomsmeding.com/iCzVXqjD |
| 2026-04-06 21:35:37 +0000 | merijn | (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds) |
| 2026-04-06 21:34:16 +0000 | divlamir_ | (~divlamir@user/divlamir) divlamir |
| 2026-04-06 21:33:47 +0000 | gues34132 | _JusSx_ |
| 2026-04-06 21:33:32 +0000 | <gues34132> | but i got the number after \ |
| 2026-04-06 21:33:11 +0000 | <gues34132> | if in string there is '\xxxx' where xxxx is a number I dont get the ASCII code of \ and of every single digit |
| 2026-04-06 21:32:07 +0000 | <gues34132> | Hi how do I get the ASCII code for CHAR? look at https://pastebin.com/5XQd7A0h |
| 2026-04-06 21:30:51 +0000 | merijn | (~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn |
| 2026-04-06 21:29:49 +0000 | jmcantrell_ | (~weechat@user/jmcantrell) jmcantrell |
| 2026-04-06 21:29:22 +0000 | gues34132 | (~username@78.211.138.170) |
| 2026-04-06 21:09:52 +0000 | pavonia | (~user@user/siracusa) siracusa |
| 2026-04-06 21:03:42 +0000 | poscat | (~poscat@user/poscat) poscat |