def instructions(type_library: PushTypeLibrary):
    'Return all core text instructions.'
    i = []
    for push_type in ['str', 'char']:
        i.append(SimpleInstruction('{t}_concat'.format(t=push_type), _concat, input_stacks=[push_type, push_type], output_stacks=['str'], code_blocks=0, docstring='Concatenates the top two {t}s and pushes the resulting string.'.format(t=push_type)))
        i.append(SimpleInstruction('str_insert_{t}'.format(t=push_type), _insert, input_stacks=['str', push_type, 'int'], output_stacks=['str'], code_blocks=0, docstring='Inserts {t} into the top str at index `n` and pushes\n            the resulting string. The value for `n` is taken from the int stack.'.format(t=push_type)))
        i.append(SimpleInstruction('{t}_from_first_char'.format(t=push_type), _first_char, input_stacks=['str'], output_stacks=[push_type], code_blocks=0, docstring='Pushes a {t} of the first character of the top string.'.format(t=push_type)))
        i.append(SimpleInstruction('{t}_from_last_char'.format(t=push_type), _last_char, input_stacks=['str'], output_stacks=[push_type], code_blocks=0, docstring='Pushes a {t} of the last character of the top string.'.format(t=push_type)))
        i.append(SimpleInstruction('{t}_from_nth_char'.format(t=push_type), _nth_char, input_stacks=['str', 'int'], output_stacks=[push_type], code_blocks=0, docstring='Pushes a {t} of the nth character of the top string. The top integer denotes nth position.'.format(t=push_type)))
        i.append(SimpleInstruction('str_contains_{t}'.format(t=push_type), _contains, input_stacks=['str', push_type], output_stacks=['bool'], code_blocks=0, docstring='Pushes true if the next {t} is in the top string. Pushes false otherwise.'.format(t=push_type)))
        i.append(SimpleInstruction('str_index_of_{t}'.format(t=push_type), _p_index, input_stacks=['str', push_type], output_stacks=['int'], code_blocks=0, docstring='Pushes the index of the next {t} in the top string. If not found, pushes -1.'.format(t=push_type)))
        i.append(ProducesManyOfTypeInstruction('str_split_on_{t}'.format(t=push_type), _split_on, input_stacks=['str', push_type], output_stack='str', code_blocks=0, docstring='Pushes multiple strs produced by splitting the top str on the top {t}.'.format(t=push_type)))
        i.append(SimpleInstruction('str_replace_first_{t}'.format(t=push_type), _replace_n, input_stacks=['str', push_type, push_type], output_stacks=['str'], code_blocks=0, docstring='Pushes the str produced by replaceing the first occurrence of the\n            top {t} with the second {t}.'.format(t=push_type)))
        i.append(SimpleInstruction('str_replace_n_{t}'.format(t=push_type), _replace_n, input_stacks=['str', push_type, push_type, 'int'], output_stacks=['str'], code_blocks=0, docstring='Pushes the str produced by replaceing the first `n` occurrences of the\n            top {t} with the second {t}. The value for `n` is the top int.'.format(t=push_type)))
        i.append(SimpleInstruction('str_replace_all_{t}'.format(t=push_type), _replace_all, input_stacks=['str', push_type, push_type], output_stacks=['str'], code_blocks=0, docstring='Pushes the str produced by replaceing all occurrences of the\n            top {t} with the second {t}.'.format(t=push_type)))
        i.append(SimpleInstruction('str_remove_first_{t}'.format(t=push_type), _remove_n, input_stacks=['str', push_type], output_stacks=['str'], code_blocks=0, docstring='Pushes the str produced by removing the first occurrence of the top {t}.'.format(t=push_type)))
        i.append(SimpleInstruction('str_remove_n_{t}'.format(t=push_type), _remove_n, input_stacks=['str', push_type, 'int'], output_stacks=['str'], code_blocks=0, docstring='Pushes the str produced by remvoing the first `n` occurrences of the\n            top {t}. The value for `n` is the top int.'.format(t=push_type)))
        i.append(SimpleInstruction('str_remove_all_{t}'.format(t=push_type), _remove_all, input_stacks=['str', push_type], output_stacks=['str'], code_blocks=0, docstring='Pushes the str produced by removing all occurrences of the top {t}.'.format(t=push_type)))
        i.append(SimpleInstruction('str_occurrences_of_{t}'.format(t=push_type), _occurrences_of, input_stacks=['str', push_type], output_stacks=['int'], code_blocks=0, docstring='Pushes the number of times the top {t} occurs in the top str to the int stack.'.format(t=push_type)))
    i.append(SimpleInstruction('str_reverse', _reverse, input_stacks=['str'], output_stacks=['str'], code_blocks=0, docstring='Takes the top string and pushes it reversed.'))
    i.append(SimpleInstruction('str_head', _head, input_stacks=['str', 'int'], output_stacks=['str'], code_blocks=0, docstring='Pushes a string of the first `n` characters from the top string. The value\n        for `n` is the top int mod the length of the string.'))
    i.append(SimpleInstruction('str_tail', _tail, input_stacks=['str', 'int'], output_stacks=['str'], code_blocks=0, docstring='Pushes a string of the last `n` characters from the top string. The value\n        for `n` is the top int mod the length of the string.'))
    i.append(SimpleInstruction('str_append_char', _concat, input_stacks=['str', 'char'], output_stacks=['str'], code_blocks=0, docstring='Appends the top char to the top string pushes the resulting string.'))
    i.append(SimpleInstruction('str_rest', _rest, input_stacks=['str'], output_stacks=['str'], code_blocks=0, docstring='Pushes the top str without its first character.'))
    i.append(SimpleInstruction('str_but_last', _but_last, input_stacks=['str'], output_stacks=['str'], code_blocks=0, docstring='Pushes the top str without its last character.'))
    i.append(SimpleInstruction('str_drop', _drop, input_stacks=['str', 'int'], output_stacks=['str'], code_blocks=0, docstring='Pushes the top str without its first `n` character. The value for `n`\n        is the top int mod the length of the string.'))
    i.append(SimpleInstruction('str_but_last_n', _but_last_n, input_stacks=['str', 'int'], output_stacks=['str'], code_blocks=0, docstring='Pushes the top str without its last `n` character. The value for `n`\n        is the top int mod the length of the string.'))
    i.append(SimpleInstruction('str_length', _len, input_stacks=['str'], output_stacks=['int'], code_blocks=0, docstring='Pushes the length of the top str to the int stack.'))
    i.append(SimpleInstruction('str_make_empty', _make_empty, input_stacks=[], output_stacks=['str'], code_blocks=0, docstring='Pushes an empty string.'))
    i.append(SimpleInstruction('str_is_empty_string', _is_empty, input_stacks=['str'], output_stacks=['bool'], code_blocks=0, docstring='Pushes True if top string is empty. Pushes False otherwise.'))
    i.append(SimpleInstruction('str_remove_nth', _remove_nth, input_stacks=['str', 'int'], output_stacks=['str'], code_blocks=0, docstring='Pushes the top str with the nth character removed.'))
    i.append(SimpleInstruction('str_set_nth', _set_nth, input_stacks=['str', 'char', 'int'], output_stacks=['str'], code_blocks=0, docstring='Pushes the top str with the nth character set to the top character.'))
    i.append(SimpleInstruction('str_strip_whitespace', _strip_whitespace, input_stacks=['str'], output_stacks=['str'], code_blocks=0, docstring='Pushes the top str with trailing and leading whitespace stripped.'))
    i.append(SimpleInstruction('char_is_whitespace', _is_whitespace, input_stacks=['char'], output_stacks=['bool'], code_blocks=0, docstring='Pushes True if the top Char is whitespace. Pushes False otherwise.'))
    i.append(SimpleInstruction('char_is_letter', _is_letter, input_stacks=['char'], output_stacks=['bool'], code_blocks=0, docstring='Pushes True if the top Char is a letter. Pushes False otherwise.'))
    i.append(SimpleInstruction('char_is_digit', _is_digit, input_stacks=['char'], output_stacks=['bool'], code_blocks=0, docstring='Pushes True if the top Char is a numeric digit. Pushes False otherwise.'))
    for push_type in ['bool', 'int', 'float', 'char']:
        i.append(SimpleInstruction('str_from_{t}'.format(t=push_type), _str_from_thing, input_stacks=[push_type], output_stacks=['str'], code_blocks=0, docstring='Pushes the top {t} converted into a str.'.format(t=push_type)))
    i.append(SimpleInstruction('char_from_bool', _char_from_bool, input_stacks=['bool'], output_stacks=['char'], code_blocks=0, docstring='Pushes the char "T" if the top bool is True. If the top\n        bool is False, pushes the char "F".'))
    i.append(SimpleInstruction('char_from_ascii_int', _char_from_ascii, input_stacks=['int'], output_stacks=['char'], code_blocks=0, docstring='Pushes the top int converted into a Character by using the int mod 128 as an ascii value.'))
    i.append(SimpleInstruction('char_from_float', _char_from_float, input_stacks=['float'], output_stacks=['char'], code_blocks=0, docstring='Pushes the top float converted into a Character by flooring\n        the float to an int, taking the int mod 128, and using it as an ascii value.'))
    i.append(ProducesManyOfTypeInstruction('chars_from_str', _all_chars, input_stacks=['str'], output_stack='char', code_blocks=0, docstring='Pushes each character of the top str to the char stack in reverse order.'))
    return i
Return all core text instructions.
def instructions(type_library: PushTypeLibrary):
    
    i = []
    for push_type in ['str', 'char']:
        i.append(SimpleInstruction('{t}_concat'.format(t=push_type), _concat, input_stacks=[push_type, push_type], output_stacks=['str'], code_blocks=0, docstring='Concatenates the top two {t}s and pushes the resulting string.'.format(t=push_type)))
        i.append(SimpleInstruction('str_insert_{t}'.format(t=push_type), _insert, input_stacks=['str', push_type, 'int'], output_stacks=['str'], code_blocks=0, docstring='Inserts {t} into the top str at index `n` and pushes\n            the resulting string. The value for `n` is taken from the int stack.'.format(t=push_type)))
        i.append(SimpleInstruction('{t}_from_first_char'.format(t=push_type), _first_char, input_stacks=['str'], output_stacks=[push_type], code_blocks=0, docstring='Pushes a {t} of the first character of the top string.'.format(t=push_type)))
        i.append(SimpleInstruction('{t}_from_last_char'.format(t=push_type), _last_char, input_stacks=['str'], output_stacks=[push_type], code_blocks=0, docstring='Pushes a {t} of the last character of the top string.'.format(t=push_type)))
        i.append(SimpleInstruction('{t}_from_nth_char'.format(t=push_type), _nth_char, input_stacks=['str', 'int'], output_stacks=[push_type], code_blocks=0, docstring='Pushes a {t} of the nth character of the top string. The top integer denotes nth position.'.format(t=push_type)))
        i.append(SimpleInstruction('str_contains_{t}'.format(t=push_type), _contains, input_stacks=['str', push_type], output_stacks=['bool'], code_blocks=0, docstring='Pushes true if the next {t} is in the top string. Pushes false otherwise.'.format(t=push_type)))
        i.append(SimpleInstruction('str_index_of_{t}'.format(t=push_type), _p_index, input_stacks=['str', push_type], output_stacks=['int'], code_blocks=0, docstring='Pushes the index of the next {t} in the top string. If not found, pushes -1.'.format(t=push_type)))
        i.append(ProducesManyOfTypeInstruction('str_split_on_{t}'.format(t=push_type), _split_on, input_stacks=['str', push_type], output_stack='str', code_blocks=0, docstring='Pushes multiple strs produced by splitting the top str on the top {t}.'.format(t=push_type)))
        i.append(SimpleInstruction('str_replace_first_{t}'.format(t=push_type), _replace_n, input_stacks=['str', push_type, push_type], output_stacks=['str'], code_blocks=0, docstring='Pushes the str produced by replaceing the first occurrence of the\n            top {t} with the second {t}.'.format(t=push_type)))
        i.append(SimpleInstruction('str_replace_n_{t}'.format(t=push_type), _replace_n, input_stacks=['str', push_type, push_type, 'int'], output_stacks=['str'], code_blocks=0, docstring='Pushes the str produced by replaceing the first `n` occurrences of the\n            top {t} with the second {t}. The value for `n` is the top int.'.format(t=push_type)))
        i.append(SimpleInstruction('str_replace_all_{t}'.format(t=push_type), _replace_all, input_stacks=['str', push_type, push_type], output_stacks=['str'], code_blocks=0, docstring='Pushes the str produced by replaceing all occurrences of the\n            top {t} with the second {t}.'.format(t=push_type)))
        i.append(SimpleInstruction('str_remove_first_{t}'.format(t=push_type), _remove_n, input_stacks=['str', push_type], output_stacks=['str'], code_blocks=0, docstring='Pushes the str produced by removing the first occurrence of the top {t}.'.format(t=push_type)))
        i.append(SimpleInstruction('str_remove_n_{t}'.format(t=push_type), _remove_n, input_stacks=['str', push_type, 'int'], output_stacks=['str'], code_blocks=0, docstring='Pushes the str produced by remvoing the first `n` occurrences of the\n            top {t}. The value for `n` is the top int.'.format(t=push_type)))
        i.append(SimpleInstruction('str_remove_all_{t}'.format(t=push_type), _remove_all, input_stacks=['str', push_type], output_stacks=['str'], code_blocks=0, docstring='Pushes the str produced by removing all occurrences of the top {t}.'.format(t=push_type)))
        i.append(SimpleInstruction('str_occurrences_of_{t}'.format(t=push_type), _occurrences_of, input_stacks=['str', push_type], output_stacks=['int'], code_blocks=0, docstring='Pushes the number of times the top {t} occurs in the top str to the int stack.'.format(t=push_type)))
    i.append(SimpleInstruction('str_reverse', _reverse, input_stacks=['str'], output_stacks=['str'], code_blocks=0, docstring='Takes the top string and pushes it reversed.'))
    i.append(SimpleInstruction('str_head', _head, input_stacks=['str', 'int'], output_stacks=['str'], code_blocks=0, docstring='Pushes a string of the first `n` characters from the top string. The value\n        for `n` is the top int mod the length of the string.'))
    i.append(SimpleInstruction('str_tail', _tail, input_stacks=['str', 'int'], output_stacks=['str'], code_blocks=0, docstring='Pushes a string of the last `n` characters from the top string. The value\n        for `n` is the top int mod the length of the string.'))
    i.append(SimpleInstruction('str_append_char', _concat, input_stacks=['str', 'char'], output_stacks=['str'], code_blocks=0, docstring='Appends the top char to the top string pushes the resulting string.'))
    i.append(SimpleInstruction('str_rest', _rest, input_stacks=['str'], output_stacks=['str'], code_blocks=0, docstring='Pushes the top str without its first character.'))
    i.append(SimpleInstruction('str_but_last', _but_last, input_stacks=['str'], output_stacks=['str'], code_blocks=0, docstring='Pushes the top str without its last character.'))
    i.append(SimpleInstruction('str_drop', _drop, input_stacks=['str', 'int'], output_stacks=['str'], code_blocks=0, docstring='Pushes the top str without its first `n` character. The value for `n`\n        is the top int mod the length of the string.'))
    i.append(SimpleInstruction('str_but_last_n', _but_last_n, input_stacks=['str', 'int'], output_stacks=['str'], code_blocks=0, docstring='Pushes the top str without its last `n` character. The value for `n`\n        is the top int mod the length of the string.'))
    i.append(SimpleInstruction('str_length', _len, input_stacks=['str'], output_stacks=['int'], code_blocks=0, docstring='Pushes the length of the top str to the int stack.'))
    i.append(SimpleInstruction('str_make_empty', _make_empty, input_stacks=[], output_stacks=['str'], code_blocks=0, docstring='Pushes an empty string.'))
    i.append(SimpleInstruction('str_is_empty_string', _is_empty, input_stacks=['str'], output_stacks=['bool'], code_blocks=0, docstring='Pushes True if top string is empty. Pushes False otherwise.'))
    i.append(SimpleInstruction('str_remove_nth', _remove_nth, input_stacks=['str', 'int'], output_stacks=['str'], code_blocks=0, docstring='Pushes the top str with the nth character removed.'))
    i.append(SimpleInstruction('str_set_nth', _set_nth, input_stacks=['str', 'char', 'int'], output_stacks=['str'], code_blocks=0, docstring='Pushes the top str with the nth character set to the top character.'))
    i.append(SimpleInstruction('str_strip_whitespace', _strip_whitespace, input_stacks=['str'], output_stacks=['str'], code_blocks=0, docstring='Pushes the top str with trailing and leading whitespace stripped.'))
    i.append(SimpleInstruction('char_is_whitespace', _is_whitespace, input_stacks=['char'], output_stacks=['bool'], code_blocks=0, docstring='Pushes True if the top Char is whitespace. Pushes False otherwise.'))
    i.append(SimpleInstruction('char_is_letter', _is_letter, input_stacks=['char'], output_stacks=['bool'], code_blocks=0, docstring='Pushes True if the top Char is a letter. Pushes False otherwise.'))
    i.append(SimpleInstruction('char_is_digit', _is_digit, input_stacks=['char'], output_stacks=['bool'], code_blocks=0, docstring='Pushes True if the top Char is a numeric digit. Pushes False otherwise.'))
    for push_type in ['bool', 'int', 'float', 'char']:
        i.append(SimpleInstruction('str_from_{t}'.format(t=push_type), _str_from_thing, input_stacks=[push_type], output_stacks=['str'], code_blocks=0, docstring='Pushes the top {t} converted into a str.'.format(t=push_type)))
    i.append(SimpleInstruction('char_from_bool', _char_from_bool, input_stacks=['bool'], output_stacks=['char'], code_blocks=0, docstring='Pushes the char "T" if the top bool is True. If the top\n        bool is False, pushes the char "F".'))
    i.append(SimpleInstruction('char_from_ascii_int', _char_from_ascii, input_stacks=['int'], output_stacks=['char'], code_blocks=0, docstring='Pushes the top int converted into a Character by using the int mod 128 as an ascii value.'))
    i.append(SimpleInstruction('char_from_float', _char_from_float, input_stacks=['float'], output_stacks=['char'], code_blocks=0, docstring='Pushes the top float converted into a Character by flooring\n        the float to an int, taking the int mod 128, and using it as an ascii value.'))
    i.append(ProducesManyOfTypeInstruction('chars_from_str', _all_chars, input_stacks=['str'], output_stack='char', code_blocks=0, docstring='Pushes each character of the top str to the char stack in reverse order.'))
    return i