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

Deprecate Show #321

Merged
merged 7 commits into from Feb 3, 2021
Merged

Deprecate Show #321

merged 7 commits into from Feb 3, 2021

Conversation

nomisRev
Copy link
Member

@nomisRev nomisRev commented Feb 3, 2021

This PR deprecates Show since Kotlin, and Kotlin's Std doesn't take Show into account nor does Kotlin have the power to automatically derive or inject Show anywhere. This makes Show very cumbersome to work with, see Tuple10Show.kt.

The use-cases of Show seemed very limited and niche to us, so we've decided to exclude it from Arrow in 1.0.0. The common technique for this is to use data class, which automatically implements toString() and correctly implementing toString().

}

override fun toString(): String =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering why we need the toString method in the sealed class

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's not needed if it's defined for all the cases.

@franciscodr
Copy link
Contributor

I think we need to remove the instance of Show for Validated and its implementation:

Copy link
Contributor

@franciscodr franciscodr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @nomisRev!

Copy link
Member

@i-walker i-walker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nomisRev Looks great

@i-walker i-walker merged commit e7b5a59 into master Feb 3, 2021
@i-walker i-walker deleted the sv-deprecate-show branch February 3, 2021 21:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants