mirror of
https://github.com/Brandon-Rozek/website.git
synced 2025-10-10 06:51:13 +00:00
Syndicated to Medium
This commit is contained in:
parent
17e7209a41
commit
bfa4e52c0b
15 changed files with 95 additions and 75 deletions
|
@ -1,10 +1,13 @@
|
|||
---
|
||||
title: "Deep Recursion in Functional Programming"
|
||||
date: 2022-11-11T14:45:17-05:00
|
||||
date: 2022-11-11 14:45:17-05:00
|
||||
draft: false
|
||||
tags: ["Scala", "Functional Programming"]
|
||||
math: false
|
||||
medium_enabled: true
|
||||
medium_post_id: 3515de0ab3a1
|
||||
tags:
|
||||
- Scala
|
||||
- Functional Programming
|
||||
title: Deep Recursion in Functional Programming
|
||||
---
|
||||
|
||||
In functional programming, we often look at a list in terms of its head (first-element) and tail (rest-of-list). This allows us to define operations on a list recursively. For example, how do we sum a list of integers such as `[1, 2, 3, 4]`?
|
||||
|
@ -115,5 +118,4 @@ deep_sum([[1], 2])
|
|||
(0 + 1) + 2
|
||||
1 + 2
|
||||
3
|
||||
```
|
||||
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue