hmemcpy / milewski-ctfp-pdf

Bartosz Milewski's 'Category Theory for Programmers' unofficial PDF and LaTeX source
https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/
Other
10.88k stars 578 forks source link

8.5 The Writer Functor #197

Closed mulderr closed 2 years ago

mulderr commented 5 years ago

First of all really enjoying the book so far, big thanks to Bartosz and all the other contributors!

I'm reading section 8.5, towards the very beginning:

type Writer a = (a, String) I said that the embellishment was somehow related to endofunctors. And, indeed, the Writer type constructor is functorial in a.

Ah, but it can't be because of instance Functor ((,) a) from base...

We don’t even have to implement fmap for it, because it’s just a simple product type.

which we cannot change!

I think this could use a note that we are ignoring some practical Haskell issues for the purpose of keeping the discussion focused on what's important.