Commit af7c22d9 authored by simonpj@microsoft.com's avatar simonpj@microsoft.com

Move isDictTy from TcType to Type

parent bbeb08a1
......@@ -101,7 +101,6 @@ import qualified Var
import TyCon
import Type
import TcType
import TysPrim
import DataCon
import Demand
......
......@@ -902,11 +902,6 @@ getClassPredTys _ = panic "getClassPredTys"
mkDictTy :: Class -> [Type] -> Type
mkDictTy clas tys = mkPredTy (ClassP clas tys)
isDictTy :: Type -> Bool
isDictTy ty | Just ty' <- tcView ty = isDictTy ty'
isDictTy (PredTy p) = isClassPred p
isDictTy _ = False
isDictLikeTy :: Type -> Bool
-- Note [Dictionary-like types]
isDictLikeTy ty | Just ty' <- tcView ty = isDictTy ty'
......
......@@ -6,7 +6,6 @@
Type - public interface
\begin{code}
{-# OPTIONS -fno-warn-incomplete-patterns #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and fix
-- any warnings in the module. See
......@@ -53,7 +52,7 @@ module Type (
funTyCon,
-- ** Predicates on types
isTyVarTy, isFunTy,
isTyVarTy, isFunTy, isDictTy,
-- (Lifting and boxity)
isUnLiftedType, isUnboxedTupleType, isAlgType, isClosedAlgType,
......@@ -820,6 +819,11 @@ pprSourceTyCon tycon
= ppr $ fam_tc `TyConApp` tys -- can't be FunTyCon
| otherwise
= ppr tycon
isDictTy :: Type -> Bool
isDictTy ty = case splitTyConApp_maybe ty of
Just (tc, _) -> isClassTyCon tc
Nothing -> False
\end{code}
......
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