Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2020-11-25 18:51:28 <jle`> heh, maybe a step in the opposite direction :P
2020-11-25 18:52:37 × borne quits (~fritjof@200116b864509c00394a967dc8ef4e61.dip.versatel-1u1.de) (Ping timeout: 260 seconds)
2020-11-25 18:53:22 alp joins (~alp@2a01:e0a:58b:4920:1429:542f:b729:d210)
2020-11-25 18:55:09 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
2020-11-25 18:55:53 × avdb quits (~avdb@ip-81-11-215-86.dsl.scarlet.be) (Quit: avdb)
2020-11-25 18:56:52 <hyperisco> solonarv, I think the formulation is necessary to consider in its exact form
2020-11-25 18:57:04 pavonia joins (~user@unaffiliated/siracusa)
2020-11-25 18:57:11 <hyperisco> it may be that combining Setters in that way doesn't give you another Setter or something, I don't know
2020-11-25 18:57:16 <hyperisco> there are different types of optics
2020-11-25 18:57:29 Tario joins (~Tario@200.119.185.161)
2020-11-25 18:58:01 justanotheruser joins (~justanoth@unaffiliated/justanotheruser)
2020-11-25 18:58:26 × p0a quits (~user@unaffiliated/p0a) (Quit: bye)
2020-11-25 18:58:41 <solonarv> hyperisco: if you don't want to use the result as a setter then you can just use the Semigroup instance to combine them
2020-11-25 18:58:58 sondr3 joins (~sondr3@cm-84.211.56.132.getinternet.no)
2020-11-25 18:58:59 <hyperisco> I am using a semigroupoid
2020-11-25 18:59:10 <hyperisco> I think your example shows the semigroup is not quite right
2020-11-25 18:59:20 × LKoen quits (~LKoen@169.244.88.92.rev.sfr.net) (Read error: Connection reset by peer)
2020-11-25 18:59:23 <solonarv> no, I literally mean: ("hello", "sailor") ^.. (_1 <> _2)
2020-11-25 18:59:37 <solonarv> my example shows that you don't get a sensible Setter by combining with <>
2020-11-25 18:59:40 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 246 seconds)
2020-11-25 18:59:44 <solonarv> but the resulting Fold does work properly
2020-11-25 18:59:53 × n0042 quits (d055ed89@208.85.237.137) (Remote host closed the connection)
2020-11-25 19:00:02 <hyperisco> I don't know about folds
2020-11-25 19:00:10 <hyperisco> my example was replacing both fst and snd with a value
2020-11-25 19:00:18 <solonarv> yeah, that's a Setter
2020-11-25 19:00:28 <hyperisco> sounds like you disagree though
2020-11-25 19:00:43 LKoen joins (~LKoen@169.244.88.92.rev.sfr.net)
2020-11-25 19:01:17 <hyperisco> and I am guessing it does violate specifically Setter laws
2020-11-25 19:01:38 Ariakenom_ joins (~Ariakenom@h-158-174-186-195.NA.cust.bahnhof.se)
2020-11-25 19:02:51 borne joins (~fritjof@200116b864509c00394a967dc8ef4e61.dip.versatel-1u1.de)
2020-11-25 19:03:34 berberman_ joins (~berberman@unaffiliated/berberman)
2020-11-25 19:03:58 <hyperisco> seems this all falls apart because the machinery for working with optics doesn't have semigroupoid/category instances
2020-11-25 19:04:14 × berberman quits (~berberman@unaffiliated/berberman) (Ping timeout: 264 seconds)
2020-11-25 19:04:58 × Tario quits (~Tario@200.119.185.161) (Read error: Connection reset by peer)
2020-11-25 19:05:04 × Ariakenom quits (~Ariakenom@h-98-128-229-104.NA.cust.bahnhof.se) (Ping timeout: 260 seconds)
2020-11-25 19:05:29 <hyperisco> I dunno it just seems weird that it sounds like the purpose is to do stuff with deep data structures, yet every time I try and use it it ends up seemingly very inefficient
2020-11-25 19:05:41 <hyperisco> I don't get it yet
2020-11-25 19:05:45 × DTZUZU quits (~DTZUZU@207.81.171.116) (Read error: Connection reset by peer)
2020-11-25 19:06:01 coot joins (~coot@37.30.49.253.nat.umts.dynamic.t-mobile.pl)
2020-11-25 19:08:02 chaosmasttter joins (~chaosmast@p200300c4a7107e01f51a90bd3c8201d7.dip0.t-ipconnect.de)
2020-11-25 19:10:36 × Rudd0 quits (~Rudd0@185.189.115.98) (Ping timeout: 240 seconds)
2020-11-25 19:10:40 vfaronov joins (~vfaronov@broadband-95-84-210-78.ip.moscow.rt.ru)
2020-11-25 19:10:59 × vfaronov quits (~vfaronov@broadband-95-84-210-78.ip.moscow.rt.ru) (Client Quit)
2020-11-25 19:11:18 vfaronov joins (~vfaronov@broadband-95-84-210-78.ip.moscow.rt.ru)
2020-11-25 19:11:59 × dequbed quits (~dequbed@yanduxian.paranoidlabs.org) (Quit: Bye o/)
2020-11-25 19:14:57 × LKoen quits (~LKoen@169.244.88.92.rev.sfr.net) (Read error: Connection reset by peer)
2020-11-25 19:15:17 dequbed joins (~dequbed@yanduxian.paranoidlabs.org)
2020-11-25 19:15:40 LKoen joins (~LKoen@169.244.88.92.rev.sfr.net)
2020-11-25 19:16:25 DTZUZU joins (~DTZUZU@207.81.171.116)
2020-11-25 19:16:31 × irc_user quits (uid423822@gateway/web/irccloud.com/x-gwxffkrhmbtyeyhx) (Quit: Connection closed for inactivity)
2020-11-25 19:18:35 × cr3 quits (~cr3@192-222-143-195.qc.cable.ebox.net) (Ping timeout: 256 seconds)
2020-11-25 19:19:14 × geekosaur quits (82659a09@host154-009.vpn.uakron.edu) (Ping timeout: 245 seconds)
2020-11-25 19:21:38 frdg joins (~nick@pool-71-184-143-249.bstnma.fios.verizon.net)
2020-11-25 19:23:26 <ezzieyguywuf> if I have `char 'L'; digitChar; digitChar; digitChar` as part of a megaparsec parser, how can I make the error message say something like "Expecting Lnnn" for a failure on any of the four checks, rather than "Expecting an 'L'", "Expecting a digit" etc. for each?
2020-11-25 19:24:12 <jle`> ezzieyguywuf: does it work if you wrap it and use (...) <?> "Expecting Lnnn" ?
2020-11-25 19:25:09 <ezzieyguywuf> jle`: yes, thanks! though just "<?> "Lnn"" gets it done, megaparsec adds the "Expecting"
2020-11-25 19:25:15 <jle`> nice :O
2020-11-25 19:25:25 <jle`> good ol megaparsec
2020-11-25 19:25:35 <sondr3> I'm back with yet another parsing question, I want to parse a line that can either end with a newline or EOF, but `takeWhileP Nothing notNewline <> eol <|> T.pack <$> someTill anySingle eof` always fail if the input doesn't contain a newline
2020-11-25 19:25:45 × matta quits (~user@24-113-169-116.wavecable.com) (Ping timeout: 240 seconds)
2020-11-25 19:25:51 <ezzieyguywuf> good ol that guy
2020-11-25 19:26:12 × revprez_anzio quits (~revprez_a@pool-108-49-213-40.bstnma.fios.verizon.net) (Ping timeout: 260 seconds)
2020-11-25 19:26:15 <sondr3> I would've expected it to try the second parser when the first failed since it wants to end with `<> eol`
2020-11-25 19:26:49 revprez_anzio joins (~revprez_a@pool-108-49-213-40.bstnma.fios.verizon.net)
2020-11-25 19:27:25 <monochrom> I would think you would have (eol <|> eof) grouped together?
2020-11-25 19:27:30 × Franciman quits (~francesco@host-82-54-193-143.retail.telecomitalia.it) (Ping timeout: 256 seconds)
2020-11-25 19:28:00 <jle`> yeah, i definitely do not know how that is supposed to be parsed
2020-11-25 19:28:19 <jle`> the haskell syntax i mean, not the parser it denotes
2020-11-25 19:28:23 <xerox_> that was in Parsec too
2020-11-25 19:29:45 Franciman joins (~francesco@host-82-54-193-143.retail.telecomitalia.it)
2020-11-25 19:29:56 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2020-11-25 19:30:02 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
2020-11-25 19:30:13 × LKoen quits (~LKoen@169.244.88.92.rev.sfr.net) (Read error: Connection reset by peer)
2020-11-25 19:30:33 <sondr3> monochrom: eof returns `m ()`, and I want to include the newline but only if it exists. I feel like I'm just missing something obvious
2020-11-25 19:30:47 LKoen joins (~LKoen@169.244.88.92.rev.sfr.net)
2020-11-25 19:30:50 <sondr3> So that both `text` and `text\n` are valid
2020-11-25 19:31:02 <jle`> sondr3: where are you expecting the parentheses to be in that?
2020-11-25 19:31:03 × invaser quits (~Thunderbi@31.148.23.125) (Ping timeout: 256 seconds)
2020-11-25 19:31:16 <jle`> (takeWhileP Nothing notNewline) <> (eol <|> T.pack <$> someTill anySingle eof) ?
2020-11-25 19:31:28 Er joins (5fa448e7@95.164.72.231)
2020-11-25 19:31:53 <jle`> or (takeWhileP Nothing notNewline <> eol) <|> (T.pack <$> someTill anySingle eof)
2020-11-25 19:32:00 <monochrom> ((eol *> pure ()) <|> eof)
2020-11-25 19:32:15 <jle`> aka void eol
2020-11-25 19:34:05 × kritzefitz quits (~kritzefit@212.86.56.80) (Ping timeout: 240 seconds)
2020-11-25 19:34:27 <sondr3> But I don't want void eol, I want void eof but include eol :p
2020-11-25 19:34:32 <monochrom> ((eol *> pure "\n") <|> eof *> pure "") for the opposite expectation.
2020-11-25 19:34:59 <monochrom> err, ((eol *> pure "\n") <|> (eof *> pure ""))
2020-11-25 19:35:51 avdb joins (~avdb@ip-81-11-215-86.dsl.scarlet.be)
2020-11-25 19:36:44 <sondr3> monochrom: thanks, the final one was exactly what I wanted
2020-11-25 19:36:47 <monochrom> I hope you have learned a lesson there. That you can always edit and manufacture return values, you are never stuck with what someone returns to you.
2020-11-25 19:37:29 <sondr3> I was about to comment on exactly that, very obvious in hindsight but I've been to focused on only what I can parse
2020-11-25 19:37:46 <sondr3> thanks jle` too :)
2020-11-25 19:38:35 Nahra joins (~Nahra@unaffiliated/nahra)
2020-11-25 19:39:08 × cosimone quits (~cosimone@2001:b07:ae5:db26:d849:743b:370b:b3cd) (Quit: cosimone)
2020-11-25 19:40:13 cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net)
2020-11-25 19:40:14 skiold joins (~skiold@ns378912.ip-5-196-69.eu)
2020-11-25 19:42:38 <dminuoso> solonarv: So I'm not really sure what the semantics of (<>) on the various optics even are.
2020-11-25 19:43:12 jonatanb joins (jonatanb@gateway/vpn/protonvpn/jonatanb)
2020-11-25 19:43:21 <dminuoso> I usually tend to look at optics since its far more constrained and principled, and there you have
2020-11-25 19:43:26 <dminuoso> failing :: (Is k A_Fold, Is l A_Fold) => Optic' k is s a -> Optic' l js s a -> Fold s a

All times are in UTC.