Your job is to make all the test green!
Notice that:
Cats implicits for a given type follow this convention
import cats.instances.mytype._
Cats syntax for a given type follow this convention
import cats.syntax.atype._
Comparing with Eq
, ===
and =!=
~testOnly example.EqSpec
Implement the printable for Gato
(spanish for Cat
).
cats
usually split typeclasses
in the following way:
- A trait defining the general behavior
- A companion object that contains the type classes
- A syntax object containing
implicit class(es)
~testOnly example.PrintableSpec
Monoids can combine
two elements of the same type (thanks to semigroup
) and have an empty
element.
|+|
is an alias forcombine
present in semigroup
~testOnly example.MonoidSpec
Playing with Functors.
Functors can
map
over something
~testOnly example.FunctorSpec
Handling additional information to the main logic flow.
Write monad add additional information
Read monad expects contextual information
~testOnly example.WriteAndReadSpec
Solving equations.
State Monad cumulates values
~testOnly example.StateSpec
Validation Monad and Either Monad handle errors
~testOnly example.ValidationSpec
If you are really, really, really having problems finding the right imports just include the following
import cats._
import cats.implicits._
However one of the goals of this exercise is to be able to identify where the typeclass implementation is located.
Contributions via GitHub pull requests are gladly accepted from their original author. Along with any pull requests, please state that the contribution is your original work and that you license the work to the project under the project's open source license. Whether or not you state this explicitly, by submitting any copyrighted material via pull request, email, or other means you agree to license the material under the project's open source license and warrant that you have the legal authority to do so.