3.0 Declarative programming techniques Flashcards
1
Q
When is an operation declarative?
A
Whenever called with the same arguments, it returns the same results independent of any other computational state.
Independent: Does not depend on any other operation outside itself
Stateless: Does not contain any internal state that it remembers between runs.
Deterministic: Always same result for same arguments.
2
Q
What is higher order programming?
A
Functions use other functions as arguments or return values.
3
Q
What is the structure of iterative functions?
A
fun {Iterate L}
if isDone then L
else
S_(i+1) = {Transform L}
{Iterate S_(i+1)}
end
end