Skip to main content
Code Review

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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
47 views

Augment vi editing mode in haskeline by implementing the ; and , commands

haskeline is a reimplementation in haskell of the GNU Readline library (the one that by default allows you to delete the word you just typed on your shell's command line by pressing Ctrl+w, for ...
5 votes
1 answer
490 views

How to implement an AVL tree efficient enough in Haskell?

upd: I am very sorry about my mistake. The old version of data is download from luogu, but the website do NOT allow me to download the data of the worst case. In fact, when facing same amount of ...
3 votes
2 answers
191 views

Pattern Finding In Lists of Strings (2d Char Array), Advent of Code Day 04 Solution

This is part 2 of Day 4 of 2024's AoC: The problem is as follows: It's an X-MAS puzzle in which you're supposed to find two MAS in the shape of an X. One way to achieve that is like this: ...
1 vote
0 answers
93 views

Value-level proofs of type-level membership and subset relations in Haskell

As part of a larger project, we're using type-level strings to identify "parties" (synonymously, "locations"). Critical to the system is the ability to express and enforce ...
5 votes
3 answers
299 views

HackerRank, Haskell simple "compression" algorithm

The question asked is very straight-forward and is simple enough to solve. What I am looking for is that hopefully I can get some understanding for using the constructs and built-ins of the Haskell ...
4 votes
1 answer
104 views

Scraping the calendar of some public libraries from their websites

I've been learning some Haskell as an amateur (to be precise: I started programming with this language, and it has been a year or less since I started seriously). So far, I have realised only small ...
8 votes
1 answer
144 views

Haskell 2-player TicTacToe terminal game

I want to get better at functional programming so I started with this simple 2-player TicTacToe game. Next I want to add a simple min-max algorithm to make it a 1-player game, but before that I'd like ...
3 votes
1 answer
102 views

Parse 2D Cartesian coordinates and output their Polar form

The following code parses a 2D Cartesian coordinate passed as Cart2Pol <x> <y> and prints the coordinate in ...
Miles's user avatar
  • 133
2 votes
0 answers
84 views

Last Stone Weight Problem in Haskell Using `fold`

A previous solution of this code has been posted on Code Review before. This solution is more complicated then that one, but more performant (see the below) Why is this another Question instead of a ...
4 votes
1 answer
220 views

Last Stone Weight Problem in Haskell using list `insert`

Background Saw this problem on TheJobOverflow which seems to be a LeetCode question. It bothered me that the "challenge" of this problem was to recognize the need for a specific data-type (...
1 vote
1 answer
230 views

Haskell code optimization for short Pi approximator

Very new in Haskell, as a first easy program I went for an old algorithm of mine to approximate pi by counting points within a circle. The snippet below is what I could get working. I had quite an ...
Tsaras's user avatar
  • 157
4 votes
1 answer
137 views

Autocomplete system with prefix tree

I am quite new to Haskell, and this problem is from dailycodingproblem.com: Implement an autocomplete system. That is, given a query string s and a set of all ...
4 votes
2 answers
772 views

Performance of Haskell prime sieve

I have this code, which is a pseudo-Sieve of Eratosthenes for generating primes: ...
3 votes
1 answer
131 views

Solve a letter digit substitution game in Haskell

I am working on a Haskell problem from exercism, which is a learn-to-code website. The problem statement is as follows. Write a function to solve alphametics puzzles. Alphametics is a puzzle where ...
5 votes
1 answer
181 views

Ackermann-Péter function call count using Writer monad

I'm quite new to Monads and I tried add function call counting to the Ackermann function code. The goal was simplicity, not performance. I want to have code review on the ...

15 30 50 per page
1
2 3 4 5
...
72

AltStyle によって変換されたページ (->オリジナル) /