Fuzion Logo
fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

effect_types.fz


# This file is part of the Fuzion language implementation.
#
# The Fuzion language implementation is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, version 3 of the License.
#
# The Fuzion language implementation is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU General Public License along with The
# Fuzion language implementation.  If not, see <https://www.gnu.org/licenses/>.


# -----------------------------------------------------------------------
#
#  Tokiwa Software GmbH, Germany
#
#  Source code of Fuzion standard library feature effect_types
#
#  Author: Fridtjof Siebert (siebert@tokiwa.software)
#
# -----------------------------------------------------------------------


# effect_types provides access to all effect types that are used by the
# current application.
#
public effect_types : container.Types is


  # fold all types of instated effects using the given `type_applicator` `a`
  # and initial value `e`.
  #
  public redef fixed type_foldf(E type,
                                A type : container.type_applicator E,
                                e E,
                                a A) E
  =>
    autogenerated_code_for_effect_types_fold E A e a

  /* the auto-generated code looks as follows:

    a.apply io.Out    (
      a.apply panic     (
        a.apply io.Err    (
          ...
          ...                  (e)
          ...
                          )
                        )
                      )

   */


# magic intrinsic used by middle end to create code for `type_foldf`, see above.
#
autogenerated_code_for_effect_types_fold(E type,
                                         A type : container.type_applicator E,
                                         e E,
                                         a A) E => intrinsic


last changed: 2026-07-23