README.md (1310B)
1 # hnock 2 3 [![Build Status](https://travis-ci.org/jtobin/hnock.svg?branch=master)](https://travis-ci.org/jtobin/hnock) 4 [![Hackage Version](https://img.shields.io/hackage/v/hnock.svg)](http://hackage.haskell.org/package/hnock) 5 [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/jtobin/hnock/blob/master/LICENSE) 6 7 A [Nock][nock] interpreter. 8 9 ## Install 10 11 Use a simple 12 13 ``` 14 stack install 15 ``` 16 17 to build the `hnock` binary and get it moved somewhere on your PATH. If you 18 just want to build the binary, you can use `stack build`. 19 20 ## Usage 21 22 From bash, simply pipe Nock expressions into the `hnock` executable: 23 24 ``` 25 $ echo '*[[[4 5] [6 14 15]] [0 7]]' | hnock 26 [14 15] 27 ``` 28 29 For playing around in GHCi, import the `Nock` library and use `hnock` to parse 30 and evaluate Nock expressions: 31 32 ``` 33 *Nock> hnock "*[[[4 5] [6 14 15]] [0 7]]" 34 [14 15] 35 ``` 36 37 To evaluate raw nock Nouns, i.e. to compute `nock(a)` for some noun `a`, use 38 the `nock` function: 39 40 ``` 41 *Nock> let expression = hnock "[[[4 5] [6 14 15]] [0 7]]" 42 *Nock> expression 43 [[[4 5] [6 [14 15]]] [0 7]] 44 *Nock> nock expression 45 [14 15] 46 ``` 47 48 ## Testing 49 50 Use a simple `stack test` to run the test suite. 51 52 ## See Also 53 54 * [A Nock Interpreter][anin] 55 56 [nock]: https://urbit.org/docs/learn/arvo/nock/definition/ 57 [anin]: https://jtobin.io/nock 58