Side note: How has Ray Liotta aged 700 years since this movie, while Steve Martin remains the same?
For those unaware, Goodfellas is based on the book Wiseguy, the detailed confessions of mobster turned FBI informant Henry Hill (the Liotta character). While co-author Nick Pileggi was working on the book, he was married to Nora Ephron, best known for writing movies about Meg Ryan hooking up with Tom Hanks via various methods of communication. Sometimes, when Hill called Pileggi for their interviews, Ephron would answer the phone and they'd shoot the s**t about life in witness protection. Unbeknownst to Hill, Ephron wasn't just being friendly; she was researching My Blue Heaven. According to Hill, he didn't realize the stuff he was saying would end up being repeated by Steve Martin in a cheesy "New York Mafia guy" accent.
"Don't worry, your secret habit of dancing the Merengue with men who look like Rick Moranis is safe with me."
So you could say that Scorsese's profane, ultra-violent murderpalooza is a prequel to this lighthearted little comedy. Goodfellas ends with Hill going into witness protection in a boring suburban town, which is the starting point of My Blue Heaven. Both movies even have scenes in which the protagonist finds out the local restaurants don't offer a decent marinara sauce. It's sort of an Antz / A Bug's Life situation, if Antz featured the Woody Allen ant pistol-whipping a guy to death and digging up his dismembered corpse, and A Bug's Life was A Bug's Life.