From 0028c1afb143dcf72747e153e9a251ebf857e511 Mon Sep 17 00:00:00 2001 From: Evan Hanson
Date: Sat, 13 Feb 2016 23:56:40 +1300 Subject: [PATCH] Preserve type of first element in mem* procedure results If the result is a list, its first element will be the same type as the first procedure argument. --- types.db | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/types.db b/types.db index b5a5333..9d565df 100644 --- a/types.db +++ b/types.db @@ -179,19 +179,19 @@ (reverse (forall (a) (#(procedure #:clean #:enforce) reverse ((list-of a)) (list-of a))) ((null) (null) (let ((#(tmp) #(1))) '()))) -(memq (forall (a) (#(procedure #:clean #:foldable) memq (* (list-of a)) - (or false (list-of a)))) +(memq (forall (a b) (#(procedure #:clean #:foldable) memq (a (list-of b)) + (or false (pair a (list-of b))))) ((* null) (let ((#(tmp) #(1))) '#f)) ((* list) (##core#inline "C_u_i_memq" #(1) #(2)))) -(memv (forall (a) (#(procedure #:clean #:foldable) memv (* (list-of a)) - (or false (list-of a)))) +(memv (forall (a b) (#(procedure #:clean #:foldable) memv (a (list-of b)) + (or false (pair a (list-of b))))) ((* null) (let ((#(tmp) #(1))) '#f)) (((or symbol procedure immediate) list) (##core#inline "C_u_i_memq" #(1) #(2)))) -(member (forall (a) (#(procedure #:clean #:foldable) member - (* (list-of a)) (or false (list-of a)))) +(member (forall (a b) (#(procedure #:clean #:foldable) member (a (list-of b)) + (or false (pair a (list-of b))))) ((* null) (let ((#(tmp) #(1))) '#f)) (((or symbol procedure immediate) list) (##core#inline "C_u_i_memq" #(1) #(2))) -- 2.7.0.rc3