-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stefanos Stefanou
committed
Nov 2, 2023
1 parent
f5840fc
commit ee7feac
Showing
3 changed files
with
10 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,14 @@ | ||
package mycats.lib | ||
|
||
import mycats.instances.OptionInstances.optionalSemigroupalInstance | ||
import mycats.lib.syntax.SemigroupalSyntax._ | ||
import mycats.instances.OptionInstances.optionalApplyInstance | ||
import mycats.lib.morphisms.Apply | ||
import mycats.lib.morphisms.arity.ApplyArityFunctions | ||
import mycats.instances.OptionInstances.optionalApplyInstance | ||
import mycats.lib.syntax.ApplySyntax.applyAritySyntaxOps | ||
//There is some sources | ||
|
||
class ApplyAritySpec extends org.scalatest.funsuite.AnyFunSuite { | ||
test("Apply Law : Arity 2 : Product should be associative") { | ||
// implicit val he:Apply[Option] = optionalApplyInstance | ||
// val opt1:Option[Int]=Some(32) | ||
// val opt2:Option[String]=Some("Hello world") | ||
// val opt3:Option[Double]=Some(42.42) | ||
// | ||
// val left = applyAritySyntaxOps(opt1).product(opt2)(he) | ||
// val right = opt2.product(opt2,opt3)(he) | ||
// | ||
// assert(optionalApplyInstance.pro(opt1,opt2,opt3)) ,"Semigroupal is not associative?") | ||
val opt1:Option[Int]=Some(32) | ||
val opt2:Option[String]=Some("Hello world") | ||
val opt3:Option[Double]=Some(42.42) | ||
//assert((opt1.productN(opt2)).productN(opt3) == opt1.productN(opt2.productN(opt3)) ,"Semigroupal is not associative?") | ||
//wait for answer https://medium.com/@PerrottaFrancisco/semigroupal-parallel-applicative-in-cats-6df527b853da | ||
} | ||
} |