Test for PR 10946.

original commit: 0e3c2b71cc827236f4695e0271b869c416489557
This commit is contained in:
Sam Tobin-Hochstadt 2010-06-01 12:26:02 -04:00
parent 58c87429da
commit 6b35e1cb24

View File

@ -0,0 +1,31 @@
#lang racket/load
(module test typed/racket
(provide a:list-helper)
(define-type (Append-List+ elem) (U (a:singleton elem) (a:join elem)))
(define-struct: (elem) a:join
((left : (Append-List+ elem)) (right : (Append-List+ elem)))
#:transparent)
(define-struct: (elem) a:singleton
((elem : elem)) #:transparent)
(: a:list-helper (All (elem) ((Pair elem (Listof elem)) -> (Append-List+ elem))))
(define (a:list-helper elems)
(cond
((empty? (cdr elems)) (make-a:singleton (car elems)))
(else (make-a:join (make-a:singleton (car elems))
(a:list-helper (cdr elems))))))
)
(module test2 racket
(require 'test)
(a:list-helper (list 1 2)))
(require 'test2)