3 ms·
A Novel Idea About `Functor` in Rust?
- lmm 2y agoSounds recursion-schemesy, maybe, those always struck me as the right way of doing AST transforms.
- knighthack 2y ago[flagged]
- 3836293648 2y agoIt doesn't. It's not for you. It's type theory people having fun. Let them
- ninkendo 2y agoBut that’s why we have Haskell, as a little holiday resort for type theorists to get their fix in while not affecting working programmers too much. Looks like they’re trying to escape again.
- dmkolobov 2y agoHow dare people have new ideas. For those that don’t hate new ideas, functors and the like allow you to write transformations on data in terms of elements, rather than the structure of the container. This means that it doesn’t have access to things like neighboring elements or the size of the overall structure( unless other traits which provide those capabilities are mentioned in the trait bounds ). Such well-known algebraic restrictions can be useful for managing complexity when writing compilers or other data pipelines. The simplest use-case is when you want to use an algorithm across multiple representations of a data structure(list vs array, for example).
- kelseyfrog 2y agoSo the author wrote a Biplate in Rust, but then decided to call it Functor? Why not call it Biplate?
- 01HNNWZ0MV43FF 2y agoNever heard of that myself