Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fAlph :: [Char] -> ([Char] -> [Char])
- fAlph alphabet = \text -> filter(\x -> elem x alphabet) text
- --fAlph alphabet = filter(\xs -> (elem xs alphabet))
- func :: [Int] -> (Int -> Int -> Int) ->([Int] -> [Int])
- func lst f = \xs -> map (\tuples -> f (fst tuples) (snd tuples)) (zip lst xs)
- --adjacencyList :: [(Int,Int)] ->[(Int,[Int])]
- --adjacencyList ::
- --extractNodes :: [(Int,Int)] -> [Int]
- --extractNodes lst = \xs
- main = do
- --print((fAlph "ABC") "BACE")
- --print((func[1,2,3] (+)) [4,5,6])
- --print(map (sum) (zip [1,2,3] [4, 5, 6]))
- --print(adjacencyList [(1,2),(1,3),(2,3),(2,4)])
- --print(extractNodes [(1,2),(1,3),(2,3),(2,4)])
- print(foldl (:) [(1,2),(1,3),(2,3),(2,4)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement