Computational Process Organization Lab3,variant 1
- Name:Liu Honggang, student number:202320048
- Name:Fu wei, student number:202320049
Lab3 variant 1
variant 1: In this variant, you should implement a lazy library for a single-linked list. For that, you should use closures. Usage of generators (yield statement) or async (async, await statements) is not allowed.
implement the following API:
- head(List) – return a list first element. If the list is empty – raise an exception.
- tail(List) – return tail of the list.
- length(List).
- map(List, Function) and reduce(List, Function, InitialState).
- mempty().
- mconcat(List1, List2) – should not force list evaluation.
- from_list(pythonList) and to_list(List).
- it should be an iterator.
- Complex test – factorial - To proof correctness, use unit tests, properties-based tests - To proof laziness,demonstrate it for all suitable implemented functions on an infinite list (e.g. natural numbers sequence) and a
- contribution summary for each group member (should be checkable by git log and git blame);
- Linkedlist:Liu honggang
- Linkedlist_test:Fu wei
we create a single-linked list and use closures.And we not use generators (yield statement) or async (async, await statements).
- (how to use developed software, how to test it), should be repeatable by an instructor by given command-line examples:
- We write Linkedlist file and test file on Pycharm.
- Use terminal to test the code. like 'python Linkedlist.py -v'and 'python Linkedlist_test.py -v'.
We create a single-linked list and use closures.It's easy to see the test result.