myriad icon indicating copy to clipboard operation
myriad copied to clipboard

Add usage of lenses to the lens how-to page

Open 7sharp9 opened this issue 4 years ago • 4 comments

https://moiraesoftware.github.io/myriad//how-tos/lenses.html

7sharp9 avatar Apr 22 '21 08:04 7sharp9

I would also like to see this. For instance I can't work out why the generated setter is 'b -> 'a -> 'b instead of 'a -> 'b -> 'b as seen in Aether. I would like to be able to use all the utility functions in Aether but the lenses generated here have the wrong signature. So now I am porting Aether (just for me) to match these signatures. But I suspect there is some intended usage pattern that motivates the signature in myriad, I'm just not seeing it.

@7sharp9 could you provide a teaser here of what the usage looks like using this signature?

travis-leith avatar Apr 22 '21 13:04 travis-leith

@travis-leith MAyeb in Aether they are flipped to promote piping the record into the setter.

7sharp9 avatar Apr 22 '21 15:04 7sharp9

See https://github.com/MoiraeSoftware/myriad/blob/master/test/Myriad.IntegrationPluginTests/Tests.fs#L103-L123 for details on usage.

7sharp9 avatar Apr 22 '21 15:04 7sharp9

Having gone through the exercise of re-implementing the various utilities to cater for the Myriad setter, having it flipped does lead to neater code in this regard.

travis-leith avatar Apr 22 '21 15:04 travis-leith

Inactive so closing.

7sharp9 avatar Jun 28 '23 11:06 7sharp9