summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--ghc.mk2
-rw-r--r--libraries/compact/Data/Compact/Internal.hs115
-rw-r--r--libraries/ghc-compact/.gitignore (renamed from libraries/compact/.gitignore)0
-rw-r--r--libraries/ghc-compact/GHC/Compact.hs (renamed from libraries/compact/Data/Compact.hs)101
-rw-r--r--libraries/ghc-compact/GHC/Compact/Serialized.hs (renamed from libraries/compact/Data/Compact/Serialized.hs)6
-rw-r--r--libraries/ghc-compact/LICENSE (renamed from libraries/compact/LICENSE)0
-rw-r--r--libraries/ghc-compact/README.md (renamed from libraries/compact/README.md)0
-rw-r--r--libraries/ghc-compact/Setup.hs (renamed from libraries/compact/Setup.hs)0
-rw-r--r--libraries/ghc-compact/ghc-compact.cabal (renamed from libraries/compact/compact.cabal)26
-rw-r--r--libraries/ghc-compact/tests/.gitignore (renamed from libraries/compact/tests/.gitignore)0
-rw-r--r--libraries/ghc-compact/tests/Makefile (renamed from libraries/compact/tests/Makefile)0
-rw-r--r--libraries/ghc-compact/tests/all.T (renamed from libraries/compact/tests/all.T)0
-rw-r--r--libraries/ghc-compact/tests/compact_append.hs (renamed from libraries/compact/tests/compact_append.hs)2
-rw-r--r--libraries/ghc-compact/tests/compact_autoexpand.hs (renamed from libraries/compact/tests/compact_autoexpand.hs)3
-rw-r--r--libraries/ghc-compact/tests/compact_bench.hs (renamed from libraries/compact/tests/compact_bench.hs)3
-rw-r--r--libraries/ghc-compact/tests/compact_bytestring.hs (renamed from libraries/compact/tests/compact_bytestring.hs)3
-rw-r--r--libraries/ghc-compact/tests/compact_cycle.hs (renamed from libraries/compact/tests/compact_cycle.hs)3
-rw-r--r--libraries/ghc-compact/tests/compact_cycle.stdout (renamed from libraries/compact/tests/compact_cycle.stdout)0
-rw-r--r--libraries/ghc-compact/tests/compact_function.hs (renamed from libraries/compact/tests/compact_function.hs)2
-rw-r--r--libraries/ghc-compact/tests/compact_function.stderr (renamed from libraries/compact/tests/compact_function.stderr)0
-rw-r--r--libraries/ghc-compact/tests/compact_gc.hs (renamed from libraries/compact/tests/compact_gc.hs)3
-rw-r--r--libraries/ghc-compact/tests/compact_huge_array.hs (renamed from libraries/compact/tests/compact_huge_array.hs)3
-rw-r--r--libraries/ghc-compact/tests/compact_largemap.hs (renamed from libraries/compact/tests/compact_largemap.hs)3
-rw-r--r--libraries/ghc-compact/tests/compact_largemap.stdout (renamed from libraries/compact/tests/compact_largemap.stdout)0
-rw-r--r--libraries/ghc-compact/tests/compact_loop.hs (renamed from libraries/compact/tests/compact_loop.hs)3
-rw-r--r--libraries/ghc-compact/tests/compact_mutable.hs (renamed from libraries/compact/tests/compact_mutable.hs)2
-rw-r--r--libraries/ghc-compact/tests/compact_mutable.stderr (renamed from libraries/compact/tests/compact_mutable.stderr)0
-rw-r--r--libraries/ghc-compact/tests/compact_pinned.hs (renamed from libraries/compact/tests/compact_pinned.hs)2
-rw-r--r--libraries/ghc-compact/tests/compact_pinned.stderr (renamed from libraries/compact/tests/compact_pinned.stderr)0
-rw-r--r--libraries/ghc-compact/tests/compact_serialize.hs (renamed from libraries/compact/tests/compact_serialize.hs)5
-rw-r--r--libraries/ghc-compact/tests/compact_serialize.stderr (renamed from libraries/compact/tests/compact_serialize.stderr)0
-rw-r--r--libraries/ghc-compact/tests/compact_share.hs (renamed from libraries/compact/tests/compact_share.hs)3
-rw-r--r--libraries/ghc-compact/tests/compact_share.stdout (renamed from libraries/compact/tests/compact_share.stdout)0
-rw-r--r--libraries/ghc-compact/tests/compact_simple.hs (renamed from libraries/compact/tests/compact_simple.hs)2
-rw-r--r--libraries/ghc-compact/tests/compact_simple.stdout (renamed from libraries/compact/tests/compact_simple.stdout)0
-rw-r--r--libraries/ghc-compact/tests/compact_simple_array.hs (renamed from libraries/compact/tests/compact_simple_array.hs)3
-rw-r--r--libraries/ghc-compact/tests/compact_threads.hs (renamed from libraries/compact/tests/compact_threads.hs)3
-rw-r--r--libraries/ghc-compact/tests/compact_threads.stdout (renamed from libraries/compact/tests/compact_threads.stdout)0
-rw-r--r--packages2
40 files changed, 131 insertions, 171 deletions
diff --git a/configure.ac b/configure.ac
index 1bb06f8194..ec526d8892 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1106,7 +1106,7 @@ AC_SUBST(BUILD_SPHINX_PDF)
LIBRARY_VERSION(base)
LIBRARY_VERSION(Cabal, Cabal/Cabal)
LIBRARY_VERSION(ghc-prim)
-LIBRARY_VERSION(compact)
+LIBRARY_VERSION(ghc-compact)
LIBRARY_ghc_VERSION="$ProjectVersion"
AC_SUBST(LIBRARY_ghc_VERSION)
diff --git a/ghc.mk b/ghc.mk
index e52c4c4091..19b0e49e0c 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -463,7 +463,7 @@ PACKAGES_STAGE1 += ghc-boot
PACKAGES_STAGE1 += template-haskell
PACKAGES_STAGE1 += hoopl
PACKAGES_STAGE1 += transformers
-PACKAGES_STAGE1 += compact
+PACKAGES_STAGE1 += ghc-compact
ifeq "$(HADDOCK_DOCS)" "YES"
PACKAGES_STAGE1 += xhtml
diff --git a/libraries/compact/Data/Compact/Internal.hs b/libraries/compact/Data/Compact/Internal.hs
deleted file mode 100644
index 722a62c09c..0000000000
--- a/libraries/compact/Data/Compact/Internal.hs
+++ /dev/null
@@ -1,115 +0,0 @@
-{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
-{-# LANGUAGE MagicHash #-}
-{-# LANGUAGE UnboxedTuples #-}
-
------------------------------------------------------------------------------
--- |
--- Module : Data.Compact.Internal
--- Copyright : (c) The University of Glasgow 2001-2009
--- (c) Giovanni Campagna <gcampagn@cs.stanford.edu> 2015
--- License : BSD-style (see the file LICENSE)
---
--- Maintainer : libraries@haskell.org
--- Stability : unstable
--- Portability : non-portable (GHC Extensions)
---
--- This module provides some internal functions and representation for dealing
--- with compact regions, which may be of interest if you need higher
--- performance.
---
--- /Since: 1.0.0/
-
-module Data.Compact.Internal
- ( Compact(..)
- , mkCompact
- , compactSized
- ) where
-
-import Control.Concurrent.MVar
-import GHC.Prim
-import GHC.Types
-
--- | A 'Compact' contains fully evaluated, pure, immutable data.
---
--- 'Compact' serves two purposes:
---
--- * Data stored in a 'Compact' has no garbage collection overhead.
--- The garbage collector considers the whole 'Compact' to be alive
--- if there is a reference to any object within it.
---
--- * A 'Compact' can be serialized, stored, and deserialized again.
--- The serialized data can only be deserialized by the exact binary
--- that created it, but it can be stored indefinitely before
--- deserialization.
---
--- Compacts are self-contained, so compacting data involves copying
--- it; if you have data that lives in two 'Compact's, each will have a
--- separate copy of the data.
---
--- The cost of compaction is similar to the cost of GC for the same
--- data, but it is perfomed only once. However, because
--- "Data.Compact.compact" does not stop-the-world, retaining internal
--- sharing during the compaction process is very costly. The user
--- can choose wether to 'compact' or 'compactWithSharing'.
---
--- When you have a @'Compact' a@, you can get a pointer to the actual object
--- in the region using "Data.Compact.getCompact". The 'Compact' type
--- serves as handle on the region itself; you can use this handle
--- to add data to a specific 'Compact' with 'compactAdd' or
--- 'compactAddWithSharing' (giving you a new handle which corresponds
--- to the same compact region, but points to the newly added object
--- in the region). At the moment, due to technical reasons,
--- it's not possible to get the @'Compact' a@ if you only have an @a@,
--- so make sure you hold on to the handle as necessary.
---
--- Data in a compact doesn't ever move, so compacting data is also a
--- way to pin arbitrary data structures in memory.
---
--- There are some limitations on what can be compacted:
---
--- * Functions. Compaction only applies to data.
---
--- * Pinned 'ByteArray#' objects cannot be compacted. This is for a
--- good reason: the memory is pinned so that it can be referenced by
--- address (the address might be stored in a C data structure, for
--- example), so we can't make a copy of it to store in the 'Compact'.
---
--- * Objects with mutable pointer fields also cannot be compacted,
--- because subsequent mutation would destroy the property that a compact is
--- self-contained.
---
--- If compaction encounters any of the above, a 'CompactionFailed'
--- exception will be thrown by the compaction operation.
---
-data Compact a = Compact Compact# a (MVar ())
- -- we can *read* from a Compact without taking a lock, but only
- -- one thread can be writing to the compact at any given time.
- -- The MVar here is to enforce mutual exclusion among writers.
- -- Note: the MVar protects the Compact# only, not the pure value 'a'
-
--- | Make a new 'Compact' object, given a pointer to the true
--- underlying region. You must uphold the invariant that @a@ lives
--- in the compact region.
---
-mkCompact
- :: Compact# -> a -> State# RealWorld -> (# State# RealWorld, Compact a #)
-mkCompact compact# a s =
- case unIO (newMVar ()) s of { (# s1, lock #) ->
- (# s1, Compact compact# a lock #) }
- where
- unIO (IO a) = a
-
--- | Transfer @a@ into a new compact region, with a preallocated size,
--- possibly preserving sharing or not. If you know how big the data
--- structure in question is, you can save time by picking an appropriate
--- block size for the compact region.
---
-compactSized :: Int -> Bool -> a -> IO (Compact a)
-compactSized (I# size) share a = IO $ \s0 ->
- case compactNew# (int2Word# size) s0 of { (# s1, compact# #) ->
- case compactAddPrim compact# a s1 of { (# s2, pk #) ->
- mkCompact compact# pk s2 }}
- where
- compactAddPrim
- | share = compactAddWithSharing#
- | otherwise = compactAdd#
diff --git a/libraries/compact/.gitignore b/libraries/ghc-compact/.gitignore
index 89cf73d0b3..89cf73d0b3 100644
--- a/libraries/compact/.gitignore
+++ b/libraries/ghc-compact/.gitignore
diff --git a/libraries/compact/Data/Compact.hs b/libraries/ghc-compact/GHC/Compact.hs
index f1339e503a..e3efaf24bc 100644
--- a/libraries/compact/Data/Compact.hs
+++ b/libraries/ghc-compact/GHC/Compact.hs
@@ -6,7 +6,7 @@
-----------------------------------------------------------------------------
-- |
--- Module : Data.Compact
+-- Module : GHC.Compact
-- Copyright : (c) The University of Glasgow 2001-2009
-- (c) Giovanni Campagna <gcampagn@cs.stanford.edu> 2014
-- License : BSD-style (see the file LICENSE)
@@ -57,9 +57,9 @@
--
-- This library is supported by GHC 8.2 and later.
-module Data.Compact (
+module GHC.Compact (
-- * The Compact type
- Compact,
+ Compact(..),
-- * Compacting data
compact,
@@ -75,13 +75,100 @@ module Data.Compact (
-- * Other utilities
compactResize,
+
+ -- * Internal operations
+ mkCompact,
+ compactSized,
) where
-import Control.Concurrent
+import Control.Concurrent.MVar
import GHC.Prim
import GHC.Types
-import Data.Compact.Internal as Internal
+-- | A 'Compact' contains fully evaluated, pure, immutable data.
+--
+-- 'Compact' serves two purposes:
+--
+-- * Data stored in a 'Compact' has no garbage collection overhead.
+-- The garbage collector considers the whole 'Compact' to be alive
+-- if there is a reference to any object within it.
+--
+-- * A 'Compact' can be serialized, stored, and deserialized again.
+-- The serialized data can only be deserialized by the exact binary
+-- that created it, but it can be stored indefinitely before
+-- deserialization.
+--
+-- Compacts are self-contained, so compacting data involves copying
+-- it; if you have data that lives in two 'Compact's, each will have a
+-- separate copy of the data.
+--
+-- The cost of compaction is similar to the cost of GC for the same
+-- data, but it is perfomed only once. However, because
+-- "Data.Compact.compact" does not stop-the-world, retaining internal
+-- sharing during the compaction process is very costly. The user
+-- can choose wether to 'compact' or 'compactWithSharing'.
+--
+-- When you have a @'Compact' a@, you can get a pointer to the actual object
+-- in the region using "Data.Compact.getCompact". The 'Compact' type
+-- serves as handle on the region itself; you can use this handle
+-- to add data to a specific 'Compact' with 'compactAdd' or
+-- 'compactAddWithSharing' (giving you a new handle which corresponds
+-- to the same compact region, but points to the newly added object
+-- in the region). At the moment, due to technical reasons,
+-- it's not possible to get the @'Compact' a@ if you only have an @a@,
+-- so make sure you hold on to the handle as necessary.
+--
+-- Data in a compact doesn't ever move, so compacting data is also a
+-- way to pin arbitrary data structures in memory.
+--
+-- There are some limitations on what can be compacted:
+--
+-- * Functions. Compaction only applies to data.
+--
+-- * Pinned 'ByteArray#' objects cannot be compacted. This is for a
+-- good reason: the memory is pinned so that it can be referenced by
+-- address (the address might be stored in a C data structure, for
+-- example), so we can't make a copy of it to store in the 'Compact'.
+--
+-- * Objects with mutable pointer fields also cannot be compacted,
+-- because subsequent mutation would destroy the property that a compact is
+-- self-contained.
+--
+-- If compaction encounters any of the above, a 'CompactionFailed'
+-- exception will be thrown by the compaction operation.
+--
+data Compact a = Compact Compact# a (MVar ())
+ -- we can *read* from a Compact without taking a lock, but only
+ -- one thread can be writing to the compact at any given time.
+ -- The MVar here is to enforce mutual exclusion among writers.
+ -- Note: the MVar protects the Compact# only, not the pure value 'a'
+
+-- | Make a new 'Compact' object, given a pointer to the true
+-- underlying region. You must uphold the invariant that @a@ lives
+-- in the compact region.
+--
+mkCompact
+ :: Compact# -> a -> State# RealWorld -> (# State# RealWorld, Compact a #)
+mkCompact compact# a s =
+ case unIO (newMVar ()) s of { (# s1, lock #) ->
+ (# s1, Compact compact# a lock #) }
+ where
+ unIO (IO a) = a
+
+-- | Transfer @a@ into a new compact region, with a preallocated size,
+-- possibly preserving sharing or not. If you know how big the data
+-- structure in question is, you can save time by picking an appropriate
+-- block size for the compact region.
+--
+compactSized :: Int -> Bool -> a -> IO (Compact a)
+compactSized (I# size) share a = IO $ \s0 ->
+ case compactNew# (int2Word# size) s0 of { (# s1, compact# #) ->
+ case compactAddPrim compact# a s1 of { (# s2, pk #) ->
+ mkCompact compact# pk s2 }}
+ where
+ compactAddPrim
+ | share = compactAddWithSharing#
+ | otherwise = compactAdd#
-- | Retrieve a direct pointer to the value pointed at by a 'Compact' reference.
-- If you have used 'compactAdd', there may be multiple 'Compact' references
@@ -104,7 +191,7 @@ getCompact (Compact _ obj _) = obj
-- class which will help statically check if this is the case or not.
--
compact :: a -> IO (Compact a)
-compact = Internal.compactSized 31268 False
+compact = compactSized 31268 False
-- | Compact a value, retaining any internal sharing and
-- cycles. /O(size of data)/
@@ -118,7 +205,7 @@ compact = Internal.compactSized 31268 False
-- class which will help statically check if this is the case or not.
--
compactWithSharing :: a -> IO (Compact a)
-compactWithSharing = Internal.compactSized 31268 True
+compactWithSharing = compactSized 31268 True
-- | Add a value to an existing 'Compact'. This will help you avoid
-- copying when the value contains pointers into the compact region,
diff --git a/libraries/compact/Data/Compact/Serialized.hs b/libraries/ghc-compact/GHC/Compact/Serialized.hs
index 56ddb30ef4..0263cdf9f1 100644
--- a/libraries/compact/Data/Compact/Serialized.hs
+++ b/libraries/ghc-compact/GHC/Compact/Serialized.hs
@@ -5,7 +5,7 @@
-----------------------------------------------------------------------------
-- |
--- Module : Data.Compact.Serialized
+-- Module : GHC.Compact.Serialized
-- Copyright : (c) The University of Glasgow 2001-2009
-- (c) Giovanni Campagna <gcampagn@cs.stanford.edu> 2015
-- License : BSD-style (see the file LICENSE)
@@ -19,7 +19,7 @@
--
-- /Since: 1.0.0/
-module Data.Compact.Serialized(
+module GHC.Compact.Serialized(
SerializedCompact(..),
withSerializedCompact,
importCompact,
@@ -39,7 +39,7 @@ import Data.IORef(newIORef, readIORef, writeIORef)
import Foreign.ForeignPtr(withForeignPtr)
import Foreign.Marshal.Utils(copyBytes)
-import Data.Compact.Internal
+import GHC.Compact
-- | A serialized version of the 'Compact' metadata (each block with
-- address and size and the address of the root). This structure is
diff --git a/libraries/compact/LICENSE b/libraries/ghc-compact/LICENSE
index 06b2599694..06b2599694 100644
--- a/libraries/compact/LICENSE
+++ b/libraries/ghc-compact/LICENSE
diff --git a/libraries/compact/README.md b/libraries/ghc-compact/README.md
index 0b7d197c88..0b7d197c88 100644
--- a/libraries/compact/README.md
+++ b/libraries/ghc-compact/README.md
diff --git a/libraries/compact/Setup.hs b/libraries/ghc-compact/Setup.hs
index 6fa548caf7..6fa548caf7 100644
--- a/libraries/compact/Setup.hs
+++ b/libraries/ghc-compact/Setup.hs
diff --git a/libraries/compact/compact.cabal b/libraries/ghc-compact/ghc-compact.cabal
index b80dc59324..829e56c4f1 100644
--- a/libraries/compact/compact.cabal
+++ b/libraries/ghc-compact/ghc-compact.cabal
@@ -1,19 +1,20 @@
-name: compact
-version: 1.0.0.0
+name: ghc-compact
+version: 0.1.0.0
-- NOTE: Don't forget to update ./changelog.md
license: BSD3
license-file: LICENSE
maintainer: libraries@haskell.org
-bug-reports: http://ghc.haskell.org/trac/ghc/newticket?component=libraries/compact
+bug-reports: http://ghc.haskell.org/trac/ghc/newticket?component=libraries/ghc-compact
synopsis: In memory storage of deeply evaluated data structure
category: Data
description:
- This package provides a single data structure, called a Compact,
- which holds a single haskell object in fully evaluated form. The
- invariant is, no pointers live inside the struct that point outside
- it, which ensures efficient garbage collection without ever reading
- the structure contents (effectively, it works as a manually managed
- "oldest generation" which is never freed until the whole is released).
+ This package provides minimal functionality for working with
+ "compact regions", which hold a fully evaluated Haskell object graph.
+ These regions maintain the invariant that no pointers live inside the struct
+ that point outside it, which ensures efficient garbage collection without
+ ever reading the structure contents (effectively, it works as a manually
+ managed "oldest generation" which is never freed until the whole is
+ released).
Internally, the struct is stored a single contiguous block of memory,
which allows efficient serialization and deserialization of structs
@@ -25,7 +26,7 @@ tested-with: GHC==7.11
source-repository head
type: git
location: http://git.haskell.org/ghc.git
- subdir: libraries/compact
+ subdir: libraries/ghc-compact
library
default-language: Haskell2010
@@ -40,6 +41,5 @@ library
bytestring >= 0.10.6.0
ghc-options: -Wall
- exposed-modules: Data.Compact
- Data.Compact.Internal
- Data.Compact.Serialized
+ exposed-modules: GHC.Compact
+ GHC.Compact.Serialized
diff --git a/libraries/compact/tests/.gitignore b/libraries/ghc-compact/tests/.gitignore
index 8887a1bbea..8887a1bbea 100644
--- a/libraries/compact/tests/.gitignore
+++ b/libraries/ghc-compact/tests/.gitignore
diff --git a/libraries/compact/tests/Makefile b/libraries/ghc-compact/tests/Makefile
index 6a0abcf1cf..6a0abcf1cf 100644
--- a/libraries/compact/tests/Makefile
+++ b/libraries/ghc-compact/tests/Makefile
diff --git a/libraries/compact/tests/all.T b/libraries/ghc-compact/tests/all.T
index 753592e733..753592e733 100644
--- a/libraries/compact/tests/all.T
+++ b/libraries/ghc-compact/tests/all.T
diff --git a/libraries/compact/tests/compact_append.hs b/libraries/ghc-compact/tests/compact_append.hs
index e61262eea6..274c0bf429 100644
--- a/libraries/compact/tests/compact_append.hs
+++ b/libraries/ghc-compact/tests/compact_append.hs
@@ -3,7 +3,7 @@ module Main where
import Control.Exception
import System.Mem
-import Data.Compact
+import GHC.Compact
assertFail :: String -> IO ()
assertFail msg = throwIO $ AssertionFailed msg
diff --git a/libraries/compact/tests/compact_autoexpand.hs b/libraries/ghc-compact/tests/compact_autoexpand.hs
index 5134380777..c4d27d08f6 100644
--- a/libraries/compact/tests/compact_autoexpand.hs
+++ b/libraries/ghc-compact/tests/compact_autoexpand.hs
@@ -3,8 +3,7 @@ module Main where
import Control.Exception
import System.Mem
-import Data.Compact
-import Data.Compact.Internal
+import GHC.Compact
assertFail :: String -> IO ()
assertFail msg = throwIO $ AssertionFailed msg
diff --git a/libraries/compact/tests/compact_bench.hs b/libraries/ghc-compact/tests/compact_bench.hs
index 3764c3e3e1..fa249dcc36 100644
--- a/libraries/compact/tests/compact_bench.hs
+++ b/libraries/ghc-compact/tests/compact_bench.hs
@@ -1,6 +1,5 @@
import Control.Exception
-import Data.Compact
-import Data.Compact.Internal
+import GHC.Compact
import qualified Data.Map as Map
import Data.Time.Clock
import Text.Printf
diff --git a/libraries/compact/tests/compact_bytestring.hs b/libraries/ghc-compact/tests/compact_bytestring.hs
index 16c486ba58..61a50df9c2 100644
--- a/libraries/compact/tests/compact_bytestring.hs
+++ b/libraries/ghc-compact/tests/compact_bytestring.hs
@@ -1,6 +1,5 @@
import qualified Data.ByteString.Char8 as B
-import Data.Compact
-import Data.Compact.Internal
+import GHC.Compact
import qualified Data.Map as Map
main = do
diff --git a/libraries/compact/tests/compact_cycle.hs b/libraries/ghc-compact/tests/compact_cycle.hs
index 4c771a1d34..54047e0c76 100644
--- a/libraries/compact/tests/compact_cycle.hs
+++ b/libraries/ghc-compact/tests/compact_cycle.hs
@@ -1,6 +1,5 @@
import Control.Exception
-import Data.Compact
-import Data.Compact.Internal
+import GHC.Compact
import qualified Data.Map as Map
import System.Exit
diff --git a/libraries/compact/tests/compact_cycle.stdout b/libraries/ghc-compact/tests/compact_cycle.stdout
index 6fc8a53046..6fc8a53046 100644
--- a/libraries/compact/tests/compact_cycle.stdout
+++ b/libraries/ghc-compact/tests/compact_cycle.stdout
diff --git a/libraries/compact/tests/compact_function.hs b/libraries/ghc-compact/tests/compact_function.hs
index 8193a78a99..166f345552 100644
--- a/libraries/compact/tests/compact_function.hs
+++ b/libraries/ghc-compact/tests/compact_function.hs
@@ -1,5 +1,5 @@
import Control.Exception
-import Data.Compact
+import GHC.Compact
data HiddenFunction = HiddenFunction (Int -> Int)
diff --git a/libraries/compact/tests/compact_function.stderr b/libraries/ghc-compact/tests/compact_function.stderr
index 197da0460b..197da0460b 100644
--- a/libraries/compact/tests/compact_function.stderr
+++ b/libraries/ghc-compact/tests/compact_function.stderr
diff --git a/libraries/compact/tests/compact_gc.hs b/libraries/ghc-compact/tests/compact_gc.hs
index a88e87d958..2e13bafdbe 100644
--- a/libraries/compact/tests/compact_gc.hs
+++ b/libraries/ghc-compact/tests/compact_gc.hs
@@ -1,6 +1,5 @@
import Control.Monad
-import Data.Compact
-import Data.Compact.Internal
+import GHC.Compact
import qualified Data.Map as Map
main = do
diff --git a/libraries/compact/tests/compact_huge_array.hs b/libraries/ghc-compact/tests/compact_huge_array.hs
index 87200d807d..85694f5d9a 100644
--- a/libraries/compact/tests/compact_huge_array.hs
+++ b/libraries/ghc-compact/tests/compact_huge_array.hs
@@ -9,8 +9,7 @@ import Data.Array
import Data.Array.ST
import qualified Data.Array.Unboxed as U
-import Data.Compact
-import Data.Compact.Internal
+import GHC.Compact
assertFail :: String -> IO ()
assertFail msg = throwIO $ AssertionFailed msg
diff --git a/libraries/compact/tests/compact_largemap.hs b/libraries/ghc-compact/tests/compact_largemap.hs
index 0c72a32c75..bc918c905b 100644
--- a/libraries/compact/tests/compact_largemap.hs
+++ b/libraries/ghc-compact/tests/compact_largemap.hs
@@ -1,5 +1,4 @@
-import Data.Compact
-import Data.Compact.Internal
+import GHC.Compact
import qualified Data.Map as Map
main = do
diff --git a/libraries/compact/tests/compact_largemap.stdout b/libraries/ghc-compact/tests/compact_largemap.stdout
index 4825984a93..4825984a93 100644
--- a/libraries/compact/tests/compact_largemap.stdout
+++ b/libraries/ghc-compact/tests/compact_largemap.stdout
diff --git a/libraries/compact/tests/compact_loop.hs b/libraries/ghc-compact/tests/compact_loop.hs
index 5cf167c393..40e0817dfe 100644
--- a/libraries/compact/tests/compact_loop.hs
+++ b/libraries/ghc-compact/tests/compact_loop.hs
@@ -4,8 +4,7 @@ import Control.Exception
import System.Mem
import Text.Show
-import Data.Compact
-import Data.Compact.Internal
+import GHC.Compact
assertFail :: String -> IO ()
assertFail msg = throwIO $ AssertionFailed msg
diff --git a/libraries/compact/tests/compact_mutable.hs b/libraries/ghc-compact/tests/compact_mutable.hs
index fdd7a436ce..33a405452d 100644
--- a/libraries/compact/tests/compact_mutable.hs
+++ b/libraries/ghc-compact/tests/compact_mutable.hs
@@ -1,6 +1,6 @@
import Control.Concurrent
import Control.Exception
-import Data.Compact
+import GHC.Compact
data HiddenMVar = HiddenMVar (MVar ())
diff --git a/libraries/compact/tests/compact_mutable.stderr b/libraries/ghc-compact/tests/compact_mutable.stderr
index 9a4bd2892e..9a4bd2892e 100644
--- a/libraries/compact/tests/compact_mutable.stderr
+++ b/libraries/ghc-compact/tests/compact_mutable.stderr
diff --git a/libraries/compact/tests/compact_pinned.hs b/libraries/ghc-compact/tests/compact_pinned.hs
index faeb2fc6bf..16eff0da8a 100644
--- a/libraries/compact/tests/compact_pinned.hs
+++ b/libraries/ghc-compact/tests/compact_pinned.hs
@@ -1,5 +1,5 @@
import Control.Exception
import qualified Data.ByteString.Char8 as B
-import Data.Compact
+import GHC.Compact
main = compact (B.pack ['a'..'c'])
diff --git a/libraries/compact/tests/compact_pinned.stderr b/libraries/ghc-compact/tests/compact_pinned.stderr
index 1f470a0d49..1f470a0d49 100644
--- a/libraries/compact/tests/compact_pinned.stderr
+++ b/libraries/ghc-compact/tests/compact_pinned.stderr
diff --git a/libraries/compact/tests/compact_serialize.hs b/libraries/ghc-compact/tests/compact_serialize.hs
index f4bd2044fc..ff8e0cfa14 100644
--- a/libraries/compact/tests/compact_serialize.hs
+++ b/libraries/ghc-compact/tests/compact_serialize.hs
@@ -8,9 +8,8 @@ import Data.IORef
import Data.ByteString (ByteString, packCStringLen)
import Foreign.Ptr
-import Data.Compact
-import Data.Compact.Internal
-import Data.Compact.Serialized
+import GHC.Compact
+import GHC.Compact.Serialized
assertFail :: String -> IO ()
assertFail msg = throwIO $ AssertionFailed msg
diff --git a/libraries/compact/tests/compact_serialize.stderr b/libraries/ghc-compact/tests/compact_serialize.stderr
index 2483efa009..2483efa009 100644
--- a/libraries/compact/tests/compact_serialize.stderr
+++ b/libraries/ghc-compact/tests/compact_serialize.stderr
diff --git a/libraries/compact/tests/compact_share.hs b/libraries/ghc-compact/tests/compact_share.hs
index 73654e430b..323c179cca 100644
--- a/libraries/compact/tests/compact_share.hs
+++ b/libraries/ghc-compact/tests/compact_share.hs
@@ -1,5 +1,4 @@
-import Data.Compact
-import Data.Compact.Internal
+import GHC.Compact
import qualified Data.Map as Map
main = do
diff --git a/libraries/compact/tests/compact_share.stdout b/libraries/ghc-compact/tests/compact_share.stdout
index 0969fdf956..0969fdf956 100644
--- a/libraries/compact/tests/compact_share.stdout
+++ b/libraries/ghc-compact/tests/compact_share.stdout
diff --git a/libraries/compact/tests/compact_simple.hs b/libraries/ghc-compact/tests/compact_simple.hs
index 83b24da4e7..28575d20d0 100644
--- a/libraries/compact/tests/compact_simple.hs
+++ b/libraries/ghc-compact/tests/compact_simple.hs
@@ -3,7 +3,7 @@ module Main where
import Control.Exception
import System.Mem
-import Data.Compact
+import GHC.Compact
assertFail :: String -> IO ()
assertFail msg = throwIO $ AssertionFailed msg
diff --git a/libraries/compact/tests/compact_simple.stdout b/libraries/ghc-compact/tests/compact_simple.stdout
index 5549a58580..5549a58580 100644
--- a/libraries/compact/tests/compact_simple.stdout
+++ b/libraries/ghc-compact/tests/compact_simple.stdout
diff --git a/libraries/compact/tests/compact_simple_array.hs b/libraries/ghc-compact/tests/compact_simple_array.hs
index 88f669837f..b897e610f4 100644
--- a/libraries/compact/tests/compact_simple_array.hs
+++ b/libraries/ghc-compact/tests/compact_simple_array.hs
@@ -9,8 +9,7 @@ import Data.Array
import Data.Array.ST
import qualified Data.Array.Unboxed as U
-import Data.Compact
-import Data.Compact.Internal
+import GHC.Compact
assertFail :: String -> IO ()
assertFail msg = throwIO $ AssertionFailed msg
diff --git a/libraries/compact/tests/compact_threads.hs b/libraries/ghc-compact/tests/compact_threads.hs
index 99d6fe2409..162612d034 100644
--- a/libraries/compact/tests/compact_threads.hs
+++ b/libraries/ghc-compact/tests/compact_threads.hs
@@ -1,7 +1,6 @@
import Control.Concurrent
import Control.Monad
-import Data.Compact
-import Data.Compact.Internal
+import GHC.Compact
import qualified Data.Map as Map
import Data.Maybe
import System.Environment
diff --git a/libraries/compact/tests/compact_threads.stdout b/libraries/ghc-compact/tests/compact_threads.stdout
index 837e12b406..837e12b406 100644
--- a/libraries/compact/tests/compact_threads.stdout
+++ b/libraries/ghc-compact/tests/compact_threads.stdout
diff --git a/packages b/packages
index 86b1578058..a99bac6561 100644
--- a/packages
+++ b/packages
@@ -45,7 +45,7 @@ libraries/array - - -
libraries/binary - - https://github.com/kolmodin/binary.git
libraries/bytestring - - https://github.com/haskell/bytestring.git
libraries/Cabal - - https://github.com/haskell/cabal.git
-libraries/compact - - -
+libraries/ghc-compact - - -
libraries/containers - - https://github.com/haskell/containers.git
libraries/deepseq - - ssh://git@github.com/haskell/deepseq.git
libraries/directory - - ssh://git@github.com/haskell/directory.git