diff --git a/CHANGELOG.md b/CHANGELOG.md index 758b173..761287b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,11 @@ **Note**: Gaps between patch versions are faulty/broken releases. **Note**: A feature tagged as Experimental is in a high state of flux, you're at risk of it changing without notice. +# 0.3.2 + +- **Polish** + - upgrade to latest fp-ts (0.4.3) (@gcanti) + # 0.3.1 - **New Feature** diff --git a/package.json b/package.json index b3cba43..363b739 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "monocle-ts", - "version": "0.3.1", + "version": "0.3.2", "description": "A porting of scala monocle library to TypeScript", "files": ["lib"], "main": "lib/index.js", @@ -26,7 +26,7 @@ }, "homepage": "https://github.com/gcanti/monocle-ts", "dependencies": { - "fp-ts": "^0.4.0" + "fp-ts": "^0.4.3" }, "devDependencies": { "@types/mocha": "^2.2.38", diff --git a/src/index.ts b/src/index.ts index 5a39922..e1de92f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -675,15 +675,3 @@ export class Ops { const ops = new Ops() export const fromTraversable: Ops['fromTraversable'] = ops.fromTraversable export const fromFoldable: Ops['fromFoldable'] = ops.fromFoldable - -// -// overloadings -// - -import { ArrayURI } from 'fp-ts/lib/overloadings' - -export interface Ops { - fromTraversable(T: Traversable): Traversal, A> - - fromFoldable(F: Foldable): Fold, A> -} diff --git a/test/Iso.ts b/test/Iso.ts index c24d825..174bdcc 100644 --- a/test/Iso.ts +++ b/test/Iso.ts @@ -2,6 +2,7 @@ import { Iso } from '../src' import * as assert from 'assert' const mTokm = new Iso(m => m / 1000, km => km * 1000) +const kmToMile = new Iso(km => km * 0.621371, mile => mile / 0.621371) describe('Iso', () => { it('get', () => { @@ -16,4 +17,8 @@ describe('Iso', () => { const double = (x: number) => x * 2 assert.strictEqual(mTokm.modify(double, 1000), 2000) }) + + it('compose', () => { + assert.strictEqual(mTokm.compose(kmToMile).get(1500).toFixed(2), '0.93') + }) })