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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:04:58+00:00 2026-06-14T16:04:58+00:00

In the mathematical languages, you can create a vector as follows: x = seq(0,

  • 0

In the mathematical languages, you can create a vector as follows:

x = seq(0, 2*pi, length.out = 100)

This outputs:

[1] 0.00000000 0.06346652 0.12693304 0.19039955 0.25386607 0.31733259 0.38079911
  [8] 0.44426563 0.50773215 0.57119866 0.63466518 0.69813170 0.76159822 0.82506474
 [15] 0.88853126 0.95199777 1.01546429 1.07893081 1.14239733 1.20586385 1.26933037
 [22] 1.33279688 1.39626340 1.45972992 1.52319644 1.58666296 1.65012947 1.71359599
 [29] 1.77706251 1.84052903 1.90399555 1.96746207 2.03092858 2.09439510 2.15786162
 [36] 2.22132814 2.28479466 2.34826118 2.41172769 2.47519421 2.53866073 2.60212725
 [43] 2.66559377 2.72906028 2.79252680 2.85599332 2.91945984 2.98292636 3.04639288
 [50] 3.10985939 3.17332591 3.23679243 3.30025895 3.36372547 3.42719199 3.49065850
 [57] 3.55412502 3.61759154 3.68105806 3.74452458 3.80799110 3.87145761 3.93492413
 [64] 3.99839065 4.06185717 4.12532369 4.18879020 4.25225672 4.31572324 4.37918976
 [71] 4.44265628 4.50612280 4.56958931 4.63305583 4.69652235 4.75998887 4.82345539
 [78] 4.88692191 4.95038842 5.01385494 5.07732146 5.14078798 5.20425450 5.26772102
 [85] 5.33118753 5.39465405 5.45812057 5.52158709 5.58505361 5.64852012 5.71198664
 [92] 5.77545316 5.83891968 5.90238620 5.96585272 6.02931923 6.09278575 6.15625227
 [99] 6.21971879 6.28318531

How can this be achieved in Haskell?

I tried creating a lambda function and using it with map, but I could n’t get the same output.

Thanks

let myPi = (\x -> 2*pi)
map myPi [1..10]
  • 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-14T16:04:59+00:00Added an answer on June 14, 2026 at 4:04 pm

    Well, you can just do

    [0, 2*pi/100 .. 2*pi]
    

    Note that this is not ideal both performance- and floating-point-rounding–wise (because it translates to enumFromThenTo), Daniel Fischer’s version is better (it translates to enumFromTo). Thinking it over, GHC will probably compile both to almost equally-fast code, but I’m not sure. If it’s really performance-critical, it’s best not to use lists at all but e.g. Data.Vector.


    As Jakub Hampl remarked, Haskell can deal with infinite lists. That’s probably not much use to you here, but it opens interesting possibilties – for instance, you might not be sure which resolution you actually need. You can let your list begin with a very low resolution, then fold back and start again with a higher one. One simple way to achieve this:

    import Data.Fixed
    
    multiResS₁ = [ log x `mod'` 2*pi | x<-[1 .. ] ]
    

    using this to plot the sine function looks like this

    Prelude Data.Fixed Graphics.Rendering.Chart.Simple> let domainS₁ = take 200 multiResS₁
    Prelude Data.Fixed Graphics.Rendering.Chart.Simple> plotPNG “multiresS1.png” domainS₁ sin

    enter image description here

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

Sidebar

Related Questions

I need to display mathematical function formulas. For this, how can i echo those
I want to validate mathematical expressions using regular expression. The mathematical expression can be
How can I render mathematical notations / expressions in Python with OpenGL? I'm actually
Abstract: Can you propose a mathematical-ish algorithm over a plane of pixels that will
Ok, I'm using mathematical equations to output numbers, though, I need this to be
I'm working on converting a mathematical formula into a program. This formula is called
I'm not sure wether R can do this (I assume it can, but maybe
This question is purely out of curiosity. I am off school for the summer,
If I am in a coding language where I can create a random number
How can this Mathematica code be ported to Python? I do not know the

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.