Topic study hub
Writing functional programs
Official AQA 7517 section 4.12.2.
0
Objectives
5
Flashcards
7
Questions
36 min
Study time
AqaA LevelComputer ScienceFundamentals of functional programming
Choose a revision tool
Start revising Writing functional programs
Syllabus checklist
What you need to know
0 objective pages available
Functional language programs1 objectives
- Functional language programs: Show experience of constructing simple programs in a functional programming language. The following is a list of functional programming languages that could be used: • Haskell • Standard ML • Scheme • Lisp. Other languages with built-in support for programming in a functional paradigm as well as other paradigms are: • Python • F# • C# • Scala • Java 8 • Delphi XE versions onwards • VB.NET 2008 onwards. Higher-order functions. A function is higher-order if it takes a function as an argument or returns a function as a result, or does both. Have experience of using the following in a functional programming language: • map • filter • reduce or fold. map is the name of a higher-order function that applies a given function to each element of a list, returning a list of results. filter is the name of 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. reduce or fold is the name of a higher-order function which reduces a list of values to a single value by repeatedly applying a combining function to the list values.
Key terms
Higher-order functionFunctional programming
Exam tips
- Describe the data flow: When answering questions about higher-order functions, state what happens to each element and state the form of the result.
Common mistakes
- Confusing map and filter: Use filter for selection based on a condition and map for applying a function to every element. If both are needed, apply them as separate stages in an appropriate order.
Practice preview
Continue by objective
Objectives are grouped by subtopic so students can jump straight to the exact skill they want to revise.
Related topics
