Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- λ> :t uncurry
- uncurry :: (a -> b -> c) -> (a, b) -> c
- λ> :t ($)
- ($) :: (a -> b) -> a -> b
- λ> :t uncurry ($)
- uncurry ($) :: (a -> c, a) -> c
- λ> :t map (uncurry ($))
- map (uncurry ($)) :: [(a -> b, a)] -> [b]
- λ> f x y = map (uncurry ($)) (zip x y)
- λ> :t f
- f :: [a -> b] -> [a] -> [b]
- λ> f x y = (map (uncurry ($))) (zip x y)
- λ> f x y = (map (uncurry ($))) ((zip x) y)
- λ> f x y = ((map (uncurry ($))) . (zip x)) y
- λ> f x = ((map (uncurry ($))) . (zip x))
- λ> f x = (map (uncurry ($))) . (zip x)
- λ> f x = (.) (map (uncurry ($))) (zip x)
- λ> f x = ((.) (map (uncurry ($)))) (zip x)
- λ> f x = (((.) (map (uncurry ($)))) . zip) x
- λ> f = (((.) (map (uncurry ($)))) . zip)
- λ> f = ((.) ((map . uncurry) ($))) . zip
- λ> :t f
- f :: [a -> b] -> [a] -> [b]
- λ> f [succ, id, id, succ] [1,2,3,4]
- [2,2,3,5]
- λ>
- -- But all this has no sense because
- λ> :t id
- id :: a -> a
- λ> :t zipWith
- zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
- λ> (zipWith id) [succ, id, id, succ] [1,2,3,4]
- [2,2,3,5]
- λ>
Add Comment
Please, Sign In to add comment