Skip to content

Commit 8e01ab7

Browse files
committed
1 parent 13cbf7d commit 8e01ab7

23 files changed

+251
-262
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
**Note**: Gaps between patch versions are faulty/broken releases.
1414
**Note**: A feature tagged as Experimental is in a high state of flux, you're at risk of it changing without notice.
1515

16+
# 0.3.0
17+
18+
- **Breaking Change**
19+
- upgrade to `[email protected]` (@gcanti)
20+
1621
# 0.2.2
1722

1823
- **New Feature**

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,16 +272,14 @@ export interface Options {
272272
*/
273273
handlersStyle: { type: 'positional' } | { type: 'record'; handlersName: string }
274274
encoding: 'literal' | 'fp-ts'
275-
version: '1.13' | '1.14'
276275
}
277276
278277
export const defaultOptions: Options = {
279278
tagName: 'type',
280279
foldName: 'fold',
281280
matcheeName: 'fa',
282281
handlersStyle: { type: 'positional' },
283-
encoding: 'literal',
284-
version: '1.13'
282+
encoding: 'literal'
285283
}
286284
```
287285

docs/bundle.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/Constrained.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@ export function _fetching<A extends string>(): Prism<Constrained<A>, Constrained
2525

2626
export function _gotData<A extends string>(): Prism<Constrained<A>, Constrained<A>> { return Prism.fromPredicate(s => s.type === "GotData"); }
2727

28-
import { Setoid } from "fp-ts/lib/Setoid";
29-
30-
export function getSetoid<A extends string>(setoidGotDataValue0: Setoid<A>): Setoid<Constrained<A>> { return { equals: (x, y) => { if (x === y) {
31-
return true;
32-
} if (x.type === "Fetching" && y.type === "Fetching") {
33-
return true;
34-
} if (x.type === "GotData" && y.type === "GotData") {
35-
return setoidGotDataValue0.equals(x.value0, y.value0);
36-
} return false; } }; }
28+
import { Setoid, fromEquals } from "fp-ts/lib/Setoid";
29+
30+
export function getSetoid<A extends string>(setoidGotDataValue0: Setoid<A>): Setoid<Constrained<A>> { return fromEquals((x, y) => { if (x.type === "Fetching" && y.type === "Fetching") {
31+
return true;
32+
} if (x.type === "GotData" && y.type === "GotData") {
33+
return setoidGotDataValue0.equals(x.value0, y.value0);
34+
} return false; }); }
3735

examples/Either.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@ export function _left<L, R>(): Prism<Either<L, R>, Either<L, R>> { return Prism.
2121

2222
export function _right<L, R>(): Prism<Either<L, R>, Either<L, R>> { return Prism.fromPredicate(s => s.type === "Right"); }
2323

24-
import { Setoid } from "fp-ts/lib/Setoid";
25-
26-
export function getSetoid<L, R>(setoidLeftValue0: Setoid<L>, setoidRightValue0: Setoid<R>): Setoid<Either<L, R>> { return { equals: (x, y) => { if (x === y) {
27-
return true;
28-
} if (x.type === "Left" && y.type === "Left") {
29-
return setoidLeftValue0.equals(x.value0, y.value0);
30-
} if (x.type === "Right" && y.type === "Right") {
31-
return setoidRightValue0.equals(x.value0, y.value0);
32-
} return false; } }; }
24+
import { Setoid, fromEquals } from "fp-ts/lib/Setoid";
25+
26+
export function getSetoid<L, R>(setoidLeftValue0: Setoid<L>, setoidRightValue0: Setoid<R>): Setoid<Either<L, R>> { return fromEquals((x, y) => { if (x.type === "Left" && y.type === "Left") {
27+
return setoidLeftValue0.equals(x.value0, y.value0);
28+
} if (x.type === "Right" && y.type === "Right") {
29+
return setoidRightValue0.equals(x.value0, y.value0);
30+
} return false; }); }
3331

examples/FooBarBaz.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,13 @@ export const _Bar: Prism<FooBarBaz, FooBarBaz> = Prism.fromPredicate(s => s.type
3232

3333
export const _Baz: Prism<FooBarBaz, FooBarBaz> = Prism.fromPredicate(s => s.type === "Baz");
3434

35-
import { Setoid } from "fp-ts/lib/Setoid";
36-
37-
export function getSetoid(): Setoid<FooBarBaz> { return { equals: (x, y) => { if (x === y) {
38-
return true;
39-
} if (x.type === "Foo" && y.type === "Foo") {
40-
return true;
41-
} if (x.type === "Bar" && y.type === "Bar") {
42-
return true;
43-
} if (x.type === "Baz" && y.type === "Baz") {
44-
return true;
45-
} return false; } }; }
35+
import { Setoid, fromEquals } from "fp-ts/lib/Setoid";
36+
37+
export function getSetoid(): Setoid<FooBarBaz> { return fromEquals((x, y) => { if (x.type === "Foo" && y.type === "Foo") {
38+
return true;
39+
} if (x.type === "Bar" && y.type === "Bar") {
40+
return true;
41+
} if (x.type === "Baz" && y.type === "Baz") {
42+
return true;
43+
} return false; }); }
4644

examples/Maybe.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@ export function _nothing<A>(): Prism<Maybe<A>, Maybe<A>> { return Prism.fromPred
2525

2626
export function _just<A>(): Prism<Maybe<A>, Maybe<A>> { return Prism.fromPredicate(s => s.type === "Just"); }
2727

28-
import { Setoid } from "fp-ts/lib/Setoid";
29-
30-
export function getSetoid<A>(setoidJustValue: Setoid<A>): Setoid<Maybe<A>> { return { equals: (x, y) => { if (x === y) {
31-
return true;
32-
} if (x.type === "Nothing" && y.type === "Nothing") {
33-
return true;
34-
} if (x.type === "Just" && y.type === "Just") {
35-
return setoidJustValue.equals(x.value, y.value);
36-
} return false; } }; }
28+
import { Setoid, fromEquals } from "fp-ts/lib/Setoid";
29+
30+
export function getSetoid<A>(setoidJustValue: Setoid<A>): Setoid<Maybe<A>> { return fromEquals((x, y) => { if (x.type === "Nothing" && y.type === "Nothing") {
31+
return true;
32+
} if (x.type === "Just" && y.type === "Just") {
33+
return setoidJustValue.equals(x.value, y.value);
34+
} return false; }); }
3735

examples/NotAlignedNames.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export type NotAlignedNames = {
2+
readonly value: string;
3+
};
4+
5+
export function ctor(value: string): NotAlignedNames { return { value }; }
6+
7+
import { Setoid, fromEquals } from "fp-ts/lib/Setoid";
8+
9+
export function getSetoid(setoidValue: Setoid<string>): Setoid<NotAlignedNames> { return fromEquals((x, y) => { return setoidValue.equals(x.value, y.value); }); }
10+

examples/Nullary.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export type Nullary = {};
2+
3+
export const nullary: Nullary = {};
4+

examples/Option.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@ export function _none<A>(): Prism<Option<A>, Option<A>> { return Prism.fromPredi
2525

2626
export function _some<A>(): Prism<Option<A>, Option<A>> { return Prism.fromPredicate(s => s.type === "Some"); }
2727

28-
import { Setoid } from "fp-ts/lib/Setoid";
29-
30-
export function getSetoid<A>(setoidSomeValue0: Setoid<A>): Setoid<Option<A>> { return { equals: (x, y) => { if (x === y) {
31-
return true;
32-
} if (x.type === "None" && y.type === "None") {
33-
return true;
34-
} if (x.type === "Some" && y.type === "Some") {
35-
return setoidSomeValue0.equals(x.value0, y.value0);
36-
} return false; } }; }
28+
import { Setoid, fromEquals } from "fp-ts/lib/Setoid";
29+
30+
export function getSetoid<A>(setoidSomeValue0: Setoid<A>): Setoid<Option<A>> { return fromEquals((x, y) => { if (x.type === "None" && y.type === "None") {
31+
return true;
32+
} if (x.type === "Some" && y.type === "Some") {
33+
return setoidSomeValue0.equals(x.value0, y.value0);
34+
} return false; }); }
3735

0 commit comments

Comments
 (0)