fork(1) download
  1. sumFromTo :: Int -> Int -> Int
  2. sumFromTo x y
  3. | x > y = 0
  4. | x == y = x
  5. | otherwise = x + sumFromTo (x + 1) y
  6.  
  7. main = do {
  8. print (sumFromTo 5 8);
  9. print (sumFromTo 8 8);
  10. print (sumFromTo 9 5);
  11. }
Success #stdin #stdout 0s 8388607KB
stdin
Standard input is empty
stdout
26
8
0