As You can see it’s almost impossible to decode it after writing. But then I started wondering how would it look in Elixir. So I implemented my first try. With prime number test and simple iterator function.
Not bad but still not dope. Then I recalled there was a new thing going on around Elixir called Streams.
Stream is an implementation of an [possibly] endless enumerable. So I gave it a try with it. This is the effect:
Prime number in 2 still pretty readable lines of code. That’s neat. Isn’t it?
/Edit Scala Bonus
I recently wrote a Haskell alternative:
I think we might have a winner here ;)