From d4d6765eeb2a963027373645cebd6c89158234be Mon Sep 17 00:00:00 2001 From: Daniel Urban Date: Tue, 4 Jul 2023 02:37:55 +0200 Subject: [PATCH] API cleanup --- TODO.md | 2 +- core/shared/src/main/scala/dev/tauri/choam/refs/package.scala | 4 ++-- .../src/main/scala/dev/tauri/choam/laws/TestInstances.scala | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TODO.md b/TODO.md index 0c9834e2c..7a8884251 100644 --- a/TODO.md +++ b/TODO.md @@ -115,9 +115,9 @@ - either `Windows-PRNG`, or (`/dev/random` and `/dev/urandom`) must be available - Scala 2.13 and 3.3 - \*.internal.\* packages (no bincompat) + - `unafe` APIs (no bincompat) - MCAS API review - is it usable outside of `choam`? - - it is, but the API is really not very good - if not, it doesn't really make sense to have it in a separate module - being in the same module would simplify using `ThreadContext` for `Rxn`-things - Rename `flatMapF` diff --git a/core/shared/src/main/scala/dev/tauri/choam/refs/package.scala b/core/shared/src/main/scala/dev/tauri/choam/refs/package.scala index bad812ef9..1b5932a2e 100644 --- a/core/shared/src/main/scala/dev/tauri/choam/refs/package.scala +++ b/core/shared/src/main/scala/dev/tauri/choam/refs/package.scala @@ -22,10 +22,10 @@ package object refs { type Ref1[A] = Ref[A] val Ref1: Ref.type = Ref - def unsafeNewRefU1[A](initial: A)(i0: Long, i1: Long, i2: Long, i3: Long): Ref[A] = + private[choam] def unsafeNewRefU1[A](initial: A)(i0: Long, i1: Long, i2: Long, i3: Long): Ref[A] = RefsPlatform.unsafeNewRefU1[A](initial, i0, i1, i2, i3) - def unsafeNewRefP1[A](initial: A)(i0: Long, i1: Long, i2: Long, i3: Long): Ref[A] = + private[choam] def unsafeNewRefP1[A](initial: A)(i0: Long, i1: Long, i2: Long, i3: Long): Ref[A] = RefsPlatform.unsafeNewRefP1[A](initial, i0, i1, i2, i3) private[choam] def unsafeNewStrictRefArray[A](size: Int, initial: A)(i0: Long, i1: Long, i2: Long, i3: Int): Ref.Array[A] = { diff --git a/laws/shared/src/main/scala/dev/tauri/choam/laws/TestInstances.scala b/laws/shared/src/main/scala/dev/tauri/choam/laws/TestInstances.scala index 02d7957f5..3f920d60e 100644 --- a/laws/shared/src/main/scala/dev/tauri/choam/laws/TestInstances.scala +++ b/laws/shared/src/main/scala/dev/tauri/choam/laws/TestInstances.scala @@ -94,7 +94,7 @@ trait TestInstances extends TestInstancesLowPrio0 { self => ) } - implicit def cogIor[A, B](implicit cogA: Cogen[A], cogB: Cogen[B]): Cogen[Ior[A, B]] = { + implicit def cogenIor[A, B](implicit cogA: Cogen[A], cogB: Cogen[B]): Cogen[Ior[A, B]] = { Cogen { (seed, ior) => ior.fold( a => cogA.perturb(seed.next, a),