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 MyGame | |
open System | |
open System.Numerics | |
open Prime | |
open Nu | |
type GameplayState = | |
| Playing | |
| Quitting |
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
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
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
[<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> |
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
No matter the business domain or programming language, programmers always end up needing support for ALL of these things | |
in some form - | |
* Resource Semantics (such as RAII in C++, or finalizers in C#) | |
* Error Semantics (such as exceptions in most languages, or conditions in Common Lisp) | |
* Algebraic Types (such as structs and unions in C, or records and DUs in F#) | |
* Data Abstraction (such as that which is often badly entangled within object systems in OO languages) |
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
exception AssertException of string | |
module Assert = | |
let isTrue value = | |
if not value then | |
raise (AssertException "Expected true but got false.") | |
let isFalse value = | |
if value then |
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
exception AssertionException of string | |
module Assert = | |
let isTrue value = | |
if not value then | |
raise (AssertionException "Expected true but got false.") | |
let isFalse value = | |
if value then |
NewerOlder