-isTrueLHsExpr (L _ (HsTick _ _ e)) = isTrueLHsExpr e
-isTrueLHsExpr (L _ (HsBinTick _ _ e)) = isTrueLHsExpr e
+isTrueLHsExpr (L loc (HsTick ix frees e))
+ | Just ticks <- isTrueLHsExpr e = Just (\ e1 ->
+ ticks e1 `thenDs` \ e2 ->
+ mkTickBox ix frees e2)
+ -- This encodes that the result is constant True for Hpc tick purposes;
+ -- which is specifically what isTrueLHsExpr is trying to find out.
+isTrueLHsExpr (L loc (HsBinTick ixT _ e))
+ | Just ticks <- isTrueLHsExpr e = Just (\ e1 ->
+ ticks e1 `thenDs` \ e2 ->
+ mkTickBox ixT [] e2)