{"_id":"@dodgez/ts-monads","_rev":"1-8d3139a78caa6ea9426f4dde3f942028","name":"@dodgez/ts-monads","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@dodgez/ts-monads","version":"0.1.0","description":"Monads in TypeScript","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","test":"mocha -r ts-node/register test/**/*.test.ts"},"author":{"name":"Zachary Dodge"},"license":"MIT","devDependencies":{"@types/chai":"^4.2.12","@types/lodash":"^4.14.161","@types/mocha":"^8.0.3","@types/node":"^14.10.1","@types/sinon-chai":"^3.2.4","chai":"^4.2.0","lodash":"^4.17.20","mocha":"^8.1.3","sinon":"^9.0.3","sinon-chai":"^3.5.0","ts-node":"^9.0.0","typescript":"^4.0.2"},"gitHead":"35cbe1d5a11fac232f24f3e4bca611ce159de736","_id":"@dodgez/ts-monads@0.1.0","_npmVersion":"5.6.0","_nodeVersion":"10.2.1","_npmUser":{"name":"dodgez","email":"zachary.dodge@cornerstonenw.com"},"dist":{"integrity":"sha512-+d7+cFvaCP7f+UuC6HnehLQWfYW6hDBvwgj2nKQltw0pIo8u4XVW6zPDzvnBb4RfkfLQt0E3T3NUITo0v3bYpg==","shasum":"523aff3e0acab2ebf8f51978a4b17396ef21030f","tarball":"https://registry.npmjs.org/@dodgez/ts-monads/-/ts-monads-0.1.0.tgz","fileCount":20,"unpackedSize":25497,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYC0ECRA9TVsSAnZWagAAcFAP/1/3cnI0/spTx3/9IEeE\njFNdvoTcBnpVTxDxIkQY0AiBCkXQ9tdUxfeykbT4O3DilZIfy94zz+vpTSpq\nnP58QfujGQ2Cziv5a4k+k/BfN5I8QOrDcM3pzFx2wes3puUZum/4n4wUmxcd\ntko8PVksA6xD4dri8e30roWExgvpcUnLIpx6xE7UJsQIXqq4RteGgsmjlLTz\nMc1Fq31+NrleHgugM0gK6mmDd79o8c5zEJNw9C00+f0dnLVZtcKSW20jh6gu\nxkgsRV5Old2MwvF6a4gaA+S+XgZJXJ9y40IQedCEgNuz7nXL6XdJ3u22W8OE\n9PeogPnl5C3FD42YiaNiVuqcgDxjJjAK8MD/80ZN3YvmQevocjwBmSkvttLu\nk8MQF19+oMQRQHU0ueiKu6kBBMYeuAojzVSGQmmyFgPvjpF8r7PzplOLTXtq\nCWmLNvjhmpz8rawMngO0XRzEVEo6tvmRhFPbJJVsjN9F8ML85Glz+T32hs9G\n+KSvMnen4js6IM74/gZEnpPGoylvkTnJ+EQo7uUnToxX+3zxME4JnF7Sspp5\ntUpX7g53A4/xlRIcN8byl7r/AAPmGgNTkTi3afMP1JU54K7hiZcjLIVGae4P\nI5CUiuh4522W+Sx5hp9i2gkjOkwA5gqzagubTRDOZpkqdIIqXpop33bWTMCb\nurbV\r\n=J8/U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGbwXrhLr9+T4kKKhp6rA4V0SEcPO8y/gurKQK/5ijIsAiA9s0DgWUm33Gg984ZxxlZ4on2fHl1HixbD9sanOeV+6w=="}]},"maintainers":[{"name":"dodgez","email":"zachary.dodge@cornerstonenw.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-monads_0.1.0_1600138499609_0.25826389593513466"},"_hasShrinkwrap":false}},"time":{"created":"2020-09-15T02:54:59.560Z","0.1.0":"2020-09-15T02:54:59.786Z","modified":"2022-04-05T05:05:48.968Z"},"maintainers":[{"name":"dodgez","email":"zachary.dodge@cornerstonenw.com"}],"description":"Monads in TypeScript","author":{"name":"Zachary Dodge"},"license":"MIT","readme":"# ts-monads\nThis package provides monads based on my (limited) experience with Haskell and has a lot of issues and incomplete functionality.\n\nThere are currently two monads provided for use in Typescript:\n1. The IO monad wraps input/output operations similar to Haskell\n2. The Maybe monad (and type!) provides an interface for maybe types\n\nNote: IO commands are only meant to be used as arguments to a top-level function call of `io_main`.\n\n## Commands\n- Compile the package, run `npm run build`\n- Run unit tests, run `npm test`\n- Run an example, run `ts-node examples/{io,monad}.example.ts`\n\n## Examples\n- `examples/io.example.ts` an example that prints `package.json` without \"extra\" whitespace.\n- `examples/maybe.example.ts` an example of a safe `list.head` and division function.\n\n## Drawbacks\nThe (`>>=`) and (`>>`) operators are not valid identifiers, and TypeScript doesn't support infix operators, so the following are replacements:\n- `>>=` is replaced with `$$_` and is called on the left object. E.g. `IO.return(3).$$_(io_log)`\n- `>>` is replaced with `$$` and is called on the left object. E.g. `io_log(\"Hello\").$$(io_log(\"World!\"))`\n\nSince TypeScript does not natively support macros, `do` syntax is not supported thus every Monad chain needs to be written manually.\n","readmeFilename":"README.md"}