Commit 195af2d5 authored by Jan Stolarek's avatar Jan Stolarek

Dead code removal, export cleanup

parent 18759cc4
...@@ -22,7 +22,7 @@ module RnTypes ( ...@@ -22,7 +22,7 @@ module RnTypes (
-- Binding related stuff -- Binding related stuff
warnContextQuantification, warnUnusedForAlls, warnContextQuantification, warnUnusedForAlls,
bindSigTyVarsFV, bindHsTyVars, rnHsBndrSig, rnLHsTyVarBndr, bindSigTyVarsFV, bindHsTyVars, rnHsBndrSig, rnLHsTyVarBndr,
extractHsTyRdrTyVars, extractHsTysRdrTyVars, extractTyVarBndrNames, extractHsTyRdrTyVars, extractHsTysRdrTyVars,
extractRdrKindSigVars, extractDataDefnKindVars, extractRdrKindSigVars, extractDataDefnKindVars,
filterInScope filterInScope
) where ) where
...@@ -48,7 +48,6 @@ import Outputable ...@@ -48,7 +48,6 @@ import Outputable
import FastString import FastString
import Maybes import Maybes
import Data.List ( nub, nubBy, deleteFirstsBy ) import Data.List ( nub, nubBy, deleteFirstsBy )
import qualified Data.Set as Set
import Control.Monad ( unless, when ) import Control.Monad ( unless, when )
#if __GLASGOW_HASKELL__ < 709 #if __GLASGOW_HASKELL__ < 709
...@@ -1123,17 +1122,6 @@ extractHsTysRdrTyVars ty ...@@ -1123,17 +1122,6 @@ extractHsTysRdrTyVars ty
= case extract_ltys ty ([],[]) of = case extract_ltys ty ([],[]) of
(kvs, tvs) -> (nub kvs, nub tvs) (kvs, tvs) -> (nub kvs, nub tvs)
-- Extracts variable names used in a type variable binder. Note that HsType
-- represents data and type constructors as type variables and so this function
-- will also return data and type constructors.
extractTyVarBndrNames :: LHsTyVarBndr RdrName -> Set.Set RdrName
extractTyVarBndrNames (L _ (UserTyVar name))
= Set.singleton name
extractTyVarBndrNames (L _ (KindedTyVar (L _ name) k))
= Set.singleton name `Set.union` (Set.fromList tvs)
`Set.union` (Set.fromList kvs)
where (kvs, tvs) = extractHsTyRdrTyVars k
extractRdrKindSigVars :: LFamilyResultSig RdrName -> [RdrName] extractRdrKindSigVars :: LFamilyResultSig RdrName -> [RdrName]
extractRdrKindSigVars (L _ resultSig) extractRdrKindSigVars (L _ resultSig)
| KindSig k <- resultSig = kindRdrNameFromSig k | KindSig k <- resultSig = kindRdrNameFromSig k
......
...@@ -11,9 +11,7 @@ module FamInst ( ...@@ -11,9 +11,7 @@ module FamInst (
newFamInst, newFamInst,
-- * Injectivity -- * Injectivity
makeInjectivityErrors, makeInjectivityErrors
tfHeadedErr, bareVariableInRHSErr
) where ) where
import HscTypes import HscTypes
......
...@@ -12,7 +12,6 @@ module TcValidity ( ...@@ -12,7 +12,6 @@ module TcValidity (
checkValidInstance, validDerivPred, checkValidInstance, validDerivPred,
checkInstTermination, checkInstTermination,
checkValidCoAxiom, checkValidCoAxBranch, checkValidCoAxiom, checkValidCoAxBranch,
checkTyFamFreeness,
checkConsistentFamInst, checkConsistentFamInst,
arityErr, badATErr arityErr, badATErr
) where ) where
......
...@@ -32,8 +32,7 @@ module Outputable ( ...@@ -32,8 +32,7 @@ module Outputable (
sep, cat, sep, cat,
fsep, fcat, fsep, fcat,
hang, punctuate, ppWhen, ppUnless, hang, punctuate, ppWhen, ppUnless,
speakNth, speakNTimes, speakN, speakNOf, plural, speakNth, speakN, speakNOf, plural, isOrAre, doOrDoes,
thirdPerson, isOrAre, doOrDoes,
coloured, PprColour, colType, colCoerc, colDataCon, coloured, PprColour, colType, colCoerc, colDataCon,
colBinder, bold, keyword, colBinder, bold, keyword,
...@@ -976,16 +975,6 @@ speakNOf 0 d = ptext (sLit "no") <+> d <> char 's' ...@@ -976,16 +975,6 @@ speakNOf 0 d = ptext (sLit "no") <+> d <> char 's'
speakNOf 1 d = ptext (sLit "one") <+> d -- E.g. "one argument" speakNOf 1 d = ptext (sLit "one") <+> d -- E.g. "one argument"
speakNOf n d = speakN n <+> d <> char 's' -- E.g. "three arguments" speakNOf n d = speakN n <+> d <> char 's' -- E.g. "three arguments"
-- | Converts a strictly positive integer into a number of times:
--
-- > speakNTimes 1 = text "once"
-- > speakNTimes 2 = text "twice"
-- > speakNTimes 4 = text "4 times"
speakNTimes :: Int {- >=1 -} -> SDoc
speakNTimes t | t == 1 = ptext (sLit "once")
| t == 2 = ptext (sLit "twice")
| otherwise = speakN t <+> ptext (sLit "times")
-- | Determines the pluralisation suffix appropriate for the length of a list: -- | Determines the pluralisation suffix appropriate for the length of a list:
-- --
-- > plural [] = char 's' -- > plural [] = char 's'
...@@ -995,16 +984,6 @@ plural :: [a] -> SDoc ...@@ -995,16 +984,6 @@ plural :: [a] -> SDoc
plural [_] = empty -- a bit frightening, but there you are plural [_] = empty -- a bit frightening, but there you are
plural _ = char 's' plural _ = char 's'
-- | Determines the suffix to use in 3rd person singular depending on the length
-- of a list:
--
-- > thirdPerson [] = empty
-- > thirdPerson ["Hello"] = char 's'
-- > thirdPerson ["Hello", "World"] = empty
thirdPerson :: [a] -> SDoc
thirdPerson [_] = char 's'
thirdPerson _ = empty
-- | Determines the form of to be appropriate for the length of a list: -- | Determines the form of to be appropriate for the length of a list:
-- --
-- > isOrAre [] = ptext (sLit "are") -- > isOrAre [] = ptext (sLit "are")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment