Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sumL :: [Int] -> Int
- sumL [] = 0
- sumL (x:xs) = x + sumL xs
- po10 :: Int -> Int
- po10 x = 10 * x
- mapMy :: (Int->Int) -> [Int] -> [Int]
- mapMy f [] = []
- mapMy f (x:xs) = (f x) : mapMy f xs
- isLast0 :: Int -> Bool
- isLast0 x
- | mod x 10 == 0 = True
- | otherwise = False
- filterMy :: (Int->Bool) -> [Int] -> [Int]
- filterMy p [] = []
- filterMy p (x:xs)
- | p x == True = x : filterMy p xs
- | otherwise = filterMy p xs
- filterMy2 :: (Int->Bool) -> [Int] -> [Int]
- filterMy2 p list = [n | n <- list, p n]
- reverseMy :: [a] -> [a]
- reverseMy [] = []
- reverseMy (x:xs) = reverseMy xs ++ [x]
- insert :: Int -> [Int] -> [Int]
- insert x [] = [x]
- insert x (y:ys)
- | x <= y = x:(y:ys)
- | otherwise = y : insert x ys
- insertSort :: [Int] -> [Int]
- insertSort [] = []
- insertSort (x:xs) = insert x (insertSort xs)
- qSort :: [Int] -> [Int]
- qSort [] = []
- qSort (x:xs) = qSort (filter (<x) xs) ++ [x] ++ qSort (filter (>=x) xs)
- repeated :: (a->a) -> Int -> (a->a)
- repeated f 1 = f
- repeated f n = \x -> f (repeated f (n - 1) x)
- derive :: (Float->Float) -> (Float->Float)
- derive f = \x -> (f (x + dx) - f x) / dx
- where dx = 0.01
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement