<commit_before>! Copyright (C) 2017 <NAME>.
! See http://factorcode.org/license.txt for BSD license.
USING: help.markup help.syntax kernel ;
IN: classes.maybe

ABOUT: "maybes"

ARTICLE: "maybes" "Maybe classes"
"A " { $snippet "maybe" } " is an anonymous union class (" { $link "unions" } ") of its members and the " { $link POSTPONE: f } " class. An object is an instance of a " { $snippet "maybe" } " class if it is either an instance of any of its participants, or " { $link POSTPONE: f } "." $nl
"The " { $snippet "maybe" } " classes are used to declare typed slots that are optional for a tuple. Without this mechanism it would be an error to assign " { $link POSTPONE: f } " to such a typed slot, and therefore any tuple containing them without specifying an " { $link POSTPONE: initial: } " value could not be created with the word " { $link new } "." $nl
"A slot with an empty " { $snippet "maybe{ }" } " class can only hold the " { $link POSTPONE: f } " value."
{ $examples
    { $example
        "TUPLE: test-maybe { value maybe{ fixnum string } } ;"
        "test-maybe new value>>"
        "f"
    }
}
{ $see-also "unions" POSTPONE: maybe{ } ;
<commit_msg>classes.maybe: fix help-lint for docs.<commit_after>! Copyright (C) 2017 <NAME>.
! See http://factorcode.org/license.txt for BSD license.
USING: help.markup help.syntax kernel ;
IN: classes.maybe

ABOUT: "maybes"

ARTICLE: "maybes" "Maybe classes"
"A " { $snippet "maybe" } " is an anonymous union class (" { $link "unions" } ") of its members and the " { $link POSTPONE: f } " class. An object is an instance of a " { $snippet "maybe" } " class if it is either an instance of any of its participants, or " { $link POSTPONE: f } "." $nl
"The " { $snippet "maybe" } " classes are used to declare typed slots that are optional for a tuple. Without this mechanism it would be an error to assign " { $link POSTPONE: f } " to such a typed slot, and therefore any tuple containing them without specifying an " { $link POSTPONE: initial: } " value could not be created with the word " { $link new } "." $nl
"A slot with an empty " { $snippet "maybe{ }" } " class can only hold the " { $link POSTPONE: f } " value."
{ $examples
    { $example
        "USING: prettyprint ;"
        "TUPLE: test-maybe { value maybe{ fixnum string } } ;"
        "test-maybe new value>> ."
        "f"
    }
}
{ $see-also "unions" POSTPONE: maybe{ } ;

{'fraction_non_alphanumeric': 0.13074352548036758, 'fraction_numerical': 0.003341687552213868, 'mean_word_length': 3.330922242314647, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1541122', 'n_tokens_mistral': 779, 'n_tokens_neox': 747, 'n_words': 318}