Logs: freenode/#haskell
| 2020-11-25 23:58:16 | <koz_> | int-e: Yeah, that too. |
| 2020-11-25 23:58:47 | × | alp quits (~alp@2a01:e0a:58b:4920:3dd7:733:8dcb:bbbc) (Ping timeout: 272 seconds) |
| 2020-11-26 00:01:20 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-11-26 00:02:12 | <ezzieyguywuf> | in megaparsec, how do I consume all the rest of the input and capture the values, rather than dumping them like eof does? |
| 2020-11-26 00:03:06 | → | boxscape joins (54a35f37@gateway/web/cgi-irc/kiwiirc.com/ip.84.163.95.55) |
| 2020-11-26 00:03:15 | <koz_> | ezzieyguywuf: takeRest? |
| 2020-11-26 00:03:55 | <ezzieyguywuf> | koz_: perfect thank you! |
| 2020-11-26 00:04:02 | <koz_> | ezzieyguywuf: No worries. |
| 2020-11-26 00:04:13 | × | gehmehgeh_ quits (~ircuser1@gateway/tor-sasl/gehmehgeh) (Quit: Leaving) |
| 2020-11-26 00:04:42 | × | cosimone quits (~cosimone@2001:b07:ae5:db26:d849:743b:370b:b3cd) (Ping timeout: 260 seconds) |
| 2020-11-26 00:04:57 | <int-e> | koz_: https://github.com/haskell/bytestring/commit/130906ef928f9761978dd7d13bd4b3082badd1b1 |
| 2020-11-26 00:06:05 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
| 2020-11-26 00:06:48 | <int-e> | (I thought I remembered that it was defined as a list originally... and now confirmed it.) |
| 2020-11-26 00:09:33 | × | frdg quits (~nick@pool-71-184-143-249.bstnma.fios.verizon.net) (Quit: Leaving.) |
| 2020-11-26 00:12:53 | × | sand_dull quits (~theuser@c-73-149-95-105.hsd1.ct.comcast.net) (Ping timeout: 260 seconds) |
| 2020-11-26 00:13:25 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-11-26 00:13:37 | × | elfets quits (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) (Quit: Leaving) |
| 2020-11-26 00:14:08 | <ezzieyguywuf> | another megaparsec question (please be gentle y'all, I'm pretty new :-P) - how do I parse a single character, but ANY character, not a particular? I'm trying to parse exactly 16 characters, but `replicate 16 char` won't do it b/c char is `Token s -> m (Token s)` |
| 2020-11-26 00:14:42 | <koz_> | anyChar? |
| 2020-11-26 00:14:58 | <ezzieyguywuf> | koz_: hrm, I thought maybe printChar. Where do you see anyChar? |
| 2020-11-26 00:15:13 | <koz_> | One sec. |
| 2020-11-26 00:15:44 | <koz_> | anySingle |
| 2020-11-26 00:16:02 | <koz_> | (which is just a fancy way of saying 'satisfy (const True)') |
| 2020-11-26 00:16:16 | × | Gurkenglas quits (~Gurkengla@unaffiliated/gurkenglas) (Ping timeout: 240 seconds) |
| 2020-11-26 00:16:44 | <ezzieyguywuf> | koz_: ah hah, yes this makes sense. thank you. |
| 2020-11-26 00:17:32 | → | royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
| 2020-11-26 00:22:13 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 260 seconds) |
| 2020-11-26 00:30:03 | → | olligobber joins (olligobber@gateway/vpn/privateinternetaccess/olligobber) |
| 2020-11-26 00:33:18 | × | sondr3 quits (~sondr3@cm-84.211.56.132.getinternet.no) (Quit: Leaving) |
| 2020-11-26 00:35:12 | × | Entertainment quits (~entertain@104.246.132.210) (Ping timeout: 256 seconds) |
| 2020-11-26 00:35:35 | → | da39a3ee5e6b4b0d joins (~da39a3ee5@2403:6200:8876:7ef3:bc9a:f509:3193:e14d) |
| 2020-11-26 00:39:13 | × | andos quits (~dan@69-165-210-185.cable.teksavvy.com) (Ping timeout: 264 seconds) |
| 2020-11-26 00:41:49 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-11-26 00:43:16 | × | hnOsmium0001 quits (uid453710@gateway/web/irccloud.com/x-sigyjgyywexrisfj) (Quit: Connection closed for inactivity) |
| 2020-11-26 00:44:05 | × | Chi1thangoo quits (~Chi1thang@87.112.60.168) (Ping timeout: 240 seconds) |
| 2020-11-26 00:44:47 | <ezzieyguywuf> | hrm, I have a `parseEnd :: Parser Text` that parses some characters at the end of the input. I want everything leading up to this - it seems like `takeWhile` is the tool for the job, but I'm unsure how to combine this with `parseEnd`. I was thinking maybe `lookahead`, but this does not return a bool so can't be used as the predicate |
| 2020-11-26 00:45:30 | × | mikolaj quits (~mikon@duch.mimuw.edu.pl) (Quit: leaving) |
| 2020-11-26 00:46:27 | <ezzieyguywuf> | I'm trying to do the equivalent of the following in a regexp: ^(.*)SOMESTATICTEXT$ |
| 2020-11-26 00:46:39 | <koz_> | That's ambiguous. |
| 2020-11-26 00:46:49 | <ezzieyguywuf> | koz_: how so? |
| 2020-11-26 00:46:57 | × | mikolaj_ quits (~mikolaj@purple.well-typed.com) (Quit: leaving) |
| 2020-11-26 00:47:10 | <koz_> | The first part could be anything, right? |
| 2020-11-26 00:47:15 | <ezzieyguywuf> | correct |
| 2020-11-26 00:47:18 | <koz_> | (including nothing at all) |
| 2020-11-26 00:47:25 | × | christo quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 2020-11-26 00:47:49 | <koz_> | lookahead won't help here because you don't know how much you have to read. |
| 2020-11-26 00:47:52 | <ezzieyguywuf> | hrm, I guess really it's more like "^(.+)SOMESTATICTEXT$" |
| 2020-11-26 00:48:12 | <koz_> | Ah, so you know there'll be _something_ prior to SOMESTATICTEXT? |
| 2020-11-26 00:48:18 | <ezzieyguywuf> | I guess I can just read till the end of line then subtract the static text |
| 2020-11-26 00:48:22 | <ezzieyguywuf> | koz_: correct. |
| 2020-11-26 00:48:38 | <koz_> | Hmm. |
| 2020-11-26 00:49:05 | <monochrom> | I wonder if it's manyTill (string "SOMESTATICTEXT\n") |
| 2020-11-26 00:49:19 | <ezzieyguywuf> | monochrom: manyTill sounds promising, let me check that out |
| 2020-11-26 00:49:56 | <ezzieyguywuf> | hrm, is that from attoparsec? |
| 2020-11-26 00:49:59 | <monochrom> | But generally, most parser combinator libraries are designed for positively specified grammars, not negatively specified "anything except this". |
| 2020-11-26 00:50:01 | <ezzieyguywuf> | can I still use it in megaparsec? |
| 2020-11-26 00:50:31 | <monochrom> | I don't actually know megaparsec. I just assume if it's in parsec then it's in megaparsec. |
| 2020-11-26 00:50:35 | <ezzieyguywuf> | monochrom: hrm, if that's the case then option (b) should be fine, i.e. use the parsing library to get "everything else" and then I can post-process by taking off the static text at the end |
| 2020-11-26 00:50:58 | <koz_> | ezzieyguywuf: If you are parsing Text, stripSuffix might prove helpful. |
| 2020-11-26 00:51:10 | <ezzieyguywuf> | koz_: yea, I am doing it as Text |
| 2020-11-26 00:51:11 | <monochrom> | The exception (pun!) is those few parser combinator libraries that are built for nondeterminism and ambiguous grammars. |
| 2020-11-26 00:51:43 | <ezzieyguywuf> | this is non-deterministic, I'm parsing the "Description" field from my bank statements, lol. |
| 2020-11-26 00:52:01 | × | Ariakenom__ quits (~Ariakenom@h-98-128-229-104.NA.cust.bahnhof.se) (Read error: Connection reset by peer) |
| 2020-11-26 00:52:16 | <monochrom> | but parsec, megaparsec, and a lot of others are designed for determinism. |
| 2020-11-26 00:52:25 | → | Ariakenom__ joins (~Ariakenom@h-98-128-229-104.NA.cust.bahnhof.se) |
| 2020-11-26 00:52:42 | → | comerijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-11-26 00:52:48 | <ezzieyguywuf> | hrm. well I seem to be doing ok so far.... |
| 2020-11-26 00:52:53 | <ezzieyguywuf> | 🤷 |
| 2020-11-26 00:52:58 | → | zariuq joins (~zar@fw1.ciirc.cvut.cz) |
| 2020-11-26 00:53:10 | <ezzieyguywuf> | I was going to use regexp, then someone was like "I usually just use a parser" |
| 2020-11-26 00:53:10 | <ezzieyguywuf> | lol |
| 2020-11-26 00:53:17 | × | xsarnik0 quits (xsarnik@gateway/shell/fi.muni.cz/x-nywghooskhwzuxkn) (Quit: Ping timeout (120 seconds)) |
| 2020-11-26 00:53:17 | × | Jajik quits (xchlup2@gateway/shell/fi.muni.cz/x-gntccaugnuwouyau) (Quit: Ping timeout (120 seconds)) |
| 2020-11-26 00:53:36 | × | dequbed quits (~dequbed@yanduxian.paranoidlabs.org) (Ping timeout: 240 seconds) |
| 2020-11-26 00:54:06 | → | dequbed joins (~dequbed@yanduxian.paranoidlabs.org) |
| 2020-11-26 00:54:25 | <monochrom> | Well, I guess things like manyTill can help. |
| 2020-11-26 00:54:44 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2020-11-26 00:55:16 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
| 2020-11-26 00:55:18 | × | hidedagger quits (~nate@unaffiliated/hidedagger) (Quit: WeeChat 2.9) |
| 2020-11-26 00:55:41 | <ski> | @quote Japsu regex |
| 2020-11-26 00:55:41 | <lambdabot> | Japsu says: iä iä, regex fhtagn |
| 2020-11-26 00:55:45 | <monochrom> | regex makes it look easy because every regex engine goes out of its way to implement nondeterminism by heavy backtracking or heaving compiling NFA to DFA. |
| 2020-11-26 00:55:53 | × | zebrag quits (~inkbottle@alagny-551-1-20-27.w83-200.abo.wanadoo.fr) (Quit: Konversation terminated!) |
| 2020-11-26 00:55:55 | <monochrom> | s/heaving/heavy/ |
| 2020-11-26 00:56:02 | → | xsarnik0 joins (xsarnik@gateway/shell/fi.muni.cz/x-rkntrcrlbmfefbac) |
| 2020-11-26 00:56:56 | × | zargoertzel quits (~zar@fw1.ciirc.cvut.cz) (Ping timeout: 240 seconds) |
| 2020-11-26 00:57:31 | <monochrom> | What I want you to notice that CFG tools seldom make this easy. It is not just our community. yacc also makes you explicitly enumerate what you allow, not what you don't allow. |
| 2020-11-26 00:57:39 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 2020-11-26 00:58:01 | × | da39a3ee5e6b4b0d quits (~da39a3ee5@2403:6200:8876:7ef3:bc9a:f509:3193:e14d) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2020-11-26 00:58:12 | <monochrom> | Hell, yacc is strongly anti-nondeterminism. |
| 2020-11-26 00:59:16 | → | zebrag joins (~inkbottle@alagny-551-1-20-27.w83-200.abo.wanadoo.fr) |
| 2020-11-26 00:59:23 | → | erisco_ joins (~erisco@208.98.222.65) |
| 2020-11-26 00:59:24 | <ski> | having better support for intersection, difference, division/derivative could be interesting |
| 2020-11-26 00:59:34 | <monochrom> | Negative specification comes into this equation because in the regex .*ABC, the .* part no longer means "anything", it now means "anything except ABC" |
| 2020-11-26 00:59:36 | → | jedws joins (~jedws@101.184.150.93) |
| 2020-11-26 01:01:12 | × | hyperisco quits (~hyperisco@d192-186-117-226.static.comm.cgocable.net) (Ping timeout: 256 seconds) |
| 2020-11-26 01:01:12 | × | conal_ quits (~conal@64.71.133.70) (Read error: Connection reset by peer) |
| 2020-11-26 01:01:21 | → | pfurla joins (~pfurla@ool-182ed2e2.dyn.optonline.net) |
| 2020-11-26 01:01:31 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-11-26 01:02:24 | × | Guest10117 quits (~vollenwei@4e69b241.skybroadband.com) (Ping timeout: 256 seconds) |
All times are in UTC.