-
Notifications
You must be signed in to change notification settings - Fork 6
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
Draft optics implementation #13
Conversation
Great! The hard part is how to compose them efficiently.
|
What obstacles are there to 'efficiently?' I'm planning on implementing profunctor optics in a way that makes sense for Plutarch lenses.
Are there any efficiency considerations I am missing? |
Consider combining |
|
We have optics!
|
Why change the warnings?
Make sure to use GHC 9.2.4. You can do `nix develop` to get the correct GHC.
|
Happy to change that back. I use |
newtype CStar r f a b = CStar { runCStar :: a -> Cont r (f b) } | ||
|
||
class CProfunctor r p where | ||
cdimap :: (a -> Cont r b) -> (c -> Cont r d) -> p b (Cont r c) -> p a (Cont r d) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should still be p b c
and p a d
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then CProfunctor r ->
would not be implementable, but you could make a newtype where it is implementable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did try that. It is more elegant, but breaks too many things.
e.g.?
|
Not having |
In general, type applications are a code smell, along with AllowAmbiguousTypes IMO.
|
1231ca4
to
80556fe
Compare
Not actually a traversal, but allows easy definition of one. With example of use
bcd0459
to
1dacc89
Compare
|
We won't really know if this works until we have a backend to test with. |
Amazing! Perhaps we should work on getting a backend to work again. |
Plutarch has changed too much for this to be mergible. |
Initial draft implementation.