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

  • Home
  • SEARCH
  • 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 3494518
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:00:53+00:00 2026-05-18T12:00:53+00:00

I can do (x : int array) But I need only 300 elements array

  • 0

I can do (x : int array)

But I need only 300 elements array , so how do I (x : int[300]) ?

Can’t find such information over msdn )

@Marcelo Cantos No reason , but I always used sized arrays. Why not ?

  • 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-18T12:00:54+00:00Added an answer on May 18, 2026 at 12:00 pm

    No. The F# type system does not support types such as “array of size 300”, and even if it did, using the type system to check potential array overflows at compile time is too impractical to implement.

    Besides, “has exactly 300 elements” is an useless property in F# in almost all situations, because there is a wealth of functions and primitives that work on arrays of arbitrary size without any risk of overflow (map or iter, for instance). Why write code that works for 300 elements when you can just as easily write code that works for any number of elements ?

    If you really need to represent the “has exactly 300 elements” property, the simplest thing you could do is create a wrapper type around the native array type. This lets you restrict those operations that return arrays to only operations that respect the 300-element invariant (such as a map from another 300-element array, or a create where the length property is always 300). I’m afraid this isn’t as simple as you hoped, but since F# does not natively support 300-element arrays, you will need to describe all the function invariants yourself.

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

Sidebar

Related Questions

You can initialize an array like this: int [ ] arr = { 1,
Explain why a nullable int can't be assigned the value of null e.g int?
Is there some way I can define String[int] to avoid using String.CharAt(int) ?
Can someone please explain why int (0.4 * 10.0) is 4 yet int ((2.4
Can you cast a List<int> to List<string> somehow? I know I could loop through
Can someone explain what this means? int (*data[2])[2];
I know that you can use a dummy int parameter on operator++ and operator--
How can you check whether a string is convertible to an int? Let's say
How can I convert a string of bytes into an int in python? Say
I know that I can do something like $int = (int)99; //(int) has a

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.