From 0f8fd105a89afafc07195f61f4abab698f1719e5 Mon Sep 17 00:00:00 2001 From: gcanti Date: Sun, 12 Feb 2017 09:28:05 +0100 Subject: [PATCH] fix ChainRec definition --- CHANGELOG.md | 23 +++++++++++++++++++++++ package.json | 2 +- src/ChainRec.ts | 4 +++- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..9f5302f38 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,23 @@ +# Changelog + +> **Tags:** +> - [New Feature] +> - [Bug Fix] +> - [Breaking Change] +> - [Documentation] +> - [Internal] +> - [Polish] +> - [Experimental] + +**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.0.2 + +- **Bug Fix** + - fix `ChainRec` definition (@gcanti) + +# 0.0.1 + +Initial release + diff --git a/package.json b/package.json index 41a4b4e1d..fc6a3eaf7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fp-ts", - "version": "0.0.1", + "version": "0.0.2", "description": "Functional programming in TypeScript", "files": [ "lib", diff --git a/src/ChainRec.ts b/src/ChainRec.ts index bd2adab37..2993211a6 100644 --- a/src/ChainRec.ts +++ b/src/ChainRec.ts @@ -5,9 +5,11 @@ import { isLeft } from './Either' import { Function1 } from './function' export interface ChainRec extends Chain { - chainRec(f: Function1>>, a: A): B; + /** forall a b. (a -> m (Either a b)) -> a -> m b */ + chainRec(f: Function1>>, a: A): HKT; } +/** forall a b. (a -> Either a b) -> a -> b */ export function tailRec(f: Function1>, a: A): B { let v = f(a) while (isLeft(v)) {