move typed requires in helper files

pull/3/head
Matthew Butterick 10 years ago
parent 2737fff0b4
commit 6586d1e8cf

@ -0,0 +1,3 @@
#lang typed/racket/base
;; isolate typed requires in a helper file so the untyped versions can be substituted on the untyped side
(require net/url)

@ -1,9 +1,7 @@
#lang racket/base #lang racket/base
(require (for-syntax racket/base racket/syntax) sugar/define net/url) (require (for-syntax racket/base racket/syntax) sugar/define net/url)
(require-via-wormhole "../typed/sugar/coerce.rkt") (require-via-wormhole "../typed/sugar/coerce.rkt")
(provide+safe [->int (any/c . -> . integer?)] (provide+safe [->int (any/c . -> . integer?)]
[->string (any/c . -> . string?)] [->string (any/c . -> . string?)]
[->symbol (any/c . -> . symbol?)] [->symbol (any/c . -> . symbol?)]
@ -14,7 +12,6 @@
[->vector (any/c . -> . vector?)] [->vector (any/c . -> . vector?)]
[->boolean (any/c . -> . boolean?)]) [->boolean (any/c . -> . boolean?)])
;; coercion contracts & *ish predicates ;; coercion contracts & *ish predicates
;; only make sense in untyped code ;; only make sense in untyped code
;; thus they are here. ;; thus they are here.

@ -0,0 +1,3 @@
#lang typed/racket/base
;; isolate typed requires in a helper file so the untyped versions can be substituted on the untyped side
(require (only-in racket/list dropf dropf-right))

@ -0,0 +1,3 @@
#lang typed/racket/base
;; isolate typed requires in a helper file so the untyped versions can be substituted on the untyped side
(require typed/net/url)

@ -1,8 +1,7 @@
#lang typed/racket/base #lang typed/racket/base
(require (for-syntax typed/racket/base racket/syntax)) (require (for-syntax typed/racket/base racket/syntax) sugar/include)
(require typed/net/url racket/set racket/sequence) (include-without-lang-line "coerce-helper.rkt")
(require typed/sugar/define) (require typed/sugar/define racket/set racket/sequence "len.rkt") ; want relative path-spec for bilingual conversion
(require "len.rkt") ; want relative path-spec for bilingual conversion
(define-syntax-rule (make-coercion-error-handler target-format x) (define-syntax-rule (make-coercion-error-handler target-format x)
(λ(e) (error (string->symbol (format "->~a" target-format)) (format "Cant convert ~s to ~a" x target-format)))) (λ(e) (error (string->symbol (format "->~a" target-format)) (format "Cant convert ~s to ~a" x target-format))))

@ -0,0 +1,4 @@
#lang typed/racket/base
;; isolate typed requires in a helper file so the untyped versions can be substituted on the untyped side
(require/typed racket/list [dropf (All (A) (Listof A) (A -> Boolean) -> (Listof A))]
[dropf-right (All (A) (Listof A) (A -> Boolean) -> (Listof A))])

@ -1,8 +1,7 @@
#lang typed/racket/base #lang typed/racket/base
(require (for-syntax racket/base racket/syntax) racket/function) (require (for-syntax racket/base racket/syntax) racket/function sugar/include)
(require (except-in racket/list flatten dropf dropf-right) typed/sugar/define "coerce.rkt" "len.rkt") (require (except-in racket/list dropf dropf-right) typed/sugar/define "coerce.rkt" "len.rkt")
(require/typed racket/list [dropf (All (A) (Listof A) (A -> Boolean) -> (Listof A))] (include-without-lang-line "list-helper.rkt")
[dropf-right (All (A) (Listof A) (A -> Boolean) -> (Listof A))])
;; use fully-qualified paths in require, ;; use fully-qualified paths in require,
;; so they'll work when this file is included elsewhere ;; so they'll work when this file is included elsewhere
(provide (all-defined-out)) (provide (all-defined-out))

Loading…
Cancel
Save