From b34ea406054c20b9cd8cdc2fbb506d88b76f1af1 Mon Sep 17 00:00:00 2001 From: "Kai(luo) Wang" Date: Mon, 5 Jun 2017 09:28:32 -0400 Subject: [PATCH] type classes with only defined laws to guideline --- docs/src/main/tut/guidelines.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/src/main/tut/guidelines.md b/docs/src/main/tut/guidelines.md index c0bbc82b8b..c6dcc9b726 100644 --- a/docs/src/main/tut/guidelines.md +++ b/docs/src/main/tut/guidelines.md @@ -70,5 +70,12 @@ You probably noticed that there is a `val dummy: Boolean` in the `PurePartiallyA to make this intermediate class a [Value Class](http://docs.scala-lang.org/overviews/core/value-classes.html) so that there is no cost of allocation, i.e. at runtime, it doesn't create an instance of `PurePartiallyApplied`. We also hide this partially applied class by making it package private and placing it inside an object. +## Type class + +### Type classes that ONLY define laws. + +We can introduce new type classes for the sake of adding laws that don't apply to the parent type class, e.g. `CommutativeSemigroup` and +`CommutativeArrow`. + #### TODO: Once we drop 2.10 support, AnyVal-extending class constructor parameters can be marked as private.