(module zip-help mzscheme (require (lib "plt-match.ss") (lib "list.ss")) (provide (all-defined)) (define (andmap/mi lst) (match lst [(list-rest x xs) (let/ec esc (foldl (lambda (cur last) (if (module-identifier=? cur last) cur (esc #f))) x xs) #t)] [(list) #t])) (define mi-lookup (match-lambda* [(list (and q (list the-s the-f)) (list-rest (list (list an-s an-f) uss) r)) (if (and (module-identifier=? the-s an-s) (module-identifier=? the-f an-f)) uss (mi-lookup q r))])) (define mi-insert (match-lambda* [(list (and i (list the-s the-f)) the-us (and m (list))) (list* (list i (list the-us)) m)] [(list (and i (list the-s the-f)) the-us (and m (list-rest (list (and c (list an-s an-f)) a-uss) r))) (if (and (module-identifier=? the-s an-s) (module-identifier=? the-f an-f)) (list* (list i (list* the-us a-uss)) r) (list* (list c a-uss) (mi-insert i the-us r)))])))