r/haskell • u/dharmatech • 3h ago
r/haskell • u/AutoModerator • 23h ago
Monthly Hask Anything (September 2026)
This is your opportunity to ask any questions you feel don't deserve their own threads, no matter how small or simple they might be!
r/haskell • u/tomejaguar • 15h ago
Bluefin is a capability system
I decided I am going to start describing Bluefin as a "capability system". This article explains why:
r/haskell • u/n00bomb • 1d ago
Functional Programming on FPGA: How Clash Works | QBayLogic
qbaylogic.comr/haskell • u/Hefty-Necessary7621 • 1d ago
blog Rust, Haskell, and the Architecture Behind Solana: Interview with Greg Fitzgerald
In this interview, we speak with Solana cofounder Greg Fitzgerald about why Rust ultimately proved to be the right fit. We discuss how his background in C++, LLVM, and Haskell shaped Solana’s architecture, what functional programming contributed to the design of a high-performance blockchain runtime, and why Rust’s combination of strong types, memory safety, and low-level control worked particularly well for BPF and virtual-machine development.
r/haskell • u/Lower_Bid_6661 • 22h ago
Learning Haskell by building a freelance marketplace — Servant, rules, actors, and a server-owned SPA
I have been learning Haskell for like 2 years now. Though I am ok writing software in Haskell, there is still a long way to go. I decided the best way to ante up my skills is to build a real-world application.
I started working on a freelance marketplace with the following features:
sellers, buyers, moderators, and collaborators.
Sellers -> create gigs, add approved collaborators, fulfill orders, deliver code to Gitea (hosted on the server), documentation to S3, and resolve any disputes.
Buyers -> clarify about gigs, make payment, verify code on Gitea, raise dispute on code not matching spec, accept delivery, submit reviews.
collaborators -> work as a team with the sellers on gigs, submit their profile, accept or deny working with sellers.
moderators -> resolve issues on gig reports, chat reports, order disputes.
Marketplaces are mostly state machines: order funded → in progress → delivered → disputed → completed, escrow release, dual-proof delivery, etc. I wanted that logic explicit and hard to “accidentally” break.
Brief on architecture:
- Servant — routes and handler types wired once; mismatches are compile errors.
- Server-owned routing — Haskell serves a cached HTML shell with data-app-id; the React (Ant Design) bundle mounts the page. No client-side router unless I add one later.
- Shell caching — split HTML template, inject page id per request.
- Frontend bundling — Vite build → static assets served by the same app.
- Rules + store layer — order/payment/delivery/dispute transitions in Haskell, not scattered in the SPA.
- Actor + supervisor (similar to Erlang OTP) — supervised S3 uploads, email, and anything needing a supervisor.
- Postgres, session cookies, Stripe Connect + webhooks, optional Gitea / Didit.
r/haskell • u/TechnoEmpress • 1d ago
announcement V0.1.0.0 of ghcup-gtk released
discourse.haskell.orgr/haskell • u/TechnoEmpress • 1d ago
announcement Google Summer of Code 2026 Wrap-up
blog.haskell.orgr/haskell • u/Prof-Math • 1d ago
A list of Haskell projects
github.comI had made a list of Haskell projects for an undergrad course I was TAing. It was meant for beginners, but I don't see why one couldn't use it for fun otherwise aswell.
If you have some other suggestions, do send them my way. If you have implemented something similar to something on the list, I would love to link your repo or write-up for future reference.
r/haskell • u/gbelloz • 1d ago
An exercise in interpreting compiler errors
I decided to use this as an exercise to get better at interpretting GHC's error messages.
I know that the error here is that I should use (+) because it's an infix operator.
But, ignoring that, how do I understand this error, and, bonus, how would I use that understanding to know what the error actually was?
(1) ghci> (+ (5 :: Integer) (6 :: Integer))
(2) <interactive>:93:4: error:
(3) • Couldn't match expected type ‘Integer -> a’
(4) with actual type ‘Integer’
(5) • The function ‘5 :: Integer’ is applied to one value argument,
(6) but its type ‘Integer’ has none
(7) In the expression: (5 :: Integer) (6 :: Integer)
(8) In the expression: + (5 :: Integer) (6 :: Integer)
(9) • Relevant bindings include
(10) it :: a -> a (bound at <interactive>:93:1)
Here's what I know:
Line (3) says the type that type unification makes it expect.
Line (4) is the type of the value that I'm trying to apply.
Line (5) clearly says it's interpretting (5 :: Integer) as a function. Why?
Line (6) dunno
Line (7) the expression where all this happened
Line (8) working out from the function nesting
Line (10) dunno
What am I missing?
r/haskell • u/Ro__Bert • 3d ago
question Trying to figure out Cabal
I was trying to use a Haskell Image Processing library (HIP), and after muddling through figuring out how to get cabal to work (something was wrong with keys, but finding ghcup seemed to have fixed that issue), I ran "cabal install hip", to which it installed everything and showed a message that it worked, but it might not be what I wanted, and that I might want to use "cabal install --lib hip".
So I tried ghci and confirmed the library was not importable, and then ran "cabal install --lib hip" and it was now visible in ghci. Except now that I've left, and re-opened a terminal, it is no longer there.
Could someone please explain what cabal is doing, why it might not have been importable with the first command, and why it might not be importable now? Does it put the installs in a specific place? Because I wonder if I've just reinstalled it twice as well.
r/haskell • u/ratherforky • 6d ago
announcement Haskell Interlude #85: Brent Yorgey
haskell.foundationIn today’s episode, we’re joined by Brent Yorgey, Associate Professor of Computer Science at Hendrix College and the creator, among other things, of the Diagrams vector graphics library and Swarm, a 2D programming and resource gathering game. We talk about teaching, domain specific languages, and competitive coding.
r/haskell • u/Fendor_ • 6d ago
announcement Vienna Haskell Meetup on the 24th September 2026
Hope everyone had a great summer!
We are hosting the next Haskell meetup in Vienna on the 24th of September 2026! The location is TU Vienna Treitlstraße 3, Seminarraum DE0110. The room will be open starting 18:00 and the first talk will start at 19:00.
We are excited to announce, the speaker for our next meetup is Dominik Schrempf (@dschrempf) (this time for real).
Compiling C to Haskell -- How
hs-bindgenTranslates C HeadersC has a library for everything, and those libraries are fast, battle-tested, and maintained by somebody else. Reaching them from Haskell is the hard part: a Haskell-native rewrite is a project of its own, and hand-writing bindings is tedious and error-prone.
hs-bindgenautomatically generates those bindings for you.In this talk, we explore the vision and the architecture behind
hs-bindgen: a compiler whose source language is C headers and whose target is Haskell modules. We discuss some challenges of reconciling C's low-level memory model with Haskell's rich type system. I hope to convince you that using a C library from Haskell is less like a project of its own and more like an afternoon's work.
This talk is going to be similar to the one that he will give at MuniHac 2026.
There will be time to discuss the presentations over some snacks and non-alcoholic drinks which are provided free of charge with an option to acquire beer for a reasonable price.
The meetup is open-ended, but we might have to relocate to a nearby bar as a group if it goes very late… There is no entrance fee or mandatory registration, but to help with planning we ask you to let us know in advance if you plan to attend here https://forms.gle/giYkuZ3CECYgZQ7A7 or per email at [haskellvienna.meetup@gmail.com](mailto:haskellvienna.meetup@gmail.com).
We especially encourage you to reach out if you would like to hold a talk or participate in the show&tell so that we can ensure there is enough time for you to present your topic.
Finally, we would like to thank Well-Typed LLP for sponsoring the last meetup!
We hope to welcome everyone soon!
Your organizers: Andreas(Andreas PK), Ben, Chris, fendor, VeryMilkyJoe, Samuel
Note: We are going to re-use this thread for announcing the Vienna Haskell Meetup in the future, so you can subscribe to this thread to stay up-to-date!
r/haskell • u/in-a-landscape • 6d ago
Are these installing times for real
Coming back to Haskell since 2019 and honestly I enjoyed it a lot then. I'm installing a formatter "fourmolu" and I'm even using some useless flag
cabal install fourmolu -j --ghc-options=-O0
and 5 minutes later it's still installing, I guess it will take about 25 minutes to install some formatter. I'm on a fairly good computer, 16GB RAM
You can call me a newb or whatever yeah I don't have the correct ghc version or cabal or whatever. Thing is, I'm supposed to be able to install your package manager and ghc version and install a formatter within minutes, but I can't. I really hope I'm doing something seriously wrong here.
UPDATE: Your recommendations helped a lot and it is indeed a fresh new install, so I guess next time any of those dependencies do not take as long.
r/haskell • u/Extra-Engineering374 • 7d ago
question My self-built tool to learn concurrency
I've always wanted to learn about concurrency control, e.g., locks in operating systems & database systems. Some time ago, locks were all I knew about concurrency, but I found it hard to grasp any systematic material to learn about. The only thing I found useful was the pthread locks implementation.
Instead, when I was a junior student, I built this: https://github.com/kINo204/honcurrency, which was basically a virtual machine with an extremely simple instruction set + a round-robin scheduler, allowing me to implement and run my own spinlock, mutex, etc., all starting from a hardware TAS/CAS instruction. I hope this tool could be useful to someone else.
However, as I learn further about concurrency, mathematical methods like CSP, CCS, and pi-calculus come up. Those process calculi provide a mathematical approach to modeling and analyzing concurrency behaviors accurately.
With these, I found my project (or tool) insufficient for gaining complete knowledge of concurrency, which only covers the engineering part; but on the other hand, I tried out implementing CSP's channel with it, and assume there's also an engineering part of those process calculi.
Anyway, I've been totally confused. How & how much should I learn about concurrency, and how does everybody learn about it?
"A monad is a monoid in the category of endofunctors" But what does that actually mean?
youtube.comr/haskell • u/trycuriouscat • 7d ago
Thoughts on this shuffle algorithm
I am a Haskell, well not beginner, but maybe intermediate. I developed the following with the assistance of ChatGPT. Is it too abstract? It's "neat" for sure, but is it reasonable?
import Control.Monad (foldM)
import Control.Monad.ST (runST)
import Control.Monad.IO.Class (MonadIO)
import Data.Primitive.Array (Array, sizeofArray, sizeofMutableArray, arrayFromList,
freezeArray, thawArray, readArray, writeArray)
import qualified Data.Vector as V
import qualified Data.Vector.Mutable as MV
import System.Random (newStdGen, uniformR )
import System.Random.Internal (RandomGen, StdGen)
modifyMWithState
:: Monad m
=> (t1 -> t2 -> t3 -> m b)
-> t4
-> (t5 -> t1)
-> (t4 -> m t5)
-> (t5 -> m a)
-> (t4 -> t2)
-> t3
-> m (a, b)
modifyMWithState algorithm container operationFor thawContainer freezeContainer
lengthOf state = do
thawedContainer <- thawContainer container
let operation = operationFor thawedContainer
newState <- algorithm operation (lengthOf container) state
newContainer <- freezeContainer thawedContainer
pure (newContainer, newState)
knuthM
:: (Monad m, RandomGen g)
=> (Int -> Int -> m ())
-> Int
-> g
-> m g
knuthM swapElements len prnGen = foldM randomSwap prnGen [lastIndex, nextIndex .. 1]
where
lastIndex = len - 1
nextIndex = lastIndex - 1
randomSwap currGen i = do
let (j, nextGen) = uniformR (0, i) currGen
swapElements i j
pure nextGen
shuffleM
:: MonadIO m
=> (StdGen -> m (a, StdGen))
-> m a
shuffleM shuffleWithGen = do
prnGen <- newStdGen
fmap fst (shuffleWithGen prnGen)
shuffleVectorWithGen
:: (Applicative f, RandomGen b)
=> V.Vector a
-> b
-> f (V.Vector a, b)
shuffleVectorWithGen vec prnGen =
pure (runST (modifyMWithState knuthM vec MV.swap V.thaw V.freeze V.length prnGen))
shuffleArrayWithGen
:: (Applicative f, RandomGen b)
=> Array a
-> b
-> f (Array a, b)
shuffleArrayWithGen arr prnGen =
pure (runST (modifyMWithState knuthM arr swapArray thawArray' freezeArray'
sizeofArray prnGen))
where
thawArray' array = thawArray array 0 (sizeofArray array)
freezeArray' thawedArray = freezeArray thawedArray 0
(sizeofMutableArray thawedArray)
swapArray a i j = do
x <- readArray a i
y <- readArray a j
writeArray a i y
writeArray a j x
shuffleVector :: MonadIO m => V.Vector a -> m (V.Vector a)
shuffleVector vec = shuffleM (shuffleVectorWithGen vec)
shuffleArray :: MonadIO m => Array a -> m (Array a)
shuffleArray arr = shuffleM (shuffleArrayWithGen arr)
-- examples:
shuffledIntVector :: IO (V.Vector Int)
shuffledIntVector = shuffleVector (V.fromList [1..10])
shuffledCharArray :: IO (Array Char)
shuffledCharArray = shuffleArray (arrayFromList ['a'..'z'])
r/haskell • u/Character_Fee6680 • 9d ago
Could you please give some guidance to an inexperienced, self-taught Haskell enthusiast?
Hi, I’m 18 and about to start university. I’d like to earn money by programming during my first few semesters, which are the easiest (though perhaps it’s overly optimistic to think I’ll have the time). Here’s my situation: I know Haskell up to the level of monad transformers, and I’ve already written code to solve a real-world problem for a family business. The issue is that, in reality, I only know Haskell and the concepts covered in the book *Learn You a Haskell for Great Good!*; while I grasp things at a deeper level (for instance, understanding that types aren't interfaces but rather sets of possibilities governed by "laws"), I actually don't know what an API is. That’s precisely why I don’t feel ready to work on a team using Haskell. Plus, there’s the fact that Haskell isn't exactly the most popular language in the commercial world. I’m not sure if I should learn another language like TypeScript or Rust for a job or focus on mastering fundamental programming concepts and building more Haskell projects to reach a competent junior level.? Thanks for reading
r/haskell • u/mpilgrem • 10d ago
[ANN] First release candidate for Stack 4.1.1
You can download binaries for this pre-release now from Release rc/v4.1.0.1 (release candidate) · commercialhaskell/stack · GitHub . Soon, it should be available also via GHCup’s prereleases channel.
Please test it and let us know at the Stack repository if you run into any trouble.
We are allowing a much longer period than usual before releasing a final version. This is to increase the opportunity for people interested in Stack’s support for GHC’s Backpack module system for cross-package use to check it behaves as described in Stack’s documentation and as expected. If all goes well, Stack 4.1.1 will be released at the end of Q3 2026.
Release notes:
- The change in major version from 3.x to 4.1 marks the introduction of Stack’s support for GHC’s Backpack module system for cross-package use.
Changes since v3.11.1:
Major changes:
- Stack now supports GHC’s Backpack module system for cross-package use. (Private Backpack, where signatures and implementations are in the same package, was already supported.) When a package uses
signaturesandmixinsto depend on an abstract interface provided by another package, Stack automatically creates the extra instantiation build steps that Cabal requires. This includes support for explicit renaming, multiple instantiations of the same indefinite package, transitive signature chains, sub-library signatures, and indefinite package from Hackage or snapshots. See the Backpack topic for details.
Behavior changes:
- When Stack’s Nix integration is enabled and a
shell-fileis not specified, Stack setsLANG=C.UTF-8(rather thanen_US.UTF-8, which may not be available if Stack has been built from source). - With Nix integration, Stack uses
nix-instantiatebeforenix-shell, enabling Stack to catch and report when the Nix expression cannot be evaluated by Nix. Thenix-instantiate-optionsoption is added, accordingly. - Stack’s
buildcommand now warns if--force-dirtyis specified but no local packages will be built.
Other enhancements:
- Add option
--query ITEM, which can be specified multiple times, to Stack’sls dependencies textcommand (the defaultls dependenciescommand), to cause Stack to filter out from the results all packages other than those queried. Like the existing--filter ITEMoption, an item is either a package name or$localsfor all project packages.
Bug fixes:
- If snapshot locations are cyclic, Stack reports an error rather than going round in circles.
r/haskell • u/gbelloz • 11d ago
question It's not you, it's monad transformers
After a few years of trying to be proficient in Haskell, and lots of reading about why it's so hard, I think I have the (obvious in retrospect) answer.
Almost every program I write is going to have two or more of:
1) read from STDIN
2) write to STDOUT
3) log
4) raise errors
5) send/receive over the network
6) talk to a database
7) read env vars
Every one of those is a "side effect", and thus is handled as a monad, and using more than one means you have to understand monad transformers.
Which I've finally found a good explanation of, "but still". Such a deep concept for such common program operations.
So I finally decided "that's why it's so hard". For what I consider the most basic programs, I need to understand (not just use, IMHO) monad transformers.
Am I off?
r/haskell • u/mattlianje • 12d ago
layoutz 0.4.0: Simple, zero-dep Haskell TUIs ✨🪶 - now w/ Kitty Support, Prompts for CLI scripts, and Collection Spinners
Hello all! Thanks for the feedback to date on layoutz. The API is just about getting stable (but lmk how it feels).
There is now
- Kitty support
- Shorthands for one-shot prompts in CLI scripts
- Collection spinners
- + Various performance improvements to the little runtime

r/haskell • u/effectfully • 12d ago
puzzle Guess the function
github.comMade another challenge. This one is really easy to understand, but very hard to solve. I’d be surprised to get any non-AI solutions at all tbh.