Questions tagged [haskell]

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.

81 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
18
votes
0answers
282 views

Mucheck - a mutation analysis tool for Haskell programs

We have been working on a mutation analysis tool for Haskell tests called MuCheck. It accepts any Haskell source file, and a function name to mutate, applies a defined set of mutation operators on it, ...
10
votes
0answers
790 views

Realtime concurrent Haskell MIDI buffer

Problem Background MIDI is a serial representation of control signals to a sound generator. Typically, a noteOn message initiates the attack phase of a sound at a given pitch. The note will ...
7
votes
1answer
147 views

BingWallpapers: Fetches and applies the image of the day from Bing as the wallpaper

I have written a small desktop program nabeelomer/BingWallpapers in Haskell. This is my first time writing Haskell. I was wondering how I can make the code use more functional programming features/...
6
votes
0answers
537 views

Website using Persistent, Blaze-html, and Scotty

I know that my let configFilePath = Prelude.head args is unsafe and was wondering how I could handle it better. My deployment almost always has a file at ...
6
votes
0answers
409 views

Implementing recursive filters with Haskell/Repa

I recently learned Haskell, and I am trying to apply it to the code I use in order to get a feeling for the language. I really like the Repa library since I manipulate a lot of multi-dimensional data....
5
votes
0answers
64 views

FRP: Processing task lists

I recently heard about functional reactive programming and thought it was rather interesting. Therefore, I started out with writing a simple program which processes a list of tasks. (In this example, ...
5
votes
0answers
269 views

Roman numerals in Haskell

I have written a module that provides some functions for dealing with Roman numerals. I would like some feedback concerning my style, potential performance or elegance improvements, and any ...
5
votes
0answers
266 views

Tic Tac Toe in Haskell

After reviewing many Tic-Tac-Toe implementations, I decided to write my own. Here it is: Logic.hs ...
5
votes
0answers
400 views

Persistent segment tree

I'm trying to solve this problem. Given a sequence \$B=B_0,B_1,\ldots,B_{N−1}\$ for each query \$(P,K)\$, find the minimum \$S\$ s.t. there are at least \$K\$ entries in \$B\$ that satisfies ...
5
votes
1answer
151 views

GitHub API client

Here is my Haskell program designed to list all of my GitHub repos along with their descriptions and languages via the GitHub JSON APIs: ...
4
votes
0answers
45 views

Functional blob counting

I have image files consisting of black and white pixels encoded as RGB8. I want to count the number of blobs i.e. contiguous areas of white pixels. I rewrote this algorithm in haskell. The algorithm ...
4
votes
0answers
154 views

Implementation of the Hindley-Milner type system (with evaluation, without type inference) as a library for use in compilers

I've written an implementation of the Hindley-Milner type system as a "Core" language for use in writing compilers of typed functional languages. This is meant to be used as a library by compilers of ...
4
votes
0answers
395 views

Sound recorder, based on sdl2

This is my first Haskell program, a command-line sdl-based(so, hopefully, cross-platform), parameter-less sound recorder. Tutorials, articles or chapters that concern mistakes in my code are just as ...
4
votes
0answers
90 views

Code Generation with Template Haskell

Background: Recently, I've been working through Coroutining Folds with Hyperfunctions. Don't bail out now if the whole thing makes little sense - it's just the motivation for the existence of my code,...
4
votes
0answers
103 views

Implementing insertAt for both [a] and [(i,a)] lists

I've implemented generic insertAt function which inserts element into both indexed and ...
4
votes
0answers
83 views

Existential Types and IO

In my attempts to grasp Existential Types in Haskell I decided to implement an integer-based fixed-length vector data type. I'm using ghc 7.8.3. Specifically I wanted to write a program which asks ...
4
votes
0answers
153 views

Splitting and Joining Machines

A small program I use as my "hello world" of streaming libraries is the following: For each line of stdin Interpret the line as a file-name If the file represented ...
4
votes
0answers
655 views

Binomial Heap in Haskell

Here's a partial binomial heap implementation in Haskell (just merge and insert): ...
4
votes
0answers
306 views

A short KenKen solver

I'm new to Haskell and I've made a very short KenKen solver. Any input is welcome. ...
3
votes
0answers
47 views

Finding the least number of terms to satisfy integer square equation

The following code is a solution to an exercise I've made: This exercise idea is based on a story from my current work place: My boss'es Ubuntu had a bug that made his printer, when asked to print ...
3
votes
0answers
199 views

Fast Hamming sequence generation in Haskell

I found some months ago that I could generate Hamming multiples of 3 and 5 multiples (3^x & 5^x) in one list comprehension. There are many fewer 3 and 5 Hamming multiples in a Hamming sequence. I ...
3
votes
0answers
92 views

Kattis Ants challenge

I am trying to learn Haskell doing some contest problems. I have worked a bit with the language but still have a very long way ahead. Right now I am working with a problem called Ants: An army of ...
3
votes
0answers
90 views

Vocabulary memory game in Haskell

As a beginner I try to implement a vokable memory game. It is still missing some feature (Loading, Display), but I would like to hear how to improve what is already there. The user should identify ...
3
votes
0answers
456 views

Snake in Haskell with Ncurses

I've created the Snake implementation in Haskell. User input and graphic is handled by the Ncurses library. The goal of this question is to get the feedback on what can I improve to make it more ...
3
votes
0answers
111 views

Haskell Laplace determinant

I have written a code in Haskell that calculates the determinant of a matrix using the laplace expansion. As I have just started learning Haskell, I would like some opinions on how well (structured) ...
3
votes
0answers
211 views

Converting English words to numbers in Haskell

A few weeks ago, I finished a number to word converter and received an excellent review. It caused me to make several fundamental changes to numToWord, such as ...
3
votes
0answers
183 views

Game of Life in Haskell with Nested Zippers, Comonads, etc

I was trying to implement Game of Life in Haskell. Here is my approach: ...
3
votes
0answers
172 views

Sudoku solver in Haskell using Reader+ST

While trying to understand monad transformers in Haskell I came up with a sudoku solver based on a combination of the ST and Reader monad. I am positively surprised with the performance, however ...
3
votes
0answers
79 views

Flexible port scanner library

I have tried to generalize the concept of turning an IP address into a boolean. The save format is an overly complicated way of storing consecutive IP addresses as strings of bits Example usage: <...
3
votes
0answers
233 views

Naive implementation of Naive Bayes in Haskell

A simple implementation of Naive Bayes, as I'm a Haskell beginner I've tried to put an emphasis on clarity and documentation. I've tried to incorporate the feedback from a similar question. This is ...
3
votes
0answers
919 views

Lambda calculus interpreter in Haskell

This code is a representation of lambda calculus using an AST instead of text. ...
3
votes
0answers
517 views

AVL Tree Implementation in Haskell

I'd like to get some feedback on my AVL tree implementation. I appreciate any comments related to style and performance, particularly if something can be written in a more concise or idiomatic way. If ...
3
votes
0answers
233 views

Zipper trees implementation

Considering the lack of general purpose library to manipulate trees (not to mention zipper ones), I may end up packaging this piece of code, so I would like it to be reviewed first. Any comment is ...
3
votes
0answers
277 views

Haskell s-expression parser and quasiquoter

There are a number of questions on this site about s-expression parsing: e.g., Calculator parsing S-expressions and Code from "Write Yourself a Scheme in 48 Hours" tutorial. However, these ...
3
votes
0answers
242 views

Using recursion schemes to avoid explicit corecursive unfolding

The code is self-contained and self-explaining. I want to improve the goal function. You can change everything below the ...
3
votes
0answers
95 views

Generation and parsing of English numerals (cardinal and ordinal)

I need to use the English numerals (American) in Haskell, so I looked for a library that did it. I have not found one, therefore I developed the program that I am presenting here. There are actually ...
3
votes
0answers
269 views

GTK application in Haskell

I'm new to both GTK and Haskell, so I'd appreciate any in both. I'm making an application which for the purposes of this question is just drawing a window that shows a red circle getting larger until ...
3
votes
0answers
54 views

2 4 tree insert function

I'm after creating an insert function for a 2 4 tree in Haskell. I'm just wondering if this is the best way to implement it (especially when handling the Root4s), ...
3
votes
0answers
60 views

URL fetcher and parser for XML feeds

Here is a program that will parse and print XML feed URLs. I want to reuse most of it to add post date to each link. This adds a new concern of CLI and output formatting on top of parsing and (poor) ...
3
votes
0answers
818 views

Novice implementation of TicTacToe in Haskell

I want to learn Haskell and figured the best way to do it is to write a simple TicTacToe implementation. However the result feels very inelegant and I think it might be the best playground for your ...
3
votes
0answers
64 views

Abstract Key Value Store

I'm attempting to define an abstract interface for a key value store. Some requirements: Once a key has been written it should never be overwritten (although it may be deleted Transactions with ...
3
votes
0answers
245 views

A solution to the AST Typing Problem

Expression trees are the bread and butter of functional programming but when it comes to adding additional information to an established tree it can be difficult to incorporate such changes without ...
3
votes
0answers
524 views

Parsing and producing sets of financial CSV files

I have this small Haskell script that I wrote some time ago to parse a set of financial CSV files to produce other CSV files. I've recently had a problem with large input files (around 300Mb) that I ...
2
votes
0answers
69 views

Parallel Miller-Rabin Prime Test in Haskell

I implemented a prime number finder using the Miller-Rabin prime test in Haskell and it seems to be working. You enter a number and it finds the next prime following that number. I also tried to make ...
2
votes
1answer
61 views

Modelling Immerman–Szelepcsényi in Haskell

I am trying to model the proof of Immerman–Szelepcsényi Theorem with Haskell since it heavily uses non-determinism. An explanation of what the point of this is can be found here. ...
2
votes
0answers
35 views

Solving the wooden snake chain puzzle

My code tries to solve the wooden snake chain puzzle: I do so by generating all possible link configurations which are then tested. I was hoping that laziness would take care of the very many ...
2
votes
0answers
78 views

Project Euler #81 in Haskell: minimal path sum through a matrix

I just completed Project Euler Problem 81 in Haskell: In the 5 by 5 matrix below, ...
2
votes
0answers
148 views

Smith-Waterman algorithm for local sequence alignment with affine gap penalties

The following is a summary from the top of my head so please correct me if I'm wrong. See the Wikipedia article for more. This is about determining the (score / edit distance of the) most similar ...
2
votes
0answers
142 views

CIS 194 - UPenn Haskell Course (2013) - Homework 4 - Tree Folding

I have been self studying the UPenn Haskell course, and I am unable to get feedback/grading on the assignments complete. This specific portion that I am having concerns with asks to write a function <...
2
votes
0answers
65 views

Genetic operators in Haskell

I have implemented two genetic operators, which is really just a fancy way of mangling lists. In particular OX-1 (illustration) and displacement mutation. I found it necessary to extract out the ...