ml4hsfe

Last updated: 2019-01-08 08:15:38 +0000

Upstream URL: git clone http://chriswarbo.net/git/ml4hsfe.git

Repo

View repository

View issue tracker

Contents of README follows


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).

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.