summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2016-07-28 15:13:54 +0000
committerÖmer Sinan Ağacan <omeragacan@gmail.com>2016-07-28 15:14:30 +0000
commitd3feb16a91bb285ce677fb79381f36e9fcdc0979 (patch)
tree05912db9f49190bafc6799d5a2a671c40dd29609
parente98edbd1b8947dcb4a47d20fc854c0a9a6954bea (diff)
downloadhaskell-d3feb16a91bb285ce677fb79381f36e9fcdc0979.tar.gz
Make Unique a newtype
Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2432
-rw-r--r--compiler/basicTypes/Unique.hs4
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/basicTypes/Unique.hs b/compiler/basicTypes/Unique.hs
index 545ea9f1ba..c42b825150 100644
--- a/compiler/basicTypes/Unique.hs
+++ b/compiler/basicTypes/Unique.hs
@@ -87,12 +87,10 @@ The @Chars@ are ``tag letters'' that identify the @UniqueSupply@.
Fast comparison is everything on @Uniques@:
-}
---why not newtype Int?
-
-- | The type of unique identifiers that are used in many places in GHC
-- for fast ordering and equality tests. You should generate these with
-- the functions from the 'UniqSupply' module
-data Unique = MkUnique {-# UNPACK #-} !Int
+newtype Unique = MkUnique Int
{-
Now come the functions which construct uniques from their pieces, and vice versa.