In C#, one can define a public static readonly field like this:
namespace MyNamespace
{
public static class MyClass
{
public static readonly string MyValue = "Test";
}
}
In F#, the code I can think of which matches the definition above best is:
namespace MyNamespace
module MyClass =
[<Literal>]
let MyValue = "Test"
But this actually translates to the following C# snippet:
namespace MyNamespace
{
public static class MyClass
{
public const string MyValue = "Test";
}
}
How can I define a public static readonly field in F#? const
is not an option for me since I want to work with different assemblies.