From 1174079776e9b44d9bffdd7588a3997a358d39f0 Mon Sep 17 00:00:00 2001 From: "Yann Esposito (Yogsototh)" Date: Thu, 10 Nov 2011 10:58:24 +0100 Subject: [PATCH] hlint suggestion --- 014.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/014.hs b/014.hs index c4c0b1f..3e26210 100644 --- a/014.hs +++ b/014.hs @@ -2,7 +2,10 @@ import Data.List type YInt = Int collatz :: YInt -> YInt -collatz n = if n<0 then 1 else if even n then n `quot` 2 else 3*n+1 +collatz n + | n<0 = 1 + | even n = n `quot` 2 + | otherwise = 3*n+1 -- The l `seq` is necessary to not be lazy (non-strict) -- And not to fill the stack