diff --git a/sugar/coerce-helper.rkt b/sugar/coerce-helper.rkt new file mode 100644 index 0000000..da491e6 --- /dev/null +++ b/sugar/coerce-helper.rkt @@ -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) \ No newline at end of file diff --git a/sugar/coerce.rkt b/sugar/coerce.rkt index b8c0af4..f7f3da4 100644 --- a/sugar/coerce.rkt +++ b/sugar/coerce.rkt @@ -1,9 +1,7 @@ #lang racket/base (require (for-syntax racket/base racket/syntax) sugar/define net/url) - (require-via-wormhole "../typed/sugar/coerce.rkt") - (provide+safe [->int (any/c . -> . integer?)] [->string (any/c . -> . string?)] [->symbol (any/c . -> . symbol?)] @@ -14,7 +12,6 @@ [->vector (any/c . -> . vector?)] [->boolean (any/c . -> . boolean?)]) - ;; coercion contracts & *ish predicates ;; only make sense in untyped code ;; thus they are here. diff --git a/sugar/list-helper.rkt b/sugar/list-helper.rkt new file mode 100644 index 0000000..e543d9e --- /dev/null +++ b/sugar/list-helper.rkt @@ -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)) \ No newline at end of file diff --git a/typed/sugar/coerce-helper.rkt b/typed/sugar/coerce-helper.rkt new file mode 100644 index 0000000..d8c2c4c --- /dev/null +++ b/typed/sugar/coerce-helper.rkt @@ -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) \ No newline at end of file diff --git a/typed/sugar/coerce.rkt b/typed/sugar/coerce.rkt index 9346354..91bb74a 100644 --- a/typed/sugar/coerce.rkt +++ b/typed/sugar/coerce.rkt @@ -1,8 +1,7 @@ #lang typed/racket/base -(require (for-syntax typed/racket/base racket/syntax)) -(require typed/net/url racket/set racket/sequence) -(require typed/sugar/define) -(require "len.rkt") ; want relative path-spec for bilingual conversion +(require (for-syntax typed/racket/base racket/syntax) sugar/include) +(include-without-lang-line "coerce-helper.rkt") +(require typed/sugar/define racket/set racket/sequence "len.rkt") ; want relative path-spec for bilingual conversion (define-syntax-rule (make-coercion-error-handler target-format x) (λ(e) (error (string->symbol (format "->~a" target-format)) (format "Can’t convert ~s to ~a" x target-format)))) diff --git a/typed/sugar/list-helper.rkt b/typed/sugar/list-helper.rkt new file mode 100644 index 0000000..8dde5f7 --- /dev/null +++ b/typed/sugar/list-helper.rkt @@ -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))]) \ No newline at end of file diff --git a/typed/sugar/list.rkt b/typed/sugar/list.rkt index c3697aa..65140e7 100644 --- a/typed/sugar/list.rkt +++ b/typed/sugar/list.rkt @@ -1,8 +1,7 @@ #lang typed/racket/base -(require (for-syntax racket/base racket/syntax) racket/function) -(require (except-in racket/list flatten dropf dropf-right) typed/sugar/define "coerce.rkt" "len.rkt") -(require/typed racket/list [dropf (All (A) (Listof A) (A -> Boolean) -> (Listof A))] - [dropf-right (All (A) (Listof A) (A -> Boolean) -> (Listof A))]) +(require (for-syntax racket/base racket/syntax) racket/function sugar/include) +(require (except-in racket/list dropf dropf-right) typed/sugar/define "coerce.rkt" "len.rkt") +(include-without-lang-line "list-helper.rkt") ;; use fully-qualified paths in require, ;; so they'll work when this file is included elsewhere (provide (all-defined-out))