There's a very simple solution to this.
First, implement a type to represent a complete description of your program's behavior:
data Mode = NormalMode { verbose :: Bool, buffer :: Int } | HelpMode
Then, implement an update function to update the arguments based on one flag and a default argument array:
defaults :: Mode
defaults = NormalMode { verbose = False, buffer = defaultBuffer }
-- assuming defaultBuffer is defined somewhere
update :: Flag -> Mode -> Mode
update Help _ = HelpMode
update _ HelpMode = HelpMode
update Verbose NormalMode { buffer = b } = NormalMode { verbose = True, buffer = b }
update (Buffer n) NormalMode { verbose = v } = NormalMode { verbose = v, buffer = n }
Then, to parse a list of Flags, just use foldr or foldl:
parseFlagsR :: [Flag] -> Mode
parseFlagsR = foldr update defaults
-- This prioritizes the leftmost Buffer flag
parseFlagsL :: [Flag] -> Mode
parseFlagsL = foldl (flip update) defaults
-- This prioritizes the rightmost Buffer flag
You could then get the buffer in any of the following ways, though I recommend the last one:
safeGetBuffer :: Mode -> Maybe Int
safeGetBuffer NormalMode { buffer = b } = Just b
safeGetBuffer _ = Nothing
getBufferWith :: Int -> Mode -> Int
getBufferWith _ NormalMode { buffer = b } = b
getBufferWith n _ = n
getBuffer :: Mode -> Int
getBuffer = getBufferWith defaultBuffer
-- defaultBuffer from earlier, again, assuming it's defined.
This solution is more general than Joseph Sible's answer, and might be useful when it comes to extracting the verbosity value. This also explicitly formulates the precedence of flags and conveniently bundles all updating operations into one.
Additionally, if you want to know more about general implementations of this, I suggest you familiarize yourself with Lenses and other Optics.