Generalised plusequals
leontrolski
13 points
7 comments
April 24, 2026
Related Discussions
Found 5 related stories in 63.3ms across 5,498 title embeddings via pgvector HNSW
- Hegel, a universal property-based testing protocol and family of PBT libraries PaulHoule · 99 pts · April 09, 2026 · 43% similar
- Combinators tosh · 140 pts · March 31, 2026 · 39% similar
- All elementary functions from a single binary operator pizza · 194 pts · April 13, 2026 · 39% similar
- A Perfectable Programming Language yuppiemephisto · 94 pts · April 12, 2026 · 38% similar
- Zstandard Across the Stack oddurmagnusson · 14 pts · April 02, 2026 · 38% similar
Discussion Highlights (5 comments)
flebron
The website asks what they do in Haskell. The answer is property modification and reading, as well as very powerful traversal constructs, use lenses ( https://hackage.haskell.org/package/lens , tutorial at https://hackage.haskell.org/package/lens-tutorial-1.0.5/docs... ).
rokob
Yeah this looks like lenses at first glance
hatthew
It seems like this is proposing syntactic sugar to make mutating and non-mutating operations be on equal footing. > The more interesting example is reassigning the deeply nested l to make the cat inside older, without mutating the original cat Isn't that mutating l, though? If you're concerned about mutating cat, shouldn't you be concerned about mutating l?
beaumayns
q has the concept of amend, which is similar: https://code.kx.com/q4m3/6_Functions/#683-general-form-of-fu... It's quite handy, though the syntax for it is rather clunky compared to the rest of the language in my opinion.
RodgerTheGreat
In Lil[0], this is how ordinary assignment syntax works. Implicitly defining a dictionary stored in a variable named "cat" with a field "age": cat.age:3 # {"age":3} Defining "l" as in the example in the article. We need the "list" operator to enlist nested values so that the "," operator doesn't concatenate them into a flat list: l:1,(list 2,list cat),4 # (1,(2,{"age":3}),4) Updating the "age" field in the nested dictionary. Lil's basic datatypes are immutable, so "l" is rebound to a new list containing a new dictionary, leaving any previous references undisturbed: l[1][1].age:9 # (1,(2,{"age":9}),4) cat # {"age":3} There's no special "infix" promotion syntax, so that last example would be: l:l,5 # (1,(2,{"age":9}),4,5) [0] http://beyondloom.com/tools/trylil.html