Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hm-parser

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hm-parser

A parser for Hidnley Milner notations

  • 0.1.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-16.67%
Maintainers
1
Weekly downloads
 
Created
Source

Hindley Milner Parser

This is a parser for Haskell-alike Hindley Milner signatures with some sugar added to support JS-specific things like methods.

It is a drop-in replacement for hindley-milner-parser-js package which is based on mona. Mona has few problems: it is very slow if used with Mocha test runner and it imports babel-polyfill by hard-code what makes it impossible to use within projects that use another version of babel-polyfill.

Usage

Install with:

$ yarn add hm-parser
# or
$ npm install hm-parser

Then:


HMP = require('hm-parser');

HMP.parse('hello :: a -> Maybe a');

// returns:
// {
//   name: 'hello',
//   constraints: [],
//   type:
//     {type: 'function', text: '', children: [
//       {type: 'typevar', text: 'a', children: []},
//       {type: 'typeConstructor', text: 'Maybe', children: [
//         {type: 'typevar', text: 'a', children: []}]}]}

See tests for more examples.

License

MIT

FAQs

Package last updated on 27 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc