Skip to content

Instantly share code, notes, and snippets.

@dmannock
Last active January 28, 2020 13:36
Show Gist options
  • Select an option

  • Save dmannock/5756e4f54cfc08de7ceac8ff5d283ad9 to your computer and use it in GitHub Desktop.

Select an option

Save dmannock/5756e4f54cfc08de7ceac8ff5d283ad9 to your computer and use it in GitHub Desktop.
F# vs C# simple object create, read, print
// store a value on an immutable object, read it and print out
// F# valid program
type A = { Simples: string }
let a = { Simples = "this is nice" }
a.Simples |> printfn "%s"
// C# also does this o.O
public class MoarBrackets {
public readonly string Value;
public MoarBrackets(string value) {
Value = value;
}
}
void Main()
{
var a = new MoarBrackets("fingers are bleeding");
Console.WriteLine(a);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment