Logs: freenode/#haskell
| 2020-11-23 11:27:20 | <cads> | maerwald, thanks! I did not know that I could fork a gist. But I do now, and I'm not ashamed :) |
| 2020-11-23 11:28:18 | → | LKoen joins (~LKoen@169.244.88.92.rev.sfr.net) |
| 2020-11-23 11:28:51 | × | phaul quits (~phaul@ruby/staff/phaul) (Ping timeout: 260 seconds) |
| 2020-11-23 11:29:44 | → | Tops2 joins (~Tobias@dyndsl-095-033-021-036.ewe-ip-backbone.de) |
| 2020-11-23 11:33:59 | × | Martinsos quits (~user@cpe-188-129-116-164.dynamic.amis.hr) (Remote host closed the connection) |
| 2020-11-23 11:36:48 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds) |
| 2020-11-23 11:38:00 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-11-23 11:38:32 | → | thc202 joins (~thc202@unaffiliated/thc202) |
| 2020-11-23 11:41:21 | → | phaul joins (~phaul@ruby/staff/phaul) |
| 2020-11-23 11:46:12 | × | oleks quits (~oleks@188.166.34.97) (Remote host closed the connection) |
| 2020-11-23 11:46:13 | → | gehmehgeh joins (~ircuser1@gateway/tor-sasl/gehmehgeh) |
| 2020-11-23 11:46:28 | × | Guest42 quits (56ca6780@gateway/web/cgi-irc/kiwiirc.com/ip.86.202.103.128) (Quit: Connection closed) |
| 2020-11-23 11:47:00 | → | klixto joins (~klixto@49.188.65.219) |
| 2020-11-23 11:47:43 | → | enoq joins (~textual@194-208-146-143.lampert.tv) |
| 2020-11-23 11:47:55 | × | SanchayanM quits (~Sanchayan@171.76.82.54) (Quit: SanchayanM) |
| 2020-11-23 11:49:53 | → | cosimone joins (~user@2001:b07:ae5:db26:d849:743b:370b:b3cd) |
| 2020-11-23 11:51:14 | → | SanchayanMaity joins (~Sanchayan@171.76.82.54) |
| 2020-11-23 11:52:43 | → | _ht joins (~huub@82-169-194-8.biz.kpn.net) |
| 2020-11-23 11:53:01 | × | phaul quits (~phaul@ruby/staff/phaul) (Ping timeout: 264 seconds) |
| 2020-11-23 11:53:09 | × | klixto quits (~klixto@49.188.65.219) (Quit: WeeChat 2.9) |
| 2020-11-23 11:53:32 | × | SanchayanMaity quits (~Sanchayan@171.76.82.54) (Client Quit) |
| 2020-11-23 11:53:37 | × | _ht quits (~huub@82-169-194-8.biz.kpn.net) (Client Quit) |
| 2020-11-23 11:57:01 | × | alp quits (~alp@2a01:e0a:58b:4920:21cf:ab8e:85fd:bb5c) (Ping timeout: 272 seconds) |
| 2020-11-23 11:58:58 | → | wonko7 joins (~wonko7@2a01:e35:2ffb:7040:55f1:c3a3:cdbe:bf52) |
| 2020-11-23 12:01:23 | × | sord937 quits (~sord937@gateway/tor-sasl/sord937) (Ping timeout: 240 seconds) |
| 2020-11-23 12:03:13 | → | sord937 joins (~sord937@gateway/tor-sasl/sord937) |
| 2020-11-23 12:04:16 | → | boxscape33 joins (54a35f37@gateway/web/cgi-irc/kiwiirc.com/ip.84.163.95.55) |
| 2020-11-23 12:05:26 | → | phaul joins (~phaul@ruby/staff/phaul) |
| 2020-11-23 12:07:02 | × | chaosmasttter quits (~chaosmast@p200300c4a72cf80165f6d709b523305b.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 2020-11-23 12:07:08 | × | boxscape quits (86ab2d68@gateway/web/cgi-irc/kiwiirc.com/ip.134.171.45.104) (Ping timeout: 246 seconds) |
| 2020-11-23 12:08:20 | → | sondr3 joins (~sondr3@cm-84.211.56.132.getinternet.no) |
| 2020-11-23 12:10:41 | → | geowiesnot joins (~user@87-89-181-157.abo.bbox.fr) |
| 2020-11-23 12:10:49 | <sondr3> | when writing parsers in Haskell where parsing depends on a sequence you parsec earlier on is there a way to avoid using state? The parser has a 'boundary' that is the end of a multiline string that you find in the beginning of parsing |
| 2020-11-23 12:11:21 | × | statusfailed quits (~statusfai@statusfailed.com) (Quit: leaving) |
| 2020-11-23 12:13:45 | × | Stanley00 quits (~stanley00@unaffiliated/stanley00) (Remote host closed the connection) |
| 2020-11-23 12:13:53 | → | statusfailed joins (~statusfai@statusfailed.com) |
| 2020-11-23 12:14:38 | → | Entertainment joins (~entertain@104.246.132.210) |
| 2020-11-23 12:16:09 | <tomsmeding> | that's what monadic parsing is for, right? |
| 2020-11-23 12:16:28 | × | geowiesnot quits (~user@87-89-181-157.abo.bbox.fr) (Ping timeout: 256 seconds) |
| 2020-11-23 12:16:43 | <tomsmeding> | do { sep <- choice [string "'", string "\""] ; body <- parseMultilineBody sep ; string sep ; return body } |
| 2020-11-23 12:16:54 | → | alp joins (~alp@2a01:e0a:58b:4920:e13d:1293:cf10:eb67) |
| 2020-11-23 12:17:05 | <tomsmeding> | of course changed to your particular situation sondr3 |
| 2020-11-23 12:17:31 | <tomsmeding> | your state is on the call stack, sort of |
| 2020-11-23 12:18:17 | <tomsmeding> | now, if you'd need to know which separator was used in a completely different part of the thing you're parsing, then you probably need some kind of state |
| 2020-11-23 12:19:22 | × | cosimone quits (~user@2001:b07:ae5:db26:d849:743b:370b:b3cd) (Quit: ERC (IRC client for Emacs 27.1)) |
| 2020-11-23 12:20:13 | <sondr3> | Yeah, the separator is shared between many entries when parsing where each entries separator must be an exact match to the first found separator |
| 2020-11-23 12:22:43 | → | Iceland_jack joins (~user@31.124.48.169) |
| 2020-11-23 12:22:49 | <tomsmeding> | is that only within the actual multiline string you're parsing? If so, can you not somehow write that parseMultilineBody function? |
| 2020-11-23 12:22:57 | <tomsmeding> | note that it gets the used separator as an argument sondr3 |
| 2020-11-23 12:24:24 | <sondr3> | The spec says that the content is "any sequence of characters that neither begins with boundary nor NEWLINE boundary", I've been able to make a parser with state where it works |
| 2020-11-23 12:24:39 | <sondr3> | But it feels kinda icky and I |
| 2020-11-23 12:24:57 | <sondr3> | new keyboard, bear with me x) |
| 2020-11-23 12:25:30 | → | oleks joins (~oleks@188.166.34.97) |
| 2020-11-23 12:25:30 | × | oleks quits (~oleks@188.166.34.97) (Client Quit) |
| 2020-11-23 12:25:36 | <sondr3> | *and I can't get hspec-megaparsec to agree with me when using ParsecT and not just Parsec |
| 2020-11-23 12:27:20 | → | chaosmasttter joins (~chaosmast@p200300c4a72cf80165f6d709b523305b.dip0.t-ipconnect.de) |
| 2020-11-23 12:28:01 | × | tabemann quits (~tabemann@172-13-49-137.lightspeed.milwwi.sbcglobal.net) (Remote host closed the connection) |
| 2020-11-23 12:30:47 | → | tabemann joins (~tabemann@172-13-49-137.lightspeed.milwwi.sbcglobal.net) |
| 2020-11-23 12:31:48 | → | danza joins (~francesco@151.74.104.171) |
| 2020-11-23 12:32:57 | → | sheb joins (~Thunderbi@77.244.36.161) |
| 2020-11-23 12:33:01 | <tomsmeding> | sondr3: which spec? |
| 2020-11-23 12:33:29 | <Iceland_jack> | :t curr |
| 2020-11-23 12:33:30 | <lambdabot> | error: |
| 2020-11-23 12:33:30 | <lambdabot> | • Variable not in scope: curr |
| 2020-11-23 12:33:30 | <lambdabot> | • Perhaps you meant ‘curry’ (imported from Data.Tuple) |
| 2020-11-23 12:33:31 | <Iceland_jack> | :t curry |
| 2020-11-23 12:33:32 | <lambdabot> | ((a, b) -> c) -> a -> b -> c |
| 2020-11-23 12:33:43 | <Iceland_jack> | curry :: ((a, b) -> c) |
| 2020-11-23 12:33:43 | <Iceland_jack> | -> (a -> b -> c) |
| 2020-11-23 12:33:57 | <tomsmeding> | neat, isn't it? |
| 2020-11-23 12:34:10 | ← | sheb parts (~Thunderbi@77.244.36.161) () |
| 2020-11-23 12:34:15 | <sondr3> | tomsmeding: https://github.com/google/hrx, looked like a simple and useful thing to use when learning parsing in Haskell, it's just the boundary stuff that's tripping me up |
| 2020-11-23 12:35:03 | <tomsmeding> | sondr3: can't you do this recursively? |
| 2020-11-23 12:35:22 | × | Franciman quits (~francesco@host-82-54-193-143.retail.telecomitalia.it) (Quit: Leaving) |
| 2020-11-23 12:35:54 | <sondr3> | tomsmeding: the thought have struck me, yeah |
| 2020-11-23 12:37:42 | → | sheb joins (~Thunderbi@77.244.36.161) |
| 2020-11-23 12:37:55 | × | NieDzejkob quits (~quassel@188.123.215.55) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 2020-11-23 12:38:38 | <sondr3> | I'll try doing it recursively, thanks for being a rubber duck tomsmeding :) |
| 2020-11-23 12:38:57 | <tomsmeding> | or even in a kind of continuation-passing style; parseComponent :: Maybe Boundary -> Parsec HRX ; parseComponent Nothing = parseNewBoundary >>= parseAfterBoundary ; parseComponent (Just bnd) = parseBoundary bnd >> parseAfterBoundary bnd ; parseAfterBoundary :: Boundary -> Parser HRX ; parseAfterBoundary bnd = do { item <- pComment bnd <|> pFile bnd <|> pDirectory bnd ; HRX rest <- parseComponent |
| 2020-11-23 12:38:57 | <tomsmeding> | (Just bnd) ; return HRX (item : rest) } |
| 2020-11-23 12:39:00 | <tomsmeding> | or something like that? |
| 2020-11-23 12:39:06 | → | NieDzejkob joins (~quassel@188.123.215.55) |
| 2020-11-23 12:39:10 | <tomsmeding> | s/ ; /\n/g |
| 2020-11-23 12:39:20 | <tomsmeding> | pseudocode though :p |
| 2020-11-23 12:39:24 | <tomsmeding> | that's CPS-like |
| 2020-11-23 12:40:19 | ← | sheb parts (~Thunderbi@77.244.36.161) () |
| 2020-11-23 12:40:38 | boxscape33 | is now known as boxscape |
| 2020-11-23 12:40:50 | <sondr3> | Looks like Haskell to me :P thanks! |
| 2020-11-23 12:41:08 | <boxscape> | % type TypeOf :: forall t . forall (a :: t) -> *; type family TypeOf t where TypeOf @t a = t |
| 2020-11-23 12:41:08 | <yahb> | boxscape: |
| 2020-11-23 12:41:09 | <boxscape> | % :kind! TypeOf (Just True) |
| 2020-11-23 12:41:09 | <yahb> | boxscape: *; = Maybe Bool |
| 2020-11-23 12:41:12 | <boxscape> | I like that this works |
| 2020-11-23 12:41:28 | <boxscape> | feels almost like using a dynamically typed language in a way |
| 2020-11-23 12:41:44 | → | sheb joins (~Thunderbi@77.244.36.161) |
| 2020-11-23 12:43:35 | <boxscape> | % type TypeOf' :: forall t . t -> *; type family TypeOf' a where TypeOf' @t a = t -- I suppose my kind sig is more complicated than it has to be |
| 2020-11-23 12:43:36 | <yahb> | boxscape: |
| 2020-11-23 12:44:16 | × | danza quits (~francesco@151.74.104.171) (Quit: Leaving) |
| 2020-11-23 12:45:31 | hackage | sr-extra 1.85.1 - Module limbo https://hackage.haskell.org/package/sr-extra-1.85.1 (DavidFox) |
| 2020-11-23 12:46:04 | <boxscape> | % Just True :: TypeOf (Just True) -- :) |
All times are in UTC.