From b4e79d10f3e45b3610416f8eadd7e9119e000d62 Mon Sep 17 00:00:00 2001 From: stylianosgakis Date: Mon, 3 Oct 2022 15:56:12 +0200 Subject: [PATCH] Update NonEmptyList.fromList deprecation to suggest `toOption()` instead Suggest `.toOption()` instead of `Option.fromNullable()`. Coming from a discussion in StackOverFlow here https://stackoverflow.com/a/73893138/9440211. --- .../src/commonMain/kotlin/arrow/core/NonEmptyList.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/NonEmptyList.kt b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/NonEmptyList.kt index 80e58e68eb1..d823b9fc482 100644 --- a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/NonEmptyList.kt +++ b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/NonEmptyList.kt @@ -237,10 +237,9 @@ public class NonEmptyList( @Deprecated( "Use toNonEmptyListOrNull instead", ReplaceWith( - "Option.fromNullable>(l.toNonEmptyListOrNull())", + "l.toNonEmptyListOrNull().toOption()", "import arrow.core.toNonEmptyListOrNull", - "import arrow.core.Option", - "import arrow.core.NonEmptyList" + "import arrow.core.toOption" ) ) @JvmStatic