Skip to content

Commit b7a3d71

Browse files
Add explaination to readme
1 parent 8bab7ad commit b7a3d71

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

README.md

+21
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,27 @@
22

33
Common functions implemented using recursion
44

5+
---
6+
7+
### How is the idea?
8+
9+
I tried to follow the haskell way, which is basically:
10+
11+
- base case
12+
- recursive case
13+
14+
15+
So, almost always we'll have:
16+
17+
- empty list
18+
- list with elements
19+
20+
(`flatten` is a special case, take a look at the file 😉 )
21+
22+
For empty list, we don't do anything. For the case of the list with elements, we separate into first element and the rest. We _do_ something to the first element, and call the recursion to complete rest. And voila!
23+
24+
25+
526
---
627

728
### Implemented:

map_explained.png

130 KB
Loading

0 commit comments

Comments
 (0)