[Haskell-cafe] how to optmize this code?

Henning Thielemann schlepptop at henning-thielemann.de
Sat Apr 9 15:17:01 CEST 2011


Gilberto Garcia schrieb:

> isMultiple :: Int -> [Int] -> Bool
> isMultiple a [] = False
> isMultiple a (x:xs) = if (mod a x == 0) then True else isMultiple a xs

I think this one can be written in terms of 'List.any'.



More information about the Haskell-Cafe mailing list