Comments (4)
Lenses seems are hard as many relevant topics emerge:
- immutability and Dispose (custom X Dispose() with X X.Using(), not void Dispose() using(x){}). I.e. other mechanisms for memory management inside immutable tree (e.g. reference counting for some cache/pool/native pointers/ kernel handles/ file handles/ etc), not GC. These infect whole tree, mutable inside immutable?
- if have object tree better have it structural equality out of box for all of it.
- can tree use Ref wrappers around value tuples, around readonly structs?
ref
returns of structs from immutable tree? Stack only tree and it lenses (infinite loop handling evens andchanging
readonly struct stored on stack? - default values not set? Options?
- could we have
expression
based lenses - allows for clever dependencies tracking, merge, diff, updates. see also https://github.com/louthy/language-ext/blob/e385e64c8c025b606640e4631c53d63bf27c2a58/LanguageExt.Core/DataTypes/Patch/Edit.cs - how to notify about update our of immutable tree to show changes in UI (lenses with notify property changed)?
- Clone lense - sub tree or whole? Custom View onto immutable tree? View with custom lenses?
- when I balance tree, what API is best for less typing and less breaks when changing lenses?
- experience of F# lenses? https://xyncro.tech/aether/
- performance, tests, documentation
I.e. what is basic lens API? Not sure that interface ILens<T, P>
is best or good one or enough for real world.
10 man days work to get it to be known:)
from imtools.
I wrote down the case when generic struct interfaces with unmanaged
constrains and inlining via attribute and all possible in
and ref
with zero GC do work in C# and beat internal calls to CLR (C++ methods).
Also I tasks and tuples and other patters get double (class and struct semantics).
So should unions be structs and passed by ref? Should be 2 kinds of interfaces?
So yet another open question at least for me.
Another question how to pass equality compares. In immutable stuff comparing becomes more usable and more important. May be it is time in .NET for next design https://github.com/qbit86/misnomer#misnomerfictionary ?
from imtools.
Here is another experiment:
dotnet/corefxlab#2458
Funny thing, that this PR is close to approval to namespace Microsoft.Collections.Extensions
.
from imtools.
Not now or maybe ImTools is not a good place for that.
from imtools.
Related Issues (20)
- Try out 2-3-4 tree HOT 4
- Remove ImMap V1 from the benchmarks in readme and add ImMap234
- Add ImHashMap23 on par with ImMap23
- Add ImMap.GetSurePresentValue method
- Replace the ImMap methods with Update delegate parameter with composable Add and Update methods
- Add a builder-like capability to the ImHashMap via BuildFromDifferent methods HOT 2
- Add the ImHashMap creation methods to accept the array of items and immediately build the final form of the map HOT 1
- Implement native ToJson and fromJson for maps HOT 1
- the Im(Hash)Map.Entry methods should return the entry type but now return the map type HOT 1
- Document Im(Hash)Map implementation quirks and tricks for the future presentation
- Try struct instead of array for PartitionedImMap HOT 1
- Add output of the ImHashMap as mermaid diagram HOT 1
- Merge the ImMap and ImHashMap implementations
- Optimize Enumerable for the PartitionedHashMap
- Reduce ImHashMap memory allocations keeping the speed
- Add AddSureNotPresent methods to compensate for GetSurePresent methods
- Optimize the case of split B2 to B3 when B2 other leaf still accommodate the Entry
- Fast mutable non-concurrent HashMap HOT 1
- Add to the ImHashMap ref state arguments to be propagated into the Update delegates
- ImHashMap<int, SampleClass> vs MemoryOwner<SampleClass> HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imtools.