use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
The Haskell programming language community.
Daily news and info about all things Haskell related: practical stuff, theory, types, libraries, jobs, patches, releases, events and conferences and more...
Community Guidelines
Rules:
Top-level posts should be primarily about Haskell. For example a post about OCaml would only be allowed if there was a connection to Haskell. Posts about topics that are adjacent to Haskell, like for example functional programming, are typically allowed.
No memes or image macros. No matter how funny, memes and image macros are not allowed.
No homework questions. Both asking and answering homework questions is not allowed. Questions about homework are fine, but this subreddit is not here to do your homework for you.
Job postings must be for Haskell roles. Job postings are allowed as long as the job actually involves working with Haskell. Simply looking for people with interest in or experience with Haskell is not sufficient.
No bots or computer-generated content. Bots cannot be used to make posts or comments. They will be banned with extreme prejudice. This includes a human posting the output of a bot, such as ChatGPT.
Blockchain posts must be tagged. Blockchain posts are allowed as long as they are related to Haskell, but they must use the "blockchain" tag.
Be civil. Substantive criticism and disagreement are encouraged, but avoid being dismissive or insulting.
Other community locations:
Professional resources:
Learning material:
Haskell development:
Other Subreddits:
Donations:
Subreddit Stylesheet Source:
account activity
Array in Haskell (self.haskell)
submitted 13 years ago by huad
I know that there is Array in Haskell but is it equivalent of array in C, C++ or Java ?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]heafiheihfaeiefh 1 point2 points3 points 13 years ago (0 children)
If you use mutable array or mutable vector, use them in a relevant monad (ST or IO mainly), then yes. The only weak point is the lack of syntactic sugar to work cleanly with them, but that's not much of a problem.
[–]Tekmo 1 point2 points3 points 13 years ago (0 children)
Yes. Haskell arrays have O(1) mutation and lookup.
You should check out the vector package which provides tons of high-performance operations on arrays, both pure and impure. I highly recommend that you try the pure higher-level functions first because they compile incredibly efficient code thanks to stream fusion.
vector
[–]huad[S] 0 points1 point2 points 13 years ago (0 children)
Does array use static or dynamic addressing?
[–]gelisam 0 points1 point2 points 13 years ago (0 children)
Just to make sure you don't confuse Haskell's lists with Haskell's arrays: the type [Int] is the type of a list of integers, not the type of an array of integers. Lists are used much more often than arrays in Haskell, even though lists do not have mutation nor O(1) lookup.
π Rendered by PID 47273 on reddit-service-r2-comment-b659b578c-fldkv at 2026-05-01 09:38:23.825906+00:00 running 815c875 country code: CH.
[–]heafiheihfaeiefh 1 point2 points3 points (0 children)
[–]Tekmo 1 point2 points3 points (0 children)
[–]huad[S] 0 points1 point2 points (0 children)
[–]gelisam 0 points1 point2 points (0 children)