diff --git a/AUTHORS.md b/AUTHORS.md index c760149274..b0a7d8ef79 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -31,6 +31,7 @@ possible: * Binh Nguyen * Bobby Rauchenberg * Brendan McAdams + * Brian McKenna * Cody Allen * Colt Frederickson * Dale Wijnand @@ -98,6 +99,13 @@ possible: * yilinwei * Zach Abbott +Cats has been heavily inspired by many libraries, including [Scalaz](https://github.com/scalaz/scalaz), +Haskell's [Prelude](https://hackage.haskell.org/package/base-4.9.0.0/docs/Prelude.html), and others. +In particular, some Cats code is only a slightly modified version of code originating in +Scalaz. Therefore, we'd also like to credit and thank all of the +[Scalaz contributors](https://github.com/scalaz/scalaz/graphs/contributors) for +their work. + We've tried to include everyone, but if you've made a contribution to Cats and are not listed, please feel free to open an issue or pull request with your name and contribution. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e554e291e3..d9dab56059 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -131,6 +131,12 @@ Write about type class methods on data structures as described in https://github Write about https://github.com/typelevel/cats/pull/36#issuecomment-72892359 +### Attributions + +If your contribution has been derived from or inspired by other work, please +state this in its ScalaDoc comment and provide proper attribution. When +possible, include the original authors' names and a link to the original work. + ### Write tests - Tests for cats-core go into the tests module, under the `cats.tests` package. diff --git a/core/src/main/scala/cats/FlatMapRec.scala b/core/src/main/scala/cats/FlatMapRec.scala index 5658b3fe00..c4eb8de942 100644 --- a/core/src/main/scala/cats/FlatMapRec.scala +++ b/core/src/main/scala/cats/FlatMapRec.scala @@ -9,6 +9,10 @@ import cats.data.Xor * * Based on Phil Freeman's * [[http://functorial.com/stack-safety-for-free/index.pdf Stack Safety for Free]]. + * + * This Scala implementation of `FlatMapRec` and its usages are derived from + * [[https://github.com/scalaz/scalaz/blob/series/7.3.x/core/src/main/scala/scalaz/BindRec.scala Scalaz's BindRec]], + * originally written by Brian McKenna. */ @typeclass trait FlatMapRec[F[_]] extends FlatMap[F] { diff --git a/core/src/main/scala/cats/NotNull.scala b/core/src/main/scala/cats/NotNull.scala index 5cf16b5e02..39dbba6691 100644 --- a/core/src/main/scala/cats/NotNull.scala +++ b/core/src/main/scala/cats/NotNull.scala @@ -6,6 +6,12 @@ package cats * * This can be useful in preventing `Null` from being inferred when a type * parameter is omitted. + * + * This trait is used along with ambiguous implicits to achieve the goal of + * preventing inference of `Null`. This ambiguous implicit trick has been used + * in the Scala community for some time. [[https://gist.github.com/milessabin/de58f3ba7024d51dcc1a Here]] + * is an early example of such a trick being used in a similar way to prevent a + * `Nothing` type. */ sealed trait NotNull[A] diff --git a/core/src/main/scala/cats/data/Validated.scala b/core/src/main/scala/cats/data/Validated.scala index cb7cedd3b2..cce53e1a74 100644 --- a/core/src/main/scala/cats/data/Validated.scala +++ b/core/src/main/scala/cats/data/Validated.scala @@ -354,6 +354,10 @@ trait ValidatedFunctions { * scala> Validated.catchOnly[NumberFormatException] { "foo".toInt } * res0: Validated[NumberFormatException, Int] = Invalid(java.lang.NumberFormatException: For input string: "foo") * }}} + * + * This method and its usage of [[NotNull]] are inspired by and derived from + * the `fromTryCatchThrowable` method [[https://github.com/scalaz/scalaz/pull/746/files contributed]] + * to Scalaz by Brian McKenna. */ def catchOnly[T >: Null <: Throwable]: CatchOnlyPartiallyApplied[T] = new CatchOnlyPartiallyApplied[T] diff --git a/core/src/main/scala/cats/data/Xor.scala b/core/src/main/scala/cats/data/Xor.scala index b7e599063d..fd253ecb61 100644 --- a/core/src/main/scala/cats/data/Xor.scala +++ b/core/src/main/scala/cats/data/Xor.scala @@ -322,6 +322,10 @@ trait XorFunctions { * scala> Xor.catchOnly[NumberFormatException] { "foo".toInt } * res0: Xor[NumberFormatException, Int] = Left(java.lang.NumberFormatException: For input string: "foo") * }}} + * + * This method and its usage of [[NotNull]] are inspired by and derived from + * the `fromTryCatchThrowable` method [[https://github.com/scalaz/scalaz/pull/746/files contributed]] + * to Scalaz by Brian McKenna. */ def catchOnly[T >: Null <: Throwable]: CatchOnlyPartiallyApplied[T] = new CatchOnlyPartiallyApplied[T]