Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 200133

Haskell is a purely functional programming language, featuring static typing, lazy evaluation, and monadic effects. The primary implementation is GHC, a high-performance compiler with a runtime supporting many forms of parallelism and concurrency.

4 votes
Accepted

Two Sum Implementation on Haskell Brute Force and Optimized approach

Sorry, I know this is stale. First things first, from a code quality perspective, it's usually not good to have redundant cases. e.g. [x, y] and x:y:xs will both match 1:2:[], and you'll get the behav …
ShapeOfMatter's user avatar
1 vote
Accepted

Solve a letter digit substitution game in Haskell

There's no particular reason to want to not have a solve', except maybe that it's hard to give it a good name. If you're worried about clutter; putting it in a where clause is fine. solve already has …
ShapeOfMatter's user avatar
3 votes
Accepted

Generic splitting in Haskell

Sometimes that's not enough, and it doesn't work for arguments you're not binding, so deffer to a more formal style of comments, which in Haskell means Haddock. … That's certainly idiomatic Haskell! but it usually isn't one's first strategy. …
ShapeOfMatter's user avatar
1 vote
Accepted

Count islands in a binary grid

Some Haskell-specific code-smell stuff also applies: Visited is used like a Bool, so let it be a Bool. (You can wrap it up various different ways for clarity though!) …
ShapeOfMatter's user avatar
5 votes
Accepted

How can I make a shorter binary rule in haskell?

I'm a little out of practice with haskell, but I'm quite fond of it. I want to address your "extra" question first. wich one of the 2 version is more readable for an haskell programmer, and why ? … [sic] Haskell programmers aren't a special magic kind of people. …
ShapeOfMatter's user avatar
2 votes
Accepted

Parse 2D Cartesian coordinates and output their Polar form

For a complete executable that actually does anything, this is fine and to-the-point. Trying to reduce boiler-plate would just be golfing. cart2pol is great. If this is part of a larger code-base, the …
ShapeOfMatter's user avatar
2 votes
Accepted

Validate Finnish IBANs

Since you're using Haskell, I'm guessing you want the compiler to be picky with you. using the -Wall flag is a good idea; there's some discussion about how to take this even farther here. …
ShapeOfMatter's user avatar
6 votes
Accepted

Simple number-guessing game in Haskell

Finding pleasant ways to talk about things like failure is its own learning-curve in Haskell. While not technically wrong, it's kinda sketchy the way you're checking the number of guesses twice. …
ShapeOfMatter's user avatar
2 votes
Accepted

Hangman game in Haskell, written using a state monad

help you debug it, that's fine.) you can often avoid using lift so much by leveraging the MonadIO class. single-character variable names are ok when they are in some sense "fully general", it's kinda a haskell
ShapeOfMatter's user avatar
2 votes

Stepwise nested pattern mattching with exceptions

The amount of repeated code isn't large, I don't think that's worth worrying about. It does seem like you've got a lot of buried cases making your nice do block hard to read. I don't think you can use …
ShapeOfMatter's user avatar
1 vote
Accepted

Autocomplete system with prefix tree

I'm not about to set up benchmarking to measure the performance, and the code is fine idiomatic haskell. …
ShapeOfMatter's user avatar
3 votes

Small combinator parsing library in Haskell

Are there any subtle Haskell-isms that I have that could easily be removed to make the more approachable to a general audience? … That's hard to say; I'm probably too familiar with Haskell to count as a general audience. Add a few comments. Maybe get rid of instance Alternative Parser. …
ShapeOfMatter's user avatar
2 votes

Random ladder for public-key encryption

I'm new to Haddock and couldn't figure out how to comment the whole module. I think the problem is that the module description needs to have some internal structure. See here I'd like to know how c …
ShapeOfMatter's user avatar
4 votes
Accepted

Last Stone Weight Problem in Haskell using list `insert`

Our first question should be "why is it O(N^2)?" The sort seems to be a merge-sort; I trust that it's O(n log(n)). But insert is noted as O(N), and you're calling it O(N) times, so it's a good bet tha …
ShapeOfMatter's user avatar
4 votes

Scraping the calendar of some public libraries from their websites

This is quite decent! Things I would want to change: The way you're representing Libraries is odd, smelly, and generally frowned upon. If you were going to have an enum data Library = Accursio | A... …
ShapeOfMatter's user avatar

15 30 50 per page