Skip to content
This repository was archived by the owner on Feb 27, 2021. It is now read-only.

Commit d114ea3

Browse files
committed
Some playground stuff
1 parent 87125f4 commit d114ea3

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ lazy val coreJVM = core.jvm.settings(mimaSettings)
191191
lazy val coreJS = core.js
192192

193193
// intentionally not in the aggregation
194-
lazy val scratch = project.dependsOn(coreJVM)
194+
lazy val scratch = project.dependsOn(coreJVM).settings(commonSettings)
195195

196196
enablePlugins(GitVersioning)
197197

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import shims._
2+
3+
object ScalazExamples {
4+
import scalaz.Functor
5+
import scalaz.syntax.functor._
6+
7+
def liftedToString[F[_]: Functor](fa: F[Int]): F[String] = fa.map(_.toString)
8+
9+
liftedToString(Box(42))
10+
11+
{
12+
import cats.instances.list._
13+
14+
liftedToString(List(1, 2, 3))
15+
}
16+
}
17+
18+
final case class Box[A](a: A)
19+
20+
object Box {
21+
import cats.Functor
22+
23+
implicit val functor: Functor[Box] = new Functor[Box] {
24+
def map[A, B](ba: Box[A])(f: A => B) = Box(f(ba.a))
25+
}
26+
}
27+
28+
object CatsExamples {
29+
import scalaz.{\/, \/-}
30+
31+
def extractFromEither[A, B](e: Either[A, B]): Option[B] = e.toOption
32+
33+
val example: Boolean \/ Int = \/-(42)
34+
extractFromEither(example.asCats)
35+
}
36+
37+
object MixedExamples {
38+
import cats.Eval
39+
import scalaz.std.list._
40+
import cats.syntax.traverse._
41+
42+
List(1, 2, 3, 4).traverse(i => Eval.later(i * 2))
43+
}

0 commit comments

Comments
 (0)