Feel.Value (feel v0.1.0)

Copy Markdown View Source

FEEL values, and the FEEL type Any.

A FEEL value is a member of the semantic domain of DMN 1.6 (section 10.3.2.1). Every value belongs to one of the FEEL types, and each type has a module under this one that defines how its values are represented, in a type t of its own:

FEEL typeModule
nullFeel.Value.Null
booleanFeel.Value.Boolean
stringFeel.Value.String
numberFeel.Value.Number
dateFeel.Value.Date
timeFeel.Value.Time
date and timeFeel.Value.DateTime
years and months durationFeel.Value.YearsAndMonthsDuration
days and time durationFeel.Value.DaysAndTimeDuration
rangeFeel.Value.Range
listFeel.Value.List
contextFeel.Value.Context
functionFeel.Value.Function

Each of those modules also has type/0 (or type/1 for the parameterised types), which returns the descriptor of its type, and value?/1, which checks whether a term is one of its values. Feel.Type is the other half: it describes the types themselves as data, for checking and inference.

This module is the type Any, the top of the type lattice (section 10.3.2.9). Every value is an instance of it, and every type conforms to it. It is the type of a function parameter declared without a type. t/0 is the union of all the value types.

Summary

Types

t()

A FEEL value as seen by Elixir code.

Functions

Returns the type descriptor of Any.

Returns true when term is a FEEL value of any type.

Types

Functions

type()

@spec type() :: Feel.Type.t()

Returns the type descriptor of Any.

value?(term)

@spec value?(term()) :: boolean()

Returns true when term is a FEEL value of any type.

Like the other value?/1 functions, it looks only at the outermost shape: a list is a list of anything, and a context is a Feel.Value.Context or a map with string keys.