polix.effects.resolution
Reference resolution for effects.
Effects can use symbolic references that are resolved at application time. This namespace provides the IResolver protocol and DefaultResolver implementation for resolving references to concrete values.
Reference types: - Keyword (:self, :target) - resolved from context bindings - State path ([:state :path :to :value]) - resolved from state - Context path ([:ctx :bindings :key]) - resolved from context - Param path ([:param :key]) - resolved from effect parameters
builtin-fns
Built-in functions available for :update-in effects.
These safe, common functions can be referenced by keyword in effect definitions rather than passing actual function references.
default-resolver
The default resolver instance.
IResolver
protocol
Protocol for resolving references in effects.
A resolver transforms symbolic references into concrete values by looking them up in state, context, or parameters.
members
resolve-ref
(resolve-ref this ref ctx)Resolves a reference to a concrete value within the given context.
The context map contains: - :state - the current application state - :bindings - map of symbolic bindings (:self, :target, etc.) - :params - effect parameters
Returns the resolved value, or the original ref if not a reference type.
resolve-fn
(resolve-fn f)Resolves a function reference to an actual function.
Accepts: - A function - returned as-is - A keyword - looked up in builtin-fns - A symbol - converted to keyword and looked up
Returns the resolved function, or nil if not found.
resolve-path
(resolve-path resolver path ctx)Resolves a path, handling references within path segments.
If the path itself is a reference (starts with :state, :ctx, or :param), resolves the entire path. Otherwise, resolves each segment individually.
resolve-predicate
(resolve-predicate pred)Resolves a predicate specification to a function.
Accepts: - A function - used directly - A keyword - returns a function that gets that key from items - A map - returns a function that matches all key-value pairs
Returns a predicate function suitable for use with filter or remove.