Why doesn't fn() coerce to fn() capturing
This works thanks to the signatures being different:
However it's still annoying to duplicate every function twice.
3 Replies
Thanks for the feedback @TeamPuzel I agree! Can you raise a discussion on GitHub here: https://github.com/modularml/mojo/discussions/new?category=ideas
Of course, I now moved this to discussions.
Awesome thanks! link here for anyone asking the same question: https://github.com/modularml/mojo/discussions/678
GitHub
coerce fn() to fn() capturing · modularml mojo · Discussion #678
When writing a List implementation this became a problem for functions like map filter or fold: fn first(self, where: fn(T) -> Bool) -> Maybe[T]: for item in self: if where(item): return item...