Haskell is a purely functional programming language with strict static type checking, and lazy evaluation. The combination of functional programming and static type checking allows rapid development of bug free and correct programs. The absence of side effects allows Haskell programs to be ...
2
votes
1answer
48 views
Search Function With Wildcard in Haskell
I'm teaching myself how to program Haskell, and I decided to make a find function in Haskell. What it does is it takes two strings, such as "hello" and "he", and it counts how many times "he" appears ...
1
vote
0answers
39 views
Representing a Java Swing containment hierarchy in Haskell
A Java desktop application exposes the class/containment hierarchy of its Swing GUI through RPC. I'm building a Haskell client that connects to the application. The objective is to be able to perform ...
4
votes
1answer
223 views
Brainf*ck Interpreter
I want to write an example for a language similar to Haskell called Frege. While the interpreter is conceptually easy, it is lengthy and looks still quite messy. Note that I don't want to use Parsec ...
7
votes
2answers
113 views
Computing strongly connected components of a graph in Haskell: review requested
This is my solution for a programming exercise for https://class.coursera.org/algo/ class. It computes sizes of 5 largest strongly connected components of a graph. I spent quite a bit of time on ...
5
votes
0answers
91 views
How can I make my stack monad, (in Haskell) faster?
I made a stack monad, (in Haskell), that lets one manipulate and control values on a stack.
I want to know if it's correct, (it seems correct), how to make it faster, and how I could detect stack ...
2
votes
1answer
64 views
How can my code for computing a Discrete Cosine Transform matrix be improved?
I'm learning Haskell and decided that my first program should also help me finish my homework (because if I'm going to procrastinate, why not make it worthwhile?). I needed to work with discrete ...
3
votes
1answer
113 views
Longest non-decreasing subsequence, in Haskell
OK, so I recently posted this solution in Python to the longest non-decreasing subsequence problem, and cleaned it up with some expert advice. As a next step, I wanted to translate this solution into ...
5
votes
1answer
130 views
Avoiding <- operator
There is some little program (example of usage lastFM API wrapper) which get playCount of 2 specific users every 5 minutes and append difference between these 2 numbers to log file.
Can you make code ...
2
votes
1answer
168 views
The game of life with a truly infinite board
The game of life is often implemented by representing the board as a 2D boolean array. This doesn't scale very well to larger boards -- it starts to consume lots of memory, and without some separate ...
1
vote
0answers
93 views
Haskell: Use of the ST Monad and Vectors
Inspired by a stack overflow question, I decided to take a crack at the Google Code Jam's Minimum Scalar Product problem as an opportunity to practice my haskell.
I'm not claiming any algorithmic ...
1
vote
1answer
83 views
How to make following CFD program more idiomatic?
Basically, I'm comparably new to Haskell, which means lacking both knowledge of advanced principles, available libraries and, maybe, some syntax.
For educational purposes I hacked together a code ...
3
votes
1answer
185 views
Optimizing ByteString escaping
I wrote a string escaping function in C, and I'm trying to rewrite it to Haskell. The C version, along with comments explaining why it does what it does, can be found on GitHub.
Here's a naïve ...
3
votes
1answer
77 views
Reversi (Othello) game engine + command line interface
I have written a game engine for the game Reversi, also called Othello. The game engine works not exactly like the official rules. For example it is possible to place "holes" on the board, places ...
6
votes
2answers
175 views
Solving puzzle with haskell. RING IN THE NEW YEAR
I am trying to solve the puzzle RINGING IN THE NEW YEAR.
Start at 2011. By moving through the maze and doing any arithmetic operations you encounter, exit the maze with a result of 2012. You may ...
2
votes
2answers
131 views
Sudoku solver in Haskell
I tried to implement a naive brute-force Sudoku solver in Haskell (I know there are loads of good solutions already) and I'd like some reviews from you experts.
The solver is very simple and it uses ...