Haskell Functor implied law

后端 未结 4 1236
清酒与你
清酒与你 2021-02-07 02:49

Typeclassopedia says:

\"A similar argument also shows that any Functor instance satisfying the first law (fmap id = id) will automatically satisfy the second law as well

4条回答
  •  渐次进展
    2021-02-07 03:33

    It seems that it was realized quite recently that law 2 follows from law 1. Thus, when the documentation was originally written, it was probably thought to be an independent requirement.

    (Personally, I'm not convinced by the argument, but since I haven't had the time to work out the details myself, I'm giving it the benefit of doubt here.)

提交回复
热议问题