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

Lots of optics #79

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Lots of optics #79

wants to merge 3 commits into from

Conversation

b-mehta
Copy link
Contributor

@b-mehta b-mehta commented Sep 12, 2019

Draft:

  • It's unclear how efficient Batch is. It's also unclear if it (and its applicative instance) are defined in the correct way: it might allocate less if the order in :*: is flipped, and the <*> definition adjusted accordingly.
  • Some of set, set', set'' might not be useful.
  • The withXXX functions aren't consistent in their return type.
  • There are some very bad names, eg MyFunctor and inn.

@b-mehta
Copy link
Contributor Author

b-mehta commented Sep 13, 2019

I've modified the Batch type as described above, and it is more efficient now.

aspiwack added a commit that referenced this pull request Sep 18, 2020
These are ported from #79 where they were needed for traversal-type
things. These instances can't hurt. Even though I don't know what we
are going to do with traversals yet.
aspiwack added a commit that referenced this pull request Sep 18, 2020
These are ported from #79 where they were needed for traversal-type
things. These instances can't hurt. Even though I don't know what we
are going to do with traversals yet.
aspiwack added a commit that referenced this pull request Sep 18, 2020
With a linear lens, we cannot linearly set the value at the lens site
in general, however, we can swap the value at the lens site for
another, which we get out of the operation.

Ported from #79.
aspiwack added a commit that referenced this pull request Sep 18, 2020
Translation between the profunctor definition of lens and the more
straightforward getter/setter pair.

Ported from #79.
@aspiwack
Copy link
Member

I've pushed most of this PR to smaller PRs (#194 , #195, #196 ).

What's left is

I'm leaving the PR open, still, as an inspiration as I'm trying to tackle the traversal story. See also #190 (and soon more).

utdemir pushed a commit that referenced this pull request Sep 22, 2020
With a linear lens, we cannot linearly set the value at the lens site
in general, however, we can swap the value at the lens site for
another, which we get out of the operation.

Ported from #79.
utdemir pushed a commit that referenced this pull request Sep 22, 2020
Translation between the profunctor definition of lens and the more
straightforward getter/setter pair.

Ported from #79.
utdemir pushed a commit that referenced this pull request Sep 22, 2020
With a linear lens, we cannot linearly set the value at the lens site
in general, however, we can swap the value at the lens site for
another, which we get out of the operation.

Ported from #79.
utdemir pushed a commit that referenced this pull request Sep 22, 2020
Translation between the profunctor definition of lens and the more
straightforward getter/setter pair.

Ported from #79.
@aspiwack aspiwack mentioned this pull request Sep 25, 2020
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.

2 participants