Back to marketplace

4.12: section 12: OOP and functional programming

No description yet. This curated deck is ready for daily study.

Total cards: 17•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (17)

#1
Front (Question)

define function application

Back (Answer)

process of giving particular inputs to a function

#2
Front (Question)

what is function type

Back (Answer)

f: A ->B f = function A = argument type: set of inputs =domain B = result type set of outputs = co-domain A and B must be subsets of objects in some data type

#3
Front (Question)

how many arguments can functions take

Back (Answer)

• although it seems multiple functions are being passed through only 1 is actually being applied • instead the result and function are passed as inputs

#4
Front (Question)

define partial function application

Back (Answer)

takes advantage of the inability of a function to take more than one input -one of the arguments is fixed leading to a more restricted specialized function

#5
Front (Question)

define composition functions

Back (Answer)

operation functional composition combines two functions to get a new function.

#6
Front (Question)

what is a high order function

Back (Answer)

A function is higher-order if it takes a function as an argument or returns a function as a result, or does both.

#7
Front (Question)

what is the map function

Back (Answer)

a higher-order function that applies a given function to each element of a list, returning a list of results.

#8
Front (Question)

what is a filter function

Back (Answer)

a higher-order function that processes a data structure, typically a list, in some order to produce a new data structure containing exactly those elements of the original data structure that match a given condition.

#9
Front (Question)

what is the reduce or fold function

Back (Answer)

a higher-order function which reduces a list of values to a single value by repeatedly applying a combining function to the list values. -can be started from the left or right of the list

#10
Front (Question)

what is the head and tail of a list

Back (Answer)

head: first element in a list tail: all remaining elements

#11
Front (Question)

how do you return the head of a list

Back (Answer)

head list_Name

#12
Front (Question)

how do you return the tail of a list

Back (Answer)

tail list_Name

#13
Front (Question)

how do you test for a empty list

Back (Answer)

null list_Name

#14
Front (Question)

how do create an empty list

Back (Answer)

list_Name = []

#15
Front (Question)

how do you return a list length

Back (Answer)

length list_Name

#16
Front (Question)

how do you prepend an item to a list

Back (Answer)

newValue: list_Name or [newValue] ++list_Name this doesnt change the list but instead cretaes a new one as the values are immutable

#17
Front (Question)

how do you append an item to a list

Back (Answer)

list_Name ++ [newValue] or create a function that reverses the list, prepends the value and reverses the list again let append y (x:xs) = reverse(y:reverse(x:xs))