diff --git a/.travis.yml b/.travis.yml
--- a/.travis.yml
+++ b/.travis.yml
@@ -54,15 +54,14 @@
     - compiler: "ghc-8.2.2"
     # env: TEST=--disable-tests BENCH=--disable-benchmarks
       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.0,ghc-8.2.2], sources: [hvr-ghc]}}
-    - compiler: "ghc-8.4.1"
-      env: GHCHEAD=true
-      addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.4.1], sources: [hvr-ghc]}}
+    - compiler: "ghc-8.4.2"
+    # env: TEST=--disable-tests BENCH=--disable-benchmarks
+      addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.4.2], sources: [hvr-ghc]}}
     - compiler: "ghc-head"
       env: GHCHEAD=true
       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-head], sources: [hvr-ghc]}}
 
   allow_failures:
-    - compiler: "ghc-8.4.1"
     - compiler: "ghc-head"
 
 before_install:
diff --git a/examples/free-examples.cabal b/examples/free-examples.cabal
--- a/examples/free-examples.cabal
+++ b/examples/free-examples.cabal
@@ -10,7 +10,7 @@
 homepage:      http://github.com/ekmett/free/
 bug-reports:   http://github.com/ekmett/free/issues
 copyright:     Copyright (C) 2008-2015 Edward A. Kmett
-tested-with:   GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.1
+tested-with:   GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.2
 synopsis:      Monads for free
 description:   Examples projects using @free@
 build-type:    Simple
diff --git a/free.cabal b/free.cabal
--- a/free.cabal
+++ b/free.cabal
@@ -1,6 +1,6 @@
 name:          free
 category:      Control, Monads
-version:       5.0.1
+version:       5.0.2
 license:       BSD3
 cabal-version: >= 1.18
 license-file:  LICENSE
@@ -10,7 +10,7 @@
 homepage:      http://github.com/ekmett/free/
 bug-reports:   http://github.com/ekmett/free/issues
 copyright:     Copyright (C) 2008-2015 Edward A. Kmett
-tested-with:   GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.1
+tested-with:   GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.2
 synopsis:      Monads for free
 description:
   Free monads are useful for many tree-like structures and domain specific languages.
@@ -84,7 +84,7 @@
     transformers-base    < 0.5,
     transformers-compat  >= 0.3     && < 1,
     template-haskell     >= 2.7.0.0 && < 3,
-    exceptions           >= 0.6 && < 0.10,
+    exceptions           >= 0.6 && < 0.11,
     containers           < 0.6
 
   exposed-modules:
diff --git a/src/Control/Alternative/Free.hs b/src/Control/Alternative/Free.hs
--- a/src/Control/Alternative/Free.hs
+++ b/src/Control/Alternative/Free.hs
@@ -33,8 +33,11 @@
 import Data.Functor.Apply
 import Data.Functor.Alt ((<!>))
 import qualified Data.Functor.Alt as Alt
-import Data.Semigroup
 import Data.Typeable
+
+#if !(MIN_VERSION_base(4,11,0))
+import Data.Semigroup
+#endif
 
 infixl 3 `Ap`
 
diff --git a/src/Control/Alternative/Free/Final.hs b/src/Control/Alternative/Free/Final.hs
--- a/src/Control/Alternative/Free/Final.hs
+++ b/src/Control/Alternative/Free/Final.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
 {-# LANGUAGE RankNTypes #-}
 
 -----------------------------------------------------------------------------
@@ -23,7 +24,10 @@
 import Data.Functor.Apply
 import Data.Functor.Alt ((<!>))
 import qualified Data.Functor.Alt as Alt
+
+#if !(MIN_VERSION_base(4,11,0))
 import Data.Semigroup
+#endif
 
 -- | The free 'Alternative' for any @f@.
 newtype Alt f a = Alt { _runAlt :: forall g. Alternative g => (forall x. f x -> g x) -> g a }
diff --git a/src/Control/Comonad/Cofree.hs b/src/Control/Comonad/Cofree.hs
--- a/src/Control/Comonad/Cofree.hs
+++ b/src/Control/Comonad/Cofree.hs
@@ -5,6 +5,7 @@
 {-# LANGUAGE MultiParamTypeClasses #-}
 #if __GLASGOW_HASKELL__ >= 707
 {-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
 {-# LANGUAGE StandaloneDeriving #-}
 #endif
 #include "free-common.h"
@@ -61,6 +62,9 @@
 import Data.Semigroup.Foldable
 import Data.Semigroup.Traversable
 import Prelude hiding (id,(.))
+#if __GLASGOW_HASKELL__ >= 707
+import GHC.Generics hiding (Infix, Prefix)
+#endif
 
 
 infixr 5 :<
@@ -107,7 +111,7 @@
 -- <https://web.archive.org/web/20161208002902/http://www.cs.le.ac.uk/people/ak155/Papers/CALCO-07/GK07.pdf Higher Dimensional Trees, Algebraically> by Neil Ghani et al.
 data Cofree f a = a :< f (Cofree f a)
 #if __GLASGOW_HASKELL__ >= 707
-  deriving (Typeable)
+  deriving (Typeable, Generic, Generic1)
 
 deriving instance (Typeable f, Data (f (Cofree f a)), Data a) => Data (Cofree f a)
 #endif
diff --git a/src/Control/Comonad/Trans/Cofree.hs b/src/Control/Comonad/Trans/Cofree.hs
--- a/src/Control/Comonad/Trans/Cofree.hs
+++ b/src/Control/Comonad/Trans/Cofree.hs
@@ -5,6 +5,7 @@
 {-# LANGUAGE Rank2Types #-}
 #if __GLASGOW_HASKELL__ >= 707
 {-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
 #endif
 
 -----------------------------------------------------------------------------
@@ -42,21 +43,27 @@
 import Data.Bitraversable
 import Data.Foldable
 import Data.Functor.Identity
-import Data.Semigroup
 import Data.Traversable
 import Control.Monad (liftM)
 import Control.Monad.Trans
 import Control.Monad.Zip
 import Prelude hiding (id,(.))
 import Data.Data
+#if __GLASGOW_HASKELL__ >= 707
+import GHC.Generics hiding (Infix, Prefix)
+#endif
 
+#if !(MIN_VERSION_base(4,8,0))
+import Data.Monoid
+#endif
+
 infixr 5 :<
 
 -- | This is the base functor of the cofree comonad transformer.
 data CofreeF f a b = a :< f b
   deriving (Eq,Ord,Show,Read
 #if __GLASGOW_HASKELL__ >= 707
-           ,Typeable
+           ,Typeable, Generic, Generic1
 #endif
            )
 
@@ -147,7 +154,7 @@
 
 instance (Functor f, ComonadEnv e w) => ComonadEnv e (CofreeT f w) where
   ask = ask . lower
-  {-# INLINE ask #-} 
+  {-# INLINE ask #-}
 
 instance Functor f => ComonadHoist (CofreeT f) where
   cohoist g = CofreeT . fmap (second (cohoist g)) . g . runCofreeT
diff --git a/src/Control/Monad/Free.hs b/src/Control/Monad/Free.hs
--- a/src/Control/Monad/Free.hs
+++ b/src/Control/Monad/Free.hs
@@ -5,6 +5,7 @@
 {-# LANGUAGE Rank2Types #-}
 #if __GLASGOW_HASKELL__ >= 707
 {-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
 {-# LANGUAGE StandaloneDeriving #-}
 #endif
 #include "free-common.h"
@@ -58,6 +59,9 @@
 import Data.Semigroup.Traversable
 import Data.Data
 import Prelude hiding (foldr)
+#if __GLASGOW_HASKELL__ >= 707
+import GHC.Generics
+#endif
 
 -- | The 'Free' 'Monad' for a 'Functor' @f@.
 --
@@ -105,7 +109,7 @@
 -- * @'Free' 'Maybe'@ can be used to model a partiality monad where each layer represents running the computation for a while longer.
 data Free f a = Pure a | Free (f (Free f a))
 #if __GLASGOW_HASKELL__ >= 707
-  deriving (Typeable)
+  deriving (Typeable, Generic, Generic1)
 
 deriving instance (Typeable f, Data (f (Free f a)), Data a) => Data (Free f a)
 #endif
diff --git a/src/Control/Monad/Free/Ap.hs b/src/Control/Monad/Free/Ap.hs
--- a/src/Control/Monad/Free/Ap.hs
+++ b/src/Control/Monad/Free/Ap.hs
@@ -5,6 +5,7 @@
 {-# LANGUAGE Rank2Types #-}
 #if __GLASGOW_HASKELL__ >= 707
 {-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
 #endif
 #include "free-common.h"
 
@@ -68,11 +69,14 @@
 import Data.Semigroup.Traversable
 import Data.Data
 import Prelude hiding (foldr)
+#if __GLASGOW_HASKELL__ >= 707
+import GHC.Generics
+#endif
 
 -- | A free monad given an applicative
 data Free f a = Pure a | Free (f (Free f a))
 #if __GLASGOW_HASKELL__ >= 707
-  deriving (Typeable)
+  deriving (Typeable, Generic, Generic1)
 #endif
 
 #ifdef LIFTED_FUNCTOR_CLASSES
diff --git a/src/Control/Monad/Trans/Free.hs b/src/Control/Monad/Trans/Free.hs
--- a/src/Control/Monad/Trans/Free.hs
+++ b/src/Control/Monad/Trans/Free.hs
@@ -6,6 +6,7 @@
 {-# LANGUAGE Rank2Types #-}
 #if __GLASGOW_HASKELL__ >= 707
 {-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
 #endif
 #include "free-common.h"
 
@@ -66,30 +67,33 @@
 import Control.Monad.Cont.Class
 import Data.Functor.Bind hiding (join)
 import Data.Functor.Classes.Compat
-import Data.Monoid
 import Data.Functor.Identity
 import Data.Traversable
 import Data.Bifunctor
 import Data.Bifoldable
 import Data.Bitraversable
 import Data.Data
+#if __GLASGOW_HASKELL__ >= 707
+import GHC.Generics
+#endif
 
 #if !(MIN_VERSION_base(4,8,0))
 import Data.Foldable
+import Data.Monoid
 #endif
 
 -- | The base functor for a free monad.
 data FreeF f a b = Pure a | Free (f b)
   deriving (Eq,Ord,Show,Read
 #if __GLASGOW_HASKELL__ >= 707
-           ,Typeable
+           ,Typeable ,Generic ,Generic1
 #endif
            )
 
 #ifdef LIFTED_FUNCTOR_CLASSES
 instance Show1 f => Show2 (FreeF f) where
   liftShowsPrec2 spa _sla _spb _slb d (Pure a) =
-    showsUnaryWith spa "Pure" d a 
+    showsUnaryWith spa "Pure" d a
   liftShowsPrec2 _spa _sla spb slb d (Free as) =
     showsUnaryWith (liftShowsPrec spb slb) "Free" d as
 
@@ -333,7 +337,7 @@
   listen (FreeT m) = FreeT $ liftM concat' $ listen (fmap listen `liftM` m)
     where
       concat' (Pure x, w) = Pure (x, w)
-      concat' (Free y, w) = Free $ fmap (second (w <>)) <$> y
+      concat' (Free y, w) = Free $ fmap (second (w `mappend`)) <$> y
   pass m = FreeT . pass' . runFreeT . hoistFreeT clean $ listen m
     where
       clean = pass . liftM (\x -> (x, const mempty))
diff --git a/src/Control/Monad/Trans/Free/Ap.hs b/src/Control/Monad/Trans/Free/Ap.hs
--- a/src/Control/Monad/Trans/Free/Ap.hs
+++ b/src/Control/Monad/Trans/Free/Ap.hs
@@ -6,6 +6,7 @@
 {-# LANGUAGE Rank2Types #-}
 #if __GLASGOW_HASKELL__ >= 707
 {-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
 #endif
 #include "free-common.h"
 
@@ -56,30 +57,33 @@
 import Control.Monad.Cont.Class
 import Data.Functor.Bind hiding (join)
 import Data.Functor.Classes.Compat
-import Data.Monoid
 import Data.Functor.Identity
 import Data.Traversable
 import Data.Bifunctor
 import Data.Bifoldable
 import Data.Bitraversable
 import Data.Data
+#if __GLASGOW_HASKELL__ >= 707
+import GHC.Generics
+#endif
 
 #if !(MIN_VERSION_base(4,8,0))
 import Data.Foldable
+import Data.Monoid
 #endif
 
 -- | The base functor for a free monad.
 data FreeF f a b = Pure a | Free (f b)
   deriving (Eq,Ord,Show,Read
 #if __GLASGOW_HASKELL__ >= 707
-           ,Typeable
+           ,Typeable ,Generic, Generic1
 #endif
            )
 
 #ifdef LIFTED_FUNCTOR_CLASSES
 instance Show1 f => Show2 (FreeF f) where
   liftShowsPrec2 spa _sla _spb _slb d (Pure a) =
-    showsUnaryWith spa "Pure" d a 
+    showsUnaryWith spa "Pure" d a
   liftShowsPrec2 _spa _sla spb slb d (Free as) =
     showsUnaryWith (liftShowsPrec spb slb) "Free" d as
 
@@ -328,7 +332,7 @@
   listen (FreeT m) = FreeT $ liftM concat' $ listen (fmap listen `liftM` m)
     where
       concat' (Pure x, w) = Pure (x, w)
-      concat' (Free y, w) = Free $ fmap (second (w <>)) <$> y
+      concat' (Free y, w) = Free $ fmap (second (w `mappend`)) <$> y
   pass m = FreeT . pass' . runFreeT . hoistFreeT clean $ listen m
     where
       clean = pass . liftM (\x -> (x, const mempty))
diff --git a/src/Control/Monad/Trans/Iter.hs b/src/Control/Monad/Trans/Iter.hs
--- a/src/Control/Monad/Trans/Iter.hs
+++ b/src/Control/Monad/Trans/Iter.hs
@@ -87,7 +87,6 @@
 import Data.Functor.Bind hiding (join)
 import Data.Functor.Classes.Compat
 import Data.Functor.Identity
-import Data.Semigroup
 import Data.Semigroup.Foldable
 import Data.Semigroup.Traversable
 import Data.Typeable
@@ -98,6 +97,10 @@
 import Data.Traversable hiding (mapM)
 #endif
 
+#if !(MIN_VERSION_base(4,11,0))
+import Data.Semigroup
+#endif
+
 -- | The monad supporting iteration based over a base monad @m@.
 --
 -- @
@@ -166,7 +169,7 @@
       goList = liftShowList sp sl
       go d (IterT x) = showsUnaryWith
         (liftShowsPrec (liftShowsPrec2 sp sl go goList) (liftShowList2 sp sl go goList))
-        "IterT" d x     
+        "IterT" d x
 #else
 instance (Functor m, Show1 m) => Show1 (IterT m) where
   showsPrec1 d (IterT m) = showParen (d > 10) $
