hlint suggestion
This commit is contained in:
parent
ee8a5460c3
commit
1174079776
1 changed files with 4 additions and 1 deletions
5
014.hs
5
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
|
||||
|
|
Loading…
Reference in a new issue