Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 1.16 KB

README.md

File metadata and controls

51 lines (36 loc) · 1.16 KB

monadic.js

Parser and Plugin for babel that provides haskell-like do-notation into javascript.

Should work with babel6

Setup

  • Install monadic.js:
npm install --save-dev monadic.js
  • Add plugin to babel's plugins list, and set monadic.js parser as babel's parser:

Part of webpack config (as an example):

//...
        loaders: [
            {
                test: /\.js$/,
                exclude: /node_modules/,
                loader: "babel-loader",
                query: {
                    presets: [ "es2015", "stage-0" ],
                    plugins: [ "monadic.js/dist/plugin.js" ],
                    parserOpts: {
                        parser: "monadic.js/dist/parser.js"
                    }
                }
            }
        ]
//...

Usage

In progress... Stay tuned...

You can take a look at, first: https://github.com/kirill-gavrilyuk/Scratch2/blob/master/src/app/main.js

Some (maybe) useful articles about monads: