diff --git a/Util.hs b/Util.hs
--- a/Util.hs
+++ b/Util.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE Safe #-}
 module Util where
 
 import Control.Applicative
@@ -108,8 +109,9 @@
 mtimesA n = unAp . stimes n . Ap
 
 newtype Ap p a = Ap { unAp :: p a }
-  deriving (Functor, Applicative, Monad, Alternative, MonadPlus, Foldable, Traversable,
-            Eq1, Ord1, Read1, Show1, Eq, Ord, Read, Show, Bounded, Enum)
+  deriving (Foldable, Functor, Traversable)
+  deriving (Eq, Ord, Read, Show, Bounded, Enum) via p a
+  deriving (Applicative, Monad, Alternative, MonadPlus, Eq1, Ord1, Read1, Show1) via p
 instance (Applicative p, Semigroup a) => Semigroup (Ap p a) where (<>) = liftA2 (<>)
 instance (Applicative p, Semigroup a, Monoid a) => Monoid (Ap p a) where
     mempty = pure mempty
diff --git a/Util/Bits.hs b/Util/Bits.hs
--- a/Util/Bits.hs
+++ b/Util/Bits.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE Safe #-}
 module Util.Bits where
 
 import Control.Applicative
diff --git a/Util/List.hs b/Util/List.hs
--- a/Util/List.hs
+++ b/Util/List.hs
@@ -1,5 +1,5 @@
 {-# LANGUAGE ViewPatterns #-}
-
+{-# LANGUAGE Safe #-}
 module Util.List where
 
 import Control.Applicative
diff --git a/util.cabal b/util.cabal
--- a/util.cabal
+++ b/util.cabal
@@ -1,5 +1,5 @@
 name:                util
-version:             0.1.14.0
+version:             0.1.14.1
 synopsis:            Utilities
 -- description:         
 license:             BSD3
@@ -25,8 +25,6 @@
   default-extensions:  NoImplicitPrelude
                      , LambdaCase
                      , MonadComprehensions
-                     , GeneralizedNewtypeDeriving
-                     , DeriveFunctor
-                     , DeriveFoldable
-                     , DeriveTraversable
+                     , DerivingVia
+                     , DeriveFoldable, DeriveFunctor, DeriveTraversable
   ghc-options:         -Wall -Wno-name-shadowing
