Skip to content

Instantly share code, notes, and snippets.

swlaschin

Block or report user

Report or block swlaschin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@swlaschin
swlaschin / WorkflowTemplate.fsx
Created May 13, 2019
Workflow Template example
View WorkflowTemplate.fsx
#load "Result.fs"
// ==================================
// Example of workflows with Onion architecture
// ==================================
let notImplemented() = failwith "not implemented"
// ==================================
// pure workflow
@swlaschin
swlaschin / testutils.fs
Last active Apr 29, 2019
Test utilities
View testutils.fs
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"
View AsyncExample.fs
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
@swlaschin
swlaschin / effective-fsharp.md
Last active Apr 26, 2019
Effective F#, tips and tricks
View effective-fsharp.md

Architecture

  • 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
@swlaschin
swlaschin / ndcoslo17_fp_track.md
Created Jul 5, 2017
Functional Track talks from NDC Oslo 2017
View ndcoslo17_fp_track.md

Functional Track talks from NDC Oslo 2017

Also, here is the list of all videos from NDC Oslo 2017:

Wednesday 2017-06-14

@swlaschin
swlaschin / ndclondon17_fp_track.md
Last active Jul 10, 2017
Functional Track talks from NDC London 2017
View ndclondon17_fp_track.md

Functional Track talks from NDC London 2017

Also, here is the list of all videos from NDC London 2017:

Wednesday 2017-01-18

@swlaschin
swlaschin / 1-checkers-scratch-design.fsx
Last active Aug 14, 2018
Example of Domain Driven Design for the game of checkers. There are two files: a scratch file with a series of designs, and a final version.
View 1-checkers-scratch-design.fsx
(*
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 =
View CsvProvider.fsx
#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
You can’t perform that action at this time.