Commit 21b4228d authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Simplify the defn of coreViewOneStarKind

I discussed it with Richard, but this version is much
simmpler and more efficient.
parent 34c95239
...@@ -311,12 +311,11 @@ coreView _ = Nothing ...@@ -311,12 +311,11 @@ coreView _ = Nothing
-- | Like 'coreView', but it also "expands" @Constraint@ to become -- | Like 'coreView', but it also "expands" @Constraint@ to become
-- @TYPE Lifted@. -- @TYPE Lifted@.
coreViewOneStarKind :: Type -> Maybe Type coreViewOneStarKind :: Type -> Maybe Type
coreViewOneStarKind = go Nothing coreViewOneStarKind ty
where | Just ty' <- coreView ty = Just ty'
go _ t | Just t' <- coreView t = go (Just t') t' | TyConApp tc [] <- ty
go _ (TyConApp tc []) | isStarKindSynonymTyCon tc = go (Just t') t' , isStarKindSynonymTyCon tc = Just liftedTypeKind
where t' = liftedTypeKind | otherwise = Nothing
go res _ = res
----------------------------------------------- -----------------------------------------------
expandTypeSynonyms :: Type -> Type expandTypeSynonyms :: Type -> Type
......
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