From e589341c4f84861d6295e276df944f82133804b8 Mon Sep 17 00:00:00 2001 From: Cody Mikol Date: Mon, 4 Oct 2021 21:40:53 -0400 Subject: [PATCH] docs(Either): correct error in `getOrElse` this fixes the example of `getOrElse` to use a lambda function rather than just passing a value. Fixes N/A --- .../arrow-core/src/commonMain/kotlin/arrow/core/Either.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Either.kt b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Either.kt index 10520b7e59f..6a87f9c6992 100644 --- a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Either.kt +++ b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Either.kt @@ -1114,8 +1114,8 @@ public fun Either>.flatten(): Either = * * Example: * ``` - * Right(12).getOrElse(17) // Result: 12 - * Left(12).getOrElse(17) // Result: 17 + * Right(12).getOrElse { 17 } // Result: 12 + * Left(12).getOrElse { 17 } // Result: 17 * ``` */ public inline fun Either<*, B>.getOrElse(default: () -> B): B =