Skip to content

Commit 278847e

Browse files
committed
Rename pipeK operator.
Having types available means that a special name is not required.
1 parent e37d9af commit 278847e

File tree

1 file changed

+3
-3
lines changed
  • http-api-client/src/commonMain/kotlin/au/com/redcrew/apisdkcreator/httpclient/arrow

1 file changed

+3
-3
lines changed

http-api-client/src/commonMain/kotlin/au/com/redcrew/apisdkcreator/httpclient/arrow/either.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import arrow.core.flatMap
1010
*
1111
* For an introduction to Kleisli arrows, see https://blog.ssanj.net/posts/2017-06-07-composing-monadic-functions-with-kleisli-arrows.html
1212
*/
13-
infix fun <A,E,B,C> ((A) -> Either<E, B>).pipeK(ff: (B) -> Either<E,C>): (A) -> Either<E,C> =
13+
infix fun <A,E,B,C> ((A) -> Either<E, B>).pipe(ff: (B) -> Either<E,C>): (A) -> Either<E,C> =
1414
{ a: A -> this(a).flatMap(ff) }
1515

1616
/**
@@ -19,9 +19,9 @@ infix fun <A,E,B,C> ((A) -> Either<E, B>).pipeK(ff: (B) -> Either<E,C>): (A) ->
1919
* To understand the use of `this` see https://kotlinlang.org/docs/this-expressions.html
2020
*/
2121
infix fun <A, E, B, C> (
22-
suspend (A) -> Either<E, B>).pipeK(ff: suspend (B) -> Either<E, C>
22+
suspend (A) -> Either<E, B>).pipe(ff: suspend (B) -> Either<E, C>
2323
): suspend (A) -> Either<E, C> =
24-
{ a: A -> either { ff(this@pipeK(a).bind()).bind() } }
24+
{ a: A -> either { ff(this@pipe(a).bind()).bind() } }
2525

2626
fun <A, B> aLeft(value: A) = Either.Left(value) as Either<A, B>
2727
fun <A, B> aRight(value: B) = Either.Right(value) as Either<A, B>

0 commit comments

Comments
 (0)