Commits

Lars Yencken committed 725d226

Haskell 01.

  • Participants
  • Parent commits d92e106

Comments (0)

Files changed (2)

haskell/01-sum-numbers.hs

+--
+-- 01-sum-numbers.hs
+--
+-- Sum all the numbers in the range [1,1000). 
+--
+
+sumNumbers = sum [i | i <- [1..999], i `mod` 3 == 0 || i `mod` 5 == 0]
+
+main = do putStrLn (show sumNumbers)
+CC = ghc
+
+ALL = 01-sum-numbers
+
+all: $(ALL)
+
+%: %.hs
+	$(CC) -o $@ $<
+
+clean:
+	rm -f $(ALL) *.hi *.o
+