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
module Sample | |
let counter = | |
let makeCounter () = | |
let i = ref 0 | |
fun () -> | |
i := !i + 1 | |
!i | |
makeCounter () |
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 Sample | |
open Microsoft.Xna.Framework | |
open Microsoft.Xna.Framework.Graphics | |
type SampleGame () as this = | |
inherit Game() | |
let gametitle, gmanager, sprite = "Sample", new GraphicsDeviceManager(this), lazy new SpriteBatch(this.GraphicsDevice) | |
do | |
gmanager.PreferredBackBufferWidth <- 800 |
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
// F# Compiler Service | |
#r @"..\packages\FSharp.Compiler.Service.0.0.57\lib\net45\FSharp.Compiler.Service.dll" | |
open System | |
open Microsoft.FSharp.Compiler.SourceCodeServices | |
open Microsoft.FSharp.Compiler.Ast | |
let checker = InteractiveChecker.Create() | |
let getUntypedTree (file, input) = | |
let checkOptions = checker.GetProjectOptionsFromScript(file, input, otherFlags = [| "--define:DEBUG" |]) |> Async.RunSynchronously |
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
SyntaxHighlighter.brushes.FSharp = function() { | |
var keywords = | |
'abstract and as assert base begin class default delegate do done ' + | |
'downcast downto elif else end exception extern false finally for ' + | |
'fun function if in inherit inline interface internal lazy let ' + | |
'match member module mutable namespace new null of open or ' + | |
'override private public rec return sig static struct then to ' + | |
'true try type upcast use val void when while with yield ' + | |
'asr land lor lsl lsr lxor mod '; |
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
#r @"bin\Debug\FsControl.Core.dll" // from https://github.com/gmpl/FsControl | |
module Monad = | |
open FsControl.Core.Abstractions | |
let do' = new Monad.DoNotationBuilder() | |
module MonadPlus = | |
open Monad | |
open FsControl.Core.Abstractions.MonadPlus |