@rgeraldporter/

Identity Monad Example

Nodejs

No description

fork
loading
Files
  • index.js
  • Identity.js

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.3418042903665306","path":"index.js","file":{"path":"index.js","content":{"asEncoding":{"base64":"Y29uc3QgeyBJZGVudGl0eSB9ID0gcmVxdWlyZSgnLi9JZGVudGl0eScpOwoKY29uc3Qgb25lID0gSWRlbnRpdHkub2YoMSk7CmNvbnN0IHR3byA9IG9uZS5tYXAoYSA9PiBhICsgMSk7Cgpjb25zb2xlLmxvZyhvbmUuaW5zcGVjdCgpKTsKLy8gPiBJZGVudGl0eSgxKQoKY29uc29sZS5sb2codHdvLmluc3BlY3QoKSk7Ci8vID4gSWRlbnRpdHkoMik="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
const { Identity } = require('./Identity');

const one = Identity.of(1);
const two = one.map(a => a + 1);

console.log(one.inspect());
// > Identity(1)

console.log(two.inspect());
// > Identity(2)