Hi F# uses additional ligatures, would be cool if those could get added.
I tried to map them to TeX symbols on http://milde.users.sourceforge.net/LUCR/Math/mathpackages/stmaryrd-symbols.pdf
I would support your idea (I am not a contributor), but I am not an F# developer, neither do I think, the author of this font is an F# developer, so could you please give some code examples, where and how the symbols are used. Also what they mean would be nice.
I think these symbols are very suitable for ligatures.
The (| ... |) "banana clips" are used to define an active pattern, where you can define a named condition, and reference it in a pattern match. (There are some examples at that link.) I don't fully understand that yet, though reading those examples, I think I'm close. :)
The [| ... |] denote the beginning and end of an array. F# uses the traditional array delimiters [ ... ] to define an immutable list instead. Given its immutability-first nature, this is usually what you want, but the array syntax is required when you need an array type, particularly for interop with the rest of the .NET framework.
Example:
let pieces = "break this \n up|into little pieces"
.Split([| ' '; '\n'; '|' |], StringSplitOptions.RemoveEmptyEntries)
(pieces would be a one-dimensional array with 6 elements, containing the words from the string)
[< and >] are used for attributes/annotations in code. As an example, in C# you'd explicitly mark that a class can be serialized by putting [Serializable] just above the class definition. In F#, you'd use [<Serializable>] instead.
Example:
[<Serializable>]
type ThisTypeCanBeSerialized() =
...properties, methods, and such...
[<AllowNullLiteral>]
type ThisTypeCanBeNull() =
/// Auto-property that Newtonsoft.Json will ignore
[<JsonIgnore>]
member val IsNotSerializedByJsonDotNet = "" with get, set
+1 for these ligatures. I've got a separate issue (which I'm about to post), but I'm loving this font - it's like the noise disappears and the code emerges!
Thanks Daniel, there's also the double tick marks `` used to quote identifiers.
For context, the double ticks are use to name identifiers with otherwise-invalid characters in them.
let````thing with spaces that I can now refer to as a single identifier````= 1
Also empty arrays look odd:
let a = [||]
Most helpful comment
Thanks Daniel, there's also the double tick marks `` used to quote identifiers.