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
let rec mkKn (ty: System.Type) = | |
if Reflection.FSharpType.IsFunction(ty) then | |
let _, ran = Reflection.FSharpType.GetFunctionElements(ty) | |
// NOTICE: do not delay `mkKn` invocation until runtime | |
let f = mkKn ran | |
Reflection.FSharpValue.MakeFunction(ty, fun _ -> f) | |
else | |
box () |
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.Collections.Generic | |
type Cache<'T> private () = | |
static let d = Dictionary<string,'T>() | |
static member Format(format: Printf.StringFormat<'T>) : 'T = | |
let key = format.Value | |
match d.TryGetValue(key) with | |
| true, r -> r | |
| _ -> |
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 A = {aval:int;b:B} | |
and B = {bval:int;a:A} | |
let rec a : A = { aval = 0; b = b } | |
and b : B = { bval = 1; a = a } |
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
let test () = printfn "OK" |
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
import Data.List | |
data Rolj = Oficiant | |
| Povar | |
| Somelje | |
deriving (Eq, Show) | |
data Reshenije = | |
Reshenije { aristid :: Rolj | |
, evasio :: Rolj |
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
(* | |
Copyright (c) 2008-2011 IntelliFactory | |
GNU Affero General Public License Usage The code | |
is free software: you can redistribute it and/or | |
modify it under the terms of the GNU Affero | |
General Public License, version 3, as published by | |
the Free Software Foundation. |
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 Website | |
module Client = | |
open IntelliFactory.WebSharper | |
open IntelliFactory.WebSharper.Html | |
[<JavaScript>] | |
let SayHello () = | |
JavaScript.Alert("HELLO!") |
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
let leak1 () = | |
let thread () = | |
async { | |
let x = Array.create 1024 0uy | |
return () | |
} | |
|> Async.Start | |
async { | |
while true do |
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 Json = | |
| Array of list<Json> | |
| Double of double | |
| False | |
| Integer of int64 | |
| Null | |
| Object of list<string*Json> | |
| String of string | |
| True |
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
(* | |
Copyright (c) 2008-2011 IntelliFactory | |
GNU Affero General Public License Usage The code | |
is free software: you can redistribute it and/or | |
modify it under the terms of the GNU Affero | |
General Public License, version 3, as published by | |
the Free Software Foundation. |