https://github.com/phadej/typify-parser
Type signature parser for typify
https://github.com/phadej/typify-parser
Last synced: 4 months ago
JSON representation
Type signature parser for typify
- Host: GitHub
- URL: https://github.com/phadej/typify-parser
- Owner: phadej
- License: mit
- Created: 2014-07-23T04:39:09.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2019-11-07T17:27:20.000Z (over 5 years ago)
- Last Synced: 2025-03-08T02:48:02.600Z (4 months ago)
- Language: JavaScript
- Size: 5.84 MB
- Stars: 9
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# typify type parser
> Type signature parser for typify
[](http://travis-ci.org/phadej/typify-parser)
[](http://badge.fury.io/js/typify-parser)
[](https://david-dm.org/phadej/typify-parser)
[](https://david-dm.org/phadej/typify-parser#info=devDependencies)
[](https://codeclimate.com/github/phadej/typify-parser)Turns `(foo, bar 42) -> quux` into
```js
{
"type": "function",
"arg": {
"type": "product",
"args": [
{
"type": "ident",
"value": "foo"
},
{
"type": "application",
"callee": {
"type": "ident",
"value": "bar"
},
"args": [
{
"type": "number",
"value": 42
}
]
}
]
},
"result": {
"type": "ident",
"value": "quux"
}
}
```## Synopsis
```js
var parser = require("typify-parser");// Example from above
var t = parser("(foo, bar 42) -> quux");// Free vars
p.freeVars(t); // ['bar', 'foo', 'quux']
p.freeVars(p("rec list -> () | a & list")) // ['a']
```