
Basic Category Theory for Scala Programmers - adamnemecek
https://blog.scalents.com/2017/09/22/basic-category-theory-for-scala-programmers-part-i/
======
networked
Bartosz Milewski has a series of posts (a book, really) and recorded lectures
that teach category theory with Haskell and C++ as reference points. HN
discussion:
[https://news.ycombinator.com/item?id=14026360](https://news.ycombinator.com/item?id=14026360).

~~~
kailuowang
We started a project to translate all Haskell sample code to scala in
Bartosz's Category theory for programmers book
[https://github.com/typelevel/CT_from_Programmers.scala](https://github.com/typelevel/CT_from_Programmers.scala)

~~~
AdieuToLogic
Very cool! It's nice to have a Rosetta Stone available for reference to help
convey deeper understanding of the book's Haskell examples.

------
alextheparrot
Scala’s category theory faculties are so incredibly awkward without an outside
library like Cats, I never thought I was writing “good code” in the functional
style in Scala until I started using Monads et al via Cats/Scalaz. Don’t get
me wrong, I could compose my function A then B then C, but now I’m passing
around these awkward Function1 instances that are hard to reuse and honestly
just look unstructured. It feels like fighting against a tide instead of
riding it to shore.

The utility also doesn’t necessarily come from the ability to transform A =>
B, as this is often provided by the user, but from being able to maintain the
context while doing so (Mapping over a future should maintain the asynchronous
context, mapping over a try should maintain the error capturing context). I
understand the author appears to know much more, but I also don’t accept that
they’ve contributed anything to a novice reading and attempting to
improve/modify their Scala code via an improvement to their category theory
knowledge.

~~~
gclaramunt
You're right and I struggled with the idea to add more in the first post, but
I've decided to leave the more interesting stuff (Functors!) for the next
part.

------
yenwel
Or... basic scala for category theorists

------
smegel
How important is this to understand in practice for a Scala programmer?

~~~
sjrd
I'm the author of Scala.js, so supposedly a Scala "expert", and I still don't
understand category theory.

Does that answer the question?

~~~
smegel
It gives me some idea, yes :)

------
sscarduzio
I like this, write a book pls

