caffeine_lang/common/helpers
Types
A tuple of a label, type, and value used for template resolution.
pub type ValueTuple {
ValueTuple(
label: String,
typ: accepted_types.AcceptedTypes,
value: dynamic.Dynamic,
)
}
Constructors
-
ValueTuple( label: String, typ: accepted_types.AcceptedTypes, value: dynamic.Dynamic, )
Values
pub fn json_from_file(
file_path: String,
) -> Result(String, errors.CompilationError)
Reads the contents of a JSON file as a string.
pub fn map_reference_to_referrer_over_collection(
references references: List(a),
referrers referrers: List(b),
reference_name reference_name: fn(a) -> String,
referrer_reference referrer_reference: fn(b) -> String,
) -> List(#(b, a))
Maps each referrer to its corresponding reference by matching names. Returns a list of tuples pairing each referrer with its matched reference.
pub fn result_try(
result: Result(a, e),
next: fn(a) -> Result(b, e),
) -> Result(b, e)
A helper for chaining Result operations with the use syntax.
Equivalent to result.try but defined here for convenient use with use.