-
Use Onion architecture
- Dependencies go inwards. That is, the Core domain doesn't know about outside layers
-
Use pipeline model to implement workflows/use-cases/stories
- Business logic makes decisions
- IO does storage with minimal logic
- Keep Business logic and IO separate
-
Keep IO at edges
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#load "Result.fs" | |
// ================================== | |
// Example of workflows with Onion architecture | |
// ================================== | |
let notImplemented() = failwith "not implemented" | |
// ================================== | |
// pure workflow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module TestUtils | |
// Utilities for tests | |
/// Helper for testing only! Do not use in production! | |
let getOk result = | |
match result with | |
| Ok v -> v | |
| Error _ -> failwith "Error not expected" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace AsyncExample | |
// requires Result.fs from https://github.com/swlaschin/DomainModelingMadeFunctional/blob/master/src/OrderTaking/Result.fs | |
open System | |
open System.Net | |
module SimpleAsyncExample = | |
let makeAsync name = async { | |
printfn "Started %s" name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
Example of domain-driven design for Checkers | |
Rules from here: https://www.itsyourturn.com/t_helptopic2030.html | |
A SERIES OF SCRATCH DESIGNS | |
*) | |
// As we go through the rules, and learn things, we create a series of designs | |
module Version1 = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#r "packages/FSharp.Data/lib/net40/FSharp.Data.dll" | |
open FSharp.Data | |
type OzoneFile = CsvProvider<"http://faculty.washington.edu/heagerty/Books/Biostatistics/DATA/ozone.csv"> | |
let csv = new OzoneFile() | |
//What are the column names of the dataset? | |
csv.Headers |
- Seven ineffective coding habits many F# programmers don't have - Yan Cui
- JavaScript Combinators, the 'Six' Edition - Reginald Braithwaite
- Spice up your website with machine learning! - Evelina Gabasova
- Ionide and state of F# open source environment - Krzysztof Cieślak
- The T in TDD: Test, Types, Tales - Mathias Brandewinder