Skip to content

Commit

Permalink
Merge pull request #188 from IntersectMBO/ghc2021
Browse files Browse the repository at this point in the history
Use language: GHC2021
  • Loading branch information
jorisdral committed Apr 25, 2024
2 parents 8d2c6b1 + 49628fb commit b385254
Show file tree
Hide file tree
Showing 10 changed files with 83 additions and 115 deletions.
7 changes: 0 additions & 7 deletions bloomfilter/src/Data/BloomFilter.hs
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RoleAnnotations #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneKindSignatures #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
-- |
--
-- A fast, space efficient Bloom filter implementation. A Bloom
Expand Down
1 change: 0 additions & 1 deletion bloomfilter/src/Data/BloomFilter/BitVec64.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{-# LANGUAGE BangPatterns #-}
-- | Minimal bit vector implementation.
module Data.BloomFilter.BitVec64 (
BitVec64 (..),
Expand Down
2 changes: 0 additions & 2 deletions bloomfilter/src/Data/BloomFilter/Easy.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE ViewPatterns #-}
-- | An easy-to-use Bloom filter interface.
module Data.BloomFilter.Easy (
-- * Easy creation and querying
Expand Down
5 changes: 0 additions & 5 deletions bloomfilter/src/Data/BloomFilter/Hash.hs
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RoleAnnotations #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}

-- |
--
-- Fast hashing of Haskell values.
Expand Down
3 changes: 0 additions & 3 deletions bloomfilter/src/Data/BloomFilter/Internal.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE RoleAnnotations #-}
{-# LANGUAGE StandaloneKindSignatures #-}
{-# OPTIONS_HADDOCK not-home #-}
-- | This module exports 'Bloom'' definition.
module Data.BloomFilter.Internal (
Expand Down
7 changes: 0 additions & 7 deletions bloomfilter/src/Data/BloomFilter/Mutable.hs
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NumericUnderscores #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}

-- |
-- A fast, space efficient Bloom filter implementation. A Bloom
-- filter is a set-like data structure that provides a probabilistic
Expand Down
2 changes: 0 additions & 2 deletions bloomfilter/src/Data/BloomFilter/Mutable/Internal.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{-# LANGUAGE RoleAnnotations #-}
{-# LANGUAGE StandaloneKindSignatures #-}
{-# OPTIONS_HADDOCK not-home #-}
-- | This module exports 'MBloom'' internals.
module Data.BloomFilter.Mutable.Internal (
Expand Down
165 changes: 80 additions & 85 deletions lsm-tree.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@ common wno-x-partial
-- we decide to refactor code that uses partial functions.
ghc-options: -Wno-x-partial

common language
default-language: GHC2021
default-extensions:
GADTs
RoleAnnotations
ViewPatterns

library
import: warnings, wno-x-partial
hs-source-dirs: src
default-language: Haskell2010
import: language, warnings, wno-x-partial
hs-source-dirs: src
exposed-modules:
Data.Map.Range
Database.LSMTree.Common
Expand Down Expand Up @@ -90,32 +96,32 @@ library

-- this exists due windows
library xxhash
default-language: Haskell2010
visibility: private
include-dirs: xxhash/xxHash-0.8.2/ xxhash/include/
import: language
visibility: private
include-dirs: xxhash/xxHash-0.8.2/ xxhash/include/
includes:
HsXXHash.h
xxhash.h

exposed-modules: XXH3
exposed-modules: XXH3

if (arch(x86_64) && !os(osx))
-- Cabal doesn't pass cc-options to "ordinary" Haskell source compilation
-- https://github.com/haskell/cabal/issues/9801
ghc-options: -optc=-mavx2 -optc=-O3

other-modules: FFI
hs-source-dirs: xxhash/src
other-modules: FFI
hs-source-dirs: xxhash/src
build-depends:
, base
, bytestring
, primitive ^>=0.9

test-suite xxhash-tests
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: xxhash/tests
main-is: xxhash-tests.hs
import: language
type: exitcode-stdio-1.0
hs-source-dirs: xxhash/tests
main-is: xxhash-tests.hs
build-depends:
, base
, bytestring
Expand All @@ -127,9 +133,9 @@ test-suite xxhash-tests

-- this fork doesn't work on 32bit systems
library bloomfilter
visibility: private
hs-source-dirs: bloomfilter/src
default-language: Haskell2010
import: language
visibility: private
hs-source-dirs: bloomfilter/src
build-depends:
, base >=4.5 && <5
, bitvec ^>=1.1.5.0
Expand All @@ -150,14 +156,14 @@ library bloomfilter
Data.BloomFilter.Mutable
Data.BloomFilter.Mutable.Internal

ghc-options: -O2 -Wall
ghc-options: -O2 -Wall

test-suite bloomfilter-tests
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: bloomfilter/tests
main-is: bloomfilter-tests.hs
other-modules: QCSupport
import: language
type: exitcode-stdio-1.0
hs-source-dirs: bloomfilter/tests
main-is: bloomfilter-tests.hs
other-modules: QCSupport
build-depends:
, base
, bytestring
Expand All @@ -170,29 +176,28 @@ test-suite bloomfilter-tests
, vector

test-suite bloomfilter-primes
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: bloomfilter/tests
main-is: primes.hs
import: language
type: exitcode-stdio-1.0
hs-source-dirs: bloomfilter/tests
main-is: primes.hs
build-depends:
, base
, primes ^>=0.2.1.0

test-suite bloomfilter-spell
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: bloomfilter/examples
main-is: spell.hs
import: language
type: exitcode-stdio-1.0
hs-source-dirs: bloomfilter/examples
main-is: spell.hs
build-depends:
, base
, lsm-tree:bloomfilter

test-suite lsm-tree-test
import: warnings, wno-x-partial
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: test src-extras
main-is: Main.hs
import: language, warnings, wno-x-partial
type: exitcode-stdio-1.0
hs-source-dirs: test src-extras
main-is: Main.hs
other-modules:
Database.LSMTree.Extras
Database.LSMTree.Extras.Generators
Expand Down Expand Up @@ -273,14 +278,13 @@ test-suite lsm-tree-test
, vector
, wide-word

ghc-options: -fno-ignore-asserts -threaded
ghc-options: -fno-ignore-asserts -threaded

benchmark lsm-tree-micro-bench
import: warnings, wno-x-partial
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: bench/micro src-extras
main-is: Main.hs
import: language, warnings, wno-x-partial
type: exitcode-stdio-1.0
hs-source-dirs: bench/micro src-extras
main-is: Main.hs
other-modules:
Bench.Database.LSMTree.Internal.BloomFilter
Bench.Database.LSMTree.Internal.IndexCompact
Expand Down Expand Up @@ -311,14 +315,13 @@ benchmark lsm-tree-micro-bench
, vector
, wide-word

ghc-options: -rtsopts -with-rtsopts=-T -threaded
ghc-options: -rtsopts -with-rtsopts=-T -threaded

benchmark lsm-tree-macro-bench
import: warnings, wno-x-partial
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: bench/macro src-extras
main-is: Main.hs
import: language, warnings, wno-x-partial
type: exitcode-stdio-1.0
hs-source-dirs: bench/macro src-extras
main-is: Main.hs
other-modules:
Bench.Database.LSMTree.Internal.BloomFilter
Database.LSMTree.Extras.Orphans
Expand All @@ -333,12 +336,11 @@ benchmark lsm-tree-macro-bench
, vector
, wide-word

ghc-options: -rtsopts -with-rtsopts=-T -threaded
ghc-options: -rtsopts -with-rtsopts=-T -threaded

library kmerge
import: warnings, wno-x-partial
default-language: Haskell2010
hs-source-dirs: src-kmerge
import: language, warnings, wno-x-partial
hs-source-dirs: src-kmerge
exposed-modules:
KMerge.Heap
KMerge.LoserTree
Expand All @@ -349,11 +351,10 @@ library kmerge
, primitive

test-suite kmerge-test
import: warnings, wno-x-partial
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: kmerge-test.hs
import: language, warnings, wno-x-partial
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: kmerge-test.hs
build-depends:
, base >=4.16 && <4.20
, deepseq
Expand All @@ -368,12 +369,11 @@ test-suite kmerge-test
, vector

benchmark kmerge-bench
import: warnings, wno-x-partial
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: kmerge-test.hs
cpp-options: -DKMERGE_BENCHMARKS
import: language, warnings, wno-x-partial
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: kmerge-test.hs
cpp-options: -DKMERGE_BENCHMARKS
build-depends:
, base >=4.16 && <4.20
, deepseq
Expand All @@ -388,11 +388,10 @@ benchmark kmerge-bench
, vector

test-suite map-range-test
import: warnings, wno-x-partial
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: map-range-test.hs
import: language, warnings, wno-x-partial
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: map-range-test.hs
build-depends:
, base >=4.16 && <4.20
, bytestring
Expand All @@ -404,9 +403,8 @@ test-suite map-range-test
, tasty-quickcheck

library prototypes
import: warnings, wno-x-partial
default-language: Haskell2010
hs-source-dirs: prototypes
import: language, warnings, wno-x-partial
hs-source-dirs: prototypes
exposed-modules:
FormatPage
ScheduledMerges
Expand All @@ -431,11 +429,10 @@ library prototypes
-Wno-missing-export-lists

test-suite lsm-prototypes-tests
import: warnings, wno-x-partial
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: lsm-prototypes-tests.hs
import: language, warnings, wno-x-partial
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: lsm-prototypes-tests.hs
build-depends:
, base
, lsm-tree:prototypes
Expand All @@ -454,10 +451,9 @@ flag serialblockio
manual: True

library fs-api-blockio
import: warnings, wno-x-partial
visibility: private
hs-source-dirs: fs-api-blockio/src
default-language: Haskell2010
import: language, warnings, wno-x-partial
visibility: private
hs-source-dirs: fs-api-blockio/src
exposed-modules:
System.FS.BlockIO.API
System.FS.BlockIO.IO
Expand Down Expand Up @@ -490,11 +486,10 @@ library fs-api-blockio
cpp-options: -DSERIALBLOCKIO

test-suite fs-api-blockio-test
import: warnings, wno-x-partial
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: fs-api-blockio/test
main-is: Main.hs
import: language, warnings, wno-x-partial
type: exitcode-stdio-1.0
hs-source-dirs: fs-api-blockio/test
main-is: Main.hs
build-depends:
, async
, base >=4.16 && <4.20
Expand All @@ -508,4 +503,4 @@ test-suite fs-api-blockio-test
, temporary
, vector

ghc-options: -threaded -fno-ignore-asserts
ghc-options: -threaded -fno-ignore-asserts
2 changes: 2 additions & 0 deletions test/Database/LSMTree/Model/Normal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ module Database.LSMTree.Model.Normal (
import qualified Crypto.Hash.SHA256 as SHA256
import qualified Data.ByteString as BS
import Data.Foldable (foldl')
import Data.Kind (Type)
import Data.Map (Map)
import qualified Data.Map.Range as Map.R
import qualified Data.Map.Strict as Map
Expand All @@ -50,6 +51,7 @@ import GHC.Exts (IsList (..))
Tables
-------------------------------------------------------------------------------}

type Table :: Type -> Type -> Type -> Type
data Table k v blob = Table
{ _values :: Map RawBytes (RawBytes, Maybe (BlobRef blob))
}
Expand Down
4 changes: 1 addition & 3 deletions xxhash/src/XXH3.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE MagicHash #-}
module XXH3 (
-- * One shot
xxh3_64bit_withSeed_bs,
Expand Down

0 comments on commit b385254

Please sign in to comment.