@@ -569,6 +569,13 @@ buildSCG' ist topfn pats args = nub $ concatMap scgPat pats where
569 if n `notElem` cases
569 if n `notElem` cases
570 then findCallsCase (n : cases) guarded n args pvs pargs
570 then findCallsCase (n : cases) guarded n args pvs pargs
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
572 | (P _ n _, args) <- unApply ap
579 | (P _ n _, args) <- unApply ap
573 -- Ordinary call, not under a delay.
580 -- Ordinary call, not under a delay.
574 -- If n is a constructor, set 'args' as Guarded
581 -- If n is a constructor, set 'args' as Guarded