endo (hackage): Package defines extra functions for Data.Monoid.Endo data type, and also generic endomorphism folding machinery. Generic endomorphism folding can be used for various purposes, including as a builder.  Here is an example how to use it with optparse-applicative package:  For details how individual option parsers look like see module Data.Monoid.Endo.Fold which contains other examples as well as this one.
Keywords: bsd3|data|library|endo|endomorphism|haskell|monoid