Add license headers for code copied from Cabal
Copy readMaybe/readEither from base >= 4.7 for backwards compatibility