Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constructor functions for Show to use receiver function #830

Closed
pakoito opened this issue May 3, 2018 · 2 comments
Closed

Constructor functions for Show to use receiver function #830

pakoito opened this issue May 3, 2018 · 2 comments

Comments

@pakoito
Copy link
Member

pakoito commented May 3, 2018

From gitter, current encoding

val catShow = Show<Cat> {
        val name = it.name
        val age = it.age
        val color = it.color
        "$name is a $age year old $color cat"
    }

with proposed encoding

val catShow = Show<Cat> {
        "$name is a $age year old $color cat"
    }
@pakoito
Copy link
Member Author

pakoito commented May 5, 2018

Eq cannot have receivers for two parameters, silly me :P

@pakoito pakoito changed the title Constructor functions for Show and Eq to use receiver function Constructor functions for Show to use receiver function May 5, 2018
@pakoito pakoito closed this as completed May 16, 2018
@pakoito
Copy link
Member Author

pakoito commented May 16, 2018

Closed by #835 . Thanks @ersin-ertan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant