diff options
author | joe <joe@jerkface.net> | 2017-02-01 03:21:52 -0500 |
---|---|---|
committer | joe <joe@jerkface.net> | 2017-02-01 03:21:52 -0500 |
commit | c51e64666b672637843a04c2f279d7d0c9eed01c (patch) | |
tree | d6f50018659ac3c5c3d72ee9bde3824514bd9f6a /src/Data/Wrapper | |
parent | 0d1de683de78a70ce9c054b444bb6f19c39d112c (diff) |
New improved iterative search algorithm.
Diffstat (limited to 'src/Data/Wrapper')
-rw-r--r-- | src/Data/Wrapper/PSQ.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Data/Wrapper/PSQ.hs b/src/Data/Wrapper/PSQ.hs index e8fa2d98..2c08011b 100644 --- a/src/Data/Wrapper/PSQ.hs +++ b/src/Data/Wrapper/PSQ.hs | |||
@@ -15,10 +15,14 @@ type Binding k p = (k,p,()) | |||
15 | pattern (:->) :: k -> p -> Binding k p | 15 | pattern (:->) :: k -> p -> Binding k p |
16 | pattern k :-> p <- (k,p,()) where k :-> p = (k,p,()) | 16 | pattern k :-> p <- (k,p,()) where k :-> p = (k,p,()) |
17 | 17 | ||
18 | key :: Binding k v -> k | 18 | key :: Binding k p -> k |
19 | key (k,p,v) = k | 19 | key (k,p,v) = k |
20 | {-# INLINE key #-} | 20 | {-# INLINE key #-} |
21 | 21 | ||
22 | prio :: Binding k p -> p | ||
23 | prio (k,p,v) = p | ||
24 | {-# INLINE prio #-} | ||
25 | |||
22 | insert :: (Ord k, Ord p) => k -> p -> PSQ k p -> PSQ k p | 26 | insert :: (Ord k, Ord p) => k -> p -> PSQ k p -> PSQ k p |
23 | insert k p q = OrdPSQ.insert k p () q | 27 | insert k p q = OrdPSQ.insert k p () q |
24 | {-# INLINE insert #-} | 28 | {-# INLINE insert #-} |