diff --git a/servant-serf.cabal b/servant-serf.cabal
--- a/servant-serf.cabal
+++ b/servant-serf.cabal
@@ -1,7 +1,7 @@
 cabal-version: 2.0
 
 name: servant-serf
-version: 0.3.1.2
+version: 0.3.1.3
 synopsis: Automatically generate Servant API modules.
 description:
   = servant-serf
@@ -87,8 +87,8 @@
 library
   autogen-modules: Paths_servant_serf
   build-depends:
-    base >= 4.14.0 && < 4.17
-    , Cabal >= 3.2.0 && < 3.7
+    base >= 4.15.0 && < 4.18
+    , Cabal-syntax >= 3.6.0 && < 3.9
     , directory >= 1.3.6 && < 1.4
     , exceptions >= 0.10.4 && < 0.11
     , filepath >= 1.4.2 && < 1.5
diff --git a/source/library/ServantSerf.hs b/source/library/ServantSerf.hs
--- a/source/library/ServantSerf.hs
+++ b/source/library/ServantSerf.hs
@@ -1,6 +1,7 @@
 module ServantSerf
-  ( ServantSerf.Main.defaultMain
-  , ServantSerf.Main.mainWith
-  ) where
+  ( ServantSerf.Main.defaultMain,
+    ServantSerf.Main.mainWith,
+  )
+where
 
 import qualified ServantSerf.Main
diff --git a/source/library/ServantSerf/Exception/ExtraArgument.hs b/source/library/ServantSerf/Exception/ExtraArgument.hs
--- a/source/library/ServantSerf/Exception/ExtraArgument.hs
+++ b/source/library/ServantSerf/Exception/ExtraArgument.hs
@@ -3,7 +3,7 @@
 import qualified Control.Monad.Catch as Exception
 
 newtype ExtraArgument
-    = ExtraArgument String
-    deriving (Eq, Show)
+  = ExtraArgument String
+  deriving (Eq, Show)
 
 instance Exception.Exception ExtraArgument
diff --git a/source/library/ServantSerf/Exception/InvalidDepth.hs b/source/library/ServantSerf/Exception/InvalidDepth.hs
--- a/source/library/ServantSerf/Exception/InvalidDepth.hs
+++ b/source/library/ServantSerf/Exception/InvalidDepth.hs
@@ -3,7 +3,7 @@
 import qualified Control.Monad.Catch as Exception
 
 newtype InvalidDepth
-    = InvalidDepth String
-    deriving (Eq, Show)
+  = InvalidDepth String
+  deriving (Eq, Show)
 
 instance Exception.Exception InvalidDepth
diff --git a/source/library/ServantSerf/Exception/InvalidModuleName.hs b/source/library/ServantSerf/Exception/InvalidModuleName.hs
--- a/source/library/ServantSerf/Exception/InvalidModuleName.hs
+++ b/source/library/ServantSerf/Exception/InvalidModuleName.hs
@@ -3,7 +3,7 @@
 import qualified Control.Monad.Catch as Exception
 
 newtype InvalidModuleName
-    = InvalidModuleName String
-    deriving (Eq, Show)
+  = InvalidModuleName String
+  deriving (Eq, Show)
 
 instance Exception.Exception InvalidModuleName
diff --git a/source/library/ServantSerf/Exception/InvalidOption.hs b/source/library/ServantSerf/Exception/InvalidOption.hs
--- a/source/library/ServantSerf/Exception/InvalidOption.hs
+++ b/source/library/ServantSerf/Exception/InvalidOption.hs
@@ -3,7 +3,7 @@
 import qualified Control.Monad.Catch as Exception
 
 newtype InvalidOption
-    = InvalidOption String
-    deriving (Eq, Show)
+  = InvalidOption String
+  deriving (Eq, Show)
 
 instance Exception.Exception InvalidOption
diff --git a/source/library/ServantSerf/Exception/MissingArgument.hs b/source/library/ServantSerf/Exception/MissingArgument.hs
--- a/source/library/ServantSerf/Exception/MissingArgument.hs
+++ b/source/library/ServantSerf/Exception/MissingArgument.hs
@@ -3,7 +3,7 @@
 import qualified Control.Monad.Catch as Exception
 
 newtype MissingArgument
-    = MissingArgument String
-    deriving (Eq, Show)
+  = MissingArgument String
+  deriving (Eq, Show)
 
 instance Exception.Exception MissingArgument
diff --git a/source/library/ServantSerf/Exception/UnknownOption.hs b/source/library/ServantSerf/Exception/UnknownOption.hs
--- a/source/library/ServantSerf/Exception/UnknownOption.hs
+++ b/source/library/ServantSerf/Exception/UnknownOption.hs
@@ -3,7 +3,7 @@
 import qualified Control.Monad.Catch as Exception
 
 newtype UnknownOption
-    = UnknownOption String
-    deriving (Eq, Show)
+  = UnknownOption String
+  deriving (Eq, Show)
 
 instance Exception.Exception UnknownOption
diff --git a/source/library/ServantSerf/Main.hs b/source/library/ServantSerf/Main.hs
--- a/source/library/ServantSerf/Main.hs
+++ b/source/library/ServantSerf/Main.hs
@@ -29,8 +29,8 @@
     Exit.exitSuccess
   files <-
     Directory.list (Config.depth $ Context.config context)
-    . FilePath.dropExtension
-    $ Context.source context
+      . FilePath.dropExtension
+      $ Context.source context
   writeFile (Context.output context) $ Module.generate context files
 
 header :: String -> String
diff --git a/source/library/ServantSerf/Module.hs b/source/library/ServantSerf/Module.hs
--- a/source/library/ServantSerf/Module.hs
+++ b/source/library/ServantSerf/Module.hs
@@ -9,43 +9,46 @@
 
 generate :: Context.Context -> [FilePath] -> String
 generate context files =
-  let
-    source = Context.source context
-    config = Context.config context
-    apiName = Config.apiName config
-    serverName = Config.serverName config
-    moduleName = case Config.moduleName config of
-      Nothing ->
-        maybe "Main" ModuleName.toString
-          . ModuleName.fromFilePath
-          $ Context.source context
-      Just x -> ModuleName.toString x
-    suffix = Config.excludeSuffix config
-    moduleNames =
-      (if null suffix then id else filter $ not . List.isSuffixOf suffix)
-        . fmap ModuleName.toString
-        . List.sort
-        . Maybe.mapMaybe ModuleName.fromFilePath
-        $ filter (FilePath.isExtensionOf "hs") files
-  in unlines
-    [ "{-# LINE 1 " <> show source <> " #-}"
-    , "{-# OPTIONS_GHC -w #-}"
-    , ""
-    , "module " <> moduleName <> " where"
-    , ""
-    , "import qualified Servant"
-    , ""
-    , List.intercalate "\n" $ fmap ("import qualified " <>) moduleNames
-    , ""
-    , "type " <> apiName
-    , "\t= " <> if null moduleNames
-      then "Servant.EmptyAPI"
-      else List.intercalate "\n\tServant.:<|> "
-        $ fmap (<> "." <> apiName) moduleNames
-    , ""
-    , serverName
-    , "\t= " <> if null moduleNames
-      then "Servant.emptyServer"
-      else List.intercalate "\n\tServant.:<|> "
-        $ fmap (<> "." <> serverName) moduleNames
-    ]
+  let source = Context.source context
+      config = Context.config context
+      apiName = Config.apiName config
+      serverName = Config.serverName config
+      moduleName = case Config.moduleName config of
+        Nothing ->
+          maybe "Main" ModuleName.toString
+            . ModuleName.fromFilePath
+            $ Context.source context
+        Just x -> ModuleName.toString x
+      suffix = Config.excludeSuffix config
+      moduleNames =
+        (if null suffix then id else filter $ not . List.isSuffixOf suffix)
+          . fmap ModuleName.toString
+          . List.sort
+          . Maybe.mapMaybe ModuleName.fromFilePath
+          $ filter (FilePath.isExtensionOf "hs") files
+   in unlines
+        [ "{-# LINE 1 " <> show source <> " #-}",
+          "{-# OPTIONS_GHC -w #-}",
+          "",
+          "module " <> moduleName <> " where",
+          "",
+          "import qualified Servant",
+          "",
+          List.intercalate "\n" $ fmap ("import qualified " <>) moduleNames,
+          "",
+          "type " <> apiName,
+          "\t= "
+            <> if null moduleNames
+              then "Servant.EmptyAPI"
+              else
+                List.intercalate "\n\tServant.:<|> " $
+                  fmap (<> "." <> apiName) moduleNames,
+          "",
+          serverName,
+          "\t= "
+            <> if null moduleNames
+              then "Servant.emptyServer"
+              else
+                List.intercalate "\n\tServant.:<|> " $
+                  fmap (<> "." <> serverName) moduleNames
+        ]
diff --git a/source/library/ServantSerf/Type/Config.hs b/source/library/ServantSerf/Type/Config.hs
--- a/source/library/ServantSerf/Type/Config.hs
+++ b/source/library/ServantSerf/Type/Config.hs
@@ -9,13 +9,13 @@
 import qualified ServantSerf.Type.ModuleName as ModuleName
 
 data Config = Config
-  { apiName :: String
-  , depth :: Depth.Depth
-  , excludeSuffix :: String
-  , help :: Bool
-  , moduleName :: Maybe ModuleName.ModuleName
-  , serverName :: String
-  , version :: Bool
+  { apiName :: String,
+    depth :: Depth.Depth,
+    excludeSuffix :: String,
+    help :: Bool,
+    moduleName :: Maybe ModuleName.ModuleName,
+    serverName :: String,
+    version :: Bool
   }
   deriving (Eq, Show)
 
@@ -24,25 +24,26 @@
 
 applyFlag :: Exception.MonadThrow m => Config -> Flag.Flag -> m Config
 applyFlag config flag = case flag of
-  Flag.ApiName x -> pure config { apiName = x }
+  Flag.ApiName x -> pure config {apiName = x}
   Flag.Depth x -> case Depth.fromString x of
     Nothing -> Exception.throwM $ InvalidDepth.InvalidDepth x
-    Just y -> pure config { depth = y }
-  Flag.ExcludeSuffix x -> pure config { excludeSuffix = x }
-  Flag.Help -> pure config { help = True }
+    Just y -> pure config {depth = y}
+  Flag.ExcludeSuffix x -> pure config {excludeSuffix = x}
+  Flag.Help -> pure config {help = True}
   Flag.ModuleName x -> case ModuleName.fromString x of
     Nothing -> Exception.throwM $ InvalidModuleName.InvalidModuleName x
-    Just y -> pure config { moduleName = Just y }
-  Flag.ServerName x -> pure config { serverName = x }
-  Flag.Version -> pure config { version = True }
+    Just y -> pure config {moduleName = Just y}
+  Flag.ServerName x -> pure config {serverName = x}
+  Flag.Version -> pure config {version = True}
 
 initial :: Config
-initial = Config
-  { apiName = "API"
-  , depth = Depth.Deep
-  , excludeSuffix = ""
-  , help = False
-  , moduleName = Nothing
-  , serverName = "server"
-  , version = False
-  }
+initial =
+  Config
+    { apiName = "API",
+      depth = Depth.Deep,
+      excludeSuffix = "",
+      help = False,
+      moduleName = Nothing,
+      serverName = "server",
+      version = False
+    }
diff --git a/source/library/ServantSerf/Type/Context.hs b/source/library/ServantSerf/Type/Context.hs
--- a/source/library/ServantSerf/Type/Context.hs
+++ b/source/library/ServantSerf/Type/Context.hs
@@ -10,17 +10,16 @@
 import qualified System.Console.GetOpt as Console
 
 data Context = Context
-  { config :: Config.Config
-  , input :: FilePath
-  , output :: FilePath
-  , source :: FilePath
+  { config :: Config.Config,
+    input :: FilePath,
+    output :: FilePath,
+    source :: FilePath
   }
   deriving (Eq, Show)
 
 fromArguments :: Exception.MonadThrow m => [String] -> m Context
 fromArguments arguments = do
-  let
-    (fs, as, us, is) = Console.getOpt' Console.Permute Flag.options arguments
+  let (fs, as, us, is) = Console.getOpt' Console.Permute Flag.options arguments
   mapM_ (Exception.throwM . UnknownOption.UnknownOption) us
   mapM_ (Exception.throwM . InvalidOption.InvalidOption) is
   c <- Config.fromFlags fs
@@ -30,4 +29,4 @@
     [_, _] -> Exception.throwM $ MissingArgument.MissingArgument "OUTPUT"
     s : i : o : xs -> do
       mapM_ (Exception.throwM . ExtraArgument.ExtraArgument) xs
-      pure Context { config = c, input = i, output = o, source = s }
+      pure Context {config = c, input = i, output = o, source = s}
diff --git a/source/library/ServantSerf/Type/Depth.hs b/source/library/ServantSerf/Type/Depth.hs
--- a/source/library/ServantSerf/Type/Depth.hs
+++ b/source/library/ServantSerf/Type/Depth.hs
@@ -1,9 +1,9 @@
 module ServantSerf.Type.Depth where
 
 data Depth
-    = Deep
-    | Shallow
-    deriving (Eq, Show)
+  = Deep
+  | Shallow
+  deriving (Eq, Show)
 
 fromString :: String -> Maybe Depth
 fromString x = case x of
diff --git a/source/library/ServantSerf/Type/Flag.hs b/source/library/ServantSerf/Type/Flag.hs
--- a/source/library/ServantSerf/Type/Flag.hs
+++ b/source/library/ServantSerf/Type/Flag.hs
@@ -3,50 +3,50 @@
 import qualified System.Console.GetOpt as Console
 
 data Flag
-    = ApiName String
-    | Depth String
-    | ExcludeSuffix String
-    | Help
-    | ModuleName String
-    | ServerName String
-    | Version
-    deriving (Eq, Show)
+  = ApiName String
+  | Depth String
+  | ExcludeSuffix String
+  | Help
+  | ModuleName String
+  | ServerName String
+  | Version
+  deriving (Eq, Show)
 
 options :: [Console.OptDescr Flag]
 options =
   [ Console.Option
-    ['h', '?']
-    ["help"]
-    (Console.NoArg Help)
-    "Shows this help message, then exits."
-  , Console.Option
-    []
-    ["version"]
-    (Console.NoArg Version)
-    "Shows the version number, then exits."
-  , Console.Option
-    []
-    ["api-name"]
-    (Console.ReqArg ApiName "API_NAME")
-    "Sets the name to use for the API type. Defaults to `API`."
-  , Console.Option
-    []
-    ["depth"]
-    (Console.ReqArg Depth "DEPTH")
-    "Controls whether to search through only one directory (`shallow`) or recursively (`deep`). Defaults to `deep`."
-  , Console.Option
-    []
-    ["exclude-suffix"]
-    (Console.ReqArg ExcludeSuffix "SUFFIX")
-    "Sets the module suffix to exclude. Defaults to the empty string."
-  , Console.Option
-    []
-    ["module-name"]
-    (Console.ReqArg ModuleName "MODULE_NAME")
-    "Sets the name of the generated module. By default this is generated from the source file name."
-  , Console.Option
-    []
-    ["server-name"]
-    (Console.ReqArg ServerName "SERVER_NAME")
-    "Sets the name to use for the server value. Defaults to `server`."
+      ['h', '?']
+      ["help"]
+      (Console.NoArg Help)
+      "Shows this help message, then exits.",
+    Console.Option
+      []
+      ["version"]
+      (Console.NoArg Version)
+      "Shows the version number, then exits.",
+    Console.Option
+      []
+      ["api-name"]
+      (Console.ReqArg ApiName "API_NAME")
+      "Sets the name to use for the API type. Defaults to `API`.",
+    Console.Option
+      []
+      ["depth"]
+      (Console.ReqArg Depth "DEPTH")
+      "Controls whether to search through only one directory (`shallow`) or recursively (`deep`). Defaults to `deep`.",
+    Console.Option
+      []
+      ["exclude-suffix"]
+      (Console.ReqArg ExcludeSuffix "SUFFIX")
+      "Sets the module suffix to exclude. Defaults to the empty string.",
+    Console.Option
+      []
+      ["module-name"]
+      (Console.ReqArg ModuleName "MODULE_NAME")
+      "Sets the name of the generated module. By default this is generated from the source file name.",
+    Console.Option
+      []
+      ["server-name"]
+      (Console.ReqArg ServerName "SERVER_NAME")
+      "Sets the name to use for the server value. Defaults to `server`."
   ]
diff --git a/source/library/ServantSerf/Type/ModuleName.hs b/source/library/ServantSerf/Type/ModuleName.hs
--- a/source/library/ServantSerf/Type/ModuleName.hs
+++ b/source/library/ServantSerf/Type/ModuleName.hs
@@ -7,8 +7,8 @@
 import qualified System.FilePath as FilePath
 
 newtype ModuleName
-    = ModuleName Cabal.ModuleName
-    deriving (Eq, Ord, Show)
+  = ModuleName Cabal.ModuleName
+  deriving (Eq, Ord, Show)
 
 toString :: ModuleName -> String
 toString (ModuleName x) = Cabal.display x
