## Slide 1

### Slide 1 text

CHEAT-SHEET Folding #3 βΆ / \ ππ βΆ / \ ππ βΆ / \ ππ βΆ / \ ππ π / \ ππ π / \ ππ π / \ ππ π / \ ππ π @philip_schwarz slides by https://fpilluminated.com/

## Slide 2

### Slide 2 text

The universal property of ππππ ... For finite lists, the universal property of ππππ can be stated as the following equivalence between two definitions for a function π that processes lists: π = π βΊ π = ππππ π π π π₯ βΆ π₯π  = π π₯ π π₯π  In the right-to-left direction, substituting π = ππππ π π into the two equations for π gives the recursive definition for ππππ. Conversely, in the left-to-right direction the two equations for g are precisely the assumptions required to show that π = ππππ π π using a simple proof by induction on finite listsβ¦ Taken as a whole, the universal property states that for finite lists the function ππππ π π is not just a solution to its defining equations, but in fact the unique solutionβ¦. The universal property of ππππ can be generalised to handle partial and infinite listsβ¦ Graham Hutton @haskelhutt ππππ :: πΌ β π½ β π½ β π½ β πΌ β π½ ππππ π π£ = π£ ππππ π π£ π₯ βΆ π₯π  = π π₯ ππππ π π£ π₯π

## Slide 3

### Slide 3 text

π = π£ π π₯ βΆ π₯π  = π π₯ π π₯π  π π’π β· πΌππ‘ β πΌππ‘ π π’π = 0 π π’π π₯ βΆ π₯π  = π₯ + π π’π π₯π  π π’π = ππππ + 0 βΊ π = ππππ π π£ βΊ πππππ’ππ‘ β· πΌππ‘ β πΌππ‘ πππππ’ππ‘ = 1 πππππ’ππ‘ π₯ βΆ π₯π  = π₯ Γ πππππ’ππ‘ π₯π  πππππ’ππ‘ = ππππ (Γ) 1 βΊ πππππ‘β β· [Ξ±] β πΌππ‘ πππππ‘β [ ] = 0 πππππ‘β π₯ βΆ π₯π  = 1 + πππππ‘β π₯π  πππππ‘β = ππππ (ππ₯. ππ. 1 + π) 0 βΊ (β§Ί) β· [Ξ±] β [Ξ±] β [Ξ±] β§Ί π¦π  = π¦π  π₯ βΆ π₯π  β§Ί π¦π  = π₯ βΆ (π₯π  β§Ί π¦π ) (β§Ί π¦π ) = ππππ βΆ π¦π  βΊ concat β· [ Ξ± ] β [Ξ±] concat = concat π₯π  βΆ π₯π π  = π₯π  β§Ί ππππππ‘ π₯π π  βΊ concat = ππππ (β§Ί) [ ]

## Slide 4

### Slide 4 text

The Triad of πππ, ππππ‘ππ and ππππ πππ Ξ» The πππππ, ππ’π‘π‘ππ, and πππ of Functional Programming =

## Slide 5

### Slide 5 text

π = π£ π π₯ βΆ π₯π  = π π₯ π π₯π  πππ β· πΌ β π½ β πΌ β π½ πππ π = πππ π π₯ βΆ π₯π  = π π₯ βΆ πππ π π₯π  πππ π = πππππ ππ₯. ππ₯π . π π₯ βΆ π₯π  [ ] βΊ ππππ‘ππ β· (πΌ β π΅πππ) β πΌ β π ππππ‘ππ p = ππππ‘ππ p π₯ βΆ π₯π  = π’π π π₯ π­π‘ππ§ π₯ βΆ ππππ‘ππ p π₯π  ππ₯π¬π ππππ‘ππ p π₯π  ππππ‘ππ p = πππππ (ππ₯. ππ₯π . π’π π π₯ π­π‘ππ§ π₯ βΆ π₯π  ππ₯π¬π π₯π ) [ ] βΊ π = πππππ π π£ βΊ πππ Ξ» ππππ =

## Slide 6

### Slide 6 text

https://fpilluminated.com/ inspired by