From 193dc89dab256625575e2611ba6a1d0c13ac502f Mon Sep 17 00:00:00 2001 From: AlejandroME Date: Fri, 20 Oct 2017 16:42:00 -0500 Subject: [PATCH 1/2] Links "LawTesting.md" in FAQ and TypeClasses pages --- docs/src/main/tut/faq.md | 5 +++++ docs/src/main/tut/typeclasses/lawtesting.md | 6 ++++++ docs/src/main/tut/typeclasses/typeclasses.md | 2 ++ 3 files changed, 13 insertions(+) diff --git a/docs/src/main/tut/faq.md b/docs/src/main/tut/faq.md index b6eddfb462..dc702b2d46 100644 --- a/docs/src/main/tut/faq.md +++ b/docs/src/main/tut/faq.md @@ -22,6 +22,7 @@ position: 40 * [What does `macro Ops` do? What is `cats.macros.Ops`?](#machinist) * [What is `tailRecM`?](#tailrecm) * [What does this symbol mean?](#symbol) + * [How can I test `laws`?](#law-testing) * [How can I help?](#contributing) ## What imports do I need? @@ -232,6 +233,10 @@ All other symbols can be imported with `import cats.implicits._` | `fa >> fb` (Deprecated) | followed by | | `FlatMap[F[_]]` | `followedBy(fa: F[A])(fb: F[B]): F[B]` | | `fa << fb` (Deprecated) | for effect | | `FlatMap[F[_]]` | `forEffect(fa: F[A])(fb: F[B]): F[A]` | +## How can I test `laws`? + +You can find more information [here](typeclasses/lawtesting.html). + ## How can I help? The cats community welcomes and encourages contributions, even if you are completely new to cats and functional programming. Here are a few ways to help out: diff --git a/docs/src/main/tut/typeclasses/lawtesting.md b/docs/src/main/tut/typeclasses/lawtesting.md index 34b9f70893..15259315f0 100644 --- a/docs/src/main/tut/typeclasses/lawtesting.md +++ b/docs/src/main/tut/typeclasses/lawtesting.md @@ -1,3 +1,9 @@ +--- +layout: docs +title: "Law Testing" +section: "typeclasses" +--- + # Law testing [Laws](https://typelevel.org/cats/typeclasses.html#laws) are an important part of cats. diff --git a/docs/src/main/tut/typeclasses/typeclasses.md b/docs/src/main/tut/typeclasses/typeclasses.md index 3d0180c130..2cea918566 100644 --- a/docs/src/main/tut/typeclasses/typeclasses.md +++ b/docs/src/main/tut/typeclasses/typeclasses.md @@ -221,6 +221,8 @@ val result = Monoid[Int].combine(sumLeft, sumRight) Cats provides laws for type classes via the `kernel-laws` and `laws` modules which makes law checking type class instances easy. +You can find out more about law testing [here](typeclasses/lawtesting.html). + ## Type classes in cats infographic From 82c17394a2e353e1f777776f20a3a0705d35cf99 Mon Sep 17 00:00:00 2001 From: AlejandroME <2565308+AlejandroME@users.noreply.github.com> Date: Sat, 21 Oct 2017 08:37:25 -0500 Subject: [PATCH 2/2] Rewrites law testing title in FAQ --- docs/src/main/tut/faq.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/main/tut/faq.md b/docs/src/main/tut/faq.md index dc702b2d46..3819a6cf55 100644 --- a/docs/src/main/tut/faq.md +++ b/docs/src/main/tut/faq.md @@ -22,7 +22,7 @@ position: 40 * [What does `macro Ops` do? What is `cats.macros.Ops`?](#machinist) * [What is `tailRecM`?](#tailrecm) * [What does this symbol mean?](#symbol) - * [How can I test `laws`?](#law-testing) + * [How can I test instances against their type classes' laws?](#law-testing) * [How can I help?](#contributing) ## What imports do I need? @@ -233,7 +233,7 @@ All other symbols can be imported with `import cats.implicits._` | `fa >> fb` (Deprecated) | followed by | | `FlatMap[F[_]]` | `followedBy(fa: F[A])(fb: F[B]): F[B]` | | `fa << fb` (Deprecated) | for effect | | `FlatMap[F[_]]` | `forEffect(fa: F[A])(fb: F[B]): F[A]` | -## How can I test `laws`? +## How can I test instances against their type classes' laws? You can find more information [here](typeclasses/lawtesting.html).