diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,10 @@
 Changelog for CmdArgs
 
+0.10.22, released 2023-03-13
+    #68, support GHC 9.6
+0.10.21, released 2021-02-14
+    Handle GHC 9.0 optimisations
+    Remove support for GHC 7.4 to 7.8
 0.10.20, released 2018-01-22
     #54, use the getopt data types from base
 0.10.19, released 2018-01-01
diff --git a/Data/Generics/Any/Prelude.hs b/Data/Generics/Any/Prelude.hs
--- a/Data/Generics/Any/Prelude.hs
+++ b/Data/Generics/Any/Prelude.hs
@@ -46,7 +46,9 @@
 
 
 isString x = typeName x == "[Char]"
-isList x = typeShell x == "[]"
+-- GHC 9.6 changes from [] to List, so accept either
+isList x = ts == "[]" || ts == "List"
+    where ts = typeShell x
 isMaybe x = typeShell x == "Maybe"
 isTuple x = isJust $ readTupleType $ typeShell x
 
diff --git a/LICENSE b/LICENSE
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright Neil Mitchell 2009-2018.
+Copyright Neil Mitchell 2009-2023.
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# CmdArgs: Easy Command Line Processing [![Hackage version](https://img.shields.io/hackage/v/cmdargs.svg?label=Hackage)](https://hackage.haskell.org/package/cmdargs) [![Build Status](https://img.shields.io/travis/ndmitchell/cmdargs.svg)](https://travis-ci.org/ndmitchell/cmdargs)
+# CmdArgs: Easy Command Line Processing [![Hackage version](https://img.shields.io/hackage/v/cmdargs.svg?label=Hackage)](https://hackage.haskell.org/package/cmdargs) [![Stackage version](https://www.stackage.org/package/cmdargs/badge/nightly?label=Stackage)](https://www.stackage.org/package/cmdargs) [![Build status](https://img.shields.io/github/workflow/status/ndmitchell/cmdargs/ci/master.svg)](https://github.com/ndmitchell/cmdargs/actions)
 
 CmdArgs is a Haskell library for defining command line parsers. The two features that make it a better choice than the standard [getopt library](http://haskell.org/ghc/docs/latest/html/libraries/base/System-Console-GetOpt.html) are:
 
@@ -16,10 +16,10 @@
 ```
 Despite being very concise, this processor is already fairly well featured:
 
-    $ runhaskell Sample.hs --hello=world
+    $ runghc Sample.hs --hello=world
     Sample {hello = "world"}
 
-    $ runhaskell Sample.hs --help
+    $ runghc Sample.hs --help
     Sample v1, (C) Neil Mitchell 2009
 
     sample [FLAG]
@@ -67,13 +67,13 @@
 
 Now we have a reasonably functional command line argument processor. Some sample interactions are:
 
-    $ runhaskell Sample.hs --hello=world
+    $ runghc Sample.hs --hello=world
     Sample {hello = "world"}
 
-    $ runhaskell Sample.hs --version
+    $ runghc Sample.hs --version
     The sample program
 
-    $ runhaskell Sample.hs --help
+    $ runghc Sample.hs --help
     The sample program
 
     sample [OPTIONS]
@@ -116,13 +116,13 @@
 ```
 Compared to the first example, we now have multiple constructors, and a sample value for each constructor is passed to `cmdArgs`. Some sample interactions with this command line are:
 
-    $ runhaskell Sample.hs hello --whom=world
+    $ runghc Sample.hs hello --whom=world
     Hello {whom = "world"}
 
-    $ runhaskell Sample.hs goodbye
+    $ runghc Sample.hs goodbye
     Goodbye
 
-    $ runhaskell Sample.hs --help
+    $ runghc Sample.hs --help
     The sample program
 
     sample [OPTIONS]
diff --git a/Setup.hs b/Setup.hs
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,4 +1,2 @@
-#! /usr/bin/runhaskell
-
 import Distribution.Simple
 main = defaultMain
diff --git a/System/Console/CmdArgs/Annotate.hs b/System/Console/CmdArgs/Annotate.hs
--- a/System/Console/CmdArgs/Annotate.hs
+++ b/System/Console/CmdArgs/Annotate.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE PatternGuards, ScopedTypeVariables, ExistentialQuantification, DeriveDataTypeable #-}
+{-# OPTIONS_GHC -O0 #-}
 
 -- | This module captures annotations on a value, and builds a 'Capture' value.
 --   This module has two ways of writing annotations:
diff --git a/System/Console/CmdArgs/Explicit.hs b/System/Console/CmdArgs/Explicit.hs
--- a/System/Console/CmdArgs/Explicit.hs
+++ b/System/Console/CmdArgs/Explicit.hs
@@ -119,7 +119,7 @@
                         Left err -> do
                             hPutStrLn stderr $ "Error when running helper " ++ cmd
                             hPutStrLn stderr err
-                            exitFailure               
+                            exitFailure
                         Right args -> processValueIO m args
 
 
@@ -173,7 +173,7 @@
             Right (a,b) -> Right $ f a b v
 
         format :: String -> Either String (HelpFormat,TextFormat)
-        format xs = foldl (\acc x -> either Left (f x) acc) (Right def) (sep xs)
+        format xs = foldl (\acc x -> f x =<< acc) (Right def) (sep xs)
             where
                 sep = words . map (\x -> if x `elem` ":," then ' ' else toLower x)
                 f x (a,b) = case x of
diff --git a/System/Console/CmdArgs/Explicit/Complete.hs b/System/Console/CmdArgs/Explicit/Complete.hs
--- a/System/Console/CmdArgs/Explicit/Complete.hs
+++ b/System/Console/CmdArgs/Explicit/Complete.hs
@@ -60,7 +60,7 @@
 
 
 pickBy :: (a -> [String]) -> String -> [a] -> Maybe a
-pickBy f name xs = find (\x -> name `elem` f x) xs `mplus` 
+pickBy f name xs = find (\x -> name `elem` f x) xs `mplus`
                    find (\x -> any (name `isPrefixOf`) (f x)) xs
 
 
@@ -98,9 +98,9 @@
 
 
 expectArgFlagMode :: [Mode a] -> Maybe (Arg a) -> [Flag a] -> String -> [Complete]
-expectArgFlagMode mode arg flag x
-    | "-" `isPrefixOf` x = expectFlag flag x ++ [CompleteValue "-" | x == "-", isJust arg]
-    | otherwise = expectMode mode x ++ expectArg arg x ++ expectFlag flag x
+expectArgFlagMode mode arg flag x =
+    (if "-" `isPrefixOf` x then [] else expectMode mode x) ++
+    expectArgFlag arg flag x
 
 expectArgFlag :: Maybe (Arg a) -> [Flag a] -> String -> [Complete]
 expectArgFlag arg flag x
diff --git a/System/Console/CmdArgs/Explicit/Process.hs b/System/Console/CmdArgs/Explicit/Process.hs
--- a/System/Console/CmdArgs/Explicit/Process.hs
+++ b/System/Console/CmdArgs/Explicit/Process.hs
@@ -23,7 +23,7 @@
             | null (fst $ modeArgs m) && isNothing (snd $ modeArgs m) && args /= [] &&
               not (null $ modeModes m) && not ("-" `isPrefixOf` concat args)
                 -> Left $ missing "mode" $ concatMap modeNames $ modeModes m
-            | otherwise -> either Left (modeCheck m) $ processFlags m (modeValue m) args
+            | otherwise -> modeCheck m =<< processFlags m (modeValue m) args
     where
         (find,a,as) = case args of
             [] -> (NotFound,"",[])
@@ -147,4 +147,3 @@
         (xs,_) -> Ambiguous $ map fst xs
     where
         match op = [(head ys,v) | (xs,v) <- names, let ys = filter (op value) xs, ys /= []]
-    
diff --git a/System/Console/CmdArgs/Explicit/Type.hs b/System/Console/CmdArgs/Explicit/Type.hs
--- a/System/Console/CmdArgs/Explicit/Type.hs
+++ b/System/Console/CmdArgs/Explicit/Type.hs
@@ -165,11 +165,11 @@
     where
         checkGroup :: Group a -> Maybe String
         checkGroup x = msum
-            [check "Empty group name" $ all (not . null . fst) $ groupNamed x
-            ,check "Empty group contents" $ all (not . null . snd) $ groupNamed x]
+            [check "Empty group name" $ not $ any (null . fst) $ groupNamed x
+            ,check "Empty group contents" $ not $ any (null . snd) $ groupNamed x]
 
         checkNames :: String -> [Name] -> Maybe String
-        checkNames msg xs = check "Empty names" (all (not . null) xs) `mplus` do
+        checkNames msg xs = check "Empty names" (not (any null xs)) `mplus` do
             bad <- listToMaybe $ xs \\ nub xs
             let dupe = filter (== bad) xs
             return $ "Sanity check failed, multiple " ++ msg ++ ": " ++ unwords (map show dupe)
diff --git a/System/Console/CmdArgs/Helper.hs b/System/Console/CmdArgs/Helper.hs
--- a/System/Console/CmdArgs/Helper.hs
+++ b/System/Console/CmdArgs/Helper.hs
@@ -264,7 +264,7 @@
     unpack x = let y = ctor "Group" x in Group
         {groupUnnamed = get "groupUnnamed" y
         ,groupHidden = get "groupHidden" y
-        ,groupNamed = get "groupNamed" y}       
+        ,groupNamed = get "groupNamed" y}
 
 instance Packer a => Packer (Mode a) where
     pack Mode{..} = Ctor "Mode"
diff --git a/System/Console/CmdArgs/Implicit.hs b/System/Console/CmdArgs/Implicit.hs
--- a/System/Console/CmdArgs/Implicit.hs
+++ b/System/Console/CmdArgs/Implicit.hs
@@ -14,13 +14,13 @@
     @main = print =<< 'cmdArgs' sample@
 
     Attributes are used to control a number of behaviours:
-    
+
     * The help message: 'help', 'typ', 'details', 'summary', 'program', 'groupname'
-    
+
     * Flag behaviour: 'opt', 'enum', 'verbosity', 'ignore'
-    
+
     * Flag name assignment: 'name', 'explicit'
-    
+
     * Controlling non-flag arguments: 'args', 'argPos'
 
     * multi-mode programs: 'modes', 'auto'
@@ -56,7 +56,7 @@
 
     All the examples are written using impure annotations. To convert to pure
     annotations follow the rules:
-    
+
     > Ctor {field1 = value1 &= ann1, field2 = value2} &= ann2 ==> record Ctor{} [field1 := value1 += ann1, field2 := value2] += ann2
     > Ctor (value1 &= ann1) value2 &= ann2 ==> record Ctor{} [atom value1 += ann1, atom value2] += ann2
     > modes [Ctor1{...}, Ctor2{...}] ==> modes_ [record Ctor1{} [...], record Ctor2{} [...]]
diff --git a/System/Console/CmdArgs/Implicit/Global.hs b/System/Console/CmdArgs/Implicit/Global.hs
--- a/System/Console/CmdArgs/Implicit/Global.hs
+++ b/System/Console/CmdArgs/Implicit/Global.hs
@@ -229,7 +229,7 @@
         isFlag_ _ = False
 
 
-asName s = map (\x -> if x == '_' then '-' else toLower x) $ if last s == '_' then init s else s 
+asName s = map (\x -> if x == '_' then '-' else toLower x) $ if last s == '_' then init s else s
 
 -- have are already assigned, want are a list of ones I might want
 data Names = Names {have :: [String], want :: [String]}
diff --git a/System/Console/CmdArgs/Quote.hs b/System/Console/CmdArgs/Quote.hs
--- a/System/Console/CmdArgs/Quote.hs
+++ b/System/Console/CmdArgs/Quote.hs
@@ -13,7 +13,7 @@
 -- > $(cmdArgsQuote [d|
 -- >     sample = Sample{hello = def &=# help "World argument" &=# opt "world"}
 -- >                    &=# summary "Sample v1"
--- > 
+-- >
 -- >     run = cmdArgs# sample :: IO Sample
 -- >     |])
 -- >
@@ -114,7 +114,7 @@
                 bind = [ValD (VarP name) (NormalB val) [] | (name,val) <- zip names vals]
                 args = [anns (VarE 'atom `AppE` VarE name) as | (name,as) <- zip names ass]
             return $ LetE bind $ VarE 'record `AppE` (ConE x `apps` map VarE names) `AppE` ListE args
-        
+
         f x = descendM f x
 
         apps x [] = x
@@ -171,7 +171,7 @@
             where
                 -- create an environment where everything in ns is missing, recursively drop one thing each time
                 without ns new = [(n, exp (new2 ++ env) e) | (n,e) <- new, n `notElem` ns, let new2 = without (n:ns) new]
-                
+
 
         dec env (FunD n cs) = FunD n $ map (clause env) cs
         dec env (ValD p x ds) = ValD p (body (addEnv ds env) x) ds
diff --git a/System/Console/CmdArgs/Test/Implicit/Diffy.hs b/System/Console/CmdArgs/Test/Implicit/Diffy.hs
--- a/System/Console/CmdArgs/Test/Implicit/Diffy.hs
+++ b/System/Console/CmdArgs/Test/Implicit/Diffy.hs
@@ -70,4 +70,3 @@
     completion [] (0,0) [CompleteValue "create",CompleteValue "diff",CompleteValue "--out",CompleteValue "--help",CompleteValue "--version",CompleteValue "--numeric-version"]
     completion ["d"] (0,1) [CompleteValue "diff"]
     completion ["dd"] (0,2) []
-
diff --git a/System/Console/CmdArgs/Test/Implicit/Maker.hs b/System/Console/CmdArgs/Test/Implicit/Maker.hs
--- a/System/Console/CmdArgs/Test/Implicit/Maker.hs
+++ b/System/Console/CmdArgs/Test/Implicit/Maker.hs
@@ -47,7 +47,7 @@
         ] += help "Run the test suite"
 
     build = record Build{}
-        [threads_ 
+        [threads_
         ,enum_ method
             [atom Release += help "Release build"
             ,atom Debug += help "Debug build"
diff --git a/System/Console/CmdArgs/Test/Implicit/Tests.hs b/System/Console/CmdArgs/Test/Implicit/Tests.hs
--- a/System/Console/CmdArgs/Test/Implicit/Tests.hs
+++ b/System/Console/CmdArgs/Test/Implicit/Tests.hs
@@ -1,5 +1,5 @@
 {-# LANGUAGE DeriveDataTypeable, RecordWildCards, TemplateHaskell, MagicHash #-}
-{-# OPTIONS_GHC -fno-warn-missing-fields -fno-warn-unused-binds #-}
+{-# OPTIONS_GHC -fno-warn-missing-fields -fno-warn-unused-binds -fno-cse #-}
 
 module System.Console.CmdArgs.Test.Implicit.Tests(test, demos) where
 
@@ -44,7 +44,7 @@
     ["--listbool","--listbool=true","--listbool=false"] === def1{listBool=[True,True,False]}
     ["--int64=12"] === def1{int64=12}
     fails ["--listbool=fred"]
-    invalid $ \_ -> def1{listBool = def &= opt "yes"}
+    invalid $ const def1{listBool = def &= opt "yes"}
 
 
 -- from bug #230
diff --git a/System/Console/CmdArgs/Test/Implicit/Util.hs b/System/Console/CmdArgs/Test/Implicit/Util.hs
--- a/System/Console/CmdArgs/Test/Implicit/Util.hs
+++ b/System/Console/CmdArgs/Test/Implicit/Util.hs
@@ -110,4 +110,3 @@
 matchLine (x:xs) (y:ys) | x == y = matchLine xs ys
 matchLine [] [] = True
 matchLine _ _ = False
-
diff --git a/System/Console/CmdArgs/Test/SplitJoin.hs b/System/Console/CmdArgs/Test/SplitJoin.hs
--- a/System/Console/CmdArgs/Test/SplitJoin.hs
+++ b/System/Console/CmdArgs/Test/SplitJoin.hs
@@ -28,7 +28,7 @@
     writeFile src "import System.Environment\nmain = print =<< getArgs\n"
     quickCheckWith stdArgs{chatty=False} $ \(CmdLine x) -> unsafePerformIO $ do
         putStr $ ",(,) " ++ (show x) ++ " "
-        system $ "runhaskell \"" ++ src ++ "\" " ++ x
+        system $ "runghc \"" ++ src ++ "\" " ++ x
         return True
 
 
@@ -45,104 +45,105 @@
 -- * Slow to run through the command line
 -- * Can't figure out how to read the output, without adding more escaping (which breaks the test)
 tests =
-    [(,) "" []
-    ,(,) "c" ["c"]
-    ,(,) "b" ["b"]
-    ,(,) "\\" ["\\"]
-    ,(,) "'//" ["'//"]
-    ,(,) "a" ["a"]
-    ,(,) "cda" ["cda"]
-    ,(,) "b'" ["b'"]
-    ,(,) "" []
-    ,(,) " " []
-    ,(,) "/b" ["/b"]
-    ,(,) "\"b/\"d a'b'b" ["b/d","a'b'b"]
-    ,(,) "d'c a\"/\\" ["d'c","a/\\"]
-    ,(,) "d" ["d"]
-    ,(,) "bb' " ["bb'"]
-    ,(,) "b'\\" ["b'\\"]
-    ,(,) "\"\\ac" ["\\ac"]
-    ,(,) "\\'\"abbb\"c/''' \\ c" ["\\'abbbc/'''","\\","c"]
-    ,(,) "/bbdbb a " ["/bbdbb","a"]
-    ,(,) "b\" d" ["b d"]
-    ,(,) "" []
-    ,(,) "\\cc/''\\b\\ccc\\'\\b\\" ["\\cc/''\\b\\ccc\\'\\b\\"]
-    ,(,) "/" ["/"]
-    ,(,) "///\"b\\c/b\"cd//c'\"" ["///b\\c/bcd//c'"]
-    ,(,) "\\\"d\\\\' /d\\\\/bb'a /\\d" ["\"d\\\\'","/d\\\\/bb'a","/\\d"]
-    ,(,) "c/ \\''/c b\\'" ["c/","\\''/c","b\\'"]
-    ,(,) "dd'b\\\\\\' /c'aaa\"" ["dd'b\\\\\\'","/c'aaa"]
-    ,(,) "b'd''\\/ b\\'b'db/'cd " ["b'd''\\/","b\\'b'db/'cd"]
-    ,(,) "a\"ba\\/\\ " ["aba\\/\\ "]
-    ,(,) "b\"'dd'c /b/c\"bbd \"\"\\ad'\"c\\\"" ["b'dd'c /b/cbbd","\\ad'c\""]
-    ,(,) "da 'c\\\\acd/'dbaaa///dccbc a \\" ["da","'c\\\\acd/'dbaaa///dccbc","a","\\"]
-    ,(,) "a'ac \"da\"" ["a'ac","da"]
-    ,(,) "\"'\\\"/\"\"b\\b  \"'\"\"ccd'a\"/c /da " ["'\"/\"b\\b","'\"ccd'a/c /da "]
-    ,(,) "d\"\\c\\\\cb c/\"aa' b\"\\/d \"'c c/" ["d\\c\\\\cb c/aa'","b\\/d 'c","c/"]
-    ,(,) "dbc\\/\"\"//c/\"accda" ["dbc\\///c/accda"]
-    ,(,) "aca a'' \\ c b'\\/d\\" ["aca","a''","\\","c","b'\\/d\\"]
-    ,(,) "dc\"bc/a\\ccdd\\\\aad\\c'ab '\\cddcdba" ["dcbc/a\\ccdd\\\\aad\\c'ab '\\cddcdba"]
-    ,(,) " c'\"ba \"b\\dc\"" ["c'ba b\\dc"]
-    ,(,) "a\\acd/a \"'c /'c'" ["a\\acd/a","'c /'c'"]
-    ,(,) " ac ddc/\"\"a/\\bd\\d c'cac\"c\\a/a''c" ["ac","ddc/a/\\bd\\d","c'cacc\\a/a''c"]
-    ,(,) "b/cd\"//bb\"/daaab/  b b \"'     d\"a\" 'd b" ["b/cd//bb/daaab/","b","b","'     da 'd b"]
-    ,(,) "a\"cc'cd\"\\'ad '\"dcc acb\"\\\\" ["acc'cd\\'ad","'dcc acb\\\\"]
-    ,(,) "/bc/bc'/\"d  \"a/\"\\ad aba\\da" ["/bc/bc'/d  a/\\ad aba\\da"]
-    ,(,) "b\\a" ["b\\a"]
-    ,(,) "/dc ''c'a\"'/'\\ /'cd\\'d/'db/b\"' cabacaaa\"\"dd" ["/dc","''c'a'/'\\ /'cd\\'d/'db/b'","cabacaaadd"]
-    ,(,) "\"ac\\\"c'/c'b\"b\"b'd\"c\"\"" ["ac\"c'/c'bbb'dc"]
-    ,(,) "/ 'ccc\"d\\dc'\"'\\  b" ["/","'cccd\\dc''\\","b"]
-    ,(,) "  '\"/\\cc\\/c '\\\\" ["'/\\cc\\/c '\\\\"]
-    ,(,) "\\ \\' ' /d  \"cc\\\\//da\"d'a/a\"ca\\\\\"\\cb c\"d'b 'acb" ["\\","\\'","'","/d","cc\\\\//dad'a/aca\\\\cb","cd'b 'acb"]
-    ,(,) "a\"\"d'\"a\"\\ \\c db'da/d\\c\"a/ aa c/db" ["ad'a\\","\\c","db'da/d\\ca/ aa c/db"]
-    ,(,) " d\\" ["d\\"]
-    ,(,) "d c b'/\\/'\"/'a'aa\"a\"/ad\\/" ["d","c","b'/\\/'/'a'aaa/ad\\/"]
-    ,(,) "  a \\' /" ["a","\\'","/"]
-    ,(,) "'/ c" ["'/","c"]
-    ,(,) "acd 'bcab /ba'daa'/ba/\"dcdadbcacb" ["acd","'bcab","/ba'daa'/ba/dcdadbcacb"]
-    ,(,) "a\\\"dd'a c\"a\"\"ac\\" ["a\"dd'a","ca\"ac\\"]
-    ,(,) "\"dba /'bb\\ d ba '/c' \"dd\\' cbcd c /b/\\b///" ["dba /'bb\\ d ba '/c' dd\\'","cbcd","c","/b/\\b///"]
-    ,(,) "a'c/c \"ccb '/d\\abd/bc  " ["a'c/c","ccb '/d\\abd/bc  "]
-    ,(,) "\\da\"\\//add\\\\ c" ["\\da\\//add\\\\ c"]
-    ,(,) "c/\\\"//  a/\"ac\"//''ba\"c/\\bc\\\"d\"bc/d" ["c/\"//","a/ac//''bac/\\bc\"dbc/d"]
-    ,(,) "/d/ a   dc'\\ \"" ["/d/","a","dc'\\",""]
-    ,(,) " \"dc//b\\cd/ \\ac\"b\"b\"d\"\"\"dd\"\" ' a\\'/ \"/'/\\a/abd\\ddd" ["dc//b\\cd/ \\acbbd\"dd","'","a\\'/","/'/\\a/abd\\ddd"]
-    ,(,) "\\'  ' d\"b bbc" ["\\'","'","db bbc"]
-    ,(,) "'ba\\a'db/bd d\\'b\\ \\/a'da' " ["'ba\\a'db/bd","d\\'b\\","\\/a'da'"]
-    ,(,) "\\b\\cc\"\"d' dd ddcb\"d" ["\\b\\ccd'","dd","ddcbd"]
-    ,(,) "d\"dc'\\d\"/'\\\"b\\c'c\" db' \\'b/\"a' / da'\"/ab'\\ c\\bc\\//dbcb\\" ["ddc'\\d/'\"b\\c'c db' \\'b/a'","/","da'/ab'\\ c\\bc\\//dbcb\\"]
-    ,(,) " b ddbbbbc\"da\\c\"'\\" ["b","ddbbbbcda\\c'\\"]
-    ,(,) "b/\"d dacd'/'\\\"''a a /'\\c'b ab\\  dda\\c'abdd'a\"//d \\\\\\ d\"\"" ["b/d dacd'/'\"''a a /'\\c'b ab\\  dda\\c'abdd'a//d","\\\\\\","d"]
-    ,(,) "/c\"\" dd'a'/b\\/'\"'/" ["/c","dd'a'/b\\/''/"]
-    ,(,) "/\"'\"\"'cc a a\\dd''\\'b" ["/'\"'cc","a","a\\dd''\\'b"]
-    ,(,) "c\"dcd''aba\" \" /'" ["cdcd''aba"," /'"]
-    ,(,) "'\"/''\\\\d'/ad\\baadabdca\\ /\\'''bd\\/\"'/' aca \\  \\a'\\ cd\"d /bdcd''cac" ["'/''\\\\d'/ad\\baadabdca\\ /\\'''bd\\/'/'","aca","\\","\\a'\\","cdd /bdcd''cac"]
-    ,(,) "\" /\"da" [" /da"]
-    ,(,) "'\"ca/'d/d/d\\ca\"/\"\" ddac cc\" ''a c''bd\"bc'dc\\/\"b\"a\\\"\"a/\\ " ["'ca/'d/d/d\\ca/","ddac","cc ''a c''bdbc'dc\\/ba\"a/\\ "]
-    ,(,) "\\\\d'ad ' ''\"cd/a \"\"\\'\\\"'dc\\" ["\\\\d'ad","'","''cd/a \"\\'\"'dc\\"]
-    ,(,) " ab  c'\\a" ["ab","c'\\a"]
-    ,(,) "b" ["b"]
-    ,(,) "''c dc c\\'d'ab'd\"\\\"cca\"b'da\"dbcdbd\"cd'/d \\cd'\"d  \"\"b cdc''/\\\"b'" ["''c","dc","c\\'d'ab'd\"ccab'dadbcdbdcd'/d","\\cd'd  \"b","cdc''/\"b'"]
-    ,(,) " \"'cb dbddbdd/" ["'cb dbddbdd/"]
-    ,(,) "a/\"d// dd/cc/\"cc\"d\" d\\/a a \\c\"  \\\\/\"\\ bcc'ac'\"\\c//d\"da/\\aac\\b\"c/'b\"\"bbd/\\" ["a/d// dd/cc/ccd","d\\/a","a","\\c  \\\\/\\","bcc'ac'\\c//dda/\\aac\\bc/'b\"bbd/\\"]
-    ,(,) "b\"ddccd\"a\"/ba\"" ["bddccda/ba"]
-    ,(,) " \"  c/b/'/bdd  cb d'c a'\"'a d\\\\db//\\\"' c'/'c\\/aa" ["  c/b/'/bdd  cb d'c a''a","d\\\\db//\"'","c'/'c\\/aa"]
-    ,(,) "\\caab" ["\\caab"]
-    ,(,) "bb\"'\"/d'bad 'd\\/'\\b//\\\\ \\d''c\"c b\\b/\\" ["bb'/d'bad","'d\\/'\\b//\\\\","\\d''cc b\\b/\\"]
-    ,(,) " c'a\"  \\cab\"bd\"dcd\"/cb/\"\"b\"b'\"d" ["c'a  \\cabbddcd/cb/bb'd"]
-    ,(,) "\\/ \"c'ca" ["\\/","c'ca"]
-    ,(,) "  d' /c'bc\"'/'\\\\dca'cc\"'\"''/d cb//'a \"bd ab\"dcaadc\\\"'d\\\"/a\"a\\\"ba//b/ d/dbac/d\\caa\"bc/ " ["d'","/c'bc'/'\\\\dca'cc'''/d cb//'a bd","abdcaadc\"'d\"/aa\"ba//b/","d/dbac/d\\caabc/ "]
-    ,(,) "/\"\\db'd/ ca\"ad b\\\\\"cd/a bbc\\ " ["/\\db'd/ caad","b\\cd/a bbc\\ "]
-    ,(,) "cdc bd'/\"c''c d \\\"aa \\d\\ bb'b/ /b/a/c'acda\\'\"\"c \"bbbaa/'/a \\aca\"'/ac' " ["cdc","bd'/c''c d \"aa \\d\\ bb'b/ /b/a/c'acda\\'\"c","bbbaa/'/a \\aca'/ac'"]
-    ,(,) "ad/'b\\d /cc\"\"ab \\ \"'  ''b\\\"/\\  a\"'d\"\\ddacdbbabb b b  //' acd\"c\\d'd\\b\"'\\\"aaba/bda/c'// \\b" ["ad/'b\\d","/ccab","\\","'  ''b\"/\\  a'd\\ddacdbbabb b b  //' acdc\\d'd\\b'\"aaba/bda/c'// \\b"]
-    ,(,) "bac cc \"ac\"/ca/ '\"\" b/b d /cd'\\'bb\" \\ \"b '/ b c ' c''\"a/ad\\ " ["bac","cc","ac/ca/","'","b/b","d","/cd'\\'bb \\ b","'/","b","c","'","c''a/ad\\ "]
-    ,(,) "baa'  b'b''\\dab/'c" ["baa'","b'b''\\dab/'c"]
-    ,(,) "cb\\\\ " ["cb\\\\"]
-    ,(,) "/b'a''d\"b\"   'c'b ba\\'b\" bb" ["/b'a''db","'c'b","ba\\'b bb"]
-    ,(,) "b /\"ca\\cbac " ["b","/ca\\cbac "]
-    ,(,) " \"\"/\"bcaa\"\"a' \\/bb \"a\\\"'\"" ["/bcaa\"a'","\\/bb","a\"'"]
-    ,(,) "\"c /''c\"\\badc/\\daa/\\ c\"a c\\ \\/cab \"b\"\\ ba\"\"/d/cd'a ad'c/ad\"' a\\d/d\\c\\'cdccd/\"a'/\"b///ac\"" ["c /''c\\badc/\\daa/\\","ca c\\ \\/cab b\\ ba\"/d/cd'a","ad'c/ad' a\\d/d\\c\\'cdccd/a'/b///ac"]
-    ,(,) "/cbbd\"/b' /dd\"/c\\ca/'\"\\ cc  \\d\"aca/\"b caa\\d\\'\"b'b  dc\"cd\\'c\" 'd/ac\"cacc\"" ["/cbbd/b' /dd/c\\ca/'\\ cc  \\daca/b caa\\d\\'b'b","dccd\\'c","'d/accacc"]
-    ,(,) "bc/bd\\ca\\bcacca\"\"\\c/\\ /\"\"a/\"c'//b'\\d/a/'ab/cbd/cacb//b \\d\"aac\\d'\"/" ["bc/bd\\ca\\bcacca\\c/\\","/a/c'//b'\\d/a/'ab/cbd/cacb//b \\daac\\d'/"]
-    ,(,) "bbac bdc/d\\\"/db\"dbdb\"a \" /\"/'a\\acacbcc c'//\\//b\"ca\"bcca c\\/aaa/c/bccbccaa  \"\" cdccc/bddcbc c''" ["bbac","bdc/d\"/dbdbdba"," //'a\\acacbcc","c'//\\//bcabcca","c\\/aaa/c/bccbccaa","","cdccc/bddcbc","c''"]
+    [f "" []
+    ,f "c" ["c"]
+    ,f "b" ["b"]
+    ,f "\\" ["\\"]
+    ,f "'//" ["'//"]
+    ,f "a" ["a"]
+    ,f "cda" ["cda"]
+    ,f "b'" ["b'"]
+    ,f "" []
+    ,f " " []
+    ,f "/b" ["/b"]
+    ,f "\"b/\"d a'b'b" ["b/d","a'b'b"]
+    ,f "d'c a\"/\\" ["d'c","a/\\"]
+    ,f "d" ["d"]
+    ,f "bb' " ["bb'"]
+    ,f "b'\\" ["b'\\"]
+    ,f "\"\\ac" ["\\ac"]
+    ,f "\\'\"abbb\"c/''' \\ c" ["\\'abbbc/'''","\\","c"]
+    ,f "/bbdbb a " ["/bbdbb","a"]
+    ,f "b\" d" ["b d"]
+    ,f "" []
+    ,f "\\cc/''\\b\\ccc\\'\\b\\" ["\\cc/''\\b\\ccc\\'\\b\\"]
+    ,f "/" ["/"]
+    ,f "///\"b\\c/b\"cd//c'\"" ["///b\\c/bcd//c'"]
+    ,f "\\\"d\\\\' /d\\\\/bb'a /\\d" ["\"d\\\\'","/d\\\\/bb'a","/\\d"]
+    ,f "c/ \\''/c b\\'" ["c/","\\''/c","b\\'"]
+    ,f "dd'b\\\\\\' /c'aaa\"" ["dd'b\\\\\\'","/c'aaa"]
+    ,f "b'd''\\/ b\\'b'db/'cd " ["b'd''\\/","b\\'b'db/'cd"]
+    ,f "a\"ba\\/\\ " ["aba\\/\\ "]
+    ,f "b\"'dd'c /b/c\"bbd \"\"\\ad'\"c\\\"" ["b'dd'c /b/cbbd","\\ad'c\""]
+    ,f "da 'c\\\\acd/'dbaaa///dccbc a \\" ["da","'c\\\\acd/'dbaaa///dccbc","a","\\"]
+    ,f "a'ac \"da\"" ["a'ac","da"]
+    ,f "\"'\\\"/\"\"b\\b  \"'\"\"ccd'a\"/c /da " ["'\"/\"b\\b","'\"ccd'a/c /da "]
+    ,f "d\"\\c\\\\cb c/\"aa' b\"\\/d \"'c c/" ["d\\c\\\\cb c/aa'","b\\/d 'c","c/"]
+    ,f "dbc\\/\"\"//c/\"accda" ["dbc\\///c/accda"]
+    ,f "aca a'' \\ c b'\\/d\\" ["aca","a''","\\","c","b'\\/d\\"]
+    ,f "dc\"bc/a\\ccdd\\\\aad\\c'ab '\\cddcdba" ["dcbc/a\\ccdd\\\\aad\\c'ab '\\cddcdba"]
+    ,f " c'\"ba \"b\\dc\"" ["c'ba b\\dc"]
+    ,f "a\\acd/a \"'c /'c'" ["a\\acd/a","'c /'c'"]
+    ,f " ac ddc/\"\"a/\\bd\\d c'cac\"c\\a/a''c" ["ac","ddc/a/\\bd\\d","c'cacc\\a/a''c"]
+    ,f "b/cd\"//bb\"/daaab/  b b \"'     d\"a\" 'd b" ["b/cd//bb/daaab/","b","b","'     da 'd b"]
+    ,f "a\"cc'cd\"\\'ad '\"dcc acb\"\\\\" ["acc'cd\\'ad","'dcc acb\\\\"]
+    ,f "/bc/bc'/\"d  \"a/\"\\ad aba\\da" ["/bc/bc'/d  a/\\ad aba\\da"]
+    ,f "b\\a" ["b\\a"]
+    ,f "/dc ''c'a\"'/'\\ /'cd\\'d/'db/b\"' cabacaaa\"\"dd" ["/dc","''c'a'/'\\ /'cd\\'d/'db/b'","cabacaaadd"]
+    ,f "\"ac\\\"c'/c'b\"b\"b'd\"c\"\"" ["ac\"c'/c'bbb'dc"]
+    ,f "/ 'ccc\"d\\dc'\"'\\  b" ["/","'cccd\\dc''\\","b"]
+    ,f "  '\"/\\cc\\/c '\\\\" ["'/\\cc\\/c '\\\\"]
+    ,f "\\ \\' ' /d  \"cc\\\\//da\"d'a/a\"ca\\\\\"\\cb c\"d'b 'acb" ["\\","\\'","'","/d","cc\\\\//dad'a/aca\\\\cb","cd'b 'acb"]
+    ,f "a\"\"d'\"a\"\\ \\c db'da/d\\c\"a/ aa c/db" ["ad'a\\","\\c","db'da/d\\ca/ aa c/db"]
+    ,f " d\\" ["d\\"]
+    ,f "d c b'/\\/'\"/'a'aa\"a\"/ad\\/" ["d","c","b'/\\/'/'a'aaa/ad\\/"]
+    ,f "  a \\' /" ["a","\\'","/"]
+    ,f "'/ c" ["'/","c"]
+    ,f "acd 'bcab /ba'daa'/ba/\"dcdadbcacb" ["acd","'bcab","/ba'daa'/ba/dcdadbcacb"]
+    ,f "a\\\"dd'a c\"a\"\"ac\\" ["a\"dd'a","ca\"ac\\"]
+    ,f "\"dba /'bb\\ d ba '/c' \"dd\\' cbcd c /b/\\b///" ["dba /'bb\\ d ba '/c' dd\\'","cbcd","c","/b/\\b///"]
+    ,f "a'c/c \"ccb '/d\\abd/bc  " ["a'c/c","ccb '/d\\abd/bc  "]
+    ,f "\\da\"\\//add\\\\ c" ["\\da\\//add\\\\ c"]
+    ,f "c/\\\"//  a/\"ac\"//''ba\"c/\\bc\\\"d\"bc/d" ["c/\"//","a/ac//''bac/\\bc\"dbc/d"]
+    ,f "/d/ a   dc'\\ \"" ["/d/","a","dc'\\",""]
+    ,f " \"dc//b\\cd/ \\ac\"b\"b\"d\"\"\"dd\"\" ' a\\'/ \"/'/\\a/abd\\ddd" ["dc//b\\cd/ \\acbbd\"dd","'","a\\'/","/'/\\a/abd\\ddd"]
+    ,f "\\'  ' d\"b bbc" ["\\'","'","db bbc"]
+    ,f "'ba\\a'db/bd d\\'b\\ \\/a'da' " ["'ba\\a'db/bd","d\\'b\\","\\/a'da'"]
+    ,f "\\b\\cc\"\"d' dd ddcb\"d" ["\\b\\ccd'","dd","ddcbd"]
+    ,f "d\"dc'\\d\"/'\\\"b\\c'c\" db' \\'b/\"a' / da'\"/ab'\\ c\\bc\\//dbcb\\" ["ddc'\\d/'\"b\\c'c db' \\'b/a'","/","da'/ab'\\ c\\bc\\//dbcb\\"]
+    ,f " b ddbbbbc\"da\\c\"'\\" ["b","ddbbbbcda\\c'\\"]
+    ,f "b/\"d dacd'/'\\\"''a a /'\\c'b ab\\  dda\\c'abdd'a\"//d \\\\\\ d\"\"" ["b/d dacd'/'\"''a a /'\\c'b ab\\  dda\\c'abdd'a//d","\\\\\\","d"]
+    ,f "/c\"\" dd'a'/b\\/'\"'/" ["/c","dd'a'/b\\/''/"]
+    ,f "/\"'\"\"'cc a a\\dd''\\'b" ["/'\"'cc","a","a\\dd''\\'b"]
+    ,f "c\"dcd''aba\" \" /'" ["cdcd''aba"," /'"]
+    ,f "'\"/''\\\\d'/ad\\baadabdca\\ /\\'''bd\\/\"'/' aca \\  \\a'\\ cd\"d /bdcd''cac" ["'/''\\\\d'/ad\\baadabdca\\ /\\'''bd\\/'/'","aca","\\","\\a'\\","cdd /bdcd''cac"]
+    ,f "\" /\"da" [" /da"]
+    ,f "'\"ca/'d/d/d\\ca\"/\"\" ddac cc\" ''a c''bd\"bc'dc\\/\"b\"a\\\"\"a/\\ " ["'ca/'d/d/d\\ca/","ddac","cc ''a c''bdbc'dc\\/ba\"a/\\ "]
+    ,f "\\\\d'ad ' ''\"cd/a \"\"\\'\\\"'dc\\" ["\\\\d'ad","'","''cd/a \"\\'\"'dc\\"]
+    ,f " ab  c'\\a" ["ab","c'\\a"]
+    ,f "b" ["b"]
+    ,f "''c dc c\\'d'ab'd\"\\\"cca\"b'da\"dbcdbd\"cd'/d \\cd'\"d  \"\"b cdc''/\\\"b'" ["''c","dc","c\\'d'ab'd\"ccab'dadbcdbdcd'/d","\\cd'd  \"b","cdc''/\"b'"]
+    ,f " \"'cb dbddbdd/" ["'cb dbddbdd/"]
+    ,f "a/\"d// dd/cc/\"cc\"d\" d\\/a a \\c\"  \\\\/\"\\ bcc'ac'\"\\c//d\"da/\\aac\\b\"c/'b\"\"bbd/\\" ["a/d// dd/cc/ccd","d\\/a","a","\\c  \\\\/\\","bcc'ac'\\c//dda/\\aac\\bc/'b\"bbd/\\"]
+    ,f "b\"ddccd\"a\"/ba\"" ["bddccda/ba"]
+    ,f " \"  c/b/'/bdd  cb d'c a'\"'a d\\\\db//\\\"' c'/'c\\/aa" ["  c/b/'/bdd  cb d'c a''a","d\\\\db//\"'","c'/'c\\/aa"]
+    ,f "\\caab" ["\\caab"]
+    ,f "bb\"'\"/d'bad 'd\\/'\\b//\\\\ \\d''c\"c b\\b/\\" ["bb'/d'bad","'d\\/'\\b//\\\\","\\d''cc b\\b/\\"]
+    ,f " c'a\"  \\cab\"bd\"dcd\"/cb/\"\"b\"b'\"d" ["c'a  \\cabbddcd/cb/bb'd"]
+    ,f "\\/ \"c'ca" ["\\/","c'ca"]
+    ,f "  d' /c'bc\"'/'\\\\dca'cc\"'\"''/d cb//'a \"bd ab\"dcaadc\\\"'d\\\"/a\"a\\\"ba//b/ d/dbac/d\\caa\"bc/ " ["d'","/c'bc'/'\\\\dca'cc'''/d cb//'a bd","abdcaadc\"'d\"/aa\"ba//b/","d/dbac/d\\caabc/ "]
+    ,f "/\"\\db'd/ ca\"ad b\\\\\"cd/a bbc\\ " ["/\\db'd/ caad","b\\cd/a bbc\\ "]
+    ,f "cdc bd'/\"c''c d \\\"aa \\d\\ bb'b/ /b/a/c'acda\\'\"\"c \"bbbaa/'/a \\aca\"'/ac' " ["cdc","bd'/c''c d \"aa \\d\\ bb'b/ /b/a/c'acda\\'\"c","bbbaa/'/a \\aca'/ac'"]
+    ,f "ad/'b\\d /cc\"\"ab \\ \"'  ''b\\\"/\\  a\"'d\"\\ddacdbbabb b b  //' acd\"c\\d'd\\b\"'\\\"aaba/bda/c'// \\b" ["ad/'b\\d","/ccab","\\","'  ''b\"/\\  a'd\\ddacdbbabb b b  //' acdc\\d'd\\b'\"aaba/bda/c'// \\b"]
+    ,f "bac cc \"ac\"/ca/ '\"\" b/b d /cd'\\'bb\" \\ \"b '/ b c ' c''\"a/ad\\ " ["bac","cc","ac/ca/","'","b/b","d","/cd'\\'bb \\ b","'/","b","c","'","c''a/ad\\ "]
+    ,f "baa'  b'b''\\dab/'c" ["baa'","b'b''\\dab/'c"]
+    ,f "cb\\\\ " ["cb\\\\"]
+    ,f "/b'a''d\"b\"   'c'b ba\\'b\" bb" ["/b'a''db","'c'b","ba\\'b bb"]
+    ,f "b /\"ca\\cbac " ["b","/ca\\cbac "]
+    ,f " \"\"/\"bcaa\"\"a' \\/bb \"a\\\"'\"" ["/bcaa\"a'","\\/bb","a\"'"]
+    ,f "\"c /''c\"\\badc/\\daa/\\ c\"a c\\ \\/cab \"b\"\\ ba\"\"/d/cd'a ad'c/ad\"' a\\d/d\\c\\'cdccd/\"a'/\"b///ac\"" ["c /''c\\badc/\\daa/\\","ca c\\ \\/cab b\\ ba\"/d/cd'a","ad'c/ad' a\\d/d\\c\\'cdccd/a'/b///ac"]
+    ,f "/cbbd\"/b' /dd\"/c\\ca/'\"\\ cc  \\d\"aca/\"b caa\\d\\'\"b'b  dc\"cd\\'c\" 'd/ac\"cacc\"" ["/cbbd/b' /dd/c\\ca/'\\ cc  \\daca/b caa\\d\\'b'b","dccd\\'c","'d/accacc"]
+    ,f "bc/bd\\ca\\bcacca\"\"\\c/\\ /\"\"a/\"c'//b'\\d/a/'ab/cbd/cacb//b \\d\"aac\\d'\"/" ["bc/bd\\ca\\bcacca\\c/\\","/a/c'//b'\\d/a/'ab/cbd/cacb//b \\daac\\d'/"]
+    ,f "bbac bdc/d\\\"/db\"dbdb\"a \" /\"/'a\\acacbcc c'//\\//b\"ca\"bcca c\\/aaa/c/bccbccaa  \"\" cdccc/bddcbc c''" ["bbac","bdc/d\"/dbdbdba"," //'a\\acacbcc","c'//\\//bcabcca","c\\/aaa/c/bccbccaa","","cdccc/bddcbc","c''"]
     ]
+    where f = (,)
diff --git a/cmdargs.cabal b/cmdargs.cabal
--- a/cmdargs.cabal
+++ b/cmdargs.cabal
@@ -1,13 +1,13 @@
-cabal-version:      >= 1.18
+cabal-version:      1.18
 build-type:         Simple
 name:               cmdargs
-version:            0.10.20
+version:            0.10.22
 license:            BSD3
 license-file:       LICENSE
 category:           Console
 author:             Neil Mitchell <ndmitchell@gmail.com>
 maintainer:         Neil Mitchell <ndmitchell@gmail.com>
-copyright:          Neil Mitchell 2009-2018
+copyright:          Neil Mitchell 2009-2023
 synopsis:           Command line argument processing
 description:
     This library provides an easy way to define command line parsers. Most users
@@ -33,7 +33,7 @@
 extra-doc-files:
     README.md
     CHANGES.txt
-tested-with:        GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2
+tested-with:        GHC==9.2, GHC==9.0, GHC==8.10, GHC==8.8, GHC==8.6, GHC==8.4, GHC==8.2, GHC==8.0
 
 source-repository head
     type:     git
