Skip to content

Update to current GHC, dependency updates, stack.yaml #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ cabal-dev
.cabal-sandbox
cabal.sandbox.config
dist
.stack-work
4 changes: 3 additions & 1 deletion Data/CritBit/Set.hs
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ import qualified Data.List as List
instance (Show a) => Show (Set a) where
show s = "fromList " ++ show (toList s)

instance CritBitKey k => Semigroup (Set k) where
(<>) = union

instance CritBitKey k => Monoid (Set k) where
mempty = empty
mappend = union
mconcat = unions

instance Foldable Set where
Expand Down
4 changes: 3 additions & 1 deletion Data/CritBit/Tree.hs
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,11 @@ import qualified Data.Array as A
import qualified Data.Foldable as Foldable
import qualified Data.List as List

instance CritBitKey k => Semigroup (CritBit k v) where
(<>) = union

instance CritBitKey k => Monoid (CritBit k v) where
mempty = empty
mappend = union
mconcat = unions

instance CritBitKey k => Traversable (CritBit k) where
Expand Down
1 change: 0 additions & 1 deletion Data/CritBit/Types/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ module Data.CritBit.Types.Internal
import Control.DeepSeq (NFData(..))
import Data.Bits (Bits, (.|.), (.&.), shiftL, shiftR)
import Data.ByteString (ByteString)
import Data.Foldable hiding (toList)
import Data.Monoid (Monoid(..))
import Data.Text ()
import Data.Text.Internal (Text(..))
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/Benchmarks.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Control.DeepSeq (NFData(..))
import Control.Monad (when)
import Control.Monad.Trans (liftIO)
import Criterion.Main (bench, bgroup, defaultMain, nf, whnf)
import Criterion.Types (Pure)
import Criterion.Types (Benchmarkable)
import Data.Foldable (foldMap)
import Data.Functor.Identity (Identity(..))
import Data.Hashable (Hashable(..), hashByteArray)
Expand Down Expand Up @@ -180,7 +180,7 @@ main = do
, bench "hashmap" $ whnf (hashmap b_hashmap_13) b_hashmap_23
, bench "trie" $ whnf (trie b_trie_13) b_trie_23
]
function (eval :: forall a b. NFData b => (a -> b) -> a -> Pure)
function (eval :: forall a b. NFData b => (a -> b) -> a -> Benchmarkable)
critbit map hashmap trie = [
bench "critbit" $ eval critbit b_critbit
, bench "map" $ eval map b_map
Expand Down Expand Up @@ -371,7 +371,7 @@ main = do
bench "critbit" $ nf (C.mapKeys f) b_critbit
, bench "map" $ nf (Map.mapKeys f) b_map
]
, bgroup "mapKeysWith" $ let f = (`mappend` "test") in [
, bgroup "mapKeysWith" $ let f = (`mappend` "test") in [
bench "critbit" $ nf (C.mapKeysWith (+) f) b_critbit
, bench "map" $ nf (Map.mapKeysWith (+) f) b_map
]
Expand Down
10 changes: 5 additions & 5 deletions critbit.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: critbit
version: 0.2.0.0
version: 0.2.1.0
homepage: https://github.com/bos/critbit
bug-reports: https://github.com/bos/critbit/issues
synopsis: Crit-bit maps and sets
Expand Down Expand Up @@ -43,7 +43,7 @@ library

build-depends:
array,
base >= 4 && < 5,
base >= 4.11 && < 5,
bytestring >= 0.9,
deepseq,
text >= 0.11.2.3,
Expand Down Expand Up @@ -71,7 +71,7 @@ test-suite tests

build-depends:
QuickCheck >= 2.7,
base >= 4 && < 5,
base >= 4.11 && < 5,
bytestring,
containers,
critbit,
Expand All @@ -89,14 +89,14 @@ benchmark benchmarks
ghc-options: -O2 -rtsopts

build-depends:
base >= 4 && < 5,
base >= 4.11 && < 5,
bytestring,
bytestring-trie,
containers,
critbit,
criterion >= 0.8,
deepseq,
hashable < 1.2,
hashable >= 1.2 && < 1.3,
mtl,
mwc-random,
text,
Expand Down
7 changes: 7 additions & 0 deletions stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resolver: lts-13.21

packages:
- .

extra-deps:
- bytestring-trie-0.2.5.0