GithubHelp home page GithubHelp logo

critbit's People

Contributors

23skidoo avatar archblob avatar bos avatar bsattelb avatar dchagniot avatar fgc avatar frerich avatar isturdy avatar kgeorgiy avatar mihaimaruseac avatar mikesteele81 avatar mno2 avatar outamaa avatar rbobrowicz avatar yoeight 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

critbit's Issues

Checking `Empty` child of `Internal` nodes

Documentation states that Empty allowed only as a root of the tree. Both performance and functions (e. g. binarySetOpWithKey) depends on this invariant. But, now it is not checked by tests at all.

Unfortunately, there is no way to write such check function using public API only.

AFAIU there are two ways to solve this problem:

  1. Make one of the API functions (e.g. toList) to check this. This check will cost just a one call on the root tree.
  2. Provide special check function in the API.

I think first variant is better.

Inline vs. Inlinable?

member is marked INLINABLE while notMember is marked INLINE, despite both habing essentially identical structure. Other things that are INLINE while similar functions are INLINABLE: foldlWithKeyWith, foldrWithKeyWith (in these cases I would expect the API wrapper functions to be INLINE and the longer core function INLINABLE, if anything), updateExtremity.

Functions missing any such pragma that I think may want one: null, empty, elems, assocs, keys, unionWith, unionWithKey, unions, unionsWith, intersectionWithKey, map, mapKeys, toAscList, toDescList, filter.

Is there some reason to these decisions that I have overlooked?

Generalize Core.delete to updateWithKey

In the definition of delete,

go (Leaf lk _) cont
   | k == lk = cont Empty

becomes

go (Leaf lk lv) cont
  | k == lk = case f k lv of
                Just lv' -> cont (Leaf lk lv')
                Nothing  -> cont Empty

since - unlike with Data.Map - we don't rebalance the tree on a deletion. Then delete = updateWithKey (const (const Nothing)).

Hopefully this isn't too hard on GHC. I'll look at this unless someone else is interested.

Bugs in `split` and `splitLookup`

Current imlementation of split and splitLookup is invalid.

Call split "bb" $ fromList [("aa", 1), ("ac", 2), ("ad", 3)] returns (fromList [("aa",1),("ac",2)],fromList [("ad",3)]) instead of (fromList [("aa",1),("ac",2), ("ad",3)],fromList []).

The same arguments demonstrate bug in splitLookup.

haskell-platform 2012.4.0.0 incompatibilities

haskell-platform 2012.4.0.0 has text == 0.11.2.3
https://github.com/haskell/haskell-platform/blob/master/haskell-platform.cabal#L91

Changing the requirement to >= 0.11.2.3 appears to build and pass tests just fine here.

The benchmarks don't build with 2012.4.0.0 for at least the following reasons:

  • Need to do import Prelude hiding (catch)
  • System.Environment.lookupEnv isn't present, so need to implement it in terms of getEnv
  • Data.Map.lookupGT isn't present, so I guess that benchmark needs to be ignored
  • No instance for (NFData B.ByteString), which is easy to define (since they're strict) but I don't know what commotion it would cause with a newer version of bytestring
import System.Environment (getEnv)
lookupEnv :: String -> IO (Maybe String)
lookupEnv name = (Just <$> getEnv name) `catch` \(_::IOError) -> return Nothing
instance NFData B.ByteString

Stackage LTS

Hi,

Would it be possible to add critbit on Stackage ?

Or would it be better if it is added by another package maintainer, one that uses it as a dependency ?

Cheers,

Complexity of 'Combination' functions.

From what I understand, and if I'm not mistaken, the complexity of union is O(n*log m) where n is the size of the second map and m the size of the first one.
Can't we do better ? I've tried to implement the difference function and I have not found a way to do it better.

Should we fork?

The instructions say to 'git clone git://github.com/bos/critbit'. Should we not fork and clone our own repository?

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.