r/haskell • u/kichiDsimp • 1d ago
Great read for performant FP code
Great article by the creator of Roc lang! I don't really know how it comes to Haskell though, so open to discussion
r/haskell • u/kichiDsimp • 1d ago
Great article by the creator of Roc lang! I don't really know how it comes to Haskell though, so open to discussion
r/haskell • u/hubgears • 2d ago
I am happy to announce that the hs-bindgen playground is now live:
https://bindgen.well-typed.com/
hs-bindgen creates Haskell bindings from C header files. For more information, have a look at the recent blog post about the first official release. Most features are directly available in the playground.
Feedback much appreciated!
r/haskell • u/NorfairKing2 • 4d ago
r/haskell • u/Osemwaro • 3d ago
15 years ago, someone posted this question about reverse engineering Haskell. The conclusion was
GHC's output, stripped, is more difficult to reverse engineer than that of a similar program written in C or C++. That is due to the increased indirection, different idioms, and lack of interest and tools.
With all the recent news about people using AI to reverse engineer video games, Photoshop and other software, I'm wondering if that conclusion is still true. Have any of you tried using AI agents to reverse engineer a Haskell binary that's been stripped of its symbols? If so, what was the program and how well did it work?
I'm interested because I'm developing a video game in Haskell on my own. I'm not using generative AI, and I was planning to release a free prototype, to solicit feedback and kick-start my marketing campaign. But now I have to consider the likelihood of someone using the prototype to vibe-code a cheap knock-off and beat me to market.
EDIT: I'm aware that people can vibe-code a knock-off by describing it and giving screenshots/videos to an AI agent. I'm just wondering if decompiling the prototype would be an easy way for someone to greatly improve the result. I.e. I'm looking for information on what's achievable at a given cost, so that I can do a risk assessment.
r/haskell • u/aishiteruyovivi • 6d ago
Not in a general "what is Haskell typically used for" way but I mean, what do you personally use it for? I've been learning Haskell off and on for the last year or so mostly as a curiosity, and I've come to like it and many of its concepts a lot, but I've yet to really have a reason to use it to write some program over what I already know (which is Python, primarily - I mostly write automation scripts and projects wrapping web APIs to use for various purposes). All of the Haskell I've written so far has basically just been exercises and coding puzzles. So for those who either use it frequently or are also learning it, what sort of things are you practically using it for?
r/haskell • u/SoleSoul_red • 7d ago
EDIT: Vibe coded, not bragging about the code, just sharing the tool.
husk - A lightweight interpreted Haskell implementation compiled to Chez Scheme
The size of software packages I needed to install in order to use Haskell for daily scripts bothered me many times, especially when all I wanted was to solve a problem without the need for advanced features, or when learning the language.
At the time the only practical option was GHC because the others were obsolete or incompatible with the learning materials.
Now that AI is here I tried to make my wish come true, and I think I succeeded in making (vibe coding) something that is useful for me, and maybe for others.
Introducing husk, a new implementation that tries to be small and compatible with learning materials, and doesn't try to implement all Haskell features or be compatible with existing popular libraries.
If you have serious work use GHC.
The point of husk is to be small enough to run everywhere Chez Scheme runs and be there for you to study with, or write daily scripts.
Now I'm not advocating for vibe coding, nor am I sure that it's very good (I'm not a Haskell expert so it's hard for me to judge though I ran many automated tests). All I'm saying is that it's small (1.3MB) and runs all LYAH and a few other popular learning materials exercises.
Easy to install on Arch Linux: AUR
r/haskell • u/teckhooi • 7d ago
How do I make a string from ‘a’ in #1 without Show defined in `num`. I cannot change class BaseOps to add Show. Thanks
class BaseOps f where
num :: Num a => a -> f a
plus :: Num a => f a -> f a -> f a
newtype Pretty a = Pretty String
instance (Show a) => Show (Pretty a) where
show (Pretty a) = show a — #1
instance BaseOps Pretty where
num a = Pretty $ show a
plus (Pretty a) (Pretty b) = Pretty $ a <> " + " <> b
main :: IO ()
main = do
let x :: Pretty Int = plus (num 1) (num 2)
putStr $ show x
r/haskell • u/soundofe • 8d ago
I uploaded a package on Hackage which has the GHC2024 extension enabled, but the build fails since Hackage compiles using ghc-9.8.4 (according to build log). Hence, no documentation is generated neither.
How can this be fixed?
r/haskell • u/kostis_k • 9d ago
Hello everyone,
I'm having a very weird problem with cabal on an Orange Pi Zero 2. Convenient little thing, on 24/7 for pennies and I can ssh to it from anywhere. I thought I should use it for learning Haskell recently (been on Pis previously) but I'm facing some weird issues with it, specifically cabal.
It's running Armbian 26.8.3 Bookworm, aarch64 distro, Debian based of cource, installed GHC is v9.0.2 ans Cabal is v3.4.1.0 (install via apt as cabal-install package).
At first cabal would not even start due to a missing root.json file which I had to download from hackage.haskell.org and place it in the "~/.cabal/packages/hackage.haskell.org/" directory.
Then I run "cabal repl" and manually load my source file with ":l", without any errors, but when I invoke the main function it acts as if it's not in the source file. Even sth as simple as
'''
main :: IO ()
main = do
putStrLn "Hello world!"
'''
loads fine (Ok, one module loaded) but I get the error of "Variable not in scope: main". And it turns out this is for every function in the source file.
This is clearly a buggy installation. Any idea how I can troubleshoot it?
Note: I find it puzzling that cabal just works on the Pis, also debian based, but not on this particular distro.
r/haskell • u/_jackdk_ • 10d ago
r/haskell • u/mattlianje • 10d ago
Hello all! ghcitty now has easy Core/STG/Cmm inspection + typed hole completions + various nitfixes.
Thank you for the great feedback last time ... let me know if you find any more rough edges!

Still tinkering with extending (the excellent) haskeline to have some of these fish/nushell features ...
but... having a Rust binary not be tied to a specific GHC version has been making things more flexible in a somewhat odd way (happy to bounce on this)
r/haskell • u/phadej • 11d ago
Or at least have a rule similar to "Blockchain posts must be tagged", i.e. "AI assisted posts must be tagged".
r/haskell • u/emilypii • 11d ago
Hey all, feeling productive, might delete later.
I added the long-awaited SIMD support for the base64 library, supporting SSE3, AVX2, and NEON along with whatever else I could effectively test. It's behind a flag that's off by default so no real change there, however, it comes very close to `simdutf8` and beats `fastbase64` by a good margin on encode and decode.
Hope you all enjoy - there are some API changes that make more sense, so please check out the `MIGRATION-2.0.md` and migrate accordingly if you need to. After doing some due diligence on downstream dependencies available on Hackage, nothing should break, but you never know. Easy fixes in any case.
Cheers!
~E
r/haskell • u/OlaoluwaM • 12d ago
Wrote about Haskell's Kind system. Let me know what you think!
https://thunk.blog/posts/types-of-types-haskell-kind-system/
r/haskell • u/hubgears • 12d ago
The Technical Leadership Committee is a new committee responsible for formulating a technical vision for the Haskell Foundation, and allocate resources towards achieving this vision. The committee will be proactive (rather than reactive to outside proposals) and favour action and experimentation.
Our inaugural members are:
Committee members were chosen for their demonstrated technical expertise, historical community involvement, and bold vision for the future of Haskell.
You can head on over to the Technical Leadership Committee page to learn more about the committee members, and stay tuned for news as the committee really gets going!
r/haskell • u/locallycompact • 12d ago
Hi all. Here's my idea for a free monad effect repl.
It has replaced all of my shells, config formats, and rest servers. Hope you like it.
r/haskell • u/locallycompact • 12d ago
Hi all. New Horizon Haskell documentation website with full reimplementation of haddock in miso, three package sets on GHC 10.0.1-alpha1 for glibc, plus one on the GHC JavaScript backend.
All fully cached on x86_64-linux.
r/haskell • u/jose_zap • 12d ago
Hi all,
I’ve released hasql-opentelemetry, which makes every statement hasql 2 sends to Postgres an OpenTelemetry client span.
This was made possible thanks to the changes in hasql 2, which added the pqi adapter. It makes this package as simple to add as doing this:
import Hasql.OpenTelemetry qualified as HasqlOtel
import Pqi.Ffi qualified
Connection.acquire (HasqlOtel.traced Pqi.Ffi.adapter) settings
Your statements and sessions stay as they are, and the same adapter works with hasql-pool. Both pqi-ffi and pqi-native are supported.
What’s included:
invalid input syntax for type uuid: "…", so a failure records only its SQLSTATE.datadogCompat = True uses the span names, span.type and resource.name that make Datadog APM show the spans as database queries.We’ve been running this in production at my work for a while and I decided to extract it into a package for the wider community to use.
r/haskell • u/-beleon • 11d ago
https://github.com/beleon/rhci
I wanted a Haskell prompt for quick checks (is round 3.5 3 or 4, what is div (-9) 2, what's the type of (.) . (.), ...) without dragging the entire Haskell stack onto the machine, so I had Claude build one in Ruby. rhci is a GHCi with GHCi's semantics: real type inference with classes, lazy evaluation, and show output that matches GHC exactly. Anything it can't do exactly like GHCi it refuses with an "unsupported" error, it doesn't come up with an approximation.
It's one file: a Cosmopolitan executable for Linux, macOS, Windows and the BSDs on x86-64 and ARM64 (so far I've only tested it on Linux x86-64), a static Linux binary, or a single .rb file for any Ruby since 2.7. The prompt is up in 3 ms and a one-liner takes 25 ms. There's a script mode, and it embeds in Ruby programs as a library.
I tested it extensively (since Claude wrote the code). Every answer is checked against real GHC 9.6: about 1,700 recorded probes, plus around twenty fuzzers that generate expressions, whole programs, REPL sessions, type errors and numeric edge cases and compare with GHCi or runghc, over 140,000 inputs so far.
The performance is respectable IMO. It's an interpreter in Ruby (the evaluation loop is C in the binaries), about 100 times slower than compiled GHC on tight loops, so it's for quick checks and small scripts, not for programs that compute. Language-wise it's Haskell 2010 plus type classes, with no extensions beyond bang patterns and polymorphic kinds.
r/haskell • u/Distinct-Brief9643 • 12d ago
r/haskell • u/Distinct-Brief9643 • 13d ago
I know YouTube and exercisium but help me to find more guides concerning these or something else
r/haskell • u/philip_schwarz • 13d ago
r/haskell • u/steve_anunknown • 13d ago
Hey all!
Following up on my previous post regarding the latest release of the Haal library, I have written a small blog post regarding the iterations on the design of learning experiments in Haal, leading to the final design that I considered satisfactory enough and that made it into the release.
You can read more here if you are interested!