let arg_count = matchGroupArity mg
let (tys,res_ty) = splitFunTysN arg_count ty
- return $ L pos $ funBind { fun_matches = MatchGroup ({-L pos fn_entry:-}matches') ty
+ return $ L pos $ funBind { fun_matches = MatchGroup matches' ty
, fun_tick = tick_no
}
addTickHsExpr (HsTick _ _) = error "addTickhsExpr: HsTick _ _"
addTickMatchGroup (MatchGroup matches ty) = do
- let isOneOfMany = True -- AJG: for now
+ let isOneOfMany = matchesOneOfMany matches
matches' <- mapM (liftL (addTickMatch isOneOfMany)) matches
return $ MatchGroup matches' ty
\begin{code}
+matchesOneOfMany :: [LMatch Id] -> Bool
+matchesOneOfMany lmatches = sum (map matchCount lmatches) > 1
+ where
+ matchCount (L _ (Match _pats _ty (GRHSs grhss _binds))) = length grhss
+\end{code}
+
+
+\begin{code}
---------------------------------------------------------------
-- Datatypes and file-access routines for the per-module (.mix)
-- indexes used by Hpc.