Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 2.7.5
version = 3.0.5

align.preset = most
align.multiline = false
Expand Down
10 changes: 5 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ lazy val scalaz: Project = (project in file("scalaz"))
.settings(
schemez(Compile, "main"),
schemez(Test, "test"),
name := "schemez-scalaz",
skip in publish := false,
name := "schemez-scalaz",
skip in publish := false,
publishArtifact in makePom := true,
publishArtifact := true,
publishArtifact := true,
libraryDependencies ++= Seq(
Scalaz.core
)
Expand All @@ -38,15 +38,15 @@ lazy val eg: Project = (project in file("example"))
.enablePlugins(ProjectPlugin)
.dependsOn(scalaz)
.settings(
name := "example",
name := "example",
skip in publish := true
)

lazy val testz: Project = (project in file("testz"))
.enablePlugins(ProjectPlugin)
.dependsOn(eg, scalaz)
.settings(
name := "testz",
name := "testz",
skip in publish := true,
libraryDependencies ++= Seq(
Scalaz.Testz.testz,
Expand Down
6 changes: 3 additions & 3 deletions project/ProjectPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ object ProjectPlugin extends AutoPlugin {
override val projectSettings: Seq[Def.Setting[_]] =
headerSettings ++
Seq(
conflictManager := ConflictManager.strict,
dependencyOverrides := DependencyOverrides.settings,
conflictManager := ConflictManager.strict,
dependencyOverrides := DependencyOverrides.settings,
autoAPIMappings in Global := true,
addCompilerPlugin(Dependencies.CompilerPlugin.kindProjector),
addCompilerPlugin(Dependencies.CompilerPlugin.monadicFor),
Expand All @@ -36,7 +36,7 @@ object ProjectPlugin extends AutoPlugin {

private lazy val headerSettings: Seq[Def.Setting[_]] = Seq(
startYear := Some(2018),
licenses := Nil,
licenses := Nil,
headerLicense := Some(
HeaderLicense.Custom(
"""Copyright (c) 2019 Yui Pham.
Expand Down
4 changes: 2 additions & 2 deletions schemez/src/main/scala/enzief/recursionz/Birecursive.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ object Birecursive {
}

/** Special `Birecursive` for any HKT `T` that has
* - an algebra `T[F] => F[T[F]]`, eg: `Fix.unfix`
* - and an coalgebra `F[T[F]] => T[F]`, eg. `Fix.apply`
* - an algebra `T[F] => F[T[F]]`, eg: `Fix.unfix`
* - and an coalgebra `F[T[F]] => T[F]`, eg. `Fix.apply`
*/
abstract class BirecursiveT[T[_[_]], F[_]](implicit F: Functor[F]) extends Recursionz[F] with RecursiveT[T, F] with CorecursiveT[T, F]

Expand Down
3 changes: 1 addition & 2 deletions schemez/src/main/scala/enzief/recursionz/Corecursive.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ object Corecursive {
}
}

/** Special `Corecursive` for any HKT `T` that has an coalgebra `F[T[F]] => T[F]`.
* Eg. `Fix.apply`
/** Special `Corecursive` for any HKT `T` that has an coalgebra `F[T[F]] => T[F]`. Eg. `Fix.apply`
*/
trait CorecursiveT[T[_[_]], F[_]] extends Recursionz[F] { _: Recursionz[F] =>

Expand Down
8 changes: 3 additions & 5 deletions schemez/src/main/scala/enzief/recursionz/Recursionz.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ import typeclass.syntax._

class Recursionz[F[_]](implicit val F: Functor[F]) {

/** Hylomorphism - fundamental operation of recursion schemes. It recursively
* applies `cof` to unfold `a` into layers of `F[A]`, then recursively folds
* then into a `B` using `f`.
* It can also be seen as the (fused) composition of an anamorphism and a
* catamorphism that avoids building the intermediate recursive data structure.
/** Hylomorphism - fundamental operation of recursion schemes. It recursively applies `cof` to unfold `a` into layers of `F[A]`, then recursively folds then
* into a `B` using `f`. It can also be seen as the (fused) composition of an anamorphism and a catamorphism that avoids building the intermediate recursive
* data structure.
*/
def hylo[A, B](a: A)(f: Algebra[F, B], cof: Coalgebra[F, A]): B =
f(cof(a).map(hylo(_)(f, cof)))
Expand Down
3 changes: 1 addition & 2 deletions schemez/src/main/scala/enzief/recursionz/Recursive.scala
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ object Recursive {
}
}

/** Special `Recursive` for any HKT `T` that has an algebra `T[F] => F[T[F]]`
* Eg: `Fix.unfix`.
/** Special `Recursive` for any HKT `T` that has an algebra `T[F] => F[T[F]]` Eg: `Fix.unfix`.
*/
trait RecursiveT[T[_[_]], F[_]] { _: Recursionz[F] =>
def projectT(t: T[F]): F[T[F]]
Expand Down