Std.Text.countOf
1 declaration
fn
countOf: Str -> Option[Int]This is a callable function.
What it does
The count this text spells, or nothing.
A count is never below nothing, so a sign is not admitted rather than
admitted and then rejected somewhere later. This is the reading a length, a
port, a quantity, or an index wants: -1 is not a short length, it is not a
length, and the difference is worth having in the type of the answer rather
than in a check every caller remembers.
Read the signature
- The text after the name is the type checked by Pudu.
- Read arrows from left to right: inputs come first, and the final type is returned.
- Names inside [ ] are type arguments, such as the item type held by a collection.
- Option holds Some(value) or None when no value is available.
