Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions typed-racket-lib/typed-racket/rep/prop-rep.rkt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#lang racket/base

(require "../utils/utils.rkt"
(require racket/lazy-require
racket/match
(contract-req)
(only-in racket/unsafe/ops unsafe-fx<=)
"../utils/utils.rkt"
"core-rep.rkt"
"fme-utils.rkt"
"rep-utils.rkt"
"free-variance.rkt"
"core-rep.rkt"
"object-rep.rkt"
racket/match
racket/lazy-require
(only-in racket/unsafe/ops unsafe-fx<=))
"rep-utils.rkt")
Comment on lines +3 to +12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is busted, see jackfirth/resyntax#316


(lazy-require
["../types/prop-ops.rkt" (-and -or negate-prop)])
Expand Down Expand Up @@ -143,8 +143,7 @@
[#:for-each (f) (for-each f ps)]
[#:custom-constructor/contract
(-> (listof (or/c TypeProp? NotTypeProp? LeqProp?)) OrProp?)
(let ([ps (sort ps (λ (p q) (unsafe-fx<= (eq-hash-code p)
(eq-hash-code q))))])
(let ([ps (sort ps unsafe-fx<= #:key eq-hash-code)])
(intern-single-ref!
orprop-intern-table
ps
Expand Down
6 changes: 3 additions & 3 deletions typed-racket-lib/typed-racket/typecheck/tc-app/utils.rkt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#lang racket/base

(require syntax/parse
syntax/parse/experimental/reflect
(for-syntax racket/base syntax/parse))
(require (for-syntax racket/base syntax/parse)
syntax/parse
syntax/parse/experimental/reflect)

(provide define-reified-syntax-class define-tc/app-syntax-class)

Expand Down
23 changes: 11 additions & 12 deletions typed-racket-lib/typed-racket/types/match-expanders.rkt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#lang racket/base

(require "../utils/utils.rkt"
"../rep/type-rep.rkt"
"../rep/values-rep.rkt"
"../rep/rep-utils.rkt"
(require (for-syntax racket/base syntax/parse)
racket/match
syntax/parse/define
racket/set
racket/unsafe/undefined
"resolve.rkt"
syntax/parse/define
"../rep/rep-utils.rkt"
"../rep/type-rep.rkt"
"../rep/values-rep.rkt"
"../utils/utils.rkt"
"base-abbrev.rkt"
(for-syntax racket/base syntax/parse))
"resolve.rkt")

(provide Listof: List: MListof: AnyPoly: AnyPoly-names:
HashTableTop:
Expand Down Expand Up @@ -75,20 +75,19 @@
(app (λ (t) (Listof? t #t)) (? Type? elem-pat)))])))


(define-simple-macro (make-Listof-pred listof-pred?:id pair-matcher:id)
(define-syntax-parse-rule (make-Listof-pred listof-pred?:id pair-matcher:id)
(define (listof-pred? t [simple? #f])
(match t
[(Mu-unsafe:
(Union: (== -Null)
(list (pair-matcher elem-t (B: 0)))))
[(Mu-unsafe: (Union: (== -Null) (list (pair-matcher elem-t (B: 0)))))
(define elem-t* (instantiate-type elem-t t))
(cond
[simple? (and (equal? elem-t elem-t*) elem-t)]
[else elem-t*])]
[(Union: (== -Null) (list (pair-matcher hd-t tl-t)))
(cond
[(listof-pred? tl-t)
=> (λ (lst-t) (and (equal? hd-t lst-t) hd-t))]
=>
(λ (lst-t) (and (equal? hd-t lst-t) hd-t))]
Comment on lines +81 to +90
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The define-simple-macro migration rule shouldn't have bothered with these formatting changes. Filed jackfirth/resyntax#317.

[else #f])]
[_ #f])))

Expand Down