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

CU-bcu7fc Deprecate all public functions, data types and generated code for IO #392

Merged
merged 4 commits into from
Feb 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions arrow-fx/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id "org.jetbrains.kotlin.jvm"
id "org.jetbrains.kotlin.kapt"
id "org.jlleitschuh.gradle.ktlint"
}

Expand All @@ -14,8 +13,6 @@ dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$KOTLINX_COROUTINES_VERSION"

compile "io.arrow-kt:arrow-core:$VERSION_NAME"
kapt "io.arrow-kt:arrow-meta:$VERSION_NAME"
kaptTest "io.arrow-kt:arrow-meta:$VERSION_NAME"

testCompile "io.kotlintest:kotlintest-runner-junit5:$KOTLIN_TEST_VERSION", excludeArrow
testCompile project(":arrow-fx-coroutines")
Expand Down
1 change: 1 addition & 0 deletions arrow-fx/src/main/kotlin/arrow/fx/Ref.kt
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ interface Ref<F, A> {
* }
* ```
*/
@Deprecated(IODeprecation)
interface RefFactory<F> {

/**
Expand Down
12 changes: 12 additions & 0 deletions arrow-fx/src/main/kotlin/arrow/fx/Schedule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,7 @@ sealed class Schedule<F, Input, Output> : ScheduleOf<F, Input, Output> {
* Run this effect once and, if it succeeded, decide using the passed policy if the effect should be repeated and if so, with how much delay.
* Returns the last output from the policy or raises an error if a repeat failed.
*/
@Deprecated(IODeprecation)
fun <F, A, B> Kind<F, A>.repeat(
CF: Concurrent<F>,
schedule: Schedule<F, A, B>
Expand All @@ -910,6 +911,7 @@ fun <F, A, B> Kind<F, A>.repeat(
* Run this effect once and, if it succeeded, decide using the passed policy if the effect should be repeated and if so, with how much delay.
* Returns the last output from the policy or raises an error if a repeat failed.
*/
@Deprecated(IODeprecation)
fun <F, E, A, B> Kind<F, A>.repeat(
ME: MonadError<F, E>,
T: Timer<F>,
Expand All @@ -920,6 +922,7 @@ fun <F, E, A, B> Kind<F, A>.repeat(
* Run this effect once and, if it succeeded, decide using the passed policy if the effect should be repeated and if so, with how much delay.
* Also offers a function to handle errors if they are encountered during repetition.
*/
@Deprecated(IODeprecation)
fun <F, A, B> Kind<F, A>.repeatOrElse(
CF: Concurrent<F>,
schedule: Schedule<F, A, B>,
Expand All @@ -930,6 +933,7 @@ fun <F, A, B> Kind<F, A>.repeatOrElse(
* Run this effect once and, if it succeeded, decide using the passed policy if the effect should be repeated and if so, with how much delay.
* Also offers a function to handle errors if they are encountered during repetition.
*/
@Deprecated(IODeprecation)
fun <F, E, A, B> Kind<F, A>.repeatOrElse(
ME: MonadError<F, E>,
T: Timer<F>,
Expand All @@ -941,6 +945,7 @@ fun <F, E, A, B> Kind<F, A>.repeatOrElse(
* Run this effect once and, if it succeeded, decide using the passed policy if the effect should be repeated and if so, with how much delay.
* Also offers a function to handle errors if they are encountered during repetition.
*/
@Deprecated(IODeprecation)
fun <F, A, B, C> Kind<F, A>.repeatOrElseEither(
CF: Concurrent<F>,
schedule: Schedule<F, A, B>,
Expand All @@ -951,6 +956,7 @@ fun <F, A, B, C> Kind<F, A>.repeatOrElseEither(
* Run this effect once and, if it succeeded, decide using the passed policy if the effect should be repeated and if so, with how much delay.
* Also offers a function to handle errors if they are encountered during repetition.
*/
@Deprecated(IODeprecation)
fun <F, E, A, B, C> Kind<F, A>.repeatOrElseEither(
ME: MonadError<F, E>,
T: Timer<F>,
Expand All @@ -976,6 +982,7 @@ fun <F, E, A, B, C> Kind<F, A>.repeatOrElseEither(
* Run an effect and, if it fails, decide using the passed policy if the effect should be retried and if so, with how much delay.
* Returns the result of the effect if if it was successful or re-raises the last error encountered when the schedule ends.
*/
@Deprecated(IODeprecation)
fun <F, A, B> Kind<F, A>.retry(
CF: Concurrent<F>,
schedule: Schedule<F, Throwable, B>
Expand All @@ -985,6 +992,7 @@ fun <F, A, B> Kind<F, A>.retry(
* Run an effect and, if it fails, decide using the passed policy if the effect should be retried and if so, with how much delay.
* Returns the result of the effect if if it was successful or re-raises the last error encountered when the schedule ends.
*/
@Deprecated(IODeprecation)
fun <F, E, A, B> Kind<F, A>.retry(
ME: MonadError<F, E>,
T: Timer<F>,
Expand All @@ -995,6 +1003,7 @@ fun <F, E, A, B> Kind<F, A>.retry(
* Run an effect and, if it fails, decide using the passed policy if the effect should be retried and if so, with how much delay.
* Also offers a function to handle errors if they are encountered during retrial.
*/
@Deprecated(IODeprecation)
fun <F, A, B> Kind<F, A>.retryOrElse(
CF: Concurrent<F>,
schedule: Schedule<F, Throwable, B>,
Expand All @@ -1005,6 +1014,7 @@ fun <F, A, B> Kind<F, A>.retryOrElse(
* Run an effect and, if it fails, decide using the passed policy if the effect should be retried and if so, with how much delay.
* Also offers a function to handle errors if they are encountered during retrial.
*/
@Deprecated(IODeprecation)
fun <F, E, A, B> Kind<F, A>.retryOrElse(
ME: MonadError<F, E>,
T: Timer<F>,
Expand All @@ -1016,6 +1026,7 @@ fun <F, E, A, B> Kind<F, A>.retryOrElse(
* Run an effect and, if it fails, decide using the passed policy if the effect should be retried and if so, with how much delay.
* Also offers a function to handle errors if they are encountered during retrial.
*/
@Deprecated(IODeprecation)
fun <F, A, B, C> Kind<F, A>.retryOrElseEither(
CF: Concurrent<F>,
schedule: Schedule<F, Throwable, B>,
Expand All @@ -1026,6 +1037,7 @@ fun <F, A, B, C> Kind<F, A>.retryOrElseEither(
* Run an effect and, if it fails, decide using the passed policy if the effect should be retried and if so, with how much delay.
* Also offers a function to handle errors if they are encountered during retrial.
*/
@Deprecated(IODeprecation)
fun <F, E, A, B, C> Kind<F, A>.retryOrElseEither(
ME: MonadError<F, E>,
T: Timer<F>,
Expand Down
1 change: 1 addition & 0 deletions arrow-fx/src/main/kotlin/arrow/fx/Semaphore.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import arrow.typeclasses.ApplicativeError
* A counting [Semaphore] is used to control access to a resource in a concurrent system.
* It keeps track of the count of available resources.
*/
@Deprecated(IODeprecation)
interface Semaphore<F> {

/**
Expand Down
2 changes: 0 additions & 2 deletions arrow-fx/src/main/kotlin/arrow/fx/extensions/ExitCaseEq.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package arrow.fx.extensions

import arrow.extension
import arrow.fx.IODeprecation
import arrow.fx.typeclasses.ExitCase
import arrow.typeclasses.Eq

@extension
@Deprecated(IODeprecation)
interface ExitCaseEq<E> : Eq<ExitCase<E>> {
fun EQE(): Eq<E>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package arrow.fx.extensions

import arrow.Kind
import arrow.core.Option
import arrow.extension
import arrow.fx.IODeprecation
import arrow.fx.Queue
import arrow.fx.QueueOf
Expand All @@ -12,7 +11,6 @@ import arrow.typeclasses.Functor
import arrow.typeclasses.Invariant
import arrow.undocumented

@extension
@undocumented
@Deprecated(IODeprecation)
interface QueueInvariant<F> : Invariant<QueuePartialOf<F>> {
Expand Down
6 changes: 0 additions & 6 deletions arrow-fx/src/main/kotlin/arrow/fx/extensions/duration.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package arrow.fx.extensions

import arrow.core.Ordering
import arrow.extension
import arrow.fx.IODeprecation
import arrow.fx.typeclasses.Duration
import arrow.fx.typeclasses.seconds
Expand All @@ -11,32 +10,27 @@ import arrow.typeclasses.Monoid
import arrow.typeclasses.Order
import arrow.typeclasses.Semigroup

@extension
@Deprecated(IODeprecation)
interface DurationEq : Eq<Duration> {
override fun Duration.eqv(b: Duration): Boolean = compareTo(b) == 0
}

@extension
@Deprecated(IODeprecation)
interface DurationHash : Hash<Duration> {
override fun Duration.hash(): Int = hashCode()
}

@extension
@Deprecated(IODeprecation)
interface DurationOrder : Order<Duration> {
override fun Duration.compare(b: Duration): Ordering =
Ordering.fromInt(this.compareTo(b))
}

@extension
@Deprecated(IODeprecation)
interface DurationSemigroup : Semigroup<Duration> {
override fun Duration.combine(b: Duration): Duration = this + b
}

@extension
@Deprecated(IODeprecation)
interface DurationMonoid : Monoid<Duration>, DurationSemigroup {
override fun empty(): Duration = 0.seconds
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package arrow.fx.extensions.duration.eq

import arrow.fx.IODeprecation
import arrow.fx.extensions.DurationEq
import arrow.fx.typeclasses.Duration
import arrow.fx.typeclasses.Duration.Companion
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.PublishedApi
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
* cached extension
*/
@PublishedApi()
internal val eq_singleton: DurationEq = object : arrow.fx.extensions.DurationEq {}

@JvmName("neqv")
@Suppress(
"UNCHECKED_CAST",
"USELESS_CAST",
"EXTENSION_SHADOWED_BY_MEMBER",
"UNUSED_PARAMETER"
)
@Deprecated(IODeprecation)
fun Duration.neqv(arg1: Duration): Boolean = arrow.fx.typeclasses.Duration.eq().run {
this@neqv.neqv(arg1) as kotlin.Boolean
}

@Suppress(
"UNCHECKED_CAST",
"NOTHING_TO_INLINE"
)
@Deprecated(IODeprecation)
inline fun Companion.eq(): DurationEq = eq_singleton
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package arrow.fx.extensions.duration.hash

import arrow.fx.IODeprecation
import arrow.fx.extensions.DurationHash
import arrow.fx.typeclasses.Duration
import arrow.fx.typeclasses.Duration.Companion
import kotlin.Deprecated
import kotlin.Int
import kotlin.PublishedApi
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
* cached extension
*/
@PublishedApi()
internal val hash_singleton: DurationHash = object : arrow.fx.extensions.DurationHash {}

@JvmName("hashWithSalt")
@Suppress(
"UNCHECKED_CAST",
"USELESS_CAST",
"EXTENSION_SHADOWED_BY_MEMBER",
"UNUSED_PARAMETER"
)
@Deprecated(IODeprecation)
fun Duration.hashWithSalt(arg1: Int): Int = arrow.fx.typeclasses.Duration.hash().run {
this@hashWithSalt.hashWithSalt(arg1) as kotlin.Int
}

@Suppress(
"UNCHECKED_CAST",
"NOTHING_TO_INLINE"
)
@Deprecated(IODeprecation)
inline fun Companion.hash(): DurationHash = hash_singleton
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package arrow.fx.extensions.duration.monoid

import arrow.fx.IODeprecation
import arrow.fx.extensions.DurationMonoid
import arrow.fx.typeclasses.Duration
import arrow.fx.typeclasses.Duration.Companion
import kotlin.Deprecated
import kotlin.PublishedApi
import kotlin.Suppress
import kotlin.collections.Collection
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
* cached extension
*/
@PublishedApi()
internal val monoid_singleton: DurationMonoid = object : arrow.fx.extensions.DurationMonoid {}

@JvmName("combineAll")
@Suppress(
"UNCHECKED_CAST",
"USELESS_CAST",
"EXTENSION_SHADOWED_BY_MEMBER",
"UNUSED_PARAMETER"
)
@Deprecated(IODeprecation)
fun Collection<Duration>.combineAll(): Duration = arrow.fx.typeclasses.Duration.monoid().run {
this@combineAll.combineAll() as arrow.fx.typeclasses.Duration
}

@JvmName("combineAll")
@Suppress(
"UNCHECKED_CAST",
"USELESS_CAST",
"EXTENSION_SHADOWED_BY_MEMBER",
"UNUSED_PARAMETER"
)
@Deprecated(IODeprecation)
fun combineAll(arg0: List<Duration>): Duration = arrow.fx.typeclasses.Duration
.monoid()
.combineAll(arg0) as arrow.fx.typeclasses.Duration

@Suppress(
"UNCHECKED_CAST",
"NOTHING_TO_INLINE"
)
@Deprecated(IODeprecation)
inline fun Companion.monoid(): DurationMonoid = monoid_singleton