Coder Social home page Coder Social logo

Comments (7)

RyanGlScott avatar RyanGlScott commented on June 24, 2024 1

Yes, I think we should re-export these from Control.Lens.Operators as well.

(<<>:~) appears misdocumented in the changelog: it is actually left-side <> and-return-result

Sorry about that! I wrote the CHANGELOG after #1058 had landed, so any errors in the CHANGELOG are purely my fault. @ncaq, would you be willing to double-check what I wrote and fix any inaccuracies?

Should these lenses also have << variants which return the old value?

Thoughts, @ncaq?

from lens.

ncaq avatar ncaq commented on June 24, 2024

I think it is a good policy to export.

from lens.

RyanGlScott avatar RyanGlScott commented on June 24, 2024

OK. Regarding the CHANGELOG mistake, I think I was confused by the Haddocks for (<<>:~):

lens/src/Control/Lens/Lens.hs

Lines 1195 to 1201 in 1ce86ea

-- | ('<>') a 'Semigroup' value onto the end of the target of a 'Lens' and
-- return the result.
-- However, unlike '<<>~', it is prepend to the head side.
--
-- When you do not need the result of the operation, ('Control.Lens.Setter.<>:~') is more flexible.
(<<>:~) :: Semigroup m => LensLike ((,)m) s t m m -> m -> s -> (m, t)
l <<>:~ m = l <%~ (m <>)

The Haddocks talk about appending an element to the end, but the implementation prepends to the front instead. As such, I think we need to correct both the Haddocks and the CHANGELOG.

from lens.

RyanGlScott avatar RyanGlScott commented on June 24, 2024

I've submitted a fix in #1068.

from lens.

ncaq avatar ncaq commented on June 24, 2024

I copied and pasted the basic part thinking it was basically the same and unlike it, prepend to the head side...
I should have checked the basic part properly.
I made a mistake because I am not good at English.
Thank you for your time and effort.

from lens.

RyanGlScott avatar RyanGlScott commented on June 24, 2024

No problem at all, @ncaq. Thank you for your contribution!

from lens.

endgame avatar endgame commented on June 24, 2024

Thank you for your time and effort.

And thank you for yours.

from lens.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.