reliance on record types in the design of components, and naming conventions #278
Replies: 1 comment 1 reply
-
Could you give examples for record type inputs within FSharp.Stats. Currently I just can list two: Regarding your second aspect: We currently are working on a solution to refactor the linear algebra module and base everything on tensors, rather than vectors and matrices. In function bodies the naming of let bindings often is based on mathematical notations. Although F# isn't case sensitive, there are conventions that are not always followed in FSharp.Stats. I'm not sure if you make life more difficult for newbies who know the conventions by mixing F# and mathematical notation. During the tensor conversion, your point should be definetley be discussed and applied to all modules. |
Beta Was this translation helpful? Give feedback.
-
I see record types are used for some components as input parameters, which is great.
I'm wondering if there is incentive to try to harmonise how those record values are going to be initialised from end users.
Some regular idioms are already used:
The first one is always good: to discourage users to take dependency on the exact set of fields in the record type and provide sensible defaults.
The second one, right now, doesn't provide much, IMO, beside one can curry that function, it will still break users if the record definition change, while it is possible to explore design with static methods with tuple form syntax, that would allow extra optional parameters and overloads (despite this is not a silver bullet and also possible pit fall).
I think it is important to settle on a single way to do it for the first one, and consider encouraging tupled form static methods for second one.
Another aspect of the consideration is about naming of fields, all the stuff is heavily geared toward statistics domain model, which draws from notation used in science, academia.
IIRC, there are idioms such as distinguish matrices and vectors based on name in a formula being upper case or lower case, and plenty more conventions.
I believe this library wants to draw from this rather than the .NET design guidelines for this particular aspect.
Beta Was this translation helpful? Give feedback.
All reactions