
9 Nov
2011
9 Nov
'11
4:04 a.m.
Hi, With a function defined like this (colors is type of Array Int [Int] and edges is [Int]): saturation (_,edges,_) = foldr (\ed ac ->if null (colors!ed) then ac else ac+1) 0 edges I'm getting an infinite loop. But when I remove the if statement like this: saturation (_,edges,_) = foldr (\ed ac -> ac+1) 0 edges everything's working. How should I define my function with the if statement to not getting an infinite loop? Best Regards, Karol Samborski