diff --git a/hw-streams.cabal b/hw-streams.cabal
--- a/hw-streams.cabal
+++ b/hw-streams.cabal
@@ -1,22 +1,21 @@
-cabal-version: 1.12
+cabal-version:  2.2
 
-name:           hw-streams
-version:        0.0.0.10
-synopsis:       Primitive functions and data types
-description:    Primitive functions and data types.
-category:       Data
-stability:      Experimental
-homepage:       http://github.com/haskell-works/hw-streams#readme
-bug-reports:    https://github.com/haskell-works/hw-streams/issues
-author:         John Ky
-maintainer:     newhoggy@gmail.com
-copyright:      2016-2018 John Ky
-license:        BSD3
-license-file:   LICENSE
-tested-with:    GHC == 8.6.1, GHC == 8.4.4, GHC == 8.2.2, GHC == 8.0.2, GHC == 7.10.3
-build-type:     Simple
-extra-source-files:
-    README.md
+name:               hw-streams
+version:            0.0.0.11
+synopsis:           Primitive functions and data types
+description:        Primitive functions and data types.
+category:           Data
+stability:          Experimental
+homepage:           http://github.com/haskell-works/hw-streams#readme
+bug-reports:        https://github.com/haskell-works/hw-streams/issues
+author:             John Ky
+maintainer:         newhoggy@gmail.com
+copyright:          2016-2019 John Ky
+license:            BSD-3-Clause
+license-file:       LICENSE
+tested-with:        GHC == 8.8.1, GHC == 8.6.5, GHC == 8.4.4
+build-type:         Simple
+extra-source-files: README.md
 
 source-repository head
   type: git
@@ -27,98 +26,107 @@
   manual: False
   default: False
 
-library
-  exposed-modules:
-      HaskellWorks.Data.Streams.ByteString
-      HaskellWorks.Data.Streams.ByteString.Lazy
-      HaskellWorks.Data.Streams.Internal
-      HaskellWorks.Data.Streams.Internal.Bundle
-      HaskellWorks.Data.Streams.Internal.Chunk
-      HaskellWorks.Data.Streams.Size
-      HaskellWorks.Data.Streams.Stream
-      HaskellWorks.Data.Streams.Stream.Ops
-      HaskellWorks.Data.Streams.Vector
-      HaskellWorks.Data.Streams.Vector.Storable
-  other-modules:
-      Paths_hw_streams
-  hs-source-dirs:
-      src
-  other-extensions: AllowAmbiguousTypes
-  ghc-options: -Wall -O2 -msse4.2
-  build-depends:
-      base >=4.8 && <5
-    , bytestring >=0.9 && <0.11
-    , ghc-prim >=0.4 && <0.6
-    , hw-bits >=0.7.0.3 && <0.8
-    , hw-prim >=0.6.2.17 && <0.7
-    , mmap >=0.5 && <0.6
-    , primitive >=0.6.3.0 && <0.7
-    , semigroups >=0.8.4 && <0.19
-    , transformers >=0.4 && <0.6
-    , vector >=0.12 && <0.13
+common base                 { build-depends: base                 >= 4.10       && < 5      }
+
+common bytestring           { build-depends: bytestring           >= 0.9        && < 0.11   }
+common criterion            { build-depends: criterion            >= 1.2        && < 1.6    }
+common directory            { build-depends: directory            >= 1.2        && < 1.4    }
+common exceptions           { build-depends: exceptions           >= 0.8        && < 0.11   }
+common ghc-prim             { build-depends: ghc-prim             >= 0.4        && < 0.6    }
+common hedgehog             { build-depends: hedgehog             >= 0.5        && < 1.1    }
+common hspec                { build-depends: hspec                >= 2.4        && < 2.8    }
+common hw-bits              { build-depends: hw-bits              >= 0.7.0.3    && < 0.8    }
+common hw-hspec-hedgehog    { build-depends: hw-hspec-hedgehog    >= 0.1        && < 0.2    }
+common hw-prim              { build-depends: hw-prim              >= 0.6.2.17   && < 0.7    }
+common mmap                 { build-depends: mmap                 >= 0.5        && < 0.6    }
+common primitive            { build-depends: primitive            >= 0.6.3.0    && < 0.8    }
+common QuickCheck           { build-depends: QuickCheck           >= 2.10       && < 2.14   }
+common semigroups           { build-depends: semigroups           >= 0.8.4      && < 0.20   }
+common transformers         { build-depends: transformers         >= 0.4        && < 0.6    }
+common vector               { build-depends: vector               >= 0.12       && < 0.13   }
+
+common config
   if flag(bounds-checking-enabled)
     cpp-options: -DBOUNDS_CHECKING_ENABLED
   default-language: Haskell2010
+  other-extensions: AllowAmbiguousTypes
 
+library
+  import:   base, config
+          , bytestring
+          , ghc-prim
+          , hw-bits
+          , hw-prim
+          , mmap
+          , primitive
+          , semigroups
+          , transformers
+          , vector
+  exposed-modules:
+    HaskellWorks.Data.Streams.ByteString
+    HaskellWorks.Data.Streams.ByteString.Lazy
+    HaskellWorks.Data.Streams.Internal
+    HaskellWorks.Data.Streams.Internal.Bundle
+    HaskellWorks.Data.Streams.Internal.Chunk
+    HaskellWorks.Data.Streams.Size
+    HaskellWorks.Data.Streams.Stream
+    HaskellWorks.Data.Streams.Stream.Ops
+    HaskellWorks.Data.Streams.Vector
+    HaskellWorks.Data.Streams.Vector.Storable
+  other-modules:      Paths_hw_streams
+  autogen-modules:    Paths_hw_streams
+  hs-source-dirs:     src
+  ghc-options:        -Wall -O2 -msse4.2
+
 test-suite hw-streams-test
-  type: exitcode-stdio-1.0
-  main-is: Spec.hs
+  import:   base, config
+          , QuickCheck
+          , bytestring
+          , directory
+          , exceptions
+          , ghc-prim
+          , hedgehog
+          , hspec
+          , hw-bits
+          , hw-hspec-hedgehog
+          , hw-prim
+          , mmap
+          , primitive
+          , semigroups
+          , transformers
+          , vector
+  type:       exitcode-stdio-1.0
+  main-is:    Spec.hs
+  hs-source-dirs: test
   other-modules:
       HaskellWorks.Data.Streams.Stream.OpsSpec
       HaskellWorks.Data.Streams.Vector.StorableSpec
       Test.Gen
       Paths_hw_streams
-  hs-source-dirs:
-      test
-  other-extensions: AllowAmbiguousTypes
-  ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N
-  build-depends:
-      QuickCheck >=2.10 && <2.13
-    , base >=4.8 && <5
-    , bytestring >=0.9 && <0.11
-    , directory >=1.2 && <1.4
-    , exceptions >=0.8 && <0.11
-    , ghc-prim >=0.4 && <0.6
-    , hedgehog >=0.5 && <0.7
-    , hspec >=2.4 && <2.6
-    , hw-bits >=0.7.0.3 && <0.8
-    , hw-hspec-hedgehog >=0.1 && <0.2
-    , hw-prim >=0.6.2.17 && <0.7
-    , hw-streams
-    , mmap >=0.5 && <0.6
-    , primitive >=0.6.3.0 && <0.7
-    , semigroups >=0.8.4 && <0.19
-    , transformers >=0.4 && <0.6
-    , vector >=0.12 && <0.13
-  if flag(bounds-checking-enabled)
-    cpp-options: -DBOUNDS_CHECKING_ENABLED
-  default-language: Haskell2010
+  autogen-modules:    Paths_hw_streams
+  ghc-options:        -Wall -threaded -rtsopts -with-rtsopts=-N
+  build-depends:      hw-streams
   build-tool-depends: hspec-discover:hspec-discover
 
 benchmark bench
-  type: exitcode-stdio-1.0
-  main-is: Main.hs
+  import:   base, config
+          , bytestring
+          , criterion
+          , ghc-prim
+          , hw-bits
+          , hw-prim
+          , mmap
+          , primitive
+          , semigroups
+          , transformers
+          , vector
+  type:               exitcode-stdio-1.0
+  main-is:            Main.hs
+  hs-source-dirs:     bench
+  build-depends:      hw-streams
+  ghc-options:        -Wall -O2 -msse4.2
+  autogen-modules:    Paths_hw_streams
   other-modules:
       Baseline.Data.Streams.Vector.Storable
       Reference.Data.Streams.Vector.Storable
       Paths_hw_streams
-  hs-source-dirs:
-      bench
-  other-extensions: AllowAmbiguousTypes
-  ghc-options: -Wall -O2 -msse4.2
-  build-depends:
-      base >=4.8 && <5
-    , bytestring >=0.9 && <0.11
-    , criterion >=1.2 && <1.6
-    , ghc-prim >=0.4 && <0.6
-    , hw-bits >=0.7.0.3 && <0.8
-    , hw-prim >=0.6.2.17 && <0.7
-    , hw-streams
-    , mmap >=0.5 && <0.6
-    , primitive >=0.6.3.0 && <0.7
-    , semigroups >=0.8.4 && <0.19
-    , transformers >=0.4 && <0.6
-    , vector >=0.12 && <0.13
-  if flag(bounds-checking-enabled)
-    cpp-options: -DBOUNDS_CHECKING_ENABLED
-  default-language: Haskell2010
