summaryrefslogtreecommitdiff
path: root/compiler/GHC/Core/Utils.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Core/Utils.hs')
-rw-r--r--compiler/GHC/Core/Utils.hs24
1 files changed, 12 insertions, 12 deletions
diff --git a/compiler/GHC/Core/Utils.hs b/compiler/GHC/Core/Utils.hs
index f2772edd8b..35a32d4c5d 100644
--- a/compiler/GHC/Core/Utils.hs
+++ b/compiler/GHC/Core/Utils.hs
@@ -339,7 +339,7 @@ mkCast expr co
-- | Wraps the given expression in the source annotation, dropping the
-- annotation if possible.
-mkTick :: Tickish Id -> CoreExpr -> CoreExpr
+mkTick :: Tickish -> CoreExpr -> CoreExpr
mkTick t orig_expr = mkTick' id id orig_expr
where
-- Some ticks (cost-centres) can be split in two, with the
@@ -424,7 +424,7 @@ mkTick t orig_expr = mkTick' id id orig_expr
-- Catch-all: Annotate where we stand
_any -> top $ Tick t $ rest expr
-mkTicks :: [Tickish Id] -> CoreExpr -> CoreExpr
+mkTicks :: [Tickish] -> CoreExpr -> CoreExpr
mkTicks ticks expr = foldr mkTick expr ticks
isSaturatedConApp :: CoreExpr -> Bool
@@ -435,13 +435,13 @@ isSaturatedConApp e = go e []
go (Cast f _) as = go f as
go _ _ = False
-mkTickNoHNF :: Tickish Id -> CoreExpr -> CoreExpr
+mkTickNoHNF :: Tickish -> CoreExpr -> CoreExpr
mkTickNoHNF t e
| exprIsHNF e = tickHNFArgs t e
| otherwise = mkTick t e
-- push a tick into the arguments of a HNF (call or constructor app)
-tickHNFArgs :: Tickish Id -> CoreExpr -> CoreExpr
+tickHNFArgs :: Tickish -> CoreExpr -> CoreExpr
tickHNFArgs t e = push t e
where
push t (App f (Type u)) = App (push t f) (Type u)
@@ -449,28 +449,28 @@ tickHNFArgs t e = push t e
push _t e = e
-- | Strip ticks satisfying a predicate from top of an expression
-stripTicksTop :: (Tickish Id -> Bool) -> Expr b -> ([Tickish Id], Expr b)
+stripTicksTop :: (Tickish -> Bool) -> Expr b -> ([Tickish], Expr b)
stripTicksTop p = go []
where go ts (Tick t e) | p t = go (t:ts) e
go ts other = (reverse ts, other)
-- | Strip ticks satisfying a predicate from top of an expression,
-- returning the remaining expression
-stripTicksTopE :: (Tickish Id -> Bool) -> Expr b -> Expr b
+stripTicksTopE :: (Tickish -> Bool) -> Expr b -> Expr b
stripTicksTopE p = go
where go (Tick t e) | p t = go e
go other = other
-- | Strip ticks satisfying a predicate from top of an expression,
-- returning the ticks
-stripTicksTopT :: (Tickish Id -> Bool) -> Expr b -> [Tickish Id]
+stripTicksTopT :: (Tickish -> Bool) -> Expr b -> [Tickish]
stripTicksTopT p = go []
where go ts (Tick t e) | p t = go (t:ts) e
go ts _ = ts
-- | Completely strip ticks satisfying a predicate from an
-- expression. Note this is O(n) in the size of the expression!
-stripTicksE :: (Tickish Id -> Bool) -> Expr b -> Expr b
+stripTicksE :: (Tickish -> Bool) -> Expr b -> Expr b
stripTicksE p expr = go expr
where go (App e a) = App (go e) (go a)
go (Lam b e) = Lam b (go e)
@@ -486,7 +486,7 @@ stripTicksE p expr = go expr
go_b (b, e) = (b, go e)
go_a (Alt c bs e) = Alt c bs (go e)
-stripTicksT :: (Tickish Id -> Bool) -> Expr b -> [Tickish Id]
+stripTicksT :: (Tickish -> Bool) -> Expr b -> [Tickish]
stripTicksT p expr = fromOL $ go expr
where go (App e a) = go e `appOL` go a
go (Lam _ e) = go e
@@ -2103,7 +2103,7 @@ cheapEqExpr :: Expr b -> Expr b -> Bool
cheapEqExpr = cheapEqExpr' (const False)
-- | Cheap expression equality test, can ignore ticks by type.
-cheapEqExpr' :: (Tickish Id -> Bool) -> Expr b -> Expr b -> Bool
+cheapEqExpr' :: (Tickish -> Bool) -> Expr b -> Expr b -> Bool
{-# INLINE cheapEqExpr' #-}
cheapEqExpr' ignoreTick e1 e2
= go e1 e2
@@ -2167,7 +2167,7 @@ eqExpr in_scope e1 e2
go_alt env (Alt c1 bs1 e1) (Alt c2 bs2 e2)
= c1 == c2 && go (rnBndrs2 env bs1 bs2) e1 e2
-eqTickish :: RnEnv2 -> Tickish Id -> Tickish Id -> Bool
+eqTickish :: RnEnv2 -> Tickish -> Tickish -> Bool
eqTickish env (Breakpoint _ lid lids) (Breakpoint _ rid rids)
= lid == rid && map (rnOccL env) lids == map (rnOccR env) rids
eqTickish _ l r = l == r
@@ -2483,7 +2483,7 @@ tryEtaReduce bndrs body
-> Type -- Type of the function to which the argument is applied
-> Maybe (Coercion -- Of type (arg_t -> t1 ~ bndr_t -> t2)
-- (and similarly for tyvars, coercion args)
- , [Tickish Var])
+ , [Tickish])
-- See Note [Eta reduction with casted arguments]
ok_arg bndr (Type ty) co _
| Just tv <- getTyVar_maybe ty