[]
[3]
["Haskell","JavaScript","C","Python"]
[1,3,True,"Python"]
[1,2,3] /= [3,2,1]
5 : ( 6 : (3 : [])) == 5 : 6 : 3 : [] == [5,6,3]
"Haskell" == ['H','a','s','k','e','l','l']
type String = [Char]
[]
x : xs
x
xs
data Hand = Empty | Add Card Hand
data List a = Nil | Cons a (List a)
data [a] = [] | a : [a]
length :: [a] -> Int (++) :: [a] -> [a] -> [a] concat :: [[a]] -> [a] take :: Int -> [a] -> [a] zip :: [a] -> [b] -> [(a,b)] map :: (a -> b) -> [a] -> [b] filter :: (a -> Bool) -> [a] -> [a]
and, or :: [Bool] -> Bool words, lines :: String -> [String] unwords, unlines :: [String] -> String
sum, product :: Num a => [a] -> a elem :: Eq a => a -> [a] -> Bool sort :: Ord a => [a] -> [a]
qsort :: Ord a => [a] -> [a] qsort [] = [] qsort (x1:xs) = qsort smaller ++ [x1] ++ qsort bigger where smaller = [x | x<-xs, x<=x1] bigger = [x | x<-xs, x>x1]
prop_take_drop n xs = take n xs ++ drop n xs == xs nonprop_take_drop n xs = drop n xs ++ take n xs == xs
quickCheck prop_take_drop
+++ OK, passed 100 tests.
quickCheck nonprop_take_drop
+++ OK, passed 100 tests.
prop_take_drop :: Eq a => Int -> [a] -> Bool nonprop_take_drop :: Eq a => Int -> [a] -> Bool
quickCheck nonprop_take_drop
nonprop_take_drop :: Int -> [()] -> Bool
()
()
data () = ()
quickCheck
:set -XNoExtendedDefaultRules
default (Integer,Double)