Skip to content

Commit 0f8fd10

Browse files
committed
fix ChainRec definition
1 parent 36a756d commit 0f8fd10

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

CHANGELOG.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Changelog
2+
3+
> **Tags:**
4+
> - [New Feature]
5+
> - [Bug Fix]
6+
> - [Breaking Change]
7+
> - [Documentation]
8+
> - [Internal]
9+
> - [Polish]
10+
> - [Experimental]
11+
12+
**Note**: Gaps between patch versions are faulty/broken releases.
13+
**Note**: A feature tagged as Experimental is in a high state of flux, you're at risk of it changing without notice.
14+
15+
# 0.0.2
16+
17+
- **Bug Fix**
18+
- fix `ChainRec` definition (@gcanti)
19+
20+
# 0.0.1
21+
22+
Initial release
23+

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fp-ts",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "Functional programming in TypeScript",
55
"files": [
66
"lib",

src/ChainRec.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ import { isLeft } from './Either'
55
import { Function1 } from './function'
66

77
export interface ChainRec<M> extends Chain<M> {
8-
chainRec<A, B>(f: Function1<A, HKT<M, Either<A, B>>>, a: A): B;
8+
/** forall a b. (a -> m (Either a b)) -> a -> m b */
9+
chainRec<A, B>(f: Function1<A, HKT<M, Either<A, B>>>, a: A): HKT<M, B>;
910
}
1011

12+
/** forall a b. (a -> Either a b) -> a -> b */
1113
export function tailRec<A, B>(f: Function1<A, Either<A, B>>, a: A): B {
1214
let v = f(a)
1315
while (isLeft(v)) {

0 commit comments

Comments
 (0)