Skip to content

Instantly share code, notes, and snippets.

@swlaschin
swlaschin / DomainModelingMadeFunctional_outline.md
Last active May 6, 2021
Workshop outline: "Domain Modeling Made Functional"
View DomainModelingMadeFunctional_outline.md

Workshop: Domain Modeling Made Functional

Functional programming and domain-driven design might not seem to be a good match, but in fact functional programming can be an excellent approach to designing decoupled, reusable systems with a rich domain model. This workshop will show you why.

This will be a hands-on workshop designed for beginners in functional programming. We'll do lots of exercises and build some small projects that take us all the way from high-level design to low-level implementation.

@swlaschin
swlaschin / dmmf_workshop.md
Created Jan 5, 2021
"Domain Modeling Made Functional" workshop description
View dmmf_workshop.md

"Domain Modeling Made Functional" workshop

Functional programming and domain-driven design might not seem to be a good match, but in fact functional programming can be an excellent approach to designing decoupled, reusable systems with a rich domain model. This workshop will show you why.

This will be a hands-on workshop designed for beginners in functional programming. We'll do lots of exercises and build some small projects that take us all the way from high-level design to low-level implementation.

Who is this for?

This will be especially useful for people learning functional programming -- all concepts used in the workshop will be explained. Previous development experience is recommended.

@swlaschin
swlaschin / SixDependencyApproachesInPractice.fsx
Last active Feb 24, 2021
Code examples from fsharpforfunandprofit.com/posts/dependencies-5/
View SixDependencyApproachesInPractice.fsx
(* ===================================
Code from my series of posts "Six approaches to dependency injection"
=================================== *)
open System
(*
## The requirements
@swlaschin
swlaschin / DependencyRetention.fsx
Last active Dec 30, 2020
Code examples from fsharpforfunandprofit.com/posts/dependencies/
View DependencyRetention.fsx
(* ===================================
Code from my series of posts "Six approaches to dependency injection"
=================================== *)
open System
(* ======================================================================
1. Dependency Retention
In which we don't worry about managing dependencies,
@swlaschin
swlaschin / DependencyInterpretation.fsx
Last active Dec 30, 2020
Code examples from fsharpforfunandprofit.com/posts/dependencies-4/
View DependencyInterpretation.fsx
(* ===================================
Code from my series of posts "Six approaches to dependency injection"
=================================== *)
open System
(* ======================================================================
5. Dependency Interpretation
@swlaschin
swlaschin / DependencyParameterization.fsx
Last active Dec 30, 2020
Code examples from fsharpforfunandprofit.com/posts/dependencies-2/
View DependencyParameterization.fsx
(* ===================================
Code from my series of posts "Six approaches to dependency injection"
=================================== *)
open System
#load "Expecto.fsx" // from https://gist.github.com/swlaschin/38e21ff8d64ebe4e93e42fd288b486d5
(* ======================================================================
@swlaschin
swlaschin / DependencyInjection.fsx
Last active Dec 30, 2020
Code examples from fsharpforfunandprofit.com/posts/dependencies-3/
View DependencyInjection.fsx
(* ===================================
Code from my series of posts "Six approaches to dependency injection"
=================================== *)
open System
(* ======================================================================
4. Dependency Injection
@swlaschin
swlaschin / DependencyRejection.fsx
Last active Dec 30, 2020
Examples from my post "Five approaches to dependency injection" at fsharpforfunandprofit.com/posts/dependencies/
View DependencyRejection.fsx
(* ===================================
Code from my series of posts "Six approaches to dependency injection"
=================================== *)
open System
(* ======================================================================
2. Dependency Rejection
@swlaschin
swlaschin / Expecto.fsx
Created Dec 22, 2020
A simple test framework for demos and blogs posts, based on Expecto
View Expecto.fsx
// ======================================
// A simple test framework for demos and blogs posts, based on Expecto
// ======================================
open System
open System.Diagnostics
[<AutoOpen>]
module Domain =
type ExpectoException(msg) = inherit Exception(msg)
type AssertException(msg) = inherit ExpectoException(msg)
@swlaschin
swlaschin / duplicate_load.md
Last active Dec 20, 2020
Example of duplicate #load
View duplicate_load.md

The duplicate #load problem and how to fix it

Symptom: A weird error such as:

error FS0001: This expression was expected to have type
    'FSI_0011.MyType'
but here has type
    'FSI_0012.MyType'