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
#include "functional" | |
#include "iostream" | |
#include "string" | |
namespace proj | |
{ | |
/// For background on the discussed subject matter, first see this gist article on Abstract Data | |
/// Types and Alternative Forms of Polymorphism in C++ - https://gist.github.com/bryanedds/6a8ea281bb4a3d8b559e | |
/// Dependency injection in C++ is easy, if you do it carefully. The quickest way to do it |
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
namespace Marvel | |
open System | |
open System.Diagnostics | |
open System.Threading | |
open System.Threading.Tasks | |
open Marvel | |
/// The 'Vsync' (AKA, 'Variable Synchrony') monad. | |
/// Runs code synchronously when the 'Venom/System/Sync' Consul variable is 'True', in parallel otherwise. | |
/// NOTE: to reference how all this stuff works in F#, see here - https://msdn.microsoft.com/en-us/library/dd233182.aspx |
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
#include "functional" | |
#include "iostream" | |
namespace proj | |
{ | |
/// Polymorphism in C++ is typically implemented with dynamic dispatch. On the plus side, it's | |
/// easy to grasp (initially), well-understood, and works retroactively. On the minus side, it | |
/// sucks you into OOP quagmires too easily and is not terribly efficient. Knowing about other | |
/// types of polymorphims may lead you to avoid this approach wherever practical. Places where | |
/// it's practically unavoidable are those that require user-defined subtypes, such as plugins |
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
open System | |
[<AutoOpen>] | |
module LoggerModule = | |
/// A fake logger type. | |
type Logger = | |
private { __ : unit } | |
[<RequireQualifiedAccess; CompilationRepresentation (CompilationRepresentationFlags.ModuleSuffix)>] |
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
Array Compute timings... | |
Run time: 00:00:00.2584128 | |
Run time: 00:00:00.2624985 | |
Run time: 00:00:00.2559355 | |
Run time: 00:00:00.2585773 | |
UList Compute timings... | |
Run time: 00:00:00.8482014 | |
Run time: 00:00:00.8477076 | |
Run time: 00:00:00.8356866 | |
Run time: 00:00:00.8330682 |
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
namespace OmniBlade | |
open System | |
open FSharpx.Collections | |
open Prime | |
open Nu | |
open Nu.Declarative | |
open OmniBlade | |
[<AutoOpen>] | |
module OmniGame = |
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
/// A tic-tac-toe piece, or the absence thereof. | |
type Piece = U | X | O | |
/// Tic-tac-toe board position. | |
type Position = { X : int; Y : int } | |
/// The game data abstraction. | |
abstraction Game = | |
{ FirstPlayerTurn : bool | |
Board : Map<Position, Piece> } |
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
type [<NoComparison>] OmniModel = | |
{ Splash : Screen | |
Title : Screen | |
TitleGui : Layer | |
TitlePlay : Entity | |
TitleCredits : Entity | |
TitleExit : Entity | |
Credits : Screen | |
CreditsGui : Layer | |
CreditsBack : Entity |
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
namespace OmniBlade | |
open Prime | |
open Nu | |
open OmniBlade | |
[<AutoOpen>] | |
module OmniGame = | |
type [<NoComparison>] OmniModel = | |
{ Omniscreen : Screen |
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
[<AutoOpen>] | |
module GelmDispatcherModule = | |
type [<NoEquality; NoComparison>] Binding<'m, 's when 's :> Simulant> = | |
{ Address : Address<obj> | |
AddressType : Type | |
MakeMessage : Event<obj, 's> -> 'm option } | |
type [<NoEquality; NoComparison>] Binding<'m, 'e, 's when 's :> Simulant> = | |
| Binding of Binding<'m, 's> |
NewerOlder