This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Box = x => | |
| ({ | |
| map: f => Box(f(x)), | |
| fold: f => f(x), | |
| toString: () => `Box(${x})` | |
| }) | |
| // Exercise: Box | |
| // Goal: Refactor each example using Box | |
| // Keep these tests passing! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| from bs4 import BeautifulSoup | |
| result = requests.get("https://medium.com/@WomenWhoCode/latest") | |
| soup = BeautifulSoup(result.content) | |
| titles = soup.find_all("a", "block-snippet") | |
| [{"title":title.string.strip(),"url":title.attrs['href']} for title in titles] |