Skip to content

successful

IsaacShelton edited this page Mar 21, 2022 · 1 revision

successful

successful represents the type of a boolean value that indicates success or failure. It can be either true or false.

Specifications

Primitive Type Bits Size Signed-ness Possible Values C Equivalent (Roughly)
successful 1 bit 1 byte ~ true or false bool

Alias-like Nature

successful is effectively an alias of bool. Both types are mutually convertible to/from each other.

Purpose

successful exists to clearly differentiate between functions/methods that return boolean results, and functions that return whether they were successful.

func getBooleanValue(value bool) bool {
    return value
}

func maybeDoThing(should_fail bool) successful {
    return !should_fail
}
Clone this wiki locally