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.

95 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
20
votes
0answers
304 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, ...
12
votes
0answers
1k 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 ...
11
votes
0answers
178 views

Telegram bot in Haskell using custom monad transformers

Note: I show almost all of my code for completeness, but I really only want the review to focus on Session.hs, Handler.hs, and maybe Controller.hs. I can delete the extra code from the review or ...
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
51 views

Feedback on LZSS implementation

Recently, I've been trying to get back into Haskell, so I tried coding up a LZSS implementation. I realize this is much more easily implemented imperatively, but I wanted to challenge myself. The last ...
6
votes
0answers
555 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
415 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
41 views

Yet another implementation of Conway's Game of life in Haskell

(Sorry for my bad English) Hi, I'm interested in getting feedback of my own implementation of Conway's Game of Life. Some details: Uses gloss for animation Uses rio for shorter dependency list My ...
5
votes
0answers
85 views

A simple chess engine in Haskell

This is my first Haskell project so I don't really have a good feel for what makes Haskell code clean, so they'll be lots of things that can be improved. Things I have a gut feeling are bad design: ...
5
votes
0answers
67 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
283 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
282 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
421 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
152 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
1answer
85 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. ...
4
votes
0answers
46 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
162 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
487 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
95 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
246 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 ...
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
86 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
154 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
694 views

Binomial Heap in Haskell

Here's a partial binomial heap implementation in Haskell (just merge and insert): ...
4
votes
0answers
331 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
34 views

How to simplify the following distance function for the taxicab ring metric space?

Consider the taxicab ring metric space shown below. This is a discrete metric space in which we have both a grid and concentric diamond rings. This metric space stretches infinitely in all four ...
3
votes
0answers
81 views

Unique Distancing Problem, Memoization in Haskell

note: You might be scared seeing the length of the post, but it's actually not that long because you don't need to read the compiler logs or the python code to understand my code (I wish StackExchange ...
3
votes
0answers
51 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
217 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
107 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
739 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
123 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
250 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
221 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
177 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
85 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
243 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
967 views

Lambda calculus interpreter in Haskell

This code is a representation of lambda calculus using an AST instead of text. ...
3
votes
0answers
612 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
240 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
309 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
96 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
279 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
55 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
62 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
848 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
69 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
265 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
538 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 ...