After the 'F# Compiler Community Session' I read the first 1K lines of SyntaxTree.fs
. That's what I learned about the language.
-
There is a byte string
let a = "abc"B val a : byte [] = [|97uy; 98uy; 99uy|]
(* State *) | |
type IState<'data> = | |
abstract member Data: 'data | |
abstract member Update: 'data -> unit | |
[<CLIEvent>] | |
abstract member Updated: IEvent<'data> | |
(* Tracked State *) | |
type ITrackedState<'data> = |
type OpenGLControl() as this = | |
inherit Control() | |
let mode = new Graphics.GraphicsMode(new Graphics.ColorFormat(8, 8, 8, 8), 24, 0, 0, Graphics.ColorFormat.Empty, 1); | |
let mutable win : GameWindow = null | |
do | |
this.IsHitTestVisible <- false | |
override this.OnAttachedToVisualTree args = |
module Observable = | |
open System | |
// ('a -> 'b -> unit) -> 'a -> IObservable<'b> | |
let subscribeWeakly callback target source = | |
let mutable sub:IDisposable = null | |
let mutable disposed = false | |
let wr = new WeakReference<_>(target) |
[<AutoOpen>] | |
module NSImageExtensions = | |
open AppKit | |
type NSImage with | |
static member GetSystemSymbolTinted (symbolName: string, accessibilityDescription: string, tint: NSColor) : NSImage = | |
let original = NSImage.GetSystemSymbol(symbolName, accessibilityDescription) | |
NSImage.ImageWithSize(original.Size, false, (fun bounds -> |
open Fable.React | |
type private GlobalState = | |
{| current: Map<string, obj> | |
update: Map<string, obj> -> unit |} | |
[<RequireQualifiedAccess>] | |
module GlobalState = | |
let private defaultValue = |
A few weeks ago the unavoidable happened, a customer asked for a translated (non English) version of our SPA. We knew this would happen at some point, but as it happens always had more important work in our backlog.
There was no way to postpone this further.
Our requirements:
We recently had to provide (near) live data to a set of views in our application. After considering the most common ways to build this we decided to go with long polling. Our entire app is event based, so we know if a certain event happed the data might have changed. Lets assume the following types represent what can happen in our application:
type CounterEvent =
| CounterWasIncremented byValue: int