Understand Functions Are Functors
Functions are functors is a basic idea in funcitonal programming. However, the (->) r
formats of functions are confusing and misleading, What's worse, affected by imperative language features, there was an misunderstanding about how the original structure is hold by a functor. To be more concrete, this blog talks about the question: why result of fmap (*2) (+100) 1
is 202
, not 102
?