shlogg · Early preview
Jetthoughts Dev @jetthoughts

Learning Elixir Through A Simple Kata

I've been learning Elixir by solving the "Counting sheep..." kata with 13 different solutions, exploring various approaches and functions like Enum and List.

I have been thinking about learning a functional language for a long time. So recently I’ve started to play around with Elixir. I am reading official guide and docs for theory. And also I do simple katas on Codewars for practice.
The last kata is **Counting sheep… **And I’ve come up with 13 solutions for it. Let me show it to you and explain why I need so many.

  
  
  Task

Consider an array of sheep where some sheep may be missing from their place. We need a function that counts the number of sheep present in the array (true means present).
For example,

[true,  true,  true,  false,
  true,...