Skip to content
πŸŒ‹ Idris implementation of patricia tree
Idris Nix Shell
Branch: master
Clone or download
chshersh and vrom911 Update author and .travis.yml (#10)
* Update author and .travis.yml

* Fix Travis CI
Latest commit 9664fd1 Jul 3, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Patricia ✨ πŸ“° [#4] Implement `IntSet` as a wrapper of `IntMap`. Oct 27, 2017
Test/Patricia β˜”οΈ Add test for `IntSet`. Oct 27, 2017
.gitignore πŸ’š [#1] Setup Travis CI using nix Oct 12, 2017
.travis.yml Update author and .travis.yml (#10) Jul 3, 2018
CODEOWNERS
CONTRIBUTING.md
LICENSE Initial commit Oct 12, 2017
README.md Update author and .travis.yml (#10) Jul 3, 2018
default.nix πŸ’š [#1] Setup Travis CI using nix Oct 12, 2017
install-dependencies.sh Update author and .travis.yml (#10) Jul 3, 2018
patricia-nix.ipkg Update author and .travis.yml (#10) Jul 3, 2018
patricia.ipkg Update author and .travis.yml (#10) Jul 3, 2018

README.md

idris-patricia

Build status MIT license

This package implements map from integer key to values. Data structure can be used as persistent array. Implementation is based on article about patricia trees and on existing Haskell implementation from containers package. Dependent types can help to ensure some invariants for data structure.

REPL examples

λΠ> the (Int32Map String) $ insert 3 "a" Empty
Leaf (MkBits 3) "a" : IntBitMap 32 String

λΠ> the (Int32Map String) $ delete 3 $ insert 3 "a" Empty
Empty : IntBitMap 32 String

λΠ> the (Int32Map String) $ insert 2 "c" $ insert 4 "b" $ insert 3 "a" Empty
Bin (MkBits 3)
    (FS (FS FZ))
    (Bin (MkBits 2) FZ (Leaf (MkBits 2) "c") (Leaf (MkBits 3) "a"))
    (Leaf (MkBits 4) "b") : IntBitMap 32 String

λΠ> toList $ the (IntBitMap 32 String) $ insert 2 "c" $ insert 4 "b" $ insert 3 "a" Empty
["c", "a", "b"] : List String

How to build

Nix

Just run this command to build project and run tests.

nix-shell -A idris-patricia --command "bash install-dependencies.sh && idris --testpkg patricia-nix.ipkg --idrispath dependencies/specdris/src"

No-Nix

  1. Install specdris following instructions from repository.
  2. Run idris --testpkg patricia.ipkg.
You can’t perform that action at this time.