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

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
-- | Like 'coreView', but it also "expands" @Constraint@ to become
-- @TYPE Lifted@.
coreViewOneStarKind :: Type -> Maybe Type
coreViewOneStarKind = go Nothing
where
go _ t | Just t' <- coreView t = go (Just t') t'
go _ (TyConApp tc []) | isStarKindSynonymTyCon tc = go (Just t') t'
where t' = liftedTypeKind
go res _ = res
coreViewOneStarKind ty
| Just ty' <- coreView ty = Just ty'
| TyConApp tc [] <- ty
, isStarKindSynonymTyCon tc = Just liftedTypeKind
| otherwise = Nothing
-----------------------------------------------
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