haskell-workshop/solutions/block5/multiplyBy

14 lines
276 B
Plaintext

multiplyBy :: Int -> (Int -> Int)
double :: Int -> Int
multiplyBy = (*)
double = multiplyBy 2
triple = multiplyBy 3
-- Test cases
main = do
print (double 4) -- Expected output: 8
print (double 7) -- Expected output: 14
print (triple 4) -- Expected output: 12