From eec872320508cd5032965f2377ca457d425786dc Mon Sep 17 00:00:00 2001 From: Eric Dobson Date: Thu, 19 Dec 2013 09:38:15 -0800 Subject: [PATCH] Make simple static contracts not combinators. original commit: 9eea867e9afc22246edafdd091d2d2a832986eee --- .../static-contracts/combinators/simple.rkt | 10 +++++----- .../typed-racket/static-contracts/structures.rkt | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/static-contracts/combinators/simple.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/static-contracts/combinators/simple.rkt index 9581fa60..48e2287b 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/static-contracts/combinators/simple.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/static-contracts/combinators/simple.rkt @@ -19,7 +19,7 @@ [flat/sc? predicate/c])) (define (simple-contract-write-proc v port mode) - (match-define (simple-contract _ syntax kind) v) + (match-define (simple-contract syntax kind) v) (define-values (open close) (if (equal? mode 0) (values "(" ")") @@ -32,16 +32,16 @@ -(struct simple-contract combinator (syntax kind) +(struct simple-contract static-contract (syntax kind) #:methods gen:sc [(define (sc-map v f) v) (define (sc->contract v f) (simple-contract-syntax v)) (define (sc->constraints v f) (simple-contract-restrict (simple-contract-kind v)))] #:methods gen:custom-write [(define write-proc simple-contract-write-proc)]) -(define (flat/sc ctc) (simple-contract null ctc 'flat)) -(define (chaperone/sc ctc) (simple-contract null ctc 'chaperone)) -(define (impersonator/sc ctc) (simple-contract null ctc 'impersonator)) +(define (flat/sc ctc) (simple-contract ctc 'flat)) +(define (chaperone/sc ctc) (simple-contract ctc 'chaperone)) +(define (impersonator/sc ctc) (simple-contract ctc 'impersonator)) (define (flat/sc? sc) (and (simple-contract? sc) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/static-contracts/structures.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/static-contracts/structures.rkt index 6634d4e0..1070eba4 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/static-contracts/structures.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/static-contracts/structures.rkt @@ -13,10 +13,10 @@ [body static-contract?])) (struct recursive-contract-use ([name identifier?])) (struct combinator ([args sequence?])) + (struct static-contract ()) [sc-map (static-contract? (static-contract? variance/c . -> . static-contract?) . -> . static-contract?)] [sc->contract (static-contract? (static-contract? . -> . syntax?) . -> . syntax?)] [sc->constraints (static-contract? (static-contract? . -> . contract-restrict?) . -> . contract-restrict?)] - [static-contract? predicate/c] [sc? predicate/c] ) @@ -135,7 +135,7 @@ ;; Super struct of static contract combinators. ;; Provides printing functionality. -;; - args : (listof static-contract?) +;; - args : (sequenceof static-contract?) (struct combinator static-contract (args) #:transparent #:property prop:combinator-name "combinator/sc"