sundaysebasidian-byte/moondmn/feel/types does not have a README file

    EngineError

    pub(all) suberror EngineError {
    Failure(String, Int, Int, String)
    } derive(Eq)

    Matchable engine failure carrying code, line, column and message.

    EngineError::equal

    fn EngineError::equal(EngineError, EngineError) -> Bool

    EngineError::not_equal

    fn EngineError::not_equal(x : EngineError, y : EngineError) -> Bool

    Date

    pub(all) struct Date {
    year : Int
    month : Int
    day : Int
    }

    Calendar date in the proleptic Gregorian calendar (years -999999999..999999999). Construct validated values with date_of or parse_date.

    Date::day_of_year

    fn Date::day_of_year(self : Date) -> Int

    Return the one-based day within the year.

    Date::ordinal

    fn Date::ordinal(self : Date) -> Int64

    Return signed days since 1970-01-01.

    Date::text

    fn Date::text(self : Date) -> String

    Format the calendar date as an ISO date.

    Date::week_of_year

    fn Date::week_of_year(self : Date) -> Int

    Return the ISO week number, including adjacent-year weeks.

    Date::weekday

    fn Date::weekday(self : Date) -> Int

    Return the ISO weekday, Monday=1 through Sunday=7.

    DateTime

    pub(all) struct DateTime {
    date : Date
    time : Time
    }

    Calendar date and local time with an optional zone.

    DateTime::epoch_nanos

    Exact UTC nanoseconds for the full date range; no Int64 narrowing.

    DateTime::has_offset

    fn DateTime::has_offset(self : DateTime) -> Bool

    Test whether this date-time carries a fixed or named zone.

    DateTime::instant

    fn DateTime::instant(self : DateTime) -> Int64 raise EngineError

    Absolute instant as nanoseconds since 1970-01-01T00:00:00Z. Fails when the value has no resolvable offset.

    DateTime::text

    fn DateTime::text(self : DateTime) -> String

    Format the stored date, time and zone as ISO text.

    Decimal

    pub struct Decimal {
    coefficient :
    BigInt

    scale : Int
    }

    Exact signed decimal with at most 34 significant digits (DMN number type). Division and out-of-range arithmetic are rounded half-to-even, the same rounding mode required by IEEE 754 decimal128.
    impl Eq for Decimal

    Decimal::abs

    fn Decimal::abs(a : Decimal) -> Decimal

    Return the non-negative decimal magnitude.

    Decimal::add

    fn Decimal::add(a : Decimal, b : Decimal) -> Decimal raise EngineError

    Add decimals with the engine precision limit.

    Decimal::ceiling

    fn Decimal::ceiling(self : Decimal) -> Decimal raise EngineError

    Round toward positive infinity.

    Decimal::compare

    fn Decimal::compare(a : Decimal, b : Decimal) -> Int

    Return a negative, zero or positive integer according to numeric order.

    Decimal::divide

    fn Decimal::divide(a : Decimal, b : Decimal) -> Decimal raise EngineError

    Divide decimals; zero divisors raise E_DIV_ZERO.

    Decimal::equal

    fn Decimal::equal(self : Decimal, other : Decimal) -> Bool

    Decimal::exp

    fn Decimal::exp(self : Decimal) -> Decimal raise EngineError

    Compute the exponential through the floating-point bridge.

    Decimal::floor

    fn Decimal::floor(self : Decimal) -> Decimal raise EngineError

    Round toward negative infinity.

    Decimal::is_integer

    fn Decimal::is_integer(self : Decimal) -> Bool

    Test whether the normalized decimal has no fractional part.

    Decimal::is_negative

    fn Decimal::is_negative(self : Decimal) -> Bool

    Test the decimal sign.

    Decimal::is_zero

    fn Decimal::is_zero(self : Decimal) -> Bool

    Test whether the decimal coefficient is zero.

    Decimal::ln

    fn Decimal::ln(self : Decimal) -> Decimal raise EngineError

    Compute the natural logarithm through the floating-point bridge.

    Decimal::log10

    fn Decimal::log10(self : Decimal) -> Decimal raise EngineError

    Compute the base-ten logarithm through the floating-point bridge.

    Decimal::modulo

    fn Decimal::modulo(a : Decimal, b : Decimal) -> Decimal raise EngineError

    Compute FEEL modulo with the divisor sign convention.

    Decimal::multiply

    fn Decimal::multiply(a : Decimal, b : Decimal) -> Decimal raise EngineError

    Multiply decimals with the engine precision limit.

    Decimal::negate

    fn Decimal::negate(a : Decimal) -> Decimal

    Reverse the decimal sign.

    Decimal::not_equal

    fn Decimal::not_equal(x : Decimal, y : Decimal) -> Bool

    Decimal::pow

    fn Decimal::pow(a : Decimal, b : Decimal) -> Decimal raise EngineError

    Raise to a decimal power, using exact integer powers when supported.

    Decimal::power_of_ten

    fn Decimal::power_of_ten(n : Int) -> Decimal raise EngineError

    Construct a decimal power of ten.

    Decimal::round

    fn Decimal::round(self : Decimal, places : Int) -> Decimal raise EngineError

    Round to decimal places using half-even ties; negative places are clamped to zero.

    Decimal::sqrt

    fn Decimal::sqrt(self : Decimal) -> Decimal raise EngineError

    Compute a square root through the bounded floating-point bridge.

    Decimal::text

    fn Decimal::text(self : Decimal) -> String

    Format the normalized decimal without binary floating-point conversion.

    Decimal::to_int

    fn Decimal::to_int(self : Decimal) -> Int raise EngineError

    Convert an integral decimal to Int32; fractional values raise E_TYPE.

    Decimal::truncate

    fn Decimal::truncate(self : Decimal) -> Decimal raise EngineError

    Discard fractional digits toward zero.

    DurationDS

    pub(all) struct DurationDS {
    negative : Bool
    days : Int64
    nanos : Int64
    }

    Days and time duration. days plus nanos (always less than one day), with a separate sign so that the canonical form is unique.

    DurationDS::add

    Add two exact days-and-time durations.

    DurationDS::canonical

    fn DurationDS::canonical(negative : Bool, days : Int64, nanos : Int64) -> DurationDS raise EngineError

    Normalize signed day and nanosecond components.

    DurationDS::is_zero

    fn DurationDS::is_zero(self : DurationDS) -> Bool

    Test whether both duration components are zero.

    DurationDS::negate

    fn DurationDS::negate(self : DurationDS) -> DurationDS

    Reverse the duration sign while preserving canonical zero.

    DurationDS::subtract

    fn DurationDS::subtract(a : DurationDS, b : DurationDS) -> DurationDS raise EngineError

    Subtract two exact days-and-time durations.

    DurationDS::text

    fn DurationDS::text(self : DurationDS) -> String

    Format a canonical ISO days-and-time duration.

    DurationDS::total_nanos

    Return the exact signed nanosecond count as a BigInt.

    DurationDS::zero

    fn DurationDS::zero() -> DurationDS

    Construct a zero days-and-time duration.

    DurationYM

    pub(all) struct DurationYM {
    negative : Bool
    years : Int
    months : Int
    }

    Years and months duration, canonicalised so 0 <= months < 12.

    DurationYM::canonical

    fn DurationYM::canonical(negative : Bool, years : Int, months : Int) -> DurationYM raise EngineError

    Normalize years and months with a separate sign.

    DurationYM::is_zero

    fn DurationYM::is_zero(self : DurationYM) -> Bool

    Test whether the years-and-months duration is zero.

    DurationYM::text

    fn DurationYM::text(self : DurationYM) -> String

    Format a canonical ISO years-and-months duration.

    DurationYM::total_months

    fn DurationYM::total_months(self : DurationYM) -> Int64

    Return the signed total number of months.

    DurationYM::zero

    fn DurationYM::zero() -> DurationYM

    Construct a zero years-and-months duration.

    FunctionValue

    pub(all) struct FunctionValue {
    name : String
    params : Array[String]
    callback : (Array[Value]) -> Value raise EngineError
    }

    Callable FEEL value with parameter names and a captured callback.

    Range

    pub(all) struct Range {
    comparison : String?
    start : Value?
    start_included : Bool
    end : Value?
    end_included : Bool
    }

    FEEL interval. Missing endpoints are unbounded.

    Range::contains

    fn Range::contains(range : Range, value : Value) -> Bool raise EngineError

    Test point membership with open and closed endpoint semantics.

    Range::json

    fn Range::json(range : Range) -> Json raise EngineError

    Encode range bounds and inclusion flags as JSON.

    Range::overlaps

    fn Range::overlaps(a : Range, b : Range) -> Bool raise EngineError

    Test whether two ranges share at least one point.

    Range::text

    fn Range::text(range : Range) -> String

    Format range endpoints and inclusion brackets.

    Range::unbounded

    fn Range::unbounded() -> Range

    Construct a range with neither a lower nor an upper bound.

    Time

    pub(all) struct Time {
    hour : Int
    minute : Int
    second : Int
    nanos : Int
    zone : Zone
    }

    Time of day with optional UTC offset or named IANA zone. Construct validated values with make_time or parse_time.

    Time::seconds

    fn Time::seconds(self : Time) -> Int64

    Nanoseconds since midnight for a valid time, ignoring the zone.

    Time::text

    fn Time::text(self : Time) -> String

    Format time, fractional seconds and the stored zone.

    Value

    pub(all) enum Value {
    Null
    Boolean(Bool)
    Number(Decimal)
    Text(String)
    Date(Date)
    Time(Time)
    DateTime(DateTime)
    DaysSeconds(DurationDS)
    YearsMonths(DurationYM)
    List(Array[Value])
    Context(Map[String, Value])
    Range(Range)
    Function(FunctionValue)
    }

    Runtime FEEL value. All temporal values are exact; functions capture their defining scope in callback, which keeps the core value type independent of the evaluator package.
    impl Eq for Value

    Value::equal

    fn Value::equal(self : Value, other : Value) -> Bool

    Value::equals

    fn Value::equals(a : Value, b : Value) -> Bool

    Compare FEEL values structurally, with temporal instant equality.

    Value::json

    fn Value::json(self : Value) -> Json raise EngineError

    Encode a value as JSON; decimals retain exact numeric spelling.

    Value::not_equal

    fn Value::not_equal(x : Value, y : Value) -> Bool

    Value::text

    fn Value::text(self : Value) -> String

    Format a value as FEEL-oriented diagnostic text.

    Value::type_name

    fn Value::type_name(self : Value) -> String

    Return the FEEL runtime type name.

    Zone

    pub(all) enum Zone {
    Unzoned
    Fixed(Int)
    Named(String)
    }

    Unzoned, fixed-offset or named time zone representation.

    civil_from_days

    fn civil_from_days(days : Int64) -> Date raise EngineError

    Convert signed days since 1970-01-01 to a Gregorian date.

    compare_values

    fn compare_values(a : Value, b : Value) -> Int raise EngineError

    Compare compatible FEEL values; incompatible kinds raise E_TYPE.

    date_add_days

    fn date_add_days(date : Date, days : Int64) -> Date raise EngineError

    Add signed calendar days without changing the calendar representation.

    date_add_months

    fn date_add_months(date : Date, months : Int64) -> Date raise EngineError

    Add signed months, clamping the day to the destination month.

    date_from_ordinal

    fn date_from_ordinal(days :
    BigInt
    ) -> Date raise EngineError

    Convert an exact epoch day after checking the supported Gregorian year range.

    date_of

    fn date_of(year : Int, month : Int, day : Int) -> Date raise EngineError

    Validate year, month and day and construct a Gregorian date.

    datetime_from_instant

    fn datetime_from_instant(nanos :
    BigInt
    , zone : Zone) -> DateTime raise EngineError

    Convert an exact UTC instant to a local date-time in the embedded IANA range.

    datetime_of

    fn datetime_of(date : Date, time : Time) -> DateTime raise EngineError

    Construct a local date-time and reject nonexistent times in covered IANA years.

    datetime_zone_offset

    fn datetime_zone_offset(value : DateTime) -> Int raise EngineError

    Resolve an IANA offset at a complete local time using embedded 2026e data. Gaps fail explicitly; overlaps choose the earlier UTC instant.

    days_from_civil

    fn days_from_civil(year : Int, month : Int, day : Int) -> Int64

    Convert a Gregorian date to signed days since 1970-01-01.

    days_in_month

    fn days_in_month(year : Int, month : Int) -> Int

    Return the month length, or zero for an invalid month.

    decimal

    fn decimal(text : String) -> Decimal raise EngineError

    Parse a decimal literal. Accepts an optional sign, a leading dot, and a decimal exponent. Values with more than 34 significant digits are rounded.

    decimal_int

    fn decimal_int(n : Int) -> Decimal

    Construct an exact decimal from a 32-bit integer.

    decimal_int64

    fn decimal_int64(n : Int64) -> Decimal

    Construct an exact decimal from a 64-bit integer.

    decimal_to_scaled

    fn decimal_to_scaled(d : Decimal, target_scale : Int) ->
    BigInt
    raise EngineError

    Convert a decimal component to an integer in target_scale units, rounding half-to-even.

    duration_ds_of_nanos

    fn duration_ds_of_nanos(total :
    BigInt
    ) -> DurationDS raise EngineError

    Build a canonical duration from a signed nanosecond count, rounding sub-nanosecond input is not possible by construction.

    duration_ym_of_months

    fn duration_ym_of_months(total :
    BigInt
    ) -> DurationYM raise EngineError

    Normalize an exact month count, rejecting magnitudes beyond Int32 years.

    error_code

    fn error_code(e : EngineError) -> String

    Extract the machine-readable error code.

    error_message

    fn error_message(e : EngineError) -> String

    Extract the diagnostic message.

    fail

    fn fail(code : String, message : String) -> EngineError

    Construct a semantic failure without a source location.

    fail_at

    fn fail_at(code : String, line : Int, column : Int, message : String) -> EngineError

    Construct a failure with a source line and column.

    from_double

    fn from_double(value : Double, places : Int) -> Decimal raise EngineError

    Build a decimal from a double rounded to places decimal places.

    from_json

    fn from_json(j : Json) -> Value raise EngineError

    Decode JSON values using exact decimals.

    is_leap_year

    fn is_leap_year(year : Int) -> Bool

    Test the Gregorian leap-year rule.

    json_context

    fn json_context(text : String) -> Map[String, Value] raise EngineError

    Decode a JSON object, rejecting invalid JSON and duplicate keys.

    make_time

    fn make_time(hour : Int, minute : Int, second : Int, nanos : Int, zone : Zone) -> Time raise EngineError

    Validate and construct a time from integer components.

    max_digits

    let max_digits : Int

    named_zone_offset

    fn named_zone_offset(name : String, date : Date) -> Int?

    Compatibility helper: resolve at local midnight, never guess a whole-day offset.

    parse_date

    fn parse_date(text : String) -> Date raise EngineError

    Parse an ISO date, rejecting invalid calendar components.

    parse_datetime

    fn parse_datetime(text : String) -> DateTime raise EngineError

    Parse an ISO date and time separated by T.

    parse_duration

    fn parse_duration(text : String) -> (DurationDS, DurationYM) raise EngineError

    Parse an ISO 8601 duration. Durations mixing date and time-of-day components with years/months are rejected, as required by FEEL.

    parse_offset_text

    fn parse_offset_text(text : String, start : Int) -> (Zone, Int) raise EngineError

    Parse a UTC offset beginning at start.

    parse_time

    fn parse_time(text : String) -> Time raise EngineError

    Parse an ISO time with an optional UTC offset or named zone.

    standard_zone_offset

    fn standard_zone_offset(zone : Zone) -> Int?

    Only date-independent named offsets can resolve a time without a date.

    zero

    fn zero() -> Decimal

    Construct exact decimal zero.

    zone_offset_seconds

    fn zone_offset_seconds(zone : Zone, date : Date) -> Int raise EngineError

    Compatibility helper for local midnight. Use datetime_zone_offset for a time.

    Powered by MoonBit

    Site sourceReport issueModulesSkillsBuild queueStatistics

    © 2026 mooncakes.io