This file contains hidden or 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 Validation = { | |
type t<'s, 'f> = | |
| Success('s) | |
| Failure('f) | |
let pure = v => Success(v) | |
let apply = (selector, source, combine) => | |
switch selector { | |
| Success(map) => |
This file contains hidden or 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
{ | |
"Create a nominal type": { | |
"prefix": "nominal", | |
"body": "type $1 = Nominal<$0, '$1'>;", | |
"description": "Creates a nominal type." | |
}, | |
"Define the base Nominal type": { | |
"prefix": "basenominal", | |
"body": [ | |
"class Tagged<T> { #secret_tag: T }", |
This file contains hidden or 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 GameEngine.Common | |
open System | |
// SimpleTypes | |
type String35 = private String35 of string | |
type PersonName = PersonName of String35 |
This file contains hidden or 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
"CheckGameAvailability" = | |
input: GameId | |
output: AvailableGameId OR GameAvailabilityError | |
dependencies: CheckGameExists, CheckGameIsFull | |
check if the game exists | |
check if the game hasn't started | |
check if there's room for one more player | |
if OK, then: |
This file contains hidden or 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
Bounded Context: Dutch Blitz game | |
Workflow: "Join Game" | |
Triggered by: | |
"Join Game" command | |
Primary input: | |
A join request | |
Output events: | |
"Player joined game" event | |
Side-effects: |
This file contains hidden or 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
Bounded Context: Dutch Blitz game | |
Workflow: "Join Game" | |
Triggered by: | |
"Join Game" command | |
Primary input: | |
A join request | |
Output events: | |
"Player joined game" event | |
Side-effects: |
This file contains hidden or 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
data JoinGameRequest = | |
PlayerName | |
AND GameId |