-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed module structure and renamed files to compensate for f# bug
- Loading branch information
Showing
36 changed files
with
742 additions
and
669 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
obj | ||
bin | ||
packages | ||
packages | ||
.vs |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
open UI | ||
open UI.Helper | ||
open System | ||
open Expecto | ||
|
||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module Step1.Domain | ||
namespace Step1.Domain | ||
|
||
type Flavour = | ||
| Vanilla | ||
|
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
namespace Step1 | ||
|
||
module Program = | ||
|
||
open Step1.Domain | ||
open Step1.Infrastructure | ||
|
||
|
||
type Msg = | ||
| Append_Flavour_sold_Vanilla | ||
| Append_Flavour_sold_Strawberry | ||
| Append_Flavour_sold_StrawberryFlavourEmptyStrawberry | ||
| GetEvents of AsyncReplyChannel<Event list> | ||
|
||
let mailbox () = | ||
let eventStore : EventStore<Event> = EventStore.initialize() | ||
|
||
MailboxProcessor.Start(fun inbox -> | ||
let rec loop eventStore = | ||
async { | ||
let! msg = inbox.Receive() | ||
|
||
match msg with | ||
| Append_Flavour_sold_Vanilla -> | ||
eventStore.Append [Flavour_sold Vanilla] | ||
return! loop eventStore | ||
|
||
| Append_Flavour_sold_Strawberry -> | ||
eventStore.Append [Flavour_sold Strawberry ] | ||
return! loop eventStore | ||
|
||
| Append_Flavour_sold_StrawberryFlavourEmptyStrawberry -> | ||
eventStore.Append [Flavour_sold Strawberry ; Flavour_empty Strawberry] | ||
return! loop eventStore | ||
|
||
| GetEvents reply -> | ||
reply.Reply (eventStore.Get()) | ||
return! loop eventStore | ||
} | ||
|
||
loop eventStore | ||
) | ||
|
||
|
||
let Append_Flavour_sold_Vanilla (mailbox : MailboxProcessor<Msg>) = | ||
mailbox.Post Msg.Append_Flavour_sold_Vanilla | ||
|
||
let Append_Flavour_sold_Strawberry (mailbox : MailboxProcessor<Msg>) = | ||
mailbox.Post Msg.Append_Flavour_sold_Strawberry | ||
|
||
let Append_Flavour_sold_StrawberryFlavourEmptyStrawberry (mailbox : MailboxProcessor<Msg>) = | ||
mailbox.Post Msg.Append_Flavour_sold_StrawberryFlavourEmptyStrawberry | ||
|
||
let getEvents (mailbox : MailboxProcessor<Msg>) = | ||
mailbox.PostAndReply Msg.GetEvents |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module Step2.Domain | ||
namespace Step2.Domain | ||
|
||
type Flavour = | ||
| Vanilla | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module Step2.Infrastructure | ||
namespace Step2.Infrastructure | ||
|
||
type Events<'Event> = | ||
'Event list | ||
|
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
namespace Step2 | ||
|
||
module Program = | ||
|
||
open Step2.Domain | ||
open Step2.Infrastructure | ||
|
||
let eventStore : EventStore<Event> = EventStore.initialize() | ||
|
||
type Msg = | ||
| Append_Flavour_sold_Vanilla | ||
| Append_Flavour_sold_Strawberry | ||
| Append_Flavour_sold_StrawberryFlavourEmptyStrawberry | ||
| GetEvents of AsyncReplyChannel<Event list> | ||
| SoldIcecreams of AsyncReplyChannel<Flavour list> | ||
|
||
let mailbox () = | ||
let eventStore : EventStore<Event> = EventStore.initialize() | ||
|
||
MailboxProcessor.Start(fun inbox -> | ||
let rec loop eventStore = | ||
async { | ||
let! msg = inbox.Receive() | ||
|
||
match msg with | ||
| Append_Flavour_sold_Vanilla -> | ||
eventStore.Append [Flavour_sold Vanilla] | ||
return! loop eventStore | ||
|
||
| Append_Flavour_sold_Strawberry -> | ||
eventStore.Append [Flavour_sold Strawberry ] | ||
return! loop eventStore | ||
|
||
| Append_Flavour_sold_StrawberryFlavourEmptyStrawberry -> | ||
eventStore.Append [Flavour_sold Strawberry ; Flavour_empty Strawberry] | ||
return! loop eventStore | ||
|
||
| GetEvents reply -> | ||
reply.Reply (eventStore.Get()) | ||
return! loop eventStore | ||
|
||
| SoldIcecreams reply -> | ||
eventStore.Get() | ||
|> List.fold Projections.soldIcecreams.Update Projections.soldIcecreams.Init | ||
|> reply.Reply | ||
|
||
return! loop eventStore | ||
} | ||
|
||
loop eventStore | ||
) | ||
|
||
|
||
let Append_Flavour_sold_Vanilla (mailbox : MailboxProcessor<Msg>) = | ||
mailbox.Post Msg.Append_Flavour_sold_Vanilla | ||
|
||
let Append_Flavour_sold_Strawberry (mailbox : MailboxProcessor<Msg>) = | ||
mailbox.Post Msg.Append_Flavour_sold_Strawberry | ||
|
||
let Append_Flavour_sold_StrawberryFlavourEmptyStrawberry (mailbox : MailboxProcessor<Msg>) = | ||
mailbox.Post Msg.Append_Flavour_sold_StrawberryFlavourEmptyStrawberry | ||
|
||
let getEvents (mailbox : MailboxProcessor<Msg>) = | ||
mailbox.PostAndReply Msg.GetEvents | ||
|
||
let listOfSoldFlavours (mailbox : MailboxProcessor<Msg>) = | ||
mailbox.PostAndReply Msg.SoldIcecreams |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module Step3.Domain | ||
namespace Step3.Domain | ||
|
||
type Flavour = | ||
| Vanilla | ||
|
File renamed without changes.
Oops, something went wrong.