Skip to content

Commit

Permalink
Remove case-λ:, pcase-λ:, pλ:, λ:, popt-λ:, opt-λ:.
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahStoryM committed May 22, 2024
1 parent 7fa7c30 commit 3684fa1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 40 deletions.
10 changes: 0 additions & 10 deletions typed-racket-doc/typed-racket/scribblings/reference/legacy.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,22 @@ A polymorphic function, abstracted over the type variables
@racket[a]. The type variables @racket[a] are bound in both the types
of the formal, and in any type expressions in the @racket[body].}

@defalias[pλ: plambda: "syntax"]

@defform/subs[(opt-lambda: formals maybe-ret . body)
([formals ([v : t] ... [v : t default] ...)
([v : t] ... [v : t default] ... v : t *)
([v : t] ... [v : t default] ... v : t ooo bound)])]{
A function with optional arguments.}

@defalias[opt-λ: opt-lambda: "syntax"]

@defform*[[(popt-lambda: (a ...) formals maybe-ret . body)
(popt-lambda: (a ... a ooo) formals maybe-ret . body)]]{
A polymorphic function with optional arguments.}

@defalias[popt-λ: popt-lambda: "syntax"]

@defalias[case-lambda: case-lambda "syntax"]

@defalias[case-λ: case-lambda: "syntax"]

@defform*[[(pcase-lambda: (a ...) [formals body] ...)
(pcase-lambda: (a ... b ooo) [formals body] ...)]]{
A polymorphic function of multiple arities.}

@defalias[pcase-λ: pcase-lambda: "syntax"]

@defform*[[
(let: ([v : t e] ...) . body)
(let: loop : t0 ([v : t e] ...) . body)]]{
Expand Down
7 changes: 1 addition & 6 deletions typed-racket-lib/typed-racket/base-env/prims-lambda.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@
(provide (rename-out [-case-lambda case-lambda]
[-case-lambda case-lambda:]
[-case-lambda case-λ]
[-case-lambda case-λ:]
[pcase-lambda: pcase-λ:]
[plambda: pλ:]
[lambda: λ:]
[popt-lambda: popt-λ:]
[opt-lambda: opt-λ:])
[lambda: λ:])
pcase-lambda:
plambda:
-lambda
Expand Down
37 changes: 13 additions & 24 deletions typed-racket-test/succeed/unicode-aliases.rkt
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
#lang typed/racket/base

(: foo0 (∀ () (→* ((∪ Symbol String)) (Integer) (Pair Boolean Integer))))
(: foo1 (∀ () (→* ((∪ Symbol String) Integer) () (Pair Boolean Integer))))
(: foo2 (∀ () (→* ((∪ Symbol String) Integer) () (Pair Boolean Integer))))
(: foo3 (∀ () (→* ((∪ Symbol String)) (Integer) (Pair Boolean Integer))))
(: foo4 (∀ () (→* ((∪ Symbol String)) (Integer) (Pair Boolean Integer))))
(define foo0 (λ #:∀ () ([s : (∪ Symbol String)] [i : Integer 0]) : (Pair Boolean Integer) (cons (symbol? s) i)))
(define foo1 (λ: ([s : (∪ Symbol String)] [i : Integer]) : (Pair Boolean Integer) (cons (symbol? s) i)))
(define foo2 (pλ: () ([s : (∪ Symbol String)] [i : Integer]) : (Pair Boolean Integer) (cons (symbol? s) i)))
(define foo3 (opt-λ: ([s : (∪ Symbol String)] [i : Integer 0]) : (Pair Boolean Integer) (cons (symbol? s) i)))
(define foo4 (popt-λ: () ([s : (∪ Symbol String)] [i : Integer 0]) : (Pair Boolean Integer) (cons (symbol? s) i)))
(foo0 'abc 0) (foo0 "abc" 0)
(foo1 'abc 0) (foo1 "abc" 0)
(foo2 'abc 0) (foo2 "abc" 0)
(foo3 'abc 0) (foo3 "abc" 0)
(foo4 'abc 0) (foo4 "abc" 0)
(: foo (→* ((∪ Symbol String)) (Integer) (Pair Boolean Integer)))
(define foo
(λ (s [i 0])
(cons (symbol? s) i)))
(foo 'abc)
(foo "abc")

(: bar0 (∀ () (case→ (→ True) (→ Any False))))
(: bar1 (∀ () (case→ (→ True) (→ Any False))))
(: bar2 (∀ () (case→ (→ True) (→ Any False))))
(define bar0 (case-λ #:∀ () [() #t] [(_) #f]))
(define bar1 (case-λ: #:∀ () [() #t] [(_) #f]))
(define bar2 (pcase-λ: () [() #t] [(_) #f]))
(bar0) (bar0 bar0)
(bar1) (bar1 bar1)
(bar2) (bar2 bar2)
(: bar (∀ () (case→ (→ True) (→ Any False))))
(define bar
(case-λ
[() #t]
[(_) #f]))
(bar)
(bar bar)

0 comments on commit 3684fa1

Please sign in to comment.