Any approach to libraries based on category theory in Rust needs to address explicit fusion via stack allocated adaptors (found in iterators, futures, streams, visitors, etc). This suggests that we might need a more general form of `Functor` than that found in Haskell. 🤔
Conversation
actual functors? I'm not sure what you mean; functors are a great abstraction
2
I mean functors where you can change the source and a target category (as in the mathematical definition). In Haskell the source and target are specialised to Hask.
1
2
But I could be trying to force functors in ways they were not meant to be forced... but it feels like there should be _some_ connection to the iterator adaptor approach... 🤔😬
1
1
And I think there is a ton of value in iterator adaptors - they are an easy thing to mentally latch on to as a chain of things that can be fused together into a single pass, and almost certainly inlined away. Even if there is the syntactic overhead of entering/exiting them.

