Skip to content

Commit

Permalink
Automated Resyntax fixes (#589)
Browse files Browse the repository at this point in the history
This is an automated change generated by Resyntax.

#### Pass 1

Applied 4 fixes to [`collection/entry.rkt`](../blob/HEAD/collection/entry.rkt)

  * Line 20, `predicate/c-migration`: The `predicate/c` contract is less clear than a `->` contract and no longer improves performance.
  * Line 21, `predicate/c-migration`: The `predicate/c` contract is less clear than a `->` contract and no longer improves performance.
  * Line 90, `single-clause-match-to-match-define`: This `match` expression can be simplified using `match-define`.
  * Line 94, `single-clause-match-to-match-define`: This `match` expression can be simplified using `match-define`.

## Summary

Fixed 4 issues in 1 file.

  * Fixed 2 occurrences of `predicate/c-migration`
  * Fixed 2 occurrences of `single-clause-match-to-match-define`

Co-authored-by: resyntax-ci[bot] <181813515+resyntax-ci[bot]@users.noreply.github.com>
  • Loading branch information
resyntax-ci[bot] authored Oct 12, 2024
1 parent e2e675a commit defa73c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions collection/entry.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
[mapping-keys (-> (-> any/c any/c) (transducer/c entry? entry?))]
[mapping-values (-> (-> any/c any/c) (transducer/c entry? entry?))]
[indexing (-> (-> any/c any/c) (transducer/c any/c entry?))]
[filtering-keys (-> predicate/c (transducer/c entry? entry?))]
[filtering-values (-> predicate/c (transducer/c entry? entry?))]
[filtering-keys (-> (-> any/c boolean?) (transducer/c entry? entry?))]
[filtering-values (-> (-> any/c boolean?) (transducer/c entry? entry?))]
[append-mapping-keys
(-> (-> any/c (sequence/c any/c)) (transducer/c entry? entry?))]
[append-mapping-values
Expand Down Expand Up @@ -87,11 +87,15 @@


(define (mapping-keys key-function)
(mapping (λ (e) (match e [(entry k v) (entry (key-function k) v)]))))
(mapping (λ (e)
(match-define (entry k v) e)
(entry (key-function k) v))))


(define (mapping-values value-function)
(mapping (λ (e) (match e [(entry k v) (entry k (value-function v))]))))
(mapping (λ (e)
(match-define (entry k v) e)
(entry k (value-function v)))))


(define (indexing key-function) (bisecting key-function values))
Expand Down

0 comments on commit defa73c

Please sign in to comment.