Closed zenMaya closed 1 year ago
Hmm. I wouldn't really mind it being a little verbose if it was just something like this:
map(T, fn(_: anytype) T { return T{} }, parser)
Sadly this cannot be written currently, so I'll accept this MR. In the future, I'll probably go over and do some breaking changes while the language itself is still pre 1.0 :)
Aaah, cicd fails because mecha is not quite up to date with zig master. I'll see if I can do the update Sunday.
Hmm. I wouldn't really mind it being a little verbose if it was just something like this:
map(T, fn(_: anytype) T { return T{} }, parser)
Sadly this cannot be written currently, so I'll accept this MR. In the future, I'll probably go over and do some breaking changes while the language itself is still pre 1.0 :)
Yes, if that was possible, it wouldn't be such a hassle. :)
Fixed build issues on master. Can you rebase on master so we can get those green checkmarks?
I think I did it correctly :), I don't know much about github workflow so hopefully!
Wasn't quite right, but I can work with it from here, so no problem
Thanks!
This is a analogue to Parsec's
<$
.It is similar to how
map
works, but instead of transforming the inner parser value, it simply discards it.Usecase:
This was always possible with plain
map
but it was quite verbose, as a dummy function inside an anonymous struct needed to be constructed.