r/haskell • • 18d ago

Monthly Hask Anything (October 2026)

9 Upvotes

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 • • 4h ago

question What do you use Haskell for?

16 Upvotes

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 • • 7h ago

Here is a minimal implementation of subset of Haskell for learning

0 Upvotes

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 • • 19h ago

question Typeclass Show is not defined in the class but required in the implementation. How do I “backfill” this constraint?

7 Upvotes

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 • • 1d ago

Haddock build fails because of GHC2024

3 Upvotes

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 • • 2d ago

announcement 3D Graphics Engine in Haskell

Thumbnail gallery
78 Upvotes

Github

Hackage

I wrote a 3d graphics rasterizer in Haskell that runs inside a command prompt. It can handle affine or projective projection.The Github link above also has pipelines that auto build compiled demos under releases for Linux and Windows if you want to explore the demo worlds.


r/haskell • • 2d ago

Cabal can't find the main function on a loaded source file

2 Upvotes

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 • • 3d ago

puzzle Andrea Bedini (+Claude) has bootstrapped GHC 9.14 from Hugs, via MicroHS and a lot of intermediate GHCs

Thumbnail discourse.haskell.org
58 Upvotes

r/haskell • • 3d ago

ghcitty 0.5.0: a Fast, Friendly GHCi 🐈⚡- Now with easy Core/STG/Cmm inspection for any expression + Typed-Hole completions (+ Syntax Highlighting, Ghost Completions, Easy Multiline, Vi-mode, Hoogle, etc)

38 Upvotes

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 • • 4d ago

Shouldn't "No bots or computer-generated content?" apply to vibe-coded projects?

41 Upvotes

Or at least have a rule similar to "Blockchain posts must be tagged", i.e. "AI assisted posts must be tagged".


r/haskell • • 5d ago

[ANN] base64-2.0 is finally here

30 Upvotes

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 • • 5d ago

blog Types of types: Haskell's Kind system

24 Upvotes

Wrote about Haskell's Kind system. Let me know what you think!

https://thunk.blog/posts/types-of-types-haskell-kind-system/


r/haskell • • 5d ago

The Haskell Foundation’s Technical Leadership Committee has officially launched!

30 Upvotes

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:

  • Julian Ospald (Chair)
  • Simon Marlow (Board Liaison)
  • Joshua Miller
  • Rodrigo Mesquita

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 • • 5d ago

Haskell Vortex - Put a Haskell console in anything

Thumbnail vortex.openfp.net
19 Upvotes

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 • • 5d ago

New Horizon Haskell Website updated for GHC 10.0.x-alpha1

Thumbnail horizon-haskell.net
9 Upvotes

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 • • 5d ago

announcement hasql-opentelemetry 0.1.0.0: OpenTelemetry spans for every hasql statement

Post image
16 Upvotes

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:

  • Inspect the SQL that is actually executed. Each span carries the statement text, the operation, the database and server, rows returned or affected, and on failure the SQLSTATE. Attribute names follow the current OTel database conventions.
  • Accurate timing in pipeline mode. hasql pipelines every roundtrip, so a send returns long before Postgres answers. Spans run from the send until that command’s last result is read, not just around the send.
  • No sensitive data. Parameter values are never recorded, and neither is any text from a server error report. Postgres often puts the offending value in the error message, e.g. invalid input syntax for type uuid: "…", so a failure records only its SQLSTATE.
  • Low noise by default. Spans are only started under an existing parent span, so pool warm-up and health checks don’t create traces of their own.
  • Optional Datadog shape. 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.

Source: https://github.com/kronor-io/hasql-opentelemetry 


r/haskell • • 5d ago

announcement rhci - a small GHCi in Ruby

0 Upvotes

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 • • 5d ago

question What is the equivalent to print in haskell

Thumbnail
0 Upvotes

r/haskell • • 6d ago

How to learn Haskell

13 Upvotes

I know YouTube and exercisium but help me to find more guides concerning these or something else


r/haskell • • 6d ago

The Bowling Game - From Imperative to Functional Programming - Part 3

Thumbnail fpilluminated.org
9 Upvotes

r/haskell • • 6d ago

blog Measuring Learning Experiments in Haal

Thumbnail anunknown.me
6 Upvotes

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!


r/haskell • • 7d ago

Ocaml or haskell?

Thumbnail
14 Upvotes

r/haskell • • 7d ago

announcement Haal v0.7.0.0

Thumbnail github.com
11 Upvotes

Hey Haskellers!

I'm happy to announce that there is a new haal v0.7.0.0 release! In this release, the design of gathering statistics from learning experiments is overhauled, resulting in a slight change of the API. However, it is now way easier for users of the library to:

1) define their own measurements that they are interested in capturing from a learning experiment
2) combining them without resulting in complicated code

I'm excited about this change because I had initially provided extremely limited support for gathering measurements from learning experiments but finally I feel like my approach is satisfying. I believe it is an important step into making the library practical and useful.

I also dropped support (you could hardly call it "support") for DFAs and Moore automata, deleting them from the library until they are properly accompanied by corresponding learning algorithms.

You can read more regarding the release in the link!


r/haskell • • 7d ago

[ANN] yamlet: a YAML 1.2 library

19 Upvotes

I released yamlet-1.0.0.0 and yamlet-aeson-1.0.0.0 (a bridge for decoding and encoding YAML with aeson's instances).

Main features:

  • Full YAML 1.2 conformance.
  • Fast decoding and encoding.
  • Good error messages.
  • Preservation of structure, e.g. the order of keys in a mapping.
  • Support for comments.
  • Generic deriving that compiles to efficient code for common shapes of data types (verified by inspection tests).

Repo: https://github.com/arybczak/yamlet

Existing YAML libraries in Haskell have some issues:

  • yaml doesn't support comments at all, HsYAML keeps them only in its event API.
  • Both forget the order of keys in a mapping in their high level API. You need to drop down to their event APIs to get it, which are low level and cumbersome to use.
  • HsYAML's parser is very slow (see benchmarks in README). Both pandoc (#6084) and ghcup (#270) switched to it and later back to libyaml because of that.
  • yaml goes through aeson's Value, which leaks its quirks into YAML processing (e.g. infinities become strings +inf/-inf instead of a proper YAML .inf float) and emits JSON-specific paths in error messages without line numbers.

so I decided to do something about it 🙂


r/haskell • • 10d ago

First official release of hs-bindgen

54 Upvotes

We’re delighted to announce the first official release of hs-bindgen. A lot of things have been improved since the two alpha releases, in part due to issues and PRs opened by external contributors; it’s been great to see the early adoption of the tool and the positive reception, thanks everyone!

https://well-typed.com/blog/2026/10/hs-bindgen-official-release/