Fork me on GitHub

Try PureScript!

Type PureScript code below and press 'Compile', or select one of the examples below:

Examples

PureScript Code

Generated Javascript

(function (_ps) {
    "use strict";
    _ps.Prelude = (function () {
        var module = {};
        function $less$dollar$greater(dict) {
            return dict.$less$dollar$greater;
        };
        module["<$>"] = $less$dollar$greater;
        return module;
    })();
    _ps.Main = (function () {
        var module = {};
        function random() {   return Math.random(); };
        var main = _ps.Prelude["<$>"](_ps.Prelude.functorFromApplicative(_ps.Prelude.applicativeFromMonad(_ps.Control_Monad_Eff.monadEff({}))))(_ps.Debug_Trace.print(_ps.Prelude.showNumber({})))(random);
        module.main = main;
        module.random = random;
        return module;
    })();
})((typeof module !== "undefined" && module.exports) ? module.exports : (typeof window !== "undefined") ? window.PS = window.PS || {} : (function () {
    throw "PureScript doesn't know how to export modules in the current environment";
})());