summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouisWasserman <>2011-03-01 01:26:13 (GMT)
committerLuite Stegeman <luite@luite.com>2011-03-01 01:26:13 (GMT)
commit1a41b2612fcfb197f8da8431080c1963d57a6092 (patch)
tree0ac97decccfc713e368b23327ffefd0a3466b8eb
parent852a9b837661b76e71770bdc9055c8cfed92ad7a (diff)
version 4.0.14.0.1
-rw-r--r--Data/TrieMap.hs10
-rw-r--r--TrieMap.cabal13
2 files changed, 20 insertions, 3 deletions
diff --git a/Data/TrieMap.hs b/Data/TrieMap.hs
index cddfa6e..b6d57a5 100644
--- a/Data/TrieMap.hs
+++ b/Data/TrieMap.hs
@@ -9,7 +9,9 @@ module Data.TrieMap (
-- ** Components
key,
before,
+ beforeWith,
after,
+ afterWith,
-- ** Locations in maps
search,
index,
@@ -1023,6 +1025,14 @@ before (TLoc _ hole) = TMap (beforeM hole)
after :: TKey k => TLocation k a -> TMap k a
after (TLoc _ hole) = TMap (afterM hole)
+-- | @'beforeWith' a loc@ is equivalent to @'insert' ('key' loc) a ('before' loc)@.
+beforeWith :: TKey k => a -> TLocation k a -> TMap k a
+beforeWith a (TLoc k hole) = TMap (beforeWithM (Assoc k a) hole)
+
+-- | @'afterWith' a loc@ is equivalent to @'insert' ('key' loc) a ('after' loc)@.
+afterWith :: TKey k => a -> TLocation k a -> TMap k a
+afterWith a (TLoc k hole) = TMap (afterWithM (Assoc k a) hole)
+
-- | Search the map for the given key, returning the
-- corresponding value (if any) and an updatable location for that key.
--
diff --git a/TrieMap.cabal b/TrieMap.cabal
index b091773..39fd47f 100644
--- a/TrieMap.cabal
+++ b/TrieMap.cabal
@@ -1,5 +1,5 @@
name: TrieMap
-version: 4.0.0
+version: 4.0.1
cabal-version: >= 1.6
tested-with: GHC
category: Algorithms
@@ -10,6 +10,8 @@ description: Provides a efficient and compact implementation of generalized
.
The most recent release combines zipper-based ideas from recently proposed changes to Data.Map, as well
as heavily optimized ByteString and Vector instances based on the vector package.
+
+ For best performance, use @cabal install -fllvm -O2@.
license: BSD3
license-file: LICENSE
author: Louis Wasserman
@@ -21,13 +23,18 @@ source-repository head
type: git
location: git@github.com:lowasser/TrieMap.git
+Flag LLVM {
+ Description: Compile with LLVM, because you mean srs bzns
+ Default: False
+}
+
Library{
build-Depends: base < 5.0.0.0, containers, template-haskell >= 2.5.0.0, bytestring >= 0.9.1.0, th-expand-syns,
vector >= 0.6, primitive >= 0.3, unpack-funcs >= 0.1.2, transformers >= 0.2.0.0
ghc-options:
- -Wall -fno-warn-name-shadowing -fno-warn-orphans -O2 -fno-spec-constr-count -fno-spec-constr-threshold
+ -Wall -fno-warn-name-shadowing -fno-warn-orphans -fno-spec-constr-count -fno-spec-constr-threshold
-fno-liberate-case-threshold -fmax-worker-args=100
-if impl(ghc >= 7.0.0)
+if impl(ghc >= 7.0.0) && flag(LLVM)
ghc-options: -fllvm -optlo-O3 -optlo-std-compile-opts
exposed-modules:
Data.TrieMap,