Functional Programming Keywords

Descrição

Functional Programming keywords for A Level Computer Science
Lyndsay Hope
FlashCards por Lyndsay Hope, atualizado more than 1 year ago
Lyndsay Hope
Criado por Lyndsay Hope mais de 7 anos atrás
85
0

Resumo de Recurso

Questão Responda
Functional Programming Paradigm Where each line of code is made up of calls to a function Each function may be made up of other functions, or result in a value
Declarative programming languages These declare or specify what properties a result should have: results are logical outcomes of functions. (unlike procedural languages which specify steps to take to find a result)
Function type 'Function type' describes the way in which the expression is created. EG integer of the domain and codomain, where f: A → B is the function type
Domain inputs of a function which are a set of data of the same type
Codomain the set of values from which outputs of a function must be drawn
First-class object an object that can be passed as an argument, or returned as a result of a function call
Higher order function a function that creates a function as its output or takes a function as its input eg map, fold, filter eg map (*2) [1, 2, 3, 4, 5]
Function application the process of calculating a function result by passing it data to produce a result
Function composition combining multiple functions to create more complex functions
Map function generates an output list from an input list by applying a function to each element in the input list ie it maps element from Input List to element from Output List
Filter function creating a subset based on specified criteria eg all even numbers
Reduce / fold function a recursive method of reducing a list to a single element by combining the elements using a function eg a list of numbers you wish to add
List a collection of data items of the same type
Identifier a lists's name
Tail every element in a list apart from the head tail [1, 2, 3, 4, 5]
Head the first element in a list head [1, 2, 3, 4, 5]
Empty list a list with no elements in it [ ]
Side effects EG • Modifying a value • Modifying a data structure in-place • Throwing an exception or halting with an error • Printing to the console or reading user input • Reading from or writing to a file

Semelhante

A level Computing Quiz
Zacchaeus Snape
Types and Components of Computer Systems
Jess Peason
Input Devices
Jess Peason
Output Devices
Jess Peason
Computing
Kwame Oteng-Adusei
Pack of playing cards answer
Karl Taylor
Code Challenge Flow Chart
Charlotte Hilton
Computing Hardware - CPU and Memory
ollietablet123
Computer Systems
lisawinkler10
Computer science quiz
Ryan Barton
Input, output and storage devices
Mr A Esch