# Domain Modeling Made Functional

## Workshop notes

![](/files/-MEX_ECHmIxthxUqkbFy)

![](/files/-MEX_Nls3K03oJ-3NN-S)

![](/files/-MEX_PWPiIvw3YqJI-0c)

![](/files/-MEX_d-TmROl4G76Agvn)

![](/files/-MEX_iWLynMGwh_yzAA8)

## Source code

<https://github.com/swlaschin/DmmfWorkshop>

## **Extra Material of the Workshop**

* [Four Candles](https://www.youtube.com/watch?v=CNTM9iM1eVw) -- comedy sketch with lessons for DDD
* [Reinventing the transaction script](https://www.youtube.com/watch?v=USSkidmaS6w) (talk)
* Functional DDD
  * [fsharpforfunandprofit.com/ddd](https://fsharpforfunandprofit.com/ddd/)
  * [“Designing with Types” series](https://fsharpforfunandprofit.com/series/designing-with-types.html) on fsharpforfunandprofit.com
  * [Serializing a rich domain model to a database, JSON, etc](https://fsharpforfunandprofit.com/posts/serializating-your-domain-model/)
  * [Code from "Domain Modeling Made Functional" book](https://github.com/swlaschin/DomainModelingMadeFunctional)
  * [Evolving a DDD design: Microwave example project](https://github.com/swlaschin/Microwave/tree/v1)
  * [Functional Domain Modeling (Scala Version)](https://www.slideshare.net/pjschwarz/scala-3-by-example-algebraic-data-types-for-domain-driven-design-part-1)
* Learning F#
  * [FSharpKoans](https://github.com/ChrisMarinos/FSharpKoans/tree/fsharp/FSharpKoans)
* F# Front end:
  * [Elmish -- the Elm Architecture for F# frontends](https://elmish.github.io/elmish/)
  * There is a whole (excellent) [book on using Elmish](https://zaid-ajaj.github.io/the-elmish-book/#/)
  * Also <https://compositional-it.com/blog/2017/09-21-safe-elmish/index.html>
* F# web frameworks:
  * <https://safe-stack.github.io/>
  * [Giraffe](https://github.com/giraffe-fsharp/Giraffe) (uses ASP.NET core)
  * [Suave](https://suave.io/) (standalone)
* Working with JSON and databases
  * [Serializing your domain model](https://fsharpforfunandprofit.com/posts/serializating-your-domain-model/) -- how to share algebraic data types with the outside world
* Advanced F#
  * <https://fsharpforfunandprofit.com/video/>
  * [Capability-based design](https://fsharpforfunandprofit.com/cap/) talk and blog post
  * [Map, apply, bind and “elevated” worlds](https://fsharpforfunandprofit.com/series/map-and-bind-and-apply-oh-my.html)
  * [Cyclic dependencies are evil](https://fsharpforfunandprofit.com/posts/cyclic-dependencies/)
* Event sourcing
  * [Event Sourcing - Step by step in F#](https://medium.com/@dzoukr/event-sourcing-step-by-step-in-f-be808aa0ca18)
  * FsUno - <https://github.com/thinkbeforecoding/FsUno>
  * [A more advanced version of FsUno](https://github.com/thinkbeforecoding/FsUno.Prod) closer to what would be put in production
* Adopting FP in your company
  * [Video: Adopting FP: A Human-First Approach](https://www.youtube.com/watch?v=vpcKnqyNdSQ) -- how to ensure that new ideas work inside a company
* F# tips and example code
  * [F# to C# interop tips](https://gist.github.com/swlaschin/2d3e75a2ff4a87112c19309c86e0dd41)
  * [C# LINQ -> F# equivalents](https://gist.github.com/swlaschin/9b0f11a5fccc73a8c11f7f7551ef19a9)
  * [“Effective F#” gist](https://gist.github.com/swlaschin/31d5a0a2c4478e82e3ed60d653c0206b) -- a lot of guidelines for developing in F#
  * [DTO validation example](https://gist.github.com/swlaschin/886db5a0f8617ce6baab8c260a36e1be)
  * [AsyncExample.fs](https://gist.github.com/swlaschin/4ffac1a64bbfeab383cc3f0e7b09f169) -- some examples of Async
  * [AsyncResult Workflow Template](https://gist.github.com/swlaschin/c153c0c68d894f6e9542fb2a2cfb746e) -- demonstrates async and result workflow
  * [Utility.fs](https://gist.github.com/swlaschin/4e4d1b3323d120983299d21c6203e2dc) -- common classes like NonEmptyList, etc
  * [Testutils.fs](https://gist.github.com/swlaschin/6cc747dccdf678d192d816d1820b63ac) -- utilities for testing
  * [Wrapping](https://gist.github.com/thelegendofando/0a80060f4ac9a45819d8c3fcd066962c)(simple) -- AWS + Json wrappers

## To go further

Links for if you want to keep going after the workshop :

1. see the link at the bottom of the Google Docs file at
2. For C# compatibility, see code at: DmmfWorkshop/CSharpInterop
3. For monads and more, see slides: F-FP\_toolkit.pdf code: ***DmmfWorkshop/src/F-ImplementingWorkflows/01-Exercises.txt***
4. For capability-based design see: <https://fsharpforfunandprofit.com/cap/> <https://www.youtube.com/watch?v=fi1FsDW1QeY>

![](/files/-MEXg-MU5-MBdT8uUV_s)

{% hint style="info" %}
Read his great book on the topic : [Domain Modeling Made Functional](https://www.amazon.com/Domain-Modeling-Made-Functional-Domain-Driven/dp/1680502549)
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yoan-thirion.gitbook.io/knowledge-base/software-craftsmanship/domain-modeling-made-functional.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
