Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
fd7c5f32
Commit
fd7c5f32
authored
Aug 03, 2007
by
simonpj@microsoft.com
Browse files
Remove dead code
parent
b374eb9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/types/Type.lhs
View file @
fd7c5f32
...
...
@@ -57,7 +57,7 @@ module Type (
predTypeRep, mkPredTy, mkPredTys, pprSourceTyCon, mkFamilyTyConApp,
-- Newtypes
splitRecNewType_maybe,
newTyConInstRhs,
newTyConInstRhs,
-- Lifting and boxity
isUnLiftedType, isUnboxedTupleType, isAlgType, isPrimitiveType,
...
...
@@ -630,31 +630,6 @@ pprSourceTyCon tycon
\end{code}
%************************************************************************
%* *
NewTypes
%* *
%************************************************************************
\begin{code}
splitRecNewType_maybe :: Type -> Maybe Type
-- Sometimes we want to look through a recursive newtype, and that's what happens here
-- It only strips *one layer* off, so the caller will usually call itself recursively
-- Only applied to types of kind *, hence the newtype is always saturated
splitRecNewType_maybe ty | Just ty' <- coreView ty = splitRecNewType_maybe ty'
splitRecNewType_maybe (TyConApp tc tys)
| isClosedNewTyCon tc
= ASSERT( tys `lengthIs` tyConArity tc ) -- splitRecNewType_maybe only be applied
-- to *types* (of kind *)
ASSERT( isRecursiveTyCon tc ) -- Guaranteed by coreView
case newTyConRhs tc of
(tvs, rep_ty) -> ASSERT( length tvs == length tys )
Just (substTyWith tvs tys rep_ty)
splitRecNewType_maybe other = Nothing
\end{code}
%************************************************************************
%* *
\subsection{Kinds and free variables}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment