Original code is in Record updates.fs
, the IL output for the type is in type.il
, and the IL output for the function is in func.il
. Also included ILSpy's interpretation of the function into C# code in func.cs
.
This file contains hidden or 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 | |
let degToRad deg = deg * (Math.PI / 180.0) | |
// This is a very slow implementation of the sine function, and could be easily | |
// optimized in a lot of ways, but I wanted to know how to calculate sine, and | |
// this works. | |
// Taken from the accepted answer at: | |
// https://math.stackexchange.com/questions/501660/is-there-a-way-to-get-trig-functions-without-a-calculator | |
let sine angle places = |
This is a short test of comparing the public API in two .NET binaries. There isn't any special comparison being done beyond determining whether or not the public APIs match perfectly.
To determine whether or not the two APIs match, build the .cs files like so:
csc /out:Lib1.dll /target:library 10_Lib1.cs
csc /out:Lib2.dll /target:library 20_Lib2.cs
This file contains hidden or 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 input = @"$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*' And $(Configuration) == 'Debug'" | |
let rec parseWord (data : System.Text.StringBuilder) (input : string) (index : int) (inQuotes : bool) : string * int = | |
let substr = input.Substring(index) | |
let f i () = (data.ToString()), (index + i) | |
let ret = f 1 | |
if input.Length = index | |
then f 0 () | |
else | |
let c = input.[index] |
This file contains hidden or 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 Fake | |
type ProjectDetails = | |
{ | |
/// Project name, useful for filtering against project files | |
Name : string; | |
/// Summary for AssemblyInfo and NuGet metadata | |
Summary : string; | |
/// Longer description for NuGet metadata | |
Description : string option; |
This file contains hidden or 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
// Toy async server for fun | |
open System.Net.Sockets | |
let mutable runServer = true | |
let handleHeaders (text : string) = | |
let lines = text.Split([| '\n' |]) |> List.ofArray | |
let requestType = lines.Head.Split([| ' ' |]) | |
lines.Tail | |
|> List.filter (fun x -> not <| System.String.IsNullOrWhiteSpace x) |
This file contains hidden or 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.ComponentModel | |
[<TypeConverter(typedefof<TabsConverter>)>] | |
type Tabs = | |
| Item | |
| Hour | |
| Event | |
| Search | |
and TabsConverter() = |
OlderNewer