Dependency Interpretation
From Interfaces to Instructions
Data Layer Interfaces
[<Interface>]
type IChannelClient =
abstract GetChannelDescription: channelId: int -> Async<string option>
[<Interface>]
type IMailSender =
abstract Send: MailEntities.Mail -> Async<unit>
[<Interface>]
type IMappingClient =
abstract NotifyLinkEvent: channelId: int * hotelId: int * LinkStatus -> Async<unit>
abstract GetMappingActivation: channelId: int * hotelId: int -> Async<MappingEntities.MappingActivationDto option>The Program Type
Understanding Program Instructions
Command/Query Separation Convention
How the Program Type Works
Building Programs
Example 1: Simple Value
Example 2: Single Query
Example 3: Transforming Results
The map Function
map FunctionImplementing map
mapThe Program Computation Expression
Building the CE
Implementing bind
bind🔗 Additional resources
Instruction Helpers
The Interpreter
Interpreter Implementation
Complete Example
Pattern Name and Origins
Benefits
Clear Separation
Pure Domain Logic
Easy Testing
Explicit Effects
Limitations
Last updated