Syndicated to Medium

This commit is contained in:
Brandon Rozek 2023-01-25 13:20:29 -05:00
parent 17e7209a41
commit bfa4e52c0b
No known key found for this signature in database
GPG key ID: 26E457DA82C9F480
15 changed files with 95 additions and 75 deletions

View file

@ -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
```
```