GithubHelp home page GithubHelp logo

ixset-typed's People

Contributors

duog avatar felixonmars avatar kosmikus avatar stepcut avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ixset-typed's Issues

getRange behavior when index has several values for each entry

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!

Get index values

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.

GHC 8.4 compatibility

Please bump template-haskell upper bound and whatever else is necessary to get this to build with GHC 8.4.

ixset-typed-0.3 test suite build broken with GHC 7.10.x

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

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.