Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7052469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:23:14+00:00 2026-05-28T03:23:14+00:00

So to add onto what I learned from this question I asked: F# Records:

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:23:15+00:00Added an answer on May 28, 2026 at 3:23 am

    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)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to add random numbers onto the end of this array when ever
In R 2.13.1 / ggplot2 0.8.9, I'm trying to add points onto a geom_tile
I would like to add a feature onto my site that would allow a
Can any1 tell me why I cant add a bitmap onto my surfaceView like
I'm trying to add a login form onto my free mathhelp site, but whenever
I am trying to simply add a Google Search bar onto my own map
I would like to be able to add the help button onto my winform,
If i have made rectangle then it is possible to add any text inside/onto
Is it possible for an SQLite data file used by an add-on to be
I have a web page that I would like others to add onto their

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.