4 ms·
In Haskell it could be sum $ filter (\x -> mod x 3 == 0 || mod x 5 == 0) [1..1000] but I don't think that detracts from the article. He said up front his soluti
by Fishkins 13y ago
In Haskell it could be
sum $ filter (\x -> mod x 3 == 0 || mod x 5 == 0) [1..1000]
but I don't think that detracts from the article. He said up front his solution was over-engineered. That's nice in this case, because it lets us see how the type annotations look for very small, simple functions so we can get an idea what they looked like. I know some Haskell and Clojure, but I'd never actually looked at core.typed. This was a nice, basic intro to it.