Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→
Page 1 .. 464 465 466 467 468 469 470 471 472 473 474 .. 18001
1,800,047 events total
2021-06-14 22:11:43 <monochrom> We're talking about a speaker who says "THREAT of making yet another parser library"
2021-06-14 22:12:05 <monochrom> Are they delusional or what. Did they forget their meds.
2021-06-14 22:12:36 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:b9b1:9fc2:289f:a533) (Remote host closed the connection)
2021-06-14 22:12:43 xsperry joins (~as@user/xsperry)
2021-06-14 22:12:52 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:b9b1:9fc2:289f:a533)
2021-06-14 22:13:07 <monochrom> Raising a trivial first-world problem of having more or fewer libraries to the level of, like, terrorism.
2021-06-14 22:13:44 × ddellacosta quits (~ddellacos@89.46.62.229) (Ping timeout: 272 seconds)
2021-06-14 22:14:04 <monochrom> It's why I refused to answer their parser question a few days ago.
2021-06-14 22:14:12 <maerwald> unification seems to be a common theme these days
2021-06-14 22:14:22 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 272 seconds)
2021-06-14 22:15:05 <geekosaur> looked to me like they were making so much noise over "can't be monadic" yet one of their requirements seemed to require a monadic parser
2021-06-14 22:16:09 <monochrom> Oh, I wouldn't be surprised if they had two points that logically imply "can't be monoadic" and one point that logically implies "must be monadic".
2021-06-14 22:16:11 × Schrostfutz_ quits (~Schrostfu@p5de88aa6.dip0.t-ipconnect.de) (Ping timeout: 244 seconds)
2021-06-14 22:16:29 <maerwald> maybe they need selective!
2021-06-14 22:16:36 <maerwald> oh, do we have selective parsers?
2021-06-14 22:16:38 <monochrom> I mean what do you expect from someone who spams the word "THREAT" in all caps.
2021-06-14 22:17:09 <monochrom> I think no, but I haven't really checked.
2021-06-14 22:17:14 × bor0 quits (~boro@user/bor0) (Quit: Leaving)
2021-06-14 22:17:17 <maerwald> I admit I have no intuition about what a selective parser looks like
2021-06-14 22:17:18 × chisui quits (~chisui@200116b8662d980089ca00d34d7b3df6.dip.versatel-1u1.de) (Ping timeout: 250 seconds)
2021-06-14 22:18:06 <monochrom> Maybe I can somewhat explain it.
2021-06-14 22:18:40 × Topsi quits (~Tobias@dyndsl-095-033-094-176.ewe-ip-backbone.de) (Read error: Connection reset by peer)
2021-06-14 22:19:09 × awth13 quits (~user@user/awth13) (Remote host closed the connection)
2021-06-14 22:19:10 <monochrom> Suppose you only need to parse for a CFG. And suppose someone has already given you "satisfy :: (Token -> Bool) -> Parser Token" as a given primitive.
2021-06-14 22:19:20 <monochrom> Then you find out that you only need Alternative.
2021-06-14 22:19:23 awth13 joins (~user@user/awth13)
2021-06-14 22:19:42 <monochrom> Furthermore, you find that to implement satisfy, you only need Selective.
2021-06-14 22:22:37 alexeikale joins (~alexeikal@2601:1c2:1b80:100:4ea5:a35a:95ba:fcb1)
2021-06-14 22:23:13 <monochrom> So for example, these days when I teach chainl1 and chainr1 to my students, I show them an implementation that stays within Alternative. (The traditional Hutton version uses MonadPlus, e.g., uses >>=.)
2021-06-14 22:23:43 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:b9b1:9fc2:289f:a533) (Remote host closed the connection)
2021-06-14 22:24:01 <maerwald> right, selective is a way to recover from a parse failure, but it still doesn't allow you to dynamically choose parsers
2021-06-14 22:24:03 <tonyday> Is there a new parser library? I love them - a good way to check on latest technique etc.
2021-06-14 22:26:09 <geekosaur> not yet, at least
2021-06-14 22:26:21 <shachaf> The latest technique: Make your grammar LL(1) and then use any old way of writing a parser.
2021-06-14 22:26:39 <shachaf> The secret parser library authors don't want you to know.
2021-06-14 22:26:41 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:b9b1:9fc2:289f:a533)
2021-06-14 22:27:43 × involans quits (~alex@cpc92718-cmbg20-2-0-cust157.5-4.cable.virginm.net) (Ping timeout: 272 seconds)
2021-06-14 22:27:47 <maerwald> I switched to regex-posix :>
2021-06-14 22:28:04 <maerwald> (and then got memory errors on darwin)
2021-06-14 22:28:13 <monochrom> haha yikes
2021-06-14 22:28:26 <maerwald> or was it windows, I forget
2021-06-14 22:29:42 × haskman quits (~haskman@171.61.149.211) (Quit: Going to sleep. ZZZzzz…)
2021-06-14 22:30:04 <maerwald> ah yeah, windows https://gitlab.haskell.org/ghc/ghc/-/issues/19945
2021-06-14 22:30:18 × tonyday quits (~user@202-65-93-249.ip4.superloop.com) (Remote host closed the connection)
2021-06-14 22:30:37 <maerwald> I remember merijn boasting how easy FFI is in haskell
2021-06-14 22:30:39 <maerwald> yeah... no
2021-06-14 22:31:41 × dhil quits (~dhil@80.208.56.181) (Ping timeout: 244 seconds)
2021-06-14 22:34:19 benin036 joins (~benin@183.82.176.206)
2021-06-14 22:35:34 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-06-14 22:36:08 × nckx quits (~nckx@tobias.gr) (Quit: Updating my Guix System <https://guix.gnu.org>)
2021-06-14 22:38:02 × eL_Bart0 quits (eL_Bart0@dietunichtguten.org) (Quit: Restarting)
2021-06-14 22:38:12 eL_Bart0 joins (eL_Bart0@dietunichtguten.org)
2021-06-14 22:40:37 nckx joins (~nckx@tobias.gr)
2021-06-14 22:42:52 × gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving)
2021-06-14 22:44:02 tonyday joins (~user@202-65-93-249.ip4.superloop.com)
2021-06-14 22:45:11 <janus> how can it be that `catMaybes = [... | Just x <- xs]` works? is it a property of the list comprehension that it skips an element when the pattern fails?
2021-06-14 22:45:15 <janus> or is it something more general?
2021-06-14 22:46:11 econo joins (uid147250@user/econo)
2021-06-14 22:46:13 <geekosaur> the former, when the pattern match fails it appends the empty list to the result instead of the result of the pattern as a singleton list
2021-06-14 22:47:25 <janus> so MonadFail is not involved?
2021-06-14 22:47:25 <geekosaur> if you use the monadic desugaring of list comprehensions, the pattern failing alls fail which is [] in the list monad
2021-06-14 22:48:02 <geekosaur> but that's I think only used when MonadComprehensions is turned on; I don't recall the simpler desugaring it otherwise uses
2021-06-14 22:48:27 <geekosaur> @undo [x | Just x <- xs]
2021-06-14 22:48:27 <lambdabot> concatMap (\ a -> case a of { Just x -> [x]; _ -> []}) xs
2021-06-14 22:48:43 <geekosaur> there you go
2021-06-14 22:48:49 <janus> oh, cool
2021-06-14 22:49:15 × NieDzejkob_ quits (~quassel@195.149.98.3) (Ping timeout: 244 seconds)
2021-06-14 22:49:17 <janus> @undo [(x,y) | (x, Just y) <- xs]
2021-06-14 22:49:17 <lambdabot> concatMap (\ a -> case a of { (x, Just y) -> [(x, y)]; _ -> []}) xs
2021-06-14 22:49:28 <ski> > do Just x <- [Just 0,Nothing,Just 2]; [x]
2021-06-14 22:49:30 <lambdabot> [0,2]
2021-06-14 22:49:40 ddellacosta joins (~ddellacos@86.106.143.21)
2021-06-14 22:49:45 <ski> @undo do Just x <- [Just 0,Nothing,Just 2]; [x]
2021-06-14 22:49:46 <lambdabot> [Just 0, Nothing, Just 2] >>= \ a -> case a of { Just x -> [x]; _ -> fail ""}
2021-06-14 22:50:01 <monochrom> It is up to you which model to use: "it's a rule of list comprehension to skip pattern mismatches", "it is a special case of MonadFail". They give the same prediction, I wouldn't draw a hard line between them.
2021-06-14 22:50:38 <monochrom> That is, unless you ask about possible differences in generated asm code even under -O10^80.
2021-06-14 22:50:47 <janus> don't like it calling fail with an empty string. so i am happy to avoid `fail`
2021-06-14 22:51:05 <ski> @src Maybe fail
2021-06-14 22:51:06 <lambdabot> fail _ = Nothing
2021-06-14 22:51:22 <ski> @src [] fail
2021-06-14 22:51:22 <lambdabot> fail _ = []
2021-06-14 22:51:29 <janus> but what if was another monad? tempting fate
2021-06-14 22:51:49 <hpc> @src IO fail
2021-06-14 22:51:49 <lambdabot> fail s = failIO s
2021-06-14 22:51:49 <monochrom> Sure, if it's another monad, then MonadFail is really invoked.
2021-06-14 22:52:02 × ham quits (~ham4@user/ham) (Read error: Connection reset by peer)
2021-06-14 22:54:13 × ddellacosta quits (~ddellacos@86.106.143.21) (Ping timeout: 244 seconds)
2021-06-14 22:54:38 ham joins (~ham4@user/ham)
2021-06-14 22:55:34 NieDzejkob joins (~quassel@195.149.98.3)
2021-06-14 22:56:17 × MQ-17J quits (~MQ-17J@d14-69-206-129.try.wideopenwest.com) (Read error: Connection reset by peer)
2021-06-14 22:56:44 MQ-17J joins (~MQ-17J@d14-69-206-129.try.wideopenwest.com)
2021-06-14 22:56:48 × hemlock quits (~hemlock@ip72-203-188-10.tu.ok.cox.net) (Ping timeout: 272 seconds)
2021-06-14 22:57:17 × hgolden quits (~hgolden2@cpe-172-114-84-61.socal.res.rr.com) (Remote host closed the connection)
2021-06-14 22:57:41 hemlock joins (~hemlock@2607:fb90:9629:beeb:8fe5:1eb6:ded9:dd19)
2021-06-14 22:57:41 × MQ-17J quits (~MQ-17J@d14-69-206-129.try.wideopenwest.com) (Read error: Connection reset by peer)
2021-06-14 22:58:10 MQ-17J joins (~MQ-17J@d14-69-206-129.try.wideopenwest.com)
2021-06-14 23:02:36 fizbin joins (~fizbin@2601:8a:4080:1280:8c7e:5b3f:79d6:ec26)
2021-06-14 23:02:53 × kayprish quits (~kayprish@cable-188-2-229-172.dynamic.sbb.rs) (Remote host closed the connection)
2021-06-14 23:03:08 × aplainzetakind quits (~johndoe@captainludd.powered.by.lunarbnc.net) (Ping timeout: 272 seconds)
2021-06-14 23:04:07 × Tuplanolla quits (~Tuplanoll@91-159-68-239.elisa-laajakaista.fi) (Quit: Leaving.)

All times are in UTC.