<commit_before><?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<erlref>
  <header>
    <copyright>
      <year>2016</year><year>2019</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.

    </legalnotice>

    <title>gen_statem</title>
    <prepared></prepared>
    <docno></docno>
    <date></date>
    <rev></rev>
  </header>
  <module since="OTP 19.0">gen_statem</module>
  <modulesummary>Generic state machine behavior.</modulesummary>
  <description>
    <p>
      <c>gen_statem</c> provides a generic state machine behaviour
      and replaces its predecessor
      <seealso marker="gen_fsm"><c>gen_fsm</c></seealso>
      since Erlang/OTP 20.0.
    </p>
    <p>
      This reference manual describes types generated from the types
      in the <c>gen_statem</c> source code, so they are correct.
      However, the generated descriptions also reflect the type hierarchy,
      which makes them kind of hard to read.
    </p>
    <p>
      To get an overview of the concepts and operation of <c>gen_statem</c>,
      do read the
      <seealso marker="doc/design_principles:statem">
	<c>gen_statem</c>&nbsp;Behaviour
      </seealso>
      in
      <seealso marker="doc/design_principles:users_guide">
	OTP Design Principles
      </seealso>
      which frequently links back to this reference manual to avoid
      containing detailed facts that may rot by age.
    </p>
    <note>
      <list type="bulleted">
	<item>This behavior appeared in Erlang/OTP 19.0.</item>
	<item>
	  In OTP 19.1 a backwards incompatible change of
	  the return tuple from
	  <seealso marker="#Module:init/1"><c>Module:init/1</c></seealso>
	  was made and the mandatory callback function
	  <seealso marker="#Module:callback_mode/0">
	    <c>Module:callback_mode/0</c>
	  </seealso>
	  was introduced.
	</item>
	<item>
	   In OTP 20.0
           <seealso marker="#type-generic_timeout">
	     generic time-outs
	   </seealso>
	   were added.
	</item>
	<item><commit_msg>Improve pointer to User's Guide<commit_after><?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<erlref>
  <header>
    <copyright>
      <year>2016</year><year>2019</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.

    </legalnotice>

    <title>gen_statem</title>
    <prepared></prepared>
    <docno></docno>
    <date></date>
    <rev></rev>
  </header>
  <module since="OTP 19.0">gen_statem</module>
  <modulesummary>Generic state machine behavior.</modulesummary>
  <description>
    <p>
      <c>gen_statem</c> provides a generic state machine behaviour
      that for new code replaces its predecessor
      <seealso marker="gen_fsm"><c>gen_fsm</c></seealso>
      since Erlang/OTP 20.0. The <c>gen_fsm</c> behaviour remains
      in OTP "as is".
    </p>
    <note>
      <p>
	If you are new to <c>gen_statem</c> and want an overview
	of concepts and operation the section
	<seealso marker="doc/design_principles:statem">
	  <c>gen_statem</c>&nbsp;Behaviour
	</seealso>
	located in the User's Guide
	<seealso marker="doc/design_principles:users_guide">
	  OTP Design Principles
	</seealso>
	is recommended to read before this reference manual,
	possibly after the Description section you are reading here.
      </p>
    </note>
    <p>
      This reference manual contains type descriptions generated from
      types in the <c>gen_statem</c> source code, so they are correct.
      However, the generated descriptions also reflect the type hierarchy,
      which sometimes makes it hard to get a good overview.
      If so, see the section
      <seealso marker="doc/design_principles:statem">
	<c>gen_statem</c>&nbsp;Behaviour
      </seealso>
      in the
      <seealso marker="doc/design_principles:users_guide">
	OTP Design Principles
      </seealso>
      User's Guide.
    </p>
    <note>
      <list type="bulleted">
	<item>This behavior appeared in Erlang/OTP 19.0.</item>
	<item>
	  In OTP 19.1 a backwards incompatible change of
	  the return tuple from
	  <seealso marker="#Module:init/1"><c>Module:init/1</c></seealso>
	  was made and the mandatory callback function
	  <seealso marker="#Module:callback_mode/0">
	    <c>Module:callback_mode/0</c>
	  </seealso>
	  was introduced.
	</item>
	<item>
	   In OTP 20.0
           <seealso marker="#type-generic_timeout">
	     generic time-outs
	   </seealso>
	   were added.
	</item>
	<item>
{'fraction_non_alphanumeric': 0.10712382305915794, 'fraction_numerical': 0.012080298454432403, 'mean_word_length': 3.073806078147612, 'pattern_counts': {'":': 0, '<': 155, '<?xml version=': 2, '>': 155, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, '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': '4019992', 'n_tokens_mistral': 1792, 'n_tokens_neox': 1684, 'n_words': 566}