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 8342313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:43:59+00:00 2026-06-09T05:43:59+00:00

In the concurrency library GHC.Conc there is a function called numCapabilities . Its type

  • 0

In the concurrency library GHC.Conc there is a function called numCapabilities. Its type is numCapabilities :: Int and it actually returns some number you passed by the command line flag (e.g. 5 if the options are +RTS -N 5).

However, getArgs (type: IO [String]) does essentially the same (it returns the unparsed non-runtime arguments) but isn’t a pure function.

If the only excuse is that numCapabilities is often needed in pure code, in what way aren’t other command line options not needed in pure code?

Am I something missing or is either numCapabilities a design flaw or am I allowed to write the following monster?

myGetArgs = unsafePerformIO getArgs
  • 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-06-09T05:44:01+00:00Added an answer on June 9, 2026 at 5:44 am

    I’ve seen very varying views on what to do in situations like this. Some think that values that might vary between compiles should not be pure, and some think that as long as a value doesn’t change during your program’s local run-time (i.e. after some “configuration” has been “set up” in main), it should be pure.

    The base package seems to have settled on a middle-ground. numCapabilities will not (as far as I know) change during run-time, but getArgs might.

    This is because there is a withArgs function that changes the args you get via getArgs. So, that answers that.

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

Sidebar

Related Questions

I am currently using an external library function that returns a File object. This
Is there anything in C# similar to the new Microsoft C++11 Concurrency library that
I've never worked with Concurrency library before. public class QueueExecutor { static final int
Are there any concurrency problems with one thread reading from one index of an
Reading Java Concurrency In Practice, there's this part in section 3.5: public Holder holder;
JDK's concurrency package, Boost's thread library, Perl's Thread library (not in Python though) all
I'm in the process of making some changes to a library that I'm using.
I have a C# library that is surfaced through a webpage UI. There's of
I use library which download torrents. But today some error happened (log): Could not
I am wondering if there is any concurrent queue implementation/library available in c++?

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.