Skip to content

Commit

Permalink
Merge pull request #765 from DavidGregory084/free-state-to-core
Browse files Browse the repository at this point in the history
Move cats-free and cats-state in to cats-core
  • Loading branch information
non committed Jan 4, 2016
2 parents 5311ec5 + 962fcab commit 9b48dbb
Show file tree
Hide file tree
Showing 28 changed files with 33 additions and 60 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Write about https://github.com/non/cats/pull/36#issuecomment-72892359
### Write tests

- Tests for cats-core go into the tests module, under the `cats.tests` package.
- Tests for additional modules, such as `free`, go into the tests directory within that module.
- Tests for additional modules, such as 'jvm', go into the tests directory within that module.
- Cats tests should extend `CatsSuite`. `CatsSuite` integrates [ScalaTest](http://www.scalatest.org/)
with [Discipline](https://github.com/typelevel/discipline) for law checking, and imports all syntax and standard instances for convenience.
- The first parameter to the `checkAll` method provided by
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ functionality, you can pick-and-choose from amongst these modules
* `cats-macros`: Macros used by Cats syntax (*required*).
* `cats-core`: Core type classes and functionality (*required*).
* `cats-laws`: Laws for testing type class instances.
* `cats-free`: "Free" data constructors for various type classes.
* `cats-state`: Monad and transformer support for state.

Release notes for Cats are available in [CHANGES.md](CHANGES.md).

Expand Down Expand Up @@ -113,8 +111,6 @@ Initially Cats will support the following modules:
* `macros`: Macro definitions needed for `core` and other projects.
* `core`: Definitions for widely-used type classes and data types.
* `laws`: The encoded laws for type classes, exported to assist third-party testing.
* `free`: "Free" data constructors for various type classes.
* `state`: Monad and transformer support for state.
* `tests`: Verifies the laws, and runs any other tests. Not published.

As the type class families grow, it's possible that additional modules
Expand Down
38 changes: 9 additions & 29 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ lazy val disciplineDependencies = Seq(

lazy val docSettings = Seq(
autoAPIMappings := true,
unidocProjectFilter in (ScalaUnidoc, unidoc) := inProjects(coreJVM, freeJVM, stateJVM),
unidocProjectFilter in (ScalaUnidoc, unidoc) := inProjects(coreJVM),
site.addMappingsToSiteDir(mappings in (ScalaUnidoc, packageDoc), "api"),
site.addMappingsToSiteDir(tut, "_tut"),
ghpagesNoJekyll := false,
Expand All @@ -87,7 +87,7 @@ lazy val docs = project
.settings(tutSettings)
.settings(tutScalacOptions ~= (_.filterNot(Set("-Ywarn-unused-import", "-Ywarn-dead-code"))))
.settings(commonJvmSettings)
.dependsOn(coreJVM, freeJVM, stateJVM)
.dependsOn(coreJVM)

lazy val cats = project.in(file("."))
.settings(moduleName := "root")
Expand All @@ -100,15 +100,15 @@ lazy val catsJVM = project.in(file(".catsJVM"))
.settings(moduleName := "cats")
.settings(catsSettings)
.settings(commonJvmSettings)
.aggregate(macrosJVM, coreJVM, lawsJVM, freeJVM, stateJVM, testsJVM, jvm, docs, bench)
.dependsOn(macrosJVM, coreJVM, lawsJVM, freeJVM, stateJVM, testsJVM % "test-internal -> test", jvm, bench % "compile-internal;test-internal -> test")
.aggregate(macrosJVM, coreJVM, lawsJVM, testsJVM, jvm, docs, bench)
.dependsOn(macrosJVM, coreJVM, lawsJVM, testsJVM % "test-internal -> test", jvm, bench % "compile-internal;test-internal -> test")

lazy val catsJS = project.in(file(".catsJS"))
.settings(moduleName := "cats")
.settings(catsSettings)
.settings(commonJsSettings)
.aggregate(macrosJS, coreJS, lawsJS, freeJS, stateJS, testsJS, js)
.dependsOn(macrosJS, coreJS, lawsJS, freeJS, stateJS, testsJS % "test-internal -> test", js)
.aggregate(macrosJS, coreJS, lawsJS, testsJS, js)
.dependsOn(macrosJS, coreJS, lawsJS, testsJS % "test-internal -> test", js)
.enablePlugins(ScalaJSPlugin)


Expand Down Expand Up @@ -151,26 +151,6 @@ lazy val laws = crossProject.crossType(CrossType.Pure)
lazy val lawsJVM = laws.jvm
lazy val lawsJS = laws.js

lazy val free = crossProject.crossType(CrossType.Pure)
.dependsOn(macros, core, tests % "test-internal -> test")
.settings(moduleName := "cats-free")
.settings(catsSettings:_*)
.jsSettings(commonJsSettings:_*)
.jvmSettings(commonJvmSettings:_*)

lazy val freeJVM = free.jvm
lazy val freeJS = free.js

lazy val state = crossProject.crossType(CrossType.Pure)
.dependsOn(macros, core, free % "compile-internal;test-internal -> test", tests % "test-internal -> test")
.settings(moduleName := "cats-state")
.settings(catsSettings:_*)
.jsSettings(commonJsSettings:_*)
.jvmSettings(commonJvmSettings:_*)

lazy val stateJVM = state.jvm
lazy val stateJS = state.js

lazy val tests = crossProject.crossType(CrossType.Pure)
.dependsOn(macros, core, laws)
.settings(moduleName := "cats-tests")
Expand All @@ -194,7 +174,7 @@ lazy val jvm = project
.settings(commonJvmSettings:_*)

// bench is currently JVM-only
lazy val bench = project.dependsOn(macrosJVM, coreJVM, freeJVM, lawsJVM)
lazy val bench = project.dependsOn(macrosJVM, coreJVM, lawsJVM)
.settings(moduleName := "cats-bench")
.settings(catsSettings)
.settings(noPublishSettings)
Expand Down Expand Up @@ -227,11 +207,11 @@ lazy val publishSettings = Seq(
) ++ credentialSettings ++ sharedPublishSettings ++ sharedReleaseProcess

// These aliases serialise the build for the benefit of Travis-CI.
addCommandAlias("buildJVM", ";macrosJVM/compile;coreJVM/compile;coreJVM/test;freeJVM/compile;freeJVM/test;stateJVM/compile;stateJVM/test;lawsJVM/compile;testsJVM/test;jvm/test;bench/test")
addCommandAlias("buildJVM", ";macrosJVM/compile;coreJVM/compile;coreJVM/test;lawsJVM/compile;testsJVM/test;jvm/test;bench/test")

addCommandAlias("validateJVM", ";scalastyle;buildJVM;makeSite")

addCommandAlias("validateJS", ";macrosJS/compile;coreJS/compile;lawsJS/compile;testsJS/test;js/test;freeJS/compile;freeJS/test;stateJS/compile;stateJS/test")
addCommandAlias("validateJS", ";macrosJS/compile;coreJS/compile;lawsJS/compile;testsJS/test;js/test")

addCommandAlias("validate", ";validateJS;validateJVM")

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/src/main/tut/const.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: default
title: "Const"
section: "data"
source: "https://github.com/non/cats/blob/master/data/src/main/scala/cats/data/Const.scala"
source: "https://github.com/non/cats/blob/master/core/src/main/scala/cats/data/Const.scala"
scaladoc: "#cats.data.Const"
---
# Const
Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/tut/freemonad.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
layout: default
title: "FreeMonads"
section: "data"
source: "https://github.com/non/cats/blob/master/core/src/main/scala/cats/free/FreeMonad.scala"
scaladoc: "#cats.free.FreeMonad"
source: "https://github.com/non/cats/blob/master/core/src/main/scala/cats/free/Free.scala"
scaladoc: "#cats.free.Free"
---

# Free Monad
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/tut/oneand.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: default
title: "OneAnd"
section: "data"
source: "https://github.com/non/cats/blob/master/data/src/main/scala/cats/data/OneAnd.scala"
source: "https://github.com/non/cats/blob/master/core/src/main/scala/cats/data/OneAnd.scala"
scaladoc: "#cats.data.OneAnd"
---
# OneAnd
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/tut/optiont.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: default
title: "OptionT"
section: "data"
source: "https://github.com/non/cats/blob/master/data/src/main/scala/cats/data/optionT.scala"
source: "https://github.com/non/cats/blob/master/core/src/main/scala/cats/data/OptionT.scala"
scaladoc: "#cats.data.OptionT"
---
# OptionT
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/tut/state.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: default
title: "State"
section: "data"
source: "https://github.com/non/cats/blob/master/state/src/main/scala/cats/state/State.scala"
source: "https://github.com/non/cats/blob/master/core/src/main/scala/cats/state/StateT.scala"
scaladoc: "#cats.state.StateT"
---
# State
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/tut/streaming.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: default
title: "Streaming"
section: "data"
source: "https://github.com/non/cats/blob/master/data/src/main/scala/cats/data/Streaming.scala"
source: "https://github.com/non/cats/blob/master/core/src/main/scala/cats/data/Streaming.scala"
scaladoc: "#cats.data.Streaming"
---

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/tut/xor.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: default
title: "Xor"
section: "data"
source: "https://github.com/non/cats/blob/master/data/src/main/scala/cats/data/Xor.scala"
source: "https://github.com/non/cats/blob/master/core/src/main/scala/cats/data/Xor.scala"
scaladoc: "#cats.data.Xor"
---
# Xor
Expand Down
2 changes: 0 additions & 2 deletions docs/src/site/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ functionality, you can pick-and-choose from amongst these modules
* `cats-macros`: Macros used by Cats syntax (*required*).
* `cats-core`: Core type classes and functionality (*required*).
* `cats-laws`: Laws for testing type class instances.
* `cats-free`: "Free" data constructors for various type classes.
* `cats-state`: Monad and transformer support for state.

Release notes for Cats are available in [CHANGES.md](https://github.com/non/cats/blob/master/CHANGES.md).

Expand Down
2 changes: 1 addition & 1 deletion scripts/travis-publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fi
sbt_cmd="sbt ++$TRAVIS_SCALA_VERSION"

coverage="$sbt_cmd coverage validateJVM coverageReport && bash <(curl -s https://codecov.io/bash)"
scala_js="$sbt_cmd macrosJS/compile coreJS/compile lawsJS/compile && $sbt_cmd testsJS/test && $sbt_cmd js/test && $sbt_cmd freeJS/test && $sbt_cmd stateJS/test"
scala_js="$sbt_cmd macrosJS/compile coreJS/compile lawsJS/compile && $sbt_cmd testsJS/test && $sbt_cmd js/test"
scala_jvm="$sbt_cmd validateJVM"

run_cmd="$coverage && $scala_js && $scala_jvm $publish_cmd"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package cats
package free
package tests

import cats.arrow.NaturalTransformation
import cats.tests.CatsSuite
import cats.free.Coyoneda
import cats.laws.discipline.{FunctorTests, SerializableTests}

import org.scalacheck.{Arbitrary, Gen}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package cats
package free
package tests

import cats.arrow.NaturalTransformation
import cats.free.FreeApplicative
import cats.laws.discipline.{MonoidalTests, ApplicativeTests, SerializableTests}
import cats.laws.discipline.eq.tuple3Eq
import cats.tests.CatsSuite
import cats.data.Const

import org.scalacheck.{Arbitrary, Gen}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package cats
package free
package tests

import cats.arrow.NaturalTransformation
import cats.tests.CatsSuite
import cats.free.{Free, Trampoline}
import cats.laws.discipline.{MonoidalTests, MonadTests, SerializableTests}
import cats.laws.discipline.eq._
import cats.laws.discipline.arbitrary.function0Arbitrary
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package cats
package free
package tests

import cats.data.{Xor, Coproduct}
import cats.free.{Free, Inject,:<:}
import cats.laws.discipline.arbitrary
import cats.tests.CatsSuite
import org.scalacheck._

class InjectTests extends CatsSuite {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package cats
package state
package tests

import cats.tests.CatsSuite
import cats.laws.discipline.{MonoidalTests, MonadStateTests, MonoidKTests, SerializableTests}
import cats.free.FreeTests._
import cats.state.{State, StateT}
import cats.tests.FreeTests._
import cats.laws.discipline.eq._
import org.scalacheck.{Arbitrary, Gen}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cats
package state
package tests

import cats.tests.CatsSuite
import cats.data.{ Func, AppFunc, Const }
import Func.{ appFunc, appFuncU }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cats
package free
package tests

import cats.tests.CatsSuite
import cats.free.Yoneda
import cats.laws.discipline.{FunctorTests, SerializableTests}

import org.scalacheck.Arbitrary
Expand Down

0 comments on commit 9b48dbb

Please sign in to comment.