So to add onto what I learned from this question I asked:
F# Records: Dangerous, only for limited use, or well used functionality?
This got me thinking about whether I should be using Types with methods or Records(?) AND methods. For example, this is a typical type I might make:
(* User Interaction Start *)
type UserInteraction public() =
member public x.CreatePassword(originalPassword) =
if String.IsNullOrEmpty originalPassword then
raise(new ArgumentException "CreatePassword: password is null or empty")
let hashUtility = new HashUtility();
hashUtility.CreateHash originalPassword
The problem I could see with this is there’s a possibility that something within that UserInteraction type is mutable due that being allowed. Now with record types, as far as I understand, they are guaranteed to be immutable.
Would it be better design a module with methods that take in or return record types only or even go one step further with method chaining?
You may want to read When to Use Classes, Unions, Records, and Structures [MSDN] (bottom of the page). You appear to have some incorrect assumptions about records. For instance, they can have mutable fields just like classes. The important differences are inheritance, pattern matching, constructors, hidden members, equality, and copy-and-update expressions.
Just noticed one small error on that page: records can, in fact, implement interfaces.
Another possibly helpful section: Differences Between Records and Classes [MSDN] (bottom of page)