@DiazCarrete@hachyderm.io avatar

DiazCarrete

@DiazCarrete@hachyderm.io

This profile is from a federated server and may be incomplete. Browse more on the original instance.

DiazCarrete, (edited ) to haskell
@DiazCarrete@hachyderm.io avatar

I know that Megaparsec doesn't backtrack automatically and that you have to use "try" for that, but this behavior of "many" was unexpected. Why oh why doesn't it parse the final space?
https://stackoverflow.com/a/78355045/1364288
Maybe I didn't read the documentation thoroughly, but I don't think it's actually spelled out in the Haddocks?

DiazCarrete,
@DiazCarrete@hachyderm.io avatar

So, if I'm getting this right, parsing failures that consume input are treated differently from parsing failures that don't consume input, and only the latter interact in the expected way with combinators like "many" and "optional"?

DiazCarrete,
@DiazCarrete@hachyderm.io avatar

Ok, the heart of the matter is the Alternative instance on which the "many" and "optional" combinators depend.

As the docs say, "empty is a parser that fails without consuming input". So a parser that fails while consuming input can't be equated to "empty". I guess the moral of the story is that one should almost always use "try" with Alternative-y combinators.

DiazCarrete, to programming
@DiazCarrete@hachyderm.io avatar
DiazCarrete,
@DiazCarrete@hachyderm.io avatar
DiazCarrete, (edited ) to ComputerScience
@DiazCarrete@hachyderm.io avatar
DiazCarrete, to accessibility
@DiazCarrete@hachyderm.io avatar

"ARIA is polyfill for HTML semantics"
https://x.com/SaraSoueidan/status/1791379249045053443

DiazCarrete, to random
@DiazCarrete@hachyderm.io avatar

about defunctionalization: "no need to worry about unspeakable horrors involved in serializing code + runtime closures"

https://discourse.haskell.org/t/serializing-haskell-functions-to-disk/9603/25

DiazCarrete, to haskell
@DiazCarrete@hachyderm.io avatar
DiazCarrete, to random
@DiazCarrete@hachyderm.io avatar

Learning about user Authentication with OAuth 2.0
https://oauth.net/articles/authentication/
(I unironically like this post, it has cleared some confusion for me.)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • โ€ข
  • anitta
  • ethstaker
  • DreamBathrooms
  • InstantRegret
  • magazineikmin
  • tester
  • khanakhh
  • everett
  • thenastyranch
  • Youngstown
  • slotface
  • tacticalgear
  • kavyap
  • osvaldo12
  • JUstTest
  • mdbf
  • GTA5RPClips
  • ngwrru68w68
  • provamag3
  • Durango
  • rosin
  • cisconetworking
  • normalnudes
  • modclub
  • megavids
  • cubers
  • Leos
  • lostlight
  • All magazines