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 | |
type Cylinder = | |
| FourFourEight | |
| SixSixTwelve | |
| ThreeThreeSix | |
| TwoTwoTwo | |
type CylinderMeasurement = | |
{ WidthA: float |
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 FsCheck | |
type Tree<'a> = | |
| Branch of 'a * Tree<'a> * Tree<'a> | |
| Empty | |
let associativity (x: Tree<int>, F(_, f: Tree<int> -> float), F(_, g: float -> char), F(_, h: char -> int)) = | |
((f >> g) >> h) x = (f >> (g >> h)) x + 1 // let it fail | |
Check.Quick associativity |
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
Install ID: bae38b44-cee7-4166-9ca6-ee73bde2b9d0 | |
16.02.2014 22:47:11 [Info] Server started at ws://localhost:8089 | |
Web server started at http://localhost:8090/ | |
Running the CloudSharper service. Press Enter to stop | |
Server exited with code 0. |
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
'devenv.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll' | |
'devenv.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualStudio.Platform.AppDomainManager\v4.0_11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Platform.AppDomainManager.dll' | |
'devenv.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll' | |
'devenv.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll' | |
'devenv.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll' |
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
**[Incremental builder cache] Creation. BuildCacheSize = 50.** Stack trace: at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo) | |
at System.Environment.get_StackTrace() | |
at Microsoft.FSharp.Compiler.SourceCodeServices.BackgroundCompiler..ctor() | |
at Microsoft.FSharp.Compiler.SourceCodeServices.InteractiveChecker..ctor() | |
at <StartupCode$FSharp-Compiler-Service>.$Service..cctor() | |
at Microsoft.FSharp.Compiler.SourceCodeServices.InteractiveChecker..cctor() | |
at Microsoft.FSharp.Compiler.SourceCodeServices.InteractiveChecker.Create() | |
at FSharp.CompilerBinding.LanguageService..ctor(FSharpFunc`2 dirtyNotify) in L:\git\FSharpVSPowerTools\src\FSharpVSPowerTools.Core\LanguageService.fs:line 119 | |
at FSharpVSPowerTools.ProjectSystem.VSLanguageService..ctor(IServiceProvider serviceProvider, IVsEditorAdaptersFactoryService editorFactory, FSharpLanguageService fsharpLanguageService) in L:\git\FSharpVSPowerTools\src\FSharpVSPowerTools.Logic\VSLanguageService.fs:line 21 | |
at System.Runti |
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 q = Expr.Coerce (<@@ obj() @@>, typeof<string>) | |
// val q : Expr = Coerce (NewObject (Object), String) | |
let q' = <@@ obj() :?> string @@> | |
// val q' : Expr = Call (None, UnboxGeneric, [NewObject (Object)]) |
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
// before | |
entity.BaseType | |
|> Option.bind (fun bt -> | |
if bt.HasTypeDefinition then Some bt.TypeDefinition | |
else None) | |
// after | |
match entity.BaseType with | |
| Some (TypeWithDefinition def) -> Some def | |
| _ -> None |
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 Events = | |
type IEvent = | |
abstract Id: Guid | |
type Event<'a> = | |
{ Id: Guid | |
Payload: 'a } | |
interface IEvent with | |
member x.Id: Guid = x.Id |
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
object StructuralTypes { | |
def time[A](f: => A) = { | |
val t0 = System.nanoTime | |
val ans = f | |
printf("Elapsed: %.3f sec\n", (System.nanoTime - t0) * 1e-9) | |
ans | |
} | |
class My(value: Int){ | |
def getId = value |
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 scala.concurrent.stm._ | |
object Test { | |
def run(n: Int) = { | |
val x = Ref(0) | |
val y = Ref(0) | |
(1 to n) foreach { i => | |
atomic { implicit tx => | |
val x1 = x() |
OlderNewer