Select a Pre-defined Filter Definition.

Filter

 

Filter Definitions

Filter
Definition
Values

Select a Pre-defined Function Definition.

Function

 

Function Definitions

Function
Definition
Values

Select a Pre-defined List Function Definition.

List Function

 

List Function Definitions

List Function
Definition
Values

Select a Pre-defined List Definition.

List

 

List Definitions

List
Definition
Values

Enter Program


Select a command


Enter a list of integer values separated by spaces

About the Sets/List and Functional Programming Activity

Function Definitions

There are a number of different types of function that can be defined. The return values from a function can be one of the following:
  1. Integer.
  2. String
  3. List
  4. Map
  5. Filter
  6. Fold
Defining a function may require up to three different parameters: a, b and c. The input values may be an integer, a string or a list.

Integer Functions

Integer functions take one or two integer values and return an integer value. They can also take a cateseian product as an input corsisting of a pari of two integer values

String Functions

String functions take one or two integer or string value and return a stringvalue.

List Functions

List consist of a head (x) and a tail (xs) where the head is the first element in the list and the tail consists of the remaining elements. The list functions take eight the head, the tail or the entire list as the input

Recursive Functions

Recursive functions take the output from the next iteration of the function as its output. A termination condition must be specified so that the resursive function does not call itself indefinitely.

Commands.

The commands are based on the commands that can be used in functional programming
They can be defined to work with either functions, lists or both.
Lists can either be defined as integers separated by spaces, or bases on the elements in an existing set definition. There are six types of commands that can be defined.
  1. Function.
  2. List Function
  3. Compound
  4. Map
  5. Filter
  6. Fold

Function Commands

These use the functions that require integer arguments and return an integer values.
The argument values are specified allowing the calculation to be displayed when the "Run" button is selected. The "Detail" button provides the detail on the functional programming mapping between the domain and the codomain. For funcitons with two arguments, a Partial Function Applicaiton can be displayed with the definition of a new intermediate function.
There is the option to specify a recursive function and the "Detail" button can be used to view the calculation after each iteration.

List Function Commands

These use the functions that require a finite list as the argument.
The function definition uses the x:xs syntax where x represents the head or first element, and xs represents the tail or the remaining elements.
There is the option to specify a recursive list function and the "Detail" button can be used to view the calculation after each iteration.

Composition Commands

This option allows for a composition of two functions to be defined
The domain of the second function must match the codomain of the first function
The new function combining both is displayed when "Run" button is selected. The "Detail" button provides the detailed calculations at each stage for each function.

Map Command

This requires a function that required one integer argument and a finite list.
The result of applying the function to each element of the list to produced a new list is displayed when "Run" button is selected.
The "Detail" button provides the detail on the functional programming mapping between the domain and the codomain for the specified function

Filter Command

This requires a an infinite list to define the filter and a finite list to apply the filter to.
All elements in the finite list that match the filter produce a new list is displayed when "Run" button is selected.
The "Detail" button provides the detail on the functional programming mapping between the domain and the codomain for the specified function

Fold Command

This require a function requiring two arguments are a finite list. In addition an initial result value must be specified
The "Run" buttons shows the result of recursively applying the current result to the next element in the list. The "Detail" button provides the detail on the functional programming mapping and the result at each stage of the calculation.


Note that this is a testing release. Please contact me is you find any issues.
Note that this is a testing release. Please contact me if you find any issues.