This repository was archived by the owner on Feb 27, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +44
-1
lines changed
scratch/src/main/scala/shims Expand file tree Collapse file tree 2 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ lazy val coreJVM = core.jvm.settings(mimaSettings)
191191lazy 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
196196enablePlugins(GitVersioning )
197197
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments