How are Functors useful?
问题 We know that any generic type F[_] with map method, which complies to some laws, is a functor . For instance, List[_] , Option[_] , and F[A] = Env => A are functors. I am just wondering if this functor abstraction is meaningful. How can I use the fact that they are functors ? Could you show an example of non-trivial computation, which would use the map and be actually useful ? 回答1: One of the biggest benefits of concepts like functions is that there are generic constructions that allow you to