Data.Store is pure, in-memory dictionary written in Haskell that supports multidimensional keys.
See:
Multi-key multi-value store for Haskell native data types with type safe interface.
Home Page: http://hackage.haskell.org/package/data-store
License: BSD 3-Clause "New" or "Revised" License
Data.Store is pure, in-memory dictionary written in Haskell that supports multidimensional keys.
See:
We will gain performance on par with regular lookup
but we will lose the ability to chain the lenses (this should not matter since we can create 'composite' query in one go unlike in tables where chaining of the lenses is used to create 'composite' queries).
Hi,
data-store seems a very interesting library for databases, but could you improve the documentation?
Explain, for example, what is the role of tag
in
data Store tag krs irs ts v
it seems that there is a mistake with the later example
...
type ContentStore = Store ContentStoreKRS ContentStoreIRS ContentStoreTS Content
Also, it is not clear how the O
and M
specifications affect the operations that I can run on a Store
.
Thanks
I haven't yet produced a minimal test case as my application is fairly complex, but here's the gist:
I'm using Storable to create a table for a record I have. The record has a field watchWState that is essentially defined as Active Int | Notifying.
If I do a map to update the state to Notifying from Active, if I do a query like S.lookup (sWatchWState .== Notifying) table, it comes back with nothing. Showing the raw table shows that the value of the row has Notifying, but the key portion still has the original value.
I can't imagine this is expected behavior. Maps by definition will update the records, so its weird that you cannot query the new table by the new values. It seems like the code https://github.com/Palmik/data-store/blob/master/src/Data/Store.hs#L445 just passes the key straight through.
In the mean time i guess I can do something like (S.fromList . Data.List.map . S.toList).
Add ordered lookups. The function signatures should look like this (here I assume that (tag, n)
denotes dimension of type one-to-one, but it could be extended to one-to-many dimensions as well):
lookupOrderByA :: IsSelection sel => sel tag krs irs ts -> (tag, n) -> I.Store tag krs irs ts v -> [(I.RawKey krs ts, v)]
lookupOrderByD :: IsSelection sel => sel tag krs irs ts -> (tag, n) -> I.Store tag krs irs ts v -> [(I.RawKey krs ts, v)]
lookupMap :: IsSelection sel => sel tag krs irs ts -> (tag, n) -> I.Store tag krs irs ts v -> Data.Map.Map (DimensionType krs irs n) (I.RawKey krs ts, v)
MySQL implements this (in the most general case) by sorting the result of the query afterwards [1]. I know we can do better at least in the case where the selection is simply (SelectionDimension n)
and we want to order the results by (tag, n)
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.