well-typed / ixset-typed Goto Github PK
View Code? Open in Web Editor NEWMore strongly typed variant of the ixset Haskell package
License: BSD 3-Clause "New" or "Revised" License
More strongly typed variant of the ixset Haskell package
License: BSD 3-Clause "New" or "Revised" License
Hello, I have this (simplified) example taken from the code docs :
data Entry = Entry Content
deriving (Show, Eq, Ord, Data, Typeable)
newtype Content = Content String
deriving (Show, Eq, Ord, Data, Typeable)
newtype CWord = CWord String
deriving (Show, Eq, Ord)
getWords :: Entry -> [CWord]
getWords (Entry (Content s)) = map CWord $ words s
type EntryIxs = '[CWord]
instance Indexable EntryIxs Entry where
indices = ixList
(ixFun getWords)
type IxEntry = IxSet EntryIxs Entry
The key here is that one Entry can give several CWord
Then if I do:
let entries = insertList [Entry (Content "word1 word4")] (empty :: IxEntry)
let r = getRange (CWord "word2") (CWord "word3") entries
I would have expected r to be empty, since no word in my only Entry is between word2 inclusive and word3. However, r does contain my Entry. I suppose, having looked at the result for getLT and getGTE, than since the entry matches LT (with word1) and GTE (with word4), it is returned, even though the matches are on different values!
If that's normal behavior, is there an easy way to code a range query that checks the range applies on each value independently of the others?
Thanks!
For example I have a table of id, country, city
indexed by id and country.
I would like to get a list of countries known to the index, without having to touch data values.
I.e. keys :: IsIndexOf ix ixs => IxSet ixs a -> [ix]
.
It is possible with map fst . groupBy
but I want to be sure I wouldn't be needlessly accessing the data.
Please update for GHC 8.2
ixset-typed appears to build fine with template-haskell 2.19
Please bump template-haskell upper bound and whatever else is necessary to get this to build with GHC 8.4.
Citing from http://hydra.cryp.to/build/863086/nixlog/1/raw:
Preprocessing test suite 'test-ixset-typed' for ixset-typed-0.3...
tests/Data/IxSet/Typed/Tests.hs:1:51: Warning:
-XOverlappingInstances is deprecated: instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS
[1 of 2] Compiling Data.IxSet.Typed.Tests ( tests/Data/IxSet/Typed/Tests.hs, dist/build/test-ixset-typed/test-ixset-typed-tmp/Data/IxSet/Typed/Tests.dyn_o )
tests/Data/IxSet/Typed/Tests.hs:61:1:
Illegal kind signature: ‘*’
Perhaps you intended to use KindSignatures
In the declaration for type synonym ‘Gs’
tests/Data/IxSet/Typed/Tests.hs:61:1:
Illegal kind signature: ‘*’
Perhaps you intended to use KindSignatures
In the declaration for type synonym ‘Gs’
tests/Data/IxSet/Typed/Tests.hs:61:1:
Illegal kind signature: ‘*’
Perhaps you intended to use KindSignatures
In an expression type signature
tests/Data/IxSet/Typed/Tests.hs:61:1:
Illegal kind signature: ‘*’
Perhaps you intended to use KindSignatures
In an expression type signature
Would be great to get this for GHC 9 compatibility: #16
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.