Skip to content

Commit f92292e

Browse files
author
Ahan Malhotra
committed
Add Readme
Signed-off-by: Ahan Malhotra <ahanmalhotra@college.harvard.edu>
1 parent d71f934 commit f92292e

File tree

2 files changed

+54
-3
lines changed

2 files changed

+54
-3
lines changed

Makefile

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Frontend to dune.
22

3-
.PHONY: default build install uninstall test clean
3+
.PHONY: default build install uninstall test clean utop
44

55
default: build
66

@@ -18,6 +18,7 @@ uninstall:
1818

1919
clean:
2020
dune clean
21-
# Optionally, remove all files/folders ignored by git as defined
22-
# in .gitignore (-X).
2321
git clean -dfXq
22+
23+
utop:
24+
dune utop lib

README.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
CS51 Utilities
2+
==
3+
4+
`cs51/utils` contains some useful utilities for problem sets and labs
5+
throughout CS51. The `Absbook` module will also be referenced
6+
throughout the course textbook, _Abstraction and Design in
7+
Computation_.
8+
9+
10+
Installation
11+
--
12+
The fastest way to install `cs51/utils` is with `opam`:
13+
14+
```
15+
opam pin add CS51Utils ssh://git@github.com:cs51/utils.git
16+
```
17+
18+
For more information on `opam pin`, please consult the
19+
[opam documentation](https://opam.ocaml.org/doc/Usage.html)
20+
21+
The advantage of the opam-based method is that other opam packages can
22+
depend on this one, and opam will recompile them automatically as
23+
necessary.
24+
25+
`cs51/utils` can also be installed directly using `make install` and
26+
uninstalled using `make uninstall`.
27+
28+
29+
Tests
30+
--
31+
32+
Certain parts of `cs51/utils` have unit tests, which can be run with
33+
```
34+
$ make test
35+
```
36+
37+
Using `cs51/utils` in utop
38+
--
39+
40+
Use `make utop` where DIR if the folder contains the `dune`
41+
file for a library. For instance, our `sub2` sample library can be
42+
used as follows:
43+
44+
```ocaml
45+
$ dune utop sub2/lib
46+
...
47+
utop # CS51Utils.Absbook.id 51 ;;
48+
- : int = 51
49+
```
50+

0 commit comments

Comments
 (0)