A Nock interpreter.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib Use 'Integer' rather than 'Int' for atoms. Jan 31, 2019
spec Add 4K spec. [ci skip] Jan 31, 2019
src
test
.ghci Update to Nock 4K. Jan 29, 2019
.gitignore Misc restructuring. Jul 12, 2018
.travis.yml Basic travis setup. Jan 30, 2019
CHANGELOG Fix CHANGELOG typo. [ci skip] Jan 31, 2019
LICENSE Cabal/stack. Jul 12, 2018
README.md
Setup.hs
hnock.cabal Use 'Integer' rather than 'Int' for atoms. Jan 31, 2019
stack-travis.yaml Basic travis setup. Jan 30, 2019
stack.yaml Update to Nock 4K. Jan 29, 2019

README.md

hnock

Build Status MIT License

A Nock interpreter.

Install

Use a simple

stack install

to build the hnock binary and get it moved somewhere on your PATH. If you just want to build the binary, you can use stack build.

Usage

From bash, simply pipe Nock expressions into the hnock executable:

$ echo '*[[[4 5] [6 14 15]] [0 7]]' | hnock
[14 15]

For playing around in GHCi, import the Nock library and use hnock to parse and evaluate Nock expressions:

*Nock> hnock "*[[[4 5] [6 14 15]] [0 7]]"
[14 15]

To evaluate raw nock Nouns, i.e. to compute nock(a) for some noun a, use the nock function:

*Nock> let expression = hnock "[[[4 5] [6 14 15]] [0 7]]"
*Nock> expression
[[[4 5] [6 [14 15]]] [0 7]]
*Nock> nock expression
[14 15]

Testing

Use a simple stack test to run the test suite.

See Also