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

Builder Profunctor instance #32

Closed
matthewleon opened this issue Feb 11, 2018 · 3 comments
Closed

Builder Profunctor instance #32

matthewleon opened this issue Feb 11, 2018 · 3 comments

Comments

@matthewleon
Copy link
Contributor

There should be a Profunctor instance for Builders.

matthewleon added a commit to matthewleon/purescript-record that referenced this issue Feb 11, 2018
@hdgarrood
Copy link
Contributor

I'm not sure this is doable, actually. The problem is that, as I understand it, a Builder a b is a function a -> b which is guaranteed to use its argument exactly once, but allowing you to lmap with any old function could break that guarantee. I've haven't been able to come up with an example of this breaking things yet but I expect it can be done.

@paf31 does this sound reasonable?

@matthewleon
Copy link
Contributor Author

@hdgarrood I see what you're saying.

@paf31
Copy link
Contributor

paf31 commented Feb 11, 2018

Something like lmap (const r) builder seems like it would cause trouble by modifying the immutable record r.

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

No branches or pull requests

3 participants