Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Data.Maybe
- import Control.Monad
- import Control.Applicative
- import Data.Tuple
- getplus :: [Integer] -> [(Integer->Integer)]
- getplus lst = fmap (+) lst
- getspec :: Integer -> [Integer] -> [Integer]
- getspec n lst = fmap (+ n) lst
- summ :: [Integer] -> [Integer] -> [Integer]
- summ lst1 lst2 = getplus lst1 <*> lst2
- decart :: [Integer] -> [Integer] -> [(Integer,Integer)]
- decart lst1 lst2 = (,) <$> lst1 <*> lst2
- get3 :: [Maybe Int] -> [ Maybe Int]
- get3 lst = fmap ((+3) <$> ) lst
- comp1 :: (String,Int) -> Int -> (String,Int)
- comp1 ch n = (+ n) <$> ch
- comp2 :: (Int,String) -> Int -> (String,Int)
- comp2 ch n = (+ n) <$> (swap ch)
- incr :: [(String,Int)] -> Int -> [(String,Int)]
- incr lst n = fmap ((+n) <$>) lst
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement