Readme
# Machine Learning for Haskell - Feature Extraction #
This repository provides a *recurrent clustering* algorithm, which assigns
feature vectors to Haskell Core syntax trees. This works by turning the tree
structure into a (left-biased) matrix then concatenating the rows. Each symbol
in the tree is given a number (feature): keywords use hard-coded numbers, whilst
names are dereferenced to get *their* syntax trees, grouped into clusters based
on the features of those trees, and the index of the cluster is used as the
feature.
## Layout ##
This is a normal Haskell project using the Cabal build system. We also provide
definitions for the Nix package manager and a benchmark suite for the Airspeed
Velocity (ASV) framework (using the `asv-nix` plugin).
- `asv.conf.json` is the Airspeed Velocity configuration. It sets up the
benchmark suite in `benchmarks/`
- `benchmarks/` defines our benchmarks. The `default.nix` file will be loaded
for each git revision, and defines a `python` executable whose environment
contains values, commands, etc. from that revision for use by the benchmark
scripts (the `*.py` files).
- `overlay.nix` is a Nix overlay, providing (among other things) a Haskell
package set containing this `ML4HSFE` package, a standalone `ML4HSFE` package
taken from that set and an instantiation of the `test.nix` tests.
- `overlayed.nix` applies our overlay to a pinned version of Nixpkgs. This
should work regardless of what version your system provides.
- `release.nix` chooses those packages from `overlayed.nix` which we want to
build and provide via continuous integration.
- `tests.nix` contains some integration tests which can't be run from the
Cabal test suite.
## Infrastructure ##
The included `shell.nix` file provides suitable versions of GHC and asv. During
development I use ghcid to build and run tests after each save. I find the
following `.ghcid` file works well:
```
--command="nix-shell --run 'cabal new-repl'"
--test=":! cabal new-test"
```
The call to `nix-shell` ensures that the GHC defined in `shell.nix` is used, and
`cabal new-repl` invokes GHCi with this library in scope. The contents of the
`--test` option will be sent to GHCi whenever the project is successfully
built/loaded. We use `:!` to invoke a shell command, and `cabal new-main` is the
command to run the test suite.
Repository
Clone this repository using: git clone http://chriswarbo.net/git/ml4hsfe.git
Branches
- master: HLint recommendations Chris Warburton <chriswarbo@gmail.com> Tue Jan 8 08:15:38 AM UTC 2019
Generated by git2html.