wk 2: functions and lists

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/14

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 7:33 PM on 4/12/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

15 Terms

1
New cards

purity

function will give the same output for the same input every time with no hidden state changes

2
New cards

pros of purity

  • easy to test

  • predicatble

  • referential transperency

3
New cards

referential transparency meaning

instead of the function call you can just put the result there

4
New cards

immutablility

data structures dont change in functional programming

instead of updating a list you just create a new list

5
New cards

pros of immutability

  • no who modifies this variable bugs

  • easier debugging bc values dont change randomly

  • concurrency is safer: if nothing changes, multiple threads can use the same data safely

6
New cards

recursion

breka problem into smaller parts since we dont need a counter or loop

7
New cards

higher order function

functions are like values that you can pass in other functions like numbers or strings — map, filter, foldr

8
New cards
9
New cards
10
New cards
11
New cards
12
New cards
13
New cards
14
New cards
15
New cards