<commit_before>---
title:  Learn you a Cats for a number of good reasons
description: In this article I will show you a few examples of what you can do by just adding the [cats library][1] to your project's dependencies.
date:   2017-05-27 22:28:00
category: scala
tags: scala cats
published: true
---

So you have heard of _cats_ and you possibly heard of contravariant functors, monad transformers, applicatives and cartesians, and possibly even stumbled upon the term _Kleisli arrows_ and thought "_who needs this?_" Well, you don't _need_ this, but it doesn't hurt to learn a new thing or two. In this article I will show you a few examples of what you can do by just adding the **cats** library to your project's dependencies.



--------------

## Syntax (extension methods)

Let's start with something relatively trivial. One of the most essential cats' type classes is the `Applicative`. It extends a number of traits and is packed full of useful methods, but in this section we'll only focus on the single one abstract method defined on the type class:

{% highlight scala %}
trait Applicative[F[_]] extends ... {
  def pure[A](a:A): F[A]
}<commit_msg>changed title on cats article<commit_after>---
title:  Learn you a Cats
description: In this article I will show you a few examples of what you can do by just adding the [cats library][1] to your project's dependencies.
date:   2017-05-27 22:28:00
category: scala
tags: scala cats
published: true
---

So you have heard of _cats_ and you possibly heard of contravariant functors, monad transformers, applicatives and cartesians, and possibly even stumbled upon the term _Kleisli arrows_ and thought "_who needs this?_" Well, you don't _need_ this, but it doesn't hurt to learn a new thing or two. In this article I will show you a few examples of what you can do by just adding the **cats** library to your project's dependencies.



--------------

## Syntax (extension methods)

Let's start with something relatively trivial. One of the most essential cats' type classes is the `Applicative`. It extends a number of traits and is packed full of useful methods, but in this section we'll only focus on the single one abstract method defined on the type class:

{% highlight scala %}
trait Applicative[F[_]] extends ... {
  def pure[A](a:A): F[A]
}
{'fraction_non_alphanumeric': 0.0779558250324816, 'fraction_numerical': 0.0129926375054136, 'mean_word_length': 4.054704595185996, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1846054', 'n_tokens_mistral': 655, 'n_tokens_neox': 605, 'n_words': 358}