Skip to content

Commit

Permalink
bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti committed Apr 26, 2021
1 parent b0de51a commit 39bbf45
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
**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.1.23

- **New Feature**
- `Zipper`
- refactor to work with readonly and NonEmpty\*, #76 (@SRachamim)

# 0.1.22

- **Bug Fix**
Expand Down
8 changes: 4 additions & 4 deletions docs/modules/Zipper.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ Added in v0.1.6
export declare const fromReadonlyArray: <A>(as: readonly A[], focusIndex?: number | undefined) => Option<Zipper<A>>
```
Added in v0.1.22
Added in v0.1.23
## fromReadonlyNonEmptyArray
Expand All @@ -409,7 +409,7 @@ Added in v0.1.22
export declare const fromReadonlyNonEmptyArray: <A>(rnea: ReadonlyNonEmptyArray<A>) => Zipper<A>
```
Added in v0.1.22
Added in v0.1.23
## make
Expand Down Expand Up @@ -453,7 +453,7 @@ Added in v0.1.6
export declare const toNonEmptyArray: <A>(fa: Zipper<A>) => NEA.NonEmptyArray<A>
```
Added in v0.1.22
Added in v0.1.23
## toReadonlyNonEmptyArray
Expand All @@ -463,7 +463,7 @@ Added in v0.1.22
export declare const toReadonlyNonEmptyArray: <A>(fa: Zipper<A>) => ReadonlyNonEmptyArray<A>
```
Added in v0.1.22
Added in v0.1.23
## ~~toArray~~
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fp-ts-contrib",
"version": "0.1.22",
"version": "0.1.23",
"description": "A community driven utility package for fp-ts",
"main": "lib/index.js",
"module": "es6/index.js",
Expand Down
18 changes: 9 additions & 9 deletions src/Zipper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const make: <A>(lefts: ReadonlyArray<A>, focus: A, rights: ReadonlyArray<

/**
* @category constructors
* @since 0.1.22
* @since 0.1.23
*/
export const fromReadonlyArray: <A>(as: ReadonlyArray<A>, focusIndex?: number) => Option<Zipper<A>> = (
as,
Expand All @@ -93,10 +93,10 @@ export const fromArray: <A>(as: Array<A>, focusIndex?: number) => Option<Zipper<

/**
* @category constructors
* @since 0.1.22
* @since 0.1.23
*/
export const fromReadonlyNonEmptyArray: <A>(rnea: ReadonlyNonEmptyArray<A>) => Zipper<A> = (nea) =>
make(A.empty, nea[0], nea.slice(1))
make([], nea[0], nea.slice(1))

/**
* @category constructors
Expand All @@ -123,7 +123,7 @@ export const length: <A>(fa: Zipper<A>) => number = (fa) => fa.lefts.length + 1

/**
* @category destructors
* @since 0.1.22
* @since 0.1.23
*/
export const toNonEmptyArray: <A>(fa: Zipper<A>) => NonEmptyArray<A> = (fa) =>
pipe(
Expand All @@ -134,7 +134,7 @@ export const toNonEmptyArray: <A>(fa: Zipper<A>) => NonEmptyArray<A> = (fa) =>

/**
* @category destructors
* @since 0.1.22
* @since 0.1.23
*/
export const toReadonlyNonEmptyArray: <A>(fa: Zipper<A>) => ReadonlyNonEmptyArray<A> = toNonEmptyArray

Expand Down Expand Up @@ -206,7 +206,7 @@ export const start: <A>(fa: Zipper<A>) => Zipper<A> = (fa) => {
if (A.isEmpty(fa.lefts)) {
return fa
} else {
return make(A.empty, fa.lefts[0], A.snoc(pipe(fa.lefts, A.dropLeft(1)), fa.focus).concat(fa.rights))
return make([], fa.lefts[0], A.snoc(pipe(fa.lefts, A.dropLeft(1)), fa.focus).concat(fa.rights))
}
}

Expand All @@ -221,7 +221,7 @@ export const end: <A>(fa: Zipper<A>) => Zipper<A> = (fa) => {
if (len === 0) {
return fa
} else {
return make(A.snoc(fa.lefts, fa.focus).concat(pipe(fa.rights, A.takeLeft(len - 1))), fa.rights[len - 1], A.empty)
return make(A.snoc(fa.lefts, fa.focus).concat(pipe(fa.rights, A.takeLeft(len - 1))), fa.rights[len - 1], [])
}
}

Expand Down Expand Up @@ -365,7 +365,7 @@ export const apSecond = <B>(fb: Zipper<B>) => <A>(fa: Zipper<A>): Zipper<B> =>
* @category Applicative
* @since 0.1.6
*/
export const of: <A>(focus: A) => Zipper<A> = (focus) => make(A.empty, focus, A.empty)
export const of: <A>(focus: A) => Zipper<A> = (focus) => make([], focus, [])

/**
* @category Extend
Expand Down Expand Up @@ -470,7 +470,7 @@ export const getSemigroup: <A>(S: Semigroup<A>) => Semigroup<Zipper<A>> = (S) =>
*/
export const getMonoid: <A>(M: Monoid<A>) => Monoid<Zipper<A>> = (M) => ({
...getSemigroup(M),
empty: make(A.empty, M.empty, A.empty)
empty: make([], M.empty, [])
})

/**
Expand Down

0 comments on commit 39bbf45

Please sign in to comment.