Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
passed_By
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
3 ms
·
1.
▲
by
passed_By
8y ago
So, haskell version may be little shorter main = interact $ unlines. map (show.calc) .lines calc :: String -> [Float] calc = foldl f [] . words where f (x:y:zs) "+" = (y + x):zs f (x:y:zs) "-"