commit 76c9e89b20cdd0e88a5f69a3db04f974ee55a758 parent 250885b0025425a3e91fda588f385de4b1fa82e7 Author: Georges Dupéron <georges.duperon@gmail.com> Date: Sun, 25 Sep 2016 16:19:46 +0200 Simplified split-xlist so that it might typecheck in Racket v.6.5 Diffstat:
| M | split-xlist.rkt | | | 19 | ++++++------------- |
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/split-xlist.rkt b/split-xlist.rkt @@ -22,15 +22,12 @@ (List (Listof A) B))) (define (recur l) - (if (null? l) - (list '() (ann l B)) - (if (pred-b? l) - (list '() l) - (let ([split-rest (recur (cdr l))]) - (cons (cons (car l) - (car split-rest)) - (cdr split-rest))) - ))) + (if (pred-b? l) + (list '() l) + (let ([split-rest (recur (cdr l))]) + (cons (cons (car l) + (car split-rest)) + (cdr split-rest))))) recur) (define-syntax-rule (m-split-list v (xlist τ₁ ^ *₁ . whole-τ-rest)) @@ -42,10 +39,6 @@ (make-predicate (xlist . whole-τ-rest))) v)) -#;(: cons2 (∀ (A B ...) (→ A (List B ...) (List A B ...)))) -#;(define (cons2 a b) - (cons a b)) - (define-syntax (bounded-filter stx) (syntax-case stx () [(_ 0 heads t l)