f []     sofar endhere = sofar
f (x:xs) sofar endhere = f xs (max sofar endhere) (max (endhere + x) 0)
maxSubSum seq = f seq 0 0

main = do
    input <- getLine
    let seq = map read (words input) :: [Int]
    putStrLn $ show $ maxSubSum seq


하스켈은 요즘 배우고 있는데여 배우면 배울수록 똑똑해지는 기분임!! 


참고로여 위 코드는 Haskell의 idiom과는 거리가 매우 멉니다. 개구린 코드에요