TPK algorithm: Difference between revisions

Content deleted Content added
Haskell: Even more peer review.
Line 134:
===[[Haskell (programming language)|Haskell]]===
<source lang="haskell">
import Control.Monad
f x = sqrt (abs x) + 5 * x ^ 3
message x = if x > 400 then "TOO LARGE" else show x
main = replicateM 11interact $ getLine >>= putStrLnunlines . map (message . f . read) . reverse . lines
</source>
Haskell uses monads for input/output. Iteration was replaced by recursion in the language.