Skip to content

Instantly share code, notes, and snippets.

@joneshf
Created March 7, 2014 22:57
Show Gist options
  • Save joneshf/9421913 to your computer and use it in GitHub Desktop.
Save joneshf/9421913 to your computer and use it in GitHub Desktop.
➜ purescript git:(master) ✗ ./.cabal-sandbox/bin/psc --no-prelude -s
module Foo where
f = \o -> o {foo = 3}
(function (_ps) {
"use strict";
_ps.Foo = (function (module) {
var f = function (o) {
var newObj = {};
for (var key in o) {
if (o.hasOwnProperty(key)) {
newObj[key] = o[key];
};
};
newObj[foo] = 3;
return newObj;
};
module.f = f;
return module;
})(_ps.Foo || {});
})((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";
})());
➜ purescript git:(master) ✗ ./.cabal-sandbox/bin/psc --no-prelude -s
module Foo where
f o = o {foo = 3}
(function (_ps) {
"use strict";
_ps.Foo = (function (module) {
var f = function (_1) {
return (function () {
var newObj = {};
for (var key in _1) {
if (_1.hasOwnProperty(key)) {
newObj[key] = _1[key];
};
};
newObj[foo] = 3;
return newObj;
})();
throw "Failed pattern match";
};
module.f = f;
return module;
})(_ps.Foo || {});
})((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";
})());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment