What is that "arg00" in the type of Fsharp.Text.Lexing's LexBuffer<char>.LexemeString?
> LexBuffer<char>.LexemeString;;
val it : arg00:LexBuffer<char> -> string
.LexemeString? > LexBuffer
What is that "arg00" in the type of LexBuffer<char>.LexemeString?
60 Views
Asked by
zell
At
There are 1 best solutions below
The short answer is that F# can sometimes keep track of argument names when printing the type of a function. In this case,
arg00is an implicit name generated by the compiler for the first argument of theLexemeStringoperation.The longer answer is that F# is a bit inconsistent when dealing with function arguments. If you define a function using
let, the output will include arguments:If you just a function as a value through its name, the result is treated as a function value (with parentheses around it) and the argument names are omitted:
However, if you define a static member and access it, then the compiler still attempts to print the argument names, but cannot access them (because the member has now been turned into a value) and so it prints implicitly generated names like
arg00: