Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unzipPairs :: [(a, b)] -> ([a], [b])
- unzipPairs list = foldl (\(l1, l2) (c, d) -> (l1 ++ c, l2 ++ d)) ([], []) list
- main.hs:2:75: error:
- • Occurs check: cannot construct the infinite type: a ~ [a]
- Expected type: [([a], [b])]
- Actual type: [(a, b)]
- • In the third argument of ‘foldl’, namely ‘list’
- In the expression:
- foldl (\ (l1, l2) (c, d) -> (l1 ++ c, l2 ++ d)) ([], []) list
- In an equation for ‘unzipPairs’:
- unzipPairs list
- = foldl (\ (l1, l2) (c, d) -> (l1 ++ c, l2 ++ d)) ([], []) list
- • Relevant bindings include
- list :: [(a, b)] (bound at main.hs:2:12)
- unzipPairs :: [(a, b)] -> ([a], [b]) (bound at main.hs:2:1)
- |
- 2 | unzipPairs list = foldl (\(l1, l2) (c, d) -> (l1 ++ c, l2 ++ d)) ([], []) list
- |
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement