Starting from:

$25

Functional-Programming - Assignment 2 - Intermediate concepts - Solved

1.    Unzip the A2.zip folder. You should find 3 files in the src folder:

Solutions.elm - for exercises 2.2.1 to 2.2.4, inclusive

Regex.elm - for exercise 2.2.5

FunSet.elm - for exercise 2.2.6

2.    Edit the first line of each of the source files as described in the comments.

3.    Edit the source files in the src folder with your solutions.

4.    When done, zip this A2 folder and name the zip archive with the following format:

A2 hFirstNamei hLastNamei hGroupi

Examples of valid names:

A2 John Doe 30432.zip

 A2 Ion Popescu 30434.zip

A2 Gigel-Dorel Petrescu  30431.zip

Examples of invalid names:

Solutions.zip

A2.zip

Solutii A2 Ion  Popescu.zip

2.2       Assignment exercises
 
       Exercise 2.2.6                                                                                                                           2p

 You are given an incomplete implementation of a very simple regex engine in the Regex.elm file. You will have to implement 4 functions: matchLit, which matches a character literal matchOneOf, which matches one of two patterns matchMany, which matches the pattern zero or more times matchSeq, which matches the two patterns, in order

Details about the expected behaviour of the functions are given as comments in the file.

 For this exercise you will have to implement the common set operations on sets if integers represented as functions. In the FunSet.elm file, you will find a type alias FunSet for the representation of a set as a function, the contains and the singletonSet functions. Details about the expected behaviour of the functions are given as comments in the file.

More products