Skip to content

Instantly share code, notes, and snippets.

@tusharmath
Last active August 18, 2016 11:25
Show Gist options
  • Save tusharmath/6acdd2a4d869437e96e0ad41a64e21fd to your computer and use it in GitHub Desktop.
Save tusharmath/6acdd2a4d869437e96e0ad41a64e21fd to your computer and use it in GitHub Desktop.
esnextbin sketch
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ESNextbin Sketch</title>
<!-- put additional styles and scripts here -->
</head>
<body>
<!-- put markup and other contents here -->
</body>
</html>
// write ES2015 code and import modules from npm
// and then press "Execute" to run your program
import {IO} from 'ramda-fantasy'
let i = 0
const ob = {
sideEffect (value) {
document.write('SIDE EFFECT: ' + value + '-' + i++ + '<br/>')
return 100
}
}
const write = (value) => IO(() => ob.sideEffect(value))
const a = write('a')
const b = write('b')
a.map((i) => console.log(i))
{
"name": "esnextbin-sketch",
"dependencies": {
"ramda-fantasy": "0.6.1"
},
"version": "0.0.0"
}
'use strict';
var _ramdaFantasy = require('ramda-fantasy');
var i = 0; // write ES2015 code and import modules from npm
// and then press "Execute" to run your program
var ob = {
sideEffect: function sideEffect(value) {
document.write('SIDE EFFECT: ' + value + '-' + i++ + '<br/>');
return 100;
}
};
var write = function write(value) {
return (0, _ramdaFantasy.IO)(function () {
return ob.sideEffect(value);
});
};
var a = write('a');
var b = write('b');
a.map(function (i) {
return console.log(i);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment