From 5019b61a33283822e8c09dc990c842199f487914 Mon Sep 17 00:00:00 2001 From: "resyntax-ci[bot]" <181813515+resyntax-ci[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 18:42:08 -0700 Subject: [PATCH] Automated Resyntax fixes (#564) This is an automated change generated by Resyntax. #### Pass 1 Applied 3 fixes to [`private/contract-projection.rkt`](../blob/HEAD/private/contract-projection.rkt) * Line 8, `predicate/c-migration`: The `predicate/c` contract is less clear than a `->` contract and no longer improves performance. * Line 12, `predicate/c-migration`: The `predicate/c` contract is less clear than a `->` contract and no longer improves performance. * Line 13, `predicate/c-migration`: The `predicate/c` contract is less clear than a `->` contract and no longer improves performance. Applied 4 fixes to [`media/text/plain.rkt`](../blob/HEAD/media/text/plain.rkt) * Line 7, `predicate/c-migration`: The `predicate/c` contract is less clear than a `->` contract and no longer improves performance. * Line 10, `predicate/c-migration`: The `predicate/c` contract is less clear than a `->` contract and no longer improves performance. * Line 14, `predicate/c-migration`: The `predicate/c` contract is less clear than a `->` contract and no longer improves performance. * Line 20, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`type/struct.rkt`](../blob/HEAD/type/struct.rkt) * Line 59, `define-simple-macro-to-define-syntax-parse-rule`: The `define-simple-macro` form has been renamed to `define-syntax-parse-rule`. Applied 1 fix to [`streaming/transducer/composition.rkt`](../blob/HEAD/streaming/transducer/composition.rkt) * Line 10, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 4 fixes to [`private/printer-markup.rkt`](../blob/HEAD/private/printer-markup.rkt) * Line 9, `predicate/c-migration`: The `predicate/c` contract is less clear than a `->` contract and no longer improves performance. * Line 17, `predicate/c-migration`: The `predicate/c` contract is less clear than a `->` contract and no longer improves performance. * Line 24, `predicate/c-migration`: The `predicate/c` contract is less clear than a `->` contract and no longer improves performance. * Line 35, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. Applied 1 fix to [`type/object/private/definition-macro.rkt`](../blob/HEAD/type/object/private/definition-macro.rkt) * Line 25, `define-simple-macro-to-define-syntax-parse-rule`: The `define-simple-macro` form has been renamed to `define-syntax-parse-rule`. Applied 5 fixes to [`private/static-name.rkt`](../blob/HEAD/private/static-name.rkt) * Line 61, `define-simple-macro-to-define-syntax-parse-rule`: The `define-simple-macro` form has been renamed to `define-syntax-parse-rule`. * Line 65, `define-simple-macro-to-define-syntax-parse-rule`: The `define-simple-macro` form has been renamed to `define-syntax-parse-rule`. * Line 69, `define-simple-macro-to-define-syntax-parse-rule`: The `define-simple-macro` form has been renamed to `define-syntax-parse-rule`. * Line 75, `define-simple-macro-to-define-syntax-parse-rule`: The `define-simple-macro` form has been renamed to `define-syntax-parse-rule`. * Line 101, `define-simple-macro-to-define-syntax-parse-rule`: The `define-simple-macro` form has been renamed to `define-syntax-parse-rule`. Applied 1 fix to [`private/vector-merge-adjacent.rkt`](../blob/HEAD/private/vector-merge-adjacent.rkt) * Line 13, `tidy-require`: Keep imports in `require` sorted and grouped by phase, with collections before files. ## Summary Fixed 20 issues in 8 files. * Fixed 9 occurrences of `predicate/c-migration` * Fixed 7 occurrences of `define-simple-macro-to-define-syntax-parse-rule` * Fixed 4 occurrences of `tidy-require` Co-authored-by: resyntax-ci[bot] <181813515+resyntax-ci[bot]@users.noreply.github.com> --- media/text/plain.rkt | 8 ++++---- private/contract-projection.rkt | 6 +++--- private/printer-markup.rkt | 12 ++++++------ private/static-name.rkt | 11 +++++------ private/vector-merge-adjacent.rkt | 4 ++-- streaming/transducer/composition.rkt | 4 ++-- type/object/private/definition-macro.rkt | 3 +-- type/struct.rkt | 3 +-- 8 files changed, 24 insertions(+), 27 deletions(-) diff --git a/media/text/plain.rkt b/media/text/plain.rkt index 4f786b54..414e2553 100644 --- a/media/text/plain.rkt +++ b/media/text/plain.rkt @@ -4,14 +4,14 @@ (provide (contract-out - [charset? predicate/c] + [charset? (-> any/c boolean?)] [us-ascii charset?] [utf-8 charset?] - [text? predicate/c] + [text? (-> any/c boolean?)] [text (-> (or/c charset? #f) immutable-bytes? text?)] [text-charset (-> text? (or/c charset? #f))] [text-bytes (-> text? immutable-bytes?)] - [text-media? predicate/c] + [text-media? (-> any/c boolean?)] [text->media (-> text? text-media?)] [media->text (-> text-media? text?)] [text/plain (-> #:charset (or/c charset? #f) media-type?)] @@ -19,8 +19,8 @@ (require racket/bool rebellion/binary/immutable-bytes - rebellion/media rebellion/collection/record + rebellion/media rebellion/type/tuple) (module+ test diff --git a/private/contract-projection.rkt b/private/contract-projection.rkt index 7d83d14e..19439b9f 100644 --- a/private/contract-projection.rkt +++ b/private/contract-projection.rkt @@ -5,12 +5,12 @@ (provide (contract-out [projection/c contract?] - [contract-get-projection (-> predicate/c blame? projection/c)] + [contract-get-projection (-> (-> any/c boolean?) blame? projection/c)] [projection-and (-> projection/c ... projection/c)] [projection-convert (-> projection/c (-> any/c any/c) (-> any/c any/c) projection/c)] - [projection-filter (-> projection/c predicate/c projection/c)] - [assert-satisfies (-> any/c predicate/c blame? #:missing-party any/c void?)])) + [projection-filter (-> projection/c (-> any/c boolean?) projection/c)] + [assert-satisfies (-> any/c (-> any/c boolean?) blame? #:missing-party any/c void?)])) (require racket/contract/combinator) diff --git a/private/printer-markup.rkt b/private/printer-markup.rkt index 7b1bafb3..50eed866 100644 --- a/private/printer-markup.rkt +++ b/private/printer-markup.rkt @@ -6,7 +6,7 @@ (provide (contract-out - [sequence-markup? predicate/c] + [sequence-markup? (-> any/c boolean?)] [sequence-markup (->* ((sequence/c any/c)) (#:indentation exact-nonnegative-integer? @@ -14,14 +14,14 @@ #:suffix any/c #:inline-separator any/c) sequence-markup?)] - [inline-sequence-markup? predicate/c] + [inline-sequence-markup? (-> any/c boolean?)] [inline-sequence-markup (->* ((sequence/c any/c)) (#:prefix any/c #:suffix any/c #:separator any/c) inline-sequence-markup?)] - [mode-sensitive-markup? predicate/c] + [mode-sensitive-markup? (-> any/c boolean?)] [mode-sensitive-markup (-> #:written-form any/c #:displayed-form any/c @@ -32,10 +32,10 @@ (-> symbol? (-> any/c (sequence/c any/c)) custom-write-function/c)])) -(require racket/pretty +(require guard + racket/pretty racket/sequence - rebellion/custom-write - guard) + rebellion/custom-write) ;@---------------------------------------------------------------------------------------------------- diff --git a/private/static-name.rkt b/private/static-name.rkt index 8d727724..4273d63d 100644 --- a/private/static-name.rkt +++ b/private/static-name.rkt @@ -58,21 +58,21 @@ (raise-syntax-error #f "named identifier not bound" context-stx id-stx)) (syntax-parse-state-cons! 'literals id-stx))) -(define-simple-macro (name/derived id:id #:context context) +(define-syntax-parse-rule (name/derived id:id #:context context) #:do [(check-name-has-binding! #'id #'context)] (quote id)) -(define-simple-macro (name id:id) +(define-syntax-parse-rule (name id:id) #:with context this-syntax (#%expression (name/derived id #:context context))) -(define-simple-macro (name-string/derived id:id #:context context) +(define-syntax-parse-rule (name-string/derived id:id #:context context) #:do [(check-name-has-binding! #'id #'context)] #:with literal-string (string->immutable-string (symbol->string (syntax-e #'id))) (quote literal-string)) -(define-simple-macro (name-string id:id) +(define-syntax-parse-rule (name-string id:id) #:with context this-syntax (#%expression (name-string/derived id #:context context))) @@ -98,8 +98,7 @@ (pattern (header:function-header-with-recursive-name . args:formals) #:with function-name #'header.function-name))) -(define-simple-macro - (define/name +(define-syntax-parse-rule (define/name (~or id:id header:function-header-with-recursive-name) body ...) (~? (splicing-let ([variable-name (quote id)]) diff --git a/private/vector-merge-adjacent.rkt b/private/vector-merge-adjacent.rkt index 12f8a13e..23340850 100644 --- a/private/vector-merge-adjacent.rkt +++ b/private/vector-merge-adjacent.rkt @@ -10,8 +10,8 @@ (-> vector? (-> any/c any/c boolean?) (-> any/c any/c any/c) (and/c vector? immutable?))])) -(require rebellion/collection/vector/builder - guard) +(require guard + rebellion/collection/vector/builder) (module+ test diff --git a/streaming/transducer/composition.rkt b/streaming/transducer/composition.rkt index 62d9a45b..f8699ffd 100644 --- a/streaming/transducer/composition.rkt +++ b/streaming/transducer/composition.rkt @@ -7,12 +7,12 @@ [transducer-pipe (-> transducer? ... transducer?)] [transducer-compose (-> transducer? ... transducer?)])) -(require racket/bool +(require guard + racket/bool racket/list racket/match rebellion/base/impossible-function rebellion/base/variant - guard rebellion/private/static-name rebellion/streaming/transducer/base rebellion/type/record) diff --git a/type/object/private/definition-macro.rkt b/type/object/private/definition-macro.rkt index 6a3f3492..a95a876e 100644 --- a/type/object/private/definition-macro.rkt +++ b/type/object/private/definition-macro.rkt @@ -22,8 +22,7 @@ ;@------------------------------------------------------------------------------ -(define-simple-macro - (define-object-type id:id (private-field:id ...) +(define-syntax-parse-rule (define-object-type id:id (private-field:id ...) (~alt (~optional (~and #:omit-root-binding omit-root-binding-kw)) diff --git a/type/struct.rkt b/type/struct.rkt index 2158b76e..04435824 100644 --- a/type/struct.rkt +++ b/type/struct.rkt @@ -56,8 +56,7 @@ (define (format-one-identifier id template-string) (format-id id template-string (syntax-e id) #:source id #:props id))) -(define-simple-macro - (define-and-provide-struct-descriptor-field-accessors +(define-syntax-parse-rule (define-and-provide-struct-descriptor-field-accessors [field:id contract:expr] ...) #:do [(define (format-fields template-string) (map (λ (field-id) (format-one-identifier field-id template-string))