The following project is a small exploration of the Egyptian multiplication algorithm. The code was inspired by the From Mathematics to Generic Programming.
A non-recursive version using foldl
was originally authored by Rodrigo Girão
Serrão after conversations on his blog Egyptian multiplication with
Haskell.
Haddock API documentation is available on:
To ensure package dependencies are installed, call:
make setup
To build run GNU Make with:
make
This runs the default targets of check
and fast
.
make test
The first time you run the benchmarks, ensure doc
target is called:
make doc bench
After which you can run just:
make bench
To run the default multiplication algorithm (multiply4
):
stack exec multiply 12 15