logo

Learning objective

Function type: Know that a function, f, has a function type f: A → B (where the type is A → B, A is the argument type, and B is the result type). Know that A is called the domain and B is called the co-domain. Know that the domain and co-domain are always subsets of objects in some data type. Loosely speaking, a function is a rule that, for each element in some set A of inputs, assigns an output chosen from set B, but without necessarily using every member of B. For example, f: {a,b,c,…z} → {0,1,2,…,25} could use the rule that maps a to 0, b to 1, and so on, using all values which are members of set B. The domain is a set from which the function’s input values are chosen. The co-domain is a set from which the function’s output values are chosen. Not all of the co-domain’s members need to be outputs.

Read the explanation, check the common trap, then practise with flashcards and questions.

At a glance

0

Flashcards

0

Questions

Topic

Functional programming paradigm

Subtopic

Function type

Aqa A Level Computer ScienceFundamentals of functional programming

Study support

Understand this objective

Quick explanation

Function type: Know that a function, f, has a function type f: A → B (where the type is A → B, A is the argument type, and B is the result type). Know that A is called the domain and B is called the co-domain. Know that the domain and co-domain are always subsets of objects in some data type. Loosely speaking, a function is a rule that, for each element in some set A of inputs, assigns an output chosen from set B, but without necessarily using every member of B. For example, f: {a,b,c,…z} → {0,1,2,…,25} could use the rule that maps a to 0, b to 1, and so on, using all values which are members of set B. The domain is a set from which the function’s input values are chosen. The co-domain is a set from which the function’s output values are chosen. Not all of the co-domain’s members need to be outputs

  • This point belongs to Functional programming paradigm, especially Function type.
  • You need to be able to function type: Know that a function, f, has a function type f: A → B (where the type is A → B, A is the argument type, and B is the result type). Know that A is called the domain and B is called the co-domain. Know that the domain and co-domain are always subsets of objects in some data type. Loosely speaking, a function is a rule that, for each element in some set A of inputs, assigns an output chosen from set B, but without necessarily using every member of B. For example, f: {a,b,c,…z} → {0,1,2,…,25} could use the rule that maps a to 0, b to 1, and so on, using all values which are members of set B. The domain is a set from which the function’s input values are chosen. The co-domain is a set from which the function’s output values are chosen. Not all of the co-domain’s members need to be outputs.
  • Use the linked flashcards and practice questions to check recall, then practise applying the idea in an exam-style answer.

Why it matters

This objective helps connect Function type to exam-style questions, flashcards, and revision notes for Functional programming paradigm.

Quick student answer

For a function f: A → B, what does A represent?

Direct answer

The domain

Key terms

  • Domain: The set from which a function's input values are chosen; in f: A → B, it is A.
  • Co-domain: The set from which a function's output values are chosen; in f: A → B, it is B. Not every co-domain member needs to be an output.

Common trap

Assuming every co-domain member must be an output: The co-domain is the set from which outputs are chosen. It may contain members that the function never uses.

Related questions

Try this as a practice card

4 linked

Question 1 of 4

Choose an answer, get feedback, then move sideways through the set.

0 of 4 attempted

Flashcard prompts

Flip through the key recall cards

4 cards

Flashcard 1 of 4

Press Space to flip, arrows to move

Revision tools

Choose how to practise

Back to topic hub
Flashcards0 linked cards
No objective-specific flashcards are cached for this page. Use the topic hub to revise the surrounding flashcards without triggering a frozen-subject DB fallback.Open topic hub
Practice Questions0 linked questions
No objective-specific practice questions are cached for this page. Use the topic question bank to practise nearby curriculum questions without weakening the egress guard.Open topic questions

Related learning objectives