Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
Equal: remove redundant code from equivalence instance implementati…
Browse files Browse the repository at this point in the history
…on (#490)
  • Loading branch information
gcanti committed Sep 7, 2023
1 parent 9815660 commit c2c34a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 61 deletions.
5 changes: 5 additions & 0 deletions .changeset/cold-olives-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/data": patch
---

Equal: remove redundant code from `equivalence` instance implementation
55 changes: 0 additions & 55 deletions docs/modules/Differ.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ Added in v1.0.0
- [models](#models)
- [Differ (interface)](#differ-interface)
- [patch](#patch)
- [ChunkPatch](#chunkpatch)
- [ContextPatch](#contextpatch)
- [HashMapPatch](#hashmappatch)
- [HashSetPatch](#hashsetpatch)
- [OrPatch](#orpatch)
- [combine](#combine)
- [diff](#diff)
- [empty](#empty)
Expand Down Expand Up @@ -169,56 +164,6 @@ Added in v1.0.0

# patch

## ChunkPatch

**Signature**

```ts
export declare const ChunkPatch: typeof ChunkPatch
```

Added in v1.0.0

## ContextPatch

**Signature**

```ts
export declare const ContextPatch: typeof ContextPatch
```

Added in v1.0.0

## HashMapPatch

**Signature**

```ts
export declare const HashMapPatch: typeof HashMapPatch
```

Added in v1.0.0

## HashSetPatch

**Signature**

```ts
export declare const HashSetPatch: typeof HashSetPatch
```

Added in v1.0.0

## OrPatch

**Signature**

```ts
export declare const OrPatch: typeof OrPatch
```

Added in v1.0.0

## combine

Combines two patches to produce a new patch that describes the updates of
Expand Down
7 changes: 1 addition & 6 deletions src/Equal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ export interface Equal extends Hash.Hash {
* @category equality
*/
export function equals<B>(that: B): <A>(self: A) => boolean
/**
* @since 1.0.0
* @category equality
*/
export function equals<A, B>(self: A, that: B): boolean
export function equals(): any {
if (arguments.length === 1) {
Expand Down Expand Up @@ -65,5 +61,4 @@ export const isEqual = (u: unknown): u is Equal => typeof u === "object" && u !=
* @since 1.0.0
* @category instances
*/
export const equivalence: <A>() => Equivalence<A> = () => (self, that) =>
Hash.hash(self) === Hash.hash(that) && equals(self, that)
export const equivalence: <A>() => Equivalence<A> = () => (self, that) => equals(self, that)

0 comments on commit c2c34a1

Please sign in to comment.