{-

CSE 341, 1999su
Assignment 3
test data
Ken Yasuhara 
July, 1999

Your code was tested after appending definitions needed for helper
function listeq to your submitted code file.  Testing entailed
checking that each of the expressions below evaluated to True.

Function listeq returns true if the two arg. lists are the same,
modulo reordering the elements.  The def. of listeq and the functions
listeq uses were appended to each student's submission by a script.

Commented lines beginning with :type indicate function type checks.
The returned type should match the type given here.

-}

----------------------------------------------------------------------
-- no. 1

-- :type squareList
-- squareList :: Num a => [a] -> [a]

squareList [1,5,-2,0,3] == [1,25,4,0,9]
squareList [] == []
squareList [1/2] == [0.25]

-- ...and likewise for squareList2

----------------------------------------------------------------------
-- no. 2

-- :type filterGE
-- filterGE :: Ord a => a -> [a] -> [a]

filterGE (-2.1) [(-1.3),(-4.8),3.1,2.7] == [-1.3,3.1,2.7]
filterGE 4 [-2,1..12] == [4,7,10]
filterGE 4 [] == []
filterGE 10 [-1..7] == []

----------------------------------------------------------------------
-- no. 3

factors 67 == [67]
listeq (factors 144) [2,3,4,6,8,9,12,16,18,24,36,48,72,144]
factors 2 == [2]

----------------------------------------------------------------------
-- no. 4

listeq (take 10 primes) [2,3,5,7,11,13,17,19,23,29]
take 1 primes == [2]

----------------------------------------------------------------------
-- no. 5

isMember 12 [(-10)..20]
not (isMember 12.2 [(-10.2)..10.0])
isMember 'c' "Horace Silver"
not (isMember 'd' "Horace Silver")
not (isMember 3 [])
isMember 2 [-10..]

listeq "coltrane" (union "coal" "tern") 
listeq "blakey" (union "" "blakey")
listeq "blakey" (union "blakey" "")
listeq "" ((union [] [])::[Char])
listeq [1,2,3,4,5] (union [1,4] [3,2,5])
listeq [1.2,1.4,0.1] (union [1.2] [1.4,0.1])

(intersection [] [] :: [Char]) == ""
intersection [] [1,2,3] == []
intersection [1.0,2.1,3.2] [] == []
intersection [1..10] [10..20] == [10]
intersection [1..10] [11..20] == []
listeq (intersection [1..10] [5..20]) [5..10]
listeq (intersection [1..10] [5..20]) (intersection [5..20] [1..10])

listeq (difference "johannes brahms" "beethoven") "jas rams"
difference [] [1,2,3,7,6] == []
(difference [] [] :: [Char]) == ""
difference "" "joseph haydn" == ""
difference [1..10] [] == [1..10]
listeq (difference [1..10] [2..4]) [1,5,6,7,8,9,10]


-- end of file