triplesWithProp :: Int -> ((Int, Int, Int) -> Bool) -> [(Int, Int, Int)] triplesWithProp n p = [(x, y, z)|x <- [1 .. n], y <-[x+1.. n], z <- [y+1 .. n], p (x,y,z)] {--Testdaten: triplesWithProp 10 (\(x,y,z) -> x+y==z) [(1,2,3),(1,3,4),(1,4,5),(1,5,6),(1,6,7),(1,7,8),(1,8,9),(1,9,10),(2,3,5), (2,4,6),(2,5,7),(2,6,8),(2,7,9),(2,8,10),(3,4,7),(3,5,8),(3,6,9),(3,7,10),(4,5,9),(4,6,10)] --}