Hoogle Search
Within LTS Haskell 24.32 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
splitTyConApp_maybe :: HasDebugCallStack => Type -> Maybe (TyCon, [Type])ghc GHC.Plugins Attempts to tease a type apart into a type constructor and the application of a number of arguments to that constructor
tcSplitAppTyNoView_maybe :: Type -> Maybe (Type, Type)ghc GHC.Plugins Just like splitAppTyNoView_maybe, but does not split (c => t) See Note [Decomposing fat arrow c=>t]
tcSplitTyConApp_maybe :: HasCallStack => Type -> Maybe (TyCon, [Type])ghc GHC.Plugins tcSplitTyConApp_maybe splits a type constructor application into its type constructor and applied types. Differs from splitTyConApp_maybe in that it does *not* split types headed with (=>), as that's not a TyCon in the type-checker. Note that this may fail (in funTyConAppTy_maybe) in the case of a FunTy with an argument of unknown kind FunTy (e.g. `FunTy (a :: k) Int`, since the kind of a isn't of the form `TYPE rep`. This isn't usually a problem but may be temporarily the case during canonicalization: see Note [Decomposing FunTy] in GHC.Tc.Solver.Equality and Note [The Purely Kinded Type Invariant (PKTI)] in GHC.Tc.Gen.HsType, Wrinkle around FunTy Consequently, you may need to zonk your type before using this function.
topNormaliseNewType_maybe :: Type -> Maybe (Coercion, Type)ghc GHC.Plugins Sometimes we want to look through a newtype and get its associated coercion. This function strips off newtype layers enough to reveal something that isn't a newtype. Specifically, here's the invariant:
topNormaliseNewType_maybe rec_nts ty = Just (co, ty')
then (a) co : ty ~R ty'. (b) ty' is not a newtype. The function returns Nothing for non-newtypes, or unsaturated applications This function does *not* look through type families, because it has no access to the type family environment. If you do have that at hand, consider to use topNormaliseType_maybe, which should be a drop-in replacement for topNormaliseNewType_maybe If topNormliseNewType_maybe ty = Just (co, ty'), then co : ty ~R ty'tyConAppArgs_maybe :: Type -> Maybe [Type]ghc GHC.Plugins The same as snd . splitTyConApp
tyConAppFunCo_maybe :: HasDebugCallStack => Role -> TyCon -> [Coercion] -> Maybe Coercionghc GHC.Plugins Return Just if this TyConAppCo should be represented as a FunCo
tyConAppFunTy_maybe :: HasDebugCallStack => TyCon -> [Type] -> Maybe Typeghc GHC.Plugins Return Just if this TyConApp should be represented as a FunTy
tyConAppTyConPicky_maybe :: Type -> Maybe TyConghc GHC.Plugins Retrieve the tycon heading this type, if there is one. Does not look through synonyms.
tyConAppTyCon_maybe :: Type -> Maybe TyConghc GHC.Plugins The same as fst . splitTyConApp We can short-cut the FunTy case
typeLevity_maybe :: HasDebugCallStack => Type -> Maybe Levityghc GHC.Plugins Tries to compute the Levity of the given type. Returns either a definite Levity, or Nothing if we aren't sure (e.g. the type is representation-polymorphic). Panics if the kind does not have the shape TYPE r.