brendanhay / gogol

A comprehensive Google Services SDK for Haskell.
Other
281 stars 105 forks source link

Fix build of core with base-4.11.0 #115

Closed hasufell closed 6 years ago

hasufell commented 6 years ago

This is backwards-compatible and although there is no full ghc-8.4.3 and lts-12.9 support yet, this is useful for projects that mix in gogol.

hasufell commented 6 years ago

There are potentially many more cases where the Monid/Semigroup change will need to be fixed. I haven't looked through the entire codebase, because we just use a fraction.

brendanhay commented 6 years ago

CPP is not required if there is a dependency upon semigroups with the following instances:

instance Semigroup Foo where
    (<>) = ...

instance Monoid Foo where
    mempty = ...
    mappend = (<>)

There will be a minor warning in newer GHCs about a non-canonical instance since Semigroup is now a superclass of Monoid, but I'd rather supress that than use CPP, if possible.

hasufell commented 6 years ago

You don't mind build not being compatible with -Werror?

brendanhay commented 6 years ago

I believe it won't warn in GHC <= 8.4.3 with both -Wall and -Wcompat. If it does either now or in the future I think {-# LANGUAGE -fno-warn-... #-} per affected module is still preferable.

hasufell commented 6 years ago

Messed up branches a bit, please see new PR: https://github.com/brendanhay/gogol/pull/116