-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcoursework8.fsx
46 lines (31 loc) · 1.67 KB
/
coursework8.fsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
(*
ITT8060 -- Advanced Programming 2015
Department of Computer Science
Tallinn University of Technology
------------------------------------------------
Coursework 8: Sequences and computation expressions
------------------------------------------------
Name:
Student ID:
------------------------------------------------
Answer the questions below. You answers to the questions should be correct F#
code written after the question. This file is an F# script file; it should be
possible to load the whole file at once. If you can't, then you have
introduced a syntax error somewhere.
This coursework will be graded.
Commit and push your solution to the repository as file coursework8.fsx in
directory coursework8.
The deadline for completing the above procedure is Friday, December 4, 2015.
We will consider the submission to be the latest version of the appropriate
files in the appropriate directory before the deadline of a particular
coursework.
*)
// 1. Make a declaration for the sequence of odd numbers.
// 2. Declare a function that, for given i and n, selects the sublist [a_i;a_i+1;...;a_i+n-1]
// of sequence [a_0; a_1; ...]
// 3. Use the functions in the Seq library to declare a function cartesian sqx sqy that gives
// a sequence containing all pairs (x,y) where x is a member of sqx and y is a member of sqy.
// 4. Make an alternative solution to 3 using sequence expressions.
// 5. Extend the logging workflow explained in the lecture to support downloading web pages.
// Log the http response code for each URL. Make a function that takes a sequence of URLs and
// downloads them while logging the response codes using the logging workflow.