sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
- Download zsh-autosuggestions by
module App | |
open Elmish | |
type State = | |
{ CurrentUser: string option } | |
type Msg = | |
| SignIn of string | |
| SignOut |
// ========= Event Sourcing in a nutshell | |
(* | |
FriendlyName: string | |
Aggregate friendly name. | |
Initial: 'State | |
Initial (empty) state we will start with. | |
Decide: 'Command -> 'State -> 'Event list |
Given you have a stack with one or more Lambda functions (e.g. as part of a Step Functions state machine), it can be pretty useful to stub long running parts with a known response.
This makes use of cdk Aspects, which allows modifying all or a filtered subsset of resources for a given scope (Stack, Construct).
In addition this leverages raw overrides to remove the original code of the Lambda function.
Please note, that the stub has to be in Python or NodeJS, since inlining code is only supported by those runtimes.
namespace Infrastructure | |
open System.Text.Encodings.Web | |
open System.Text.Json | |
open System.Text.Json.Serialization | |
[<RequireQualifiedAccess>] | |
module JsonSerializer = | |
let private setupOptions (options: JsonSerializerOptions) = | |
options.PropertyNamingPolicy <- JsonNamingPolicy.CamelCase |
// Single case union | |
[<Struct>] type MHPI = MHPI of double | |
// An entity that contains SCU | |
type Entity = { | |
Foo: string | |
Bar: MHPI | |
} | |
// JSON.NET Converter |
namespace Newtonsoft.Json.Converters | |
open Microsoft.FSharp.Reflection | |
open Newtonsoft.Json | |
open System | |
type IdiomaticDuConverter() = | |
inherit JsonConverter() | |
[<Literal>] |
namespace HttpClient.FSharp | |
open System | |
open System.Net.Http | |
type HttpMethod = | |
| Post | |
| Put | |
| Delete | |
| Get |
// Our simple domain model | |
type Priority = | |
| Low | |
| Normal | |
| High | |
type Message = { | |
Text : string | |
Priority : Priority | |
} |