Skip to content

Commit

Permalink
Option: remove useless type parameter in getLeft, getRight
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti committed May 12, 2021
1 parent 4567fa6 commit 73bcb18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/modules/Option.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ Returns the `Left` value of an `Either` if possible.
**Signature**

```ts
export declare const getLeft: <E, A>(ma: Either<E, A>) => Option<E>
export declare const getLeft: <E>(ma: Either<E, unknown>) => Option<E>
```

**Example**
Expand All @@ -301,7 +301,7 @@ Returns the `Right` value of an `Either` if possible.
**Signature**

```ts
export declare const getRight: <E, A>(ma: Either<E, A>) => Option<A>
export declare const getRight: <A>(ma: Either<unknown, A>) => Option<A>
```

**Example**
Expand Down
4 changes: 2 additions & 2 deletions src/Option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export function fromPredicate<A>(predicate: Predicate<A>): <B extends A>(b: B) =
* @category constructors
* @since 2.0.0
*/
export const getLeft = <E, A>(ma: Either<E, A>): Option<E> => (ma._tag === 'Right' ? none : some(ma.left))
export const getLeft = <E>(ma: Either<E, unknown>): Option<E> => (ma._tag === 'Right' ? none : some(ma.left))

/**
* Returns the `Right` value of an `Either` if possible.
Expand All @@ -145,7 +145,7 @@ export const getLeft = <E, A>(ma: Either<E, A>): Option<E> => (ma._tag === 'Righ
* @category constructors
* @since 2.0.0
*/
export const getRight = <E, A>(ma: Either<E, A>): Option<A> => (ma._tag === 'Left' ? none : some(ma.right))
export const getRight = <A>(ma: Either<unknown, A>): Option<A> => (ma._tag === 'Left' ? none : some(ma.right))

// -------------------------------------------------------------------------------------
// non-pipeables
Expand Down

0 comments on commit 73bcb18

Please sign in to comment.