-- This is a module to demonstrate some -- sample functions and test out basic -- haskell syntax (alternatives, where clauses) -- -- richard buckland -- comp1711 module Week2Style where -- example functions to see if sum of 3 numbers is pos or not -- ok positiveSum1 :: Int -> Int -> Int -> String positiveSum1 a b c | (a+b+c) > 0 = "Sum is greater than zero!" | (a+b+c) <= 0 = "Sum is NOT greater than zero!" -- better positiveSum2 :: Int -> Int -> Int -> String positiveSum2 a b c | total > 0 = "Sum is greater than zero!" | total <=0 = "Sum is NOT greater than zero!" where total = a + b + c -- best positiveSum3 :: Int -> Int -> Int -> String positiveSum3 a b c | (a+b+c) > 0 = "Sum is greater than zero!" | otherwise = "Sum is NOT greater than zero!" where total = a + b + c