@@ -569,6 +569,13 @@ buildSCG' ist topfn pats args = nub $ concatMap scgPat pats where
569569 if n `notElem` cases
570570 then findCallsCase (n : cases) guarded n args pvs pargs
571571 else []
572+ | (P _ ifthenelse _, [_, _, t, e]) <- unApply ap,
573+ ifthenelse == sNS (sUN "ifThenElse") ["Bool", "Prelude"]
574+ -- Continue look inside if...then...else blocks
575+ -- TODO: Consider whether we should do this for user defined ifThenElse
576+ -- rather than just the one in the Prelude as a special case
577+ = findCalls cases guarded t pvs pargs ++
578+ findCalls cases guarded e pvs pargs
572579 | (P _ n _, args) <- unApply ap
573580 -- Ordinary call, not under a delay.
574581 -- If n is a constructor, set 'args' as Guarded