-- definitions for Lua 5.1 string library

--# assume global `string`:
--#     [string_meta] {
--#         `byte`: function(s: string, i: integer?, j: integer?) --> (integer...);
--#         `char`: function(integer...) --> string;
--#         `dump`: function(`function`: function) --> string;
--#         -- TODO repeating return types can contain integer when the pattern contains `()`
--#         `find`: function(s: string, pattern: string, init: integer?, plain: boolean?) -->
--#                          (integer, integer, string...);
--#         `format`: function(formatstring: string, any...) --> string;
--#         `gmatch`: function(s: string, pattern: string) --> function() --> string?;
--#         -- TODO have to constrain the function argument, but not easy
--#         `gsub`: function(s: string, pattern: string,
--#                          repl: string | map<string, string> |
--#                                (function(WHATEVER...) --> string),
--#                          n: integer?) --> string;
--#         `len`: function(s: string) --> integer;
--#         `lower`: function(s: string) --> string;
--#         -- TODO repeating return types can contain integer when the pattern contains `()`
--#         `match`: function(s: string, pattern: string, init: integer?) --> (string...);
--#         `rep`: function(s: string, n: integer) --> string;
--#         `reverse`: function(s: string) --> string;
--#         `sub`: function(s: string, i: integer, j: integer?) --> string;
--#         `upper`: function(s: string) --> string;
--#         ...
--#     }

