Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version 2.6.3 #1232

Merged
merged 28 commits into from
Jun 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d830282
better Writer.getMonad tests
gcanti Jun 7, 2020
79f3ce9
change `ReadonlyNonEmptyArray` to get better type inference
gcanti Jun 7, 2020
ee77318
move `pipe` to `function` module
gcanti Jun 7, 2020
621956f
do not use `io` instance in `Random` module (@gcanti)
gcanti Jun 7, 2020
8f75bb9
do not use instance operations when there's an alternative way
gcanti Jun 7, 2020
bebf1ab
export `sequence` from all modules which admit a `Traversable` instance
gcanti Jun 7, 2020
3b717cd
export a pipeable `traverse` function from all modules which admit a …
gcanti Jun 7, 2020
a25cf3e
export a pipeable `traverseWithIndex` function from all modules which…
gcanti Jun 7, 2020
ca7be88
remove `array` instance from Tree implementation
gcanti Jun 7, 2020
5da4820
remove EitherT from TaskEither
gcanti Jun 7, 2020
b312b89
bump version
gcanti Jun 7, 2020
8d50ee3
remove EitherT from IOEither
gcanti Jun 7, 2020
8a4e7d4
remove `<instance>.sequence` from tests
gcanti Jun 8, 2020
1ed1acc
remove EitherT from ReaderEither
gcanti Jun 8, 2020
9292e36
add internal Apply instances
gcanti Jun 8, 2020
af4b131
remove useless internal instances from Either
gcanti Jun 8, 2020
52c3c60
remove ReaderT from Reader
gcanti Jun 8, 2020
7f004fe
remove ReaderT from ReaderTask
gcanti Jun 8, 2020
1ba658e
remove ReaderT from ReaderTaskEither
gcanti Jun 8, 2020
15b2b97
remove StateT from State
gcanti Jun 8, 2020
3b8e366
remove StateT from StateReaderTaskEither
gcanti Jun 8, 2020
b89a847
remove WriterT from Writer
gcanti Jun 8, 2020
234e4ed
update changelog
gcanti Jun 8, 2020
3b79ea0
remove spreads
gcanti Jun 8, 2020
6d6569c
remove internal monadIdentity instance
gcanti Jun 8, 2020
06e5c11
remove internal monadTaskEither instance
gcanti Jun 8, 2020
efb5445
remove TheseT from TaskThese
gcanti Jun 8, 2020
3089785
replace hardcoded URIs with corresponding types
gcanti Jun 8, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
**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.

# 2.6.3

- **Polish**
- change `ReadonlyNonEmptyArray` definition to get better type inference (@gcanti)
- move `pipe` to `function` module (@gcanti)
- export `sequence` from all modules which admit a `Traversable` instance (@gcanti)
- export a pipeable `traverse` function from all modules which admit a `Traversable` instance (@gcanti)
- export a pipeable `traverseWithIndex` function from all modules which admit a `TraversableWithIndex` instance (@gcanti)
- remove monad transformers imports from all modules (@gcanti)

# 2.6.2

The goal of this release is to make `fp-ts` more "tree shaking" friendly.
Expand Down
33 changes: 33 additions & 0 deletions docs/modules/Array.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ Added in v2.0.0
- [isOutOfBound](#isoutofbound)
- [lookup](#lookup)
- [modifyAt](#modifyat)
- [sequence](#sequence)
- [splitAt](#splitat)
- [traverse](#traverse)
- [traverseWithIndex](#traversewithindex)
- [unzip](#unzip)
- [updateAt](#updateat)

Expand Down Expand Up @@ -1768,6 +1771,16 @@ assert.deepStrictEqual(modifyAt(1, double)([]), none)

Added in v2.0.0

## sequence

**Signature**

```ts
export declare const sequence: Sequence1<'Array'>
```

Added in v2.6.3

## splitAt

Splits an array into two pieces, the first piece has `n` elements.
Expand All @@ -1791,6 +1804,26 @@ assert.deepStrictEqual(splitAt(2)([1, 2, 3, 4, 5]), [

Added in v2.0.0

## traverse

**Signature**

```ts
export declare const traverse: PipeableTraverse1<'Array'>
```

Added in v2.6.3

## traverseWithIndex

**Signature**

```ts
export declare const traverseWithIndex: PipeableTraverseWithIndex1<'Array', number>
```

Added in v2.6.3

## unzip

The function is reverse of `zip`. Takes an array of pairs and return two corresponding arrays
Expand Down
22 changes: 22 additions & 0 deletions docs/modules/Either.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ Added in v2.0.0
- [utils](#utils)
- [elem](#elem)
- [exists](#exists)
- [sequence](#sequence)
- [toError](#toerror)
- [traverse](#traverse)

---

Expand Down Expand Up @@ -783,6 +785,16 @@ assert.strictEqual(gt2(right(3)), true)

Added in v2.0.0

## sequence

**Signature**

```ts
export declare const sequence: Sequence2<'Either'>
```

Added in v2.6.3

## toError

Default value for the `onError` argument of `tryCatch`
Expand All @@ -794,3 +806,13 @@ export declare function toError(e: unknown): Error
```

Added in v2.0.0

## traverse

**Signature**

```ts
export declare const traverse: PipeableTraverse2<'Either'>
```

Added in v2.6.3
135 changes: 69 additions & 66 deletions docs/modules/IOEither.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ Added in v2.0.0
- [map](#map)
- [Monad](#monad)
- [chain](#chain)
- [chainEitherK](#chaineitherk)
- [chainFirst](#chainfirst)
- [chainW](#chainw)
- [flatten](#flatten)
- [MonadThrow](#monadthrow)
- [bracket](#bracket)
- [combinators](#combinators)
- [chainEitherK](#chaineitherk)
- [chainEitherKW](#chaineitherkw)
- [filterOrElse](#filterorelse)
- [fromEitherK](#fromeitherk)
- [orElse](#orelse)
- [swap](#swap)
- [constructors](#constructors)
Expand All @@ -60,10 +64,6 @@ Added in v2.0.0
- [IOEither (interface)](#ioeither-interface)
- [URI](#uri)
- [URI (type alias)](#uri-type-alias)
- [utils](#utils)
- [bracket](#bracket)
- [chainEitherKW](#chaineitherkw)
- [fromEitherK](#fromeitherk)

---

Expand Down Expand Up @@ -157,16 +157,6 @@ export declare const chain: <E, A, B>(f: (a: A) => IOEither<E, B>) => (ma: IOEit

Added in v2.0.0

## chainEitherK

**Signature**

```ts
export declare function chainEitherK<E, A, B>(f: (a: A) => Either<E, B>): (ma: IOEither<E, A>) => IOEither<E, B>
```

Added in v2.4.0

## chainFirst

**Signature**
Expand Down Expand Up @@ -197,8 +187,51 @@ export declare const flatten: <E, A>(mma: IOEither<E, IOEither<E, A>>) => IOEith

Added in v2.0.0

# MonadThrow

## bracket

Make sure that a resource is cleaned up in the event of an exception (_). The release action is called regardless of
whether the body action throws (_) or returns.

(\*) i.e. returns a `Left`

**Signature**

```ts
export declare const bracket: <E, A, B>(
acquire: IOEither<E, A>,
use: (a: A) => IOEither<E, B>,
release: (a: A, e: E.Either<E, B>) => IOEither<E, void>
) => IOEither<E, B>
```

Added in v2.0.0

# combinators

## chainEitherK

**Signature**

```ts
export declare function chainEitherK<E, A, B>(f: (a: A) => Either<E, B>): (ma: IOEither<E, A>) => IOEither<E, B>
```

Added in v2.4.0

## chainEitherKW

**Signature**

```ts
export declare const chainEitherKW: <D, A, B>(
f: (a: A) => E.Either<D, B>
) => <E>(ma: IOEither<E, A>) => IOEither<D | E, B>
```

Added in v2.6.1

## filterOrElse

**Signature**
Expand All @@ -212,12 +245,24 @@ export declare const filterOrElse: {

Added in v2.0.0

## fromEitherK

**Signature**

```ts
export declare function fromEitherK<E, A extends ReadonlyArray<unknown>, B>(
f: (...a: A) => Either<E, B>
): (...a: A) => IOEither<E, B>
```

Added in v2.4.0

## orElse

**Signature**

```ts
export declare function orElse<E, A, M>(onLeft: (e: E) => IOEither<M, A>): (ma: IOEither<E, A>) => IOEither<M, A>
export declare const orElse: <E, A, M>(onLeft: (e: E) => IOEither<M, A>) => (ma: IOEither<E, A>) => IOEither<M, A>
```

Added in v2.0.0
Expand Down Expand Up @@ -282,7 +327,7 @@ Added in v2.0.0
**Signature**

```ts
export declare const leftIO: <E = never, A = never>(me: IO<E>) => IOEither<E, A>
export declare const leftIO: <E = never, A = never>(me: I.IO<E>) => IOEither<E, A>
```

Added in v2.0.0
Expand All @@ -302,7 +347,7 @@ Added in v2.0.0
**Signature**

```ts
export declare const rightIO: <E = never, A = never>(ma: IO<A>) => IOEither<E, A>
export declare const rightIO: <E = never, A = never>(ma: I.IO<A>) => IOEither<E, A>
```

Added in v2.0.0
Expand All @@ -326,7 +371,10 @@ Added in v2.0.0
**Signature**

```ts
export declare function fold<E, A, B>(onLeft: (e: E) => IO<B>, onRight: (a: A) => IO<B>): (ma: IOEither<E, A>) => IO<B>
export declare const fold: <E, A, B>(
onLeft: (e: E) => I.IO<B>,
onRight: (a: A) => I.IO<B>
) => (ma: IOEither<E, A>) => I.IO<B>
```

Added in v2.0.0
Expand All @@ -336,7 +384,7 @@ Added in v2.0.0
**Signature**

```ts
export declare function getOrElse<E, A>(onLeft: (e: E) => IO<A>): (ma: IOEither<E, A>) => IO<A>
export declare const getOrElse: <E, A>(onLeft: (e: E) => I.IO<A>) => (ma: IOEither<E, A>) => I.IO<A>
```

Added in v2.0.0
Expand All @@ -346,7 +394,7 @@ Added in v2.0.0
**Signature**

```ts
export declare const getOrElseW: <E, B>(onLeft: (e: E) => IO<B>) => <A>(ma: IOEither<E, A>) => IO<B | A>
export declare const getOrElseW: <E, B>(onLeft: (e: E) => I.IO<B>) => <A>(ma: IOEither<E, A>) => I.IO<B | A>
```

Added in v2.6.0
Expand Down Expand Up @@ -456,48 +504,3 @@ export type URI = typeof URI
```

Added in v2.0.0

# utils

## bracket

Make sure that a resource is cleaned up in the event of an exception (_). The release action is called regardless of
whether the body action throws (_) or returns.

(\*) i.e. returns a `Left`

**Signature**

```ts
export declare function bracket<E, A, B>(
acquire: IOEither<E, A>,
use: (a: A) => IOEither<E, B>,
release: (a: A, e: Either<E, B>) => IOEither<E, void>
): IOEither<E, B>
```

Added in v2.0.0

## chainEitherKW

**Signature**

```ts
export declare const chainEitherKW: <D, A, B>(
f: (a: A) => E.Either<D, B>
) => <E>(ma: IOEither<E, A>) => IOEither<D | E, B>
```

Added in v2.6.1

## fromEitherK

**Signature**

```ts
export declare function fromEitherK<E, A extends ReadonlyArray<unknown>, B>(
f: (...a: A) => Either<E, B>
): (...a: A) => IOEither<E, B>
```

Added in v2.4.0
25 changes: 25 additions & 0 deletions docs/modules/Identity.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ Added in v2.0.0
- [Identity (type alias)](#identity-type-alias)
- [URI](#uri)
- [URI (type alias)](#uri-type-alias)
- [utils](#utils)
- [sequence](#sequence)
- [traverse](#traverse)

---

Expand Down Expand Up @@ -266,3 +269,25 @@ export type URI = typeof URI
```

Added in v2.0.0

# utils

## sequence

**Signature**

```ts
export declare const sequence: Sequence1<'Identity'>
```

Added in v2.6.3

## traverse

**Signature**

```ts
export declare const traverse: PipeableTraverse1<'Identity'>
```

Added in v2.6.3
Loading