fork(3) download
  1. main = print $ getPrime 10
  2.  
  3. getPrime x = [(y, z) | y <- [1..x], z <- [y .. x], isPrime $ y + z]
  4.  
  5. isPrime x = all (\y-> x `mod` y /=0)$ filter isPrime [2 .. floor $ sqrt $ fromIntegral x]
Success #stdin #stdout 0s 6236KB
stdin
Standard input is empty
stdout
[(1,1),(1,2),(1,4),(1,6),(1,10),(2,3),(2,5),(2,9),(3,4),(3,8),(3,10),(4,7),(4,9),(5,6),(5,8),(6,7),(7,10),(8,9),(9,10)]