• + 0 comments

    The generate code by HR is bad. Haskell is a functional programming language and it should be a declarative style rather than imperative.

    for example this processes whole input like a stream. Betpkr Much more elegant.

    filterIt :: [Int] -> [String] filterIt (a:xs) = map show $ filter (\x -> x < a) xs

    main = interact $ unlines . filterIt. map read. words