diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2017-08-01 09:48:52 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-08-01 10:37:34 -0400 |
commit | c13720c8c6047844f659ad4ce684946b80c99bee (patch) | |
tree | 9c6462bf94d69daa318e5a4a9e2d84981743e1ec /compiler/prelude/TysWiredIn.hs | |
parent | b311096c5cf4b669dcfceb99561ac6e1c4cca0cd (diff) | |
download | haskell-c13720c8c6047844f659ad4ce684946b80c99bee.tar.gz |
Drop GHC 7.10 compatibility
GHC 8.2.1 is out, so now GHC's support window only extends back to GHC
8.0. This means we can delete gobs of code that was only used for GHC
7.10 support. Hooray!
Test Plan: ./validate
Reviewers: hvr, bgamari, austin, goldfire, simonmar
Reviewed By: bgamari
Subscribers: Phyx, rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3781
Diffstat (limited to 'compiler/prelude/TysWiredIn.hs')
-rw-r--r-- | compiler/prelude/TysWiredIn.hs | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/compiler/prelude/TysWiredIn.hs b/compiler/prelude/TysWiredIn.hs index 28c6629a91..5a8c4aae78 100644 --- a/compiler/prelude/TysWiredIn.hs +++ b/compiler/prelude/TysWiredIn.hs @@ -162,10 +162,6 @@ import Util import BooleanFormula ( mkAnd ) import qualified Data.ByteString.Char8 as BS -#if !MIN_VERSION_bytestring(0,10,8) -import qualified Data.ByteString.Internal as BSI -import qualified Data.ByteString.Unsafe as BSU -#endif alpha_tyvar :: [TyVar] alpha_tyvar = [alphaTyVar] @@ -690,7 +686,7 @@ isBuiltInOcc_maybe occ = -- boxed tuple data/tycon "()" -> Just $ tup_name Boxed 0 - _ | Just rest <- "(" `stripPrefix` name + _ | Just rest <- "(" `BS.stripPrefix` name , (commas, rest') <- BS.span (==',') rest , ")" <- rest' -> Just $ tup_name Boxed (1+BS.length commas) @@ -698,21 +694,21 @@ isBuiltInOcc_maybe occ = -- unboxed tuple data/tycon "(##)" -> Just $ tup_name Unboxed 0 "Unit#" -> Just $ tup_name Unboxed 1 - _ | Just rest <- "(#" `stripPrefix` name + _ | Just rest <- "(#" `BS.stripPrefix` name , (commas, rest') <- BS.span (==',') rest , "#)" <- rest' -> Just $ tup_name Unboxed (1+BS.length commas) -- unboxed sum tycon - _ | Just rest <- "(#" `stripPrefix` name + _ | Just rest <- "(#" `BS.stripPrefix` name , (pipes, rest') <- BS.span (=='|') rest , "#)" <- rest' -> Just $ tyConName $ sumTyCon (1+BS.length pipes) -- unboxed sum datacon - _ | Just rest <- "(#" `stripPrefix` name + _ | Just rest <- "(#" `BS.stripPrefix` name , (pipes1, rest') <- BS.span (=='|') rest - , Just rest'' <- "_" `stripPrefix` rest' + , Just rest'' <- "_" `BS.stripPrefix` rest' , (pipes2, rest''') <- BS.span (=='|') rest'' , "#)" <- rest''' -> let arity = BS.length pipes1 + BS.length pipes2 + 1 @@ -720,15 +716,6 @@ isBuiltInOcc_maybe occ = in Just $ dataConName $ sumDataCon alt arity _ -> Nothing where - -- TODO: Drop when bytestring 0.10.8 can be assumed -#if MIN_VERSION_bytestring(0,10,8) - stripPrefix = BS.stripPrefix -#else - stripPrefix bs1@(BSI.PS _ _ l1) bs2 - | bs1 `BS.isPrefixOf` bs2 = Just (BSU.unsafeDrop l1 bs2) - | otherwise = Nothing -#endif - name = fastStringToByteString $ occNameFS occ choose_ns :: Name -> Name -> Name |