CurryInfo: base-3.4.0 / System.Console.GetOpt.usageInfo

definition: Info
 
usageInfo :: String                    -- header
          -> [OptDescr a]              -- option descriptors
          -> String                    -- nicely formatted decription of options
usageInfo header optDescr = unlines (header:table) where
  (ss,ls,ds)     = (unzip3 . concatMap fmtOpt) optDescr
  table          = zipWith3 paste (sameLen ss) (sameLen ls) ds
  paste x y z    = "  " ++ x ++ "  " ++ y ++ "  " ++ z
  sameLen xs     = flushLeft ((maximum . map length) xs) xs
  flushLeft n xs = [ take n (x ++ repeat ' ') | x <- xs ]
demand: Info
 no demanded arguments
deterministic: Info
 deterministic operation
failfree: Info
 (_, _)
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {(_,_) |-> _}
name: Info
 usageInfo
precedence: Info
 no precedence defined
result-values: Info
 _
signature: Info
 String -> [OptDescr a] -> String
solution-complete: Info
 operation might suspend on free variables
terminating: Info
 possibly non-terminating
totally-defined: Info
 possibly non-reducible on same data term