Skip to content

Conversation

@JordanMartinez
Copy link
Contributor

@JordanMartinez JordanMartinez commented Dec 25, 2020

Fixes #246

to :: rep -> a
from :: a -> rep

toRep :: forall from to. Generic from to => Proxy from -> Proxy to
Copy link
Member

Choose a reason for hiding this comment

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

Could we reuse a and rep variables, like in the class declaration?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

to :: rep -> a
from :: a -> rep

toRep :: forall from to. Generic from to => Proxy from -> Proxy to
Copy link
Member

Choose a reason for hiding this comment

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

Also I don’t know about you but I frequently confuse to and from, and I’m sure having to :: rep -> a but toRep :: Proxy a -> Proxy rep is going to be even more confusing to me 😬 May I suggest repOf instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good to me!

Copy link
Member

@kl0tl kl0tl left a comment

Choose a reason for hiding this comment

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

Thank you!

@JordanMartinez JordanMartinez merged commit 894e8f9 into purescript:master Dec 26, 2020
turlando pushed a commit to purescm/purescript-prelude that referenced this pull request Sep 3, 2021
* Add toRep

* Update type variable names to match class names

* Rename toRep to repOf
@JordanMartinez JordanMartinez deleted the addToRep branch September 24, 2021 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[generics-rep] Add a toRep function

3 participants