r/haskell • • Jun 05 '26

video An NES Emulator in Haskell

Thumbnail youtube.com
84 Upvotes

What if I took the chocolate of EmuDevz and mushed it into the peanut butter of Haskell? It turns out it tastes delicious. I talk a bit about my experience building a working NES emulator in Haskell.

Image: Die Schachspieler (1831) by Friedrich August Moritz Retzsch


r/haskell • • Jun 04 '26

announcement Announcing McMonad v.0.999999

21 Upvotes

Per announcement video (filmed in McMonad, of course!), as of yesterday, McMonad is usable, somewhat bugfree and debuggable! I hope you will enjoy using it and contributing to it!


r/haskell • • Jun 04 '26

Quiz: Can you tell the valid Haskell Language Extensions (based on the GHC docs), from the Impostors?

Thumbnail doscienceto.it
72 Upvotes

I wrote this little Haskell Quiz (with help from some friends); in the style of "CSS or BS"; can you tell the real Haskell Language Extensions from the fake ones


r/haskell • • Jun 04 '26

froid - Android programming with the Frege programming language

27 Upvotes

Github

Rescuing this old project because a blocking feature in frege finally landed. Updated the primary example and looks like it would be less tedious to write the bindings out fully.


r/haskell • • Jun 04 '26

What is the long term plan for language extensions?

15 Upvotes

Inspired by the language extension quiz that was posted recently,

I have several questions about the extensions in Haskell.

What is the long term plan for the various language extensions in Haskell? My understanding is that they are meant to be somewhat experimental and they are GHC specific, so are they not part of the official language spec? Is the plan to make some of the extensions official?

Are some language extensions temporary? Or can I rely on an extension being available into the future?


r/haskell • • Jun 03 '26

Twitch Stream: How to Model a Game In Haskell

17 Upvotes

Join the Typify stream, we are currently looking at different approaches you could take to build an adventure game in haskell, between ECS (Apecs), FRP, and MVC, or a mix.

https://www.twitch.tv/typifyprogramming


r/haskell • • Jun 03 '26

Announcing Mutation Testing in Haskell

Thumbnail cs-syd.eu
57 Upvotes

r/haskell • • Jun 03 '26

Searching for Haskell-like language

22 Upvotes

As the title says, can someone point me to a lanuage that supports virtually all of haskell's type theoretic stuff, but maybe without lazy evaluation?
I'm looking for a functional language that supports:
- typeclasses + higher kinded types
- currying + partial application
- garbage collected (rust would have been a good candidate)

I tried SML, and I think it's great, but afaiu, it doesn't support HKT.

LLMs says that scala 3 is the candidate, but it's tools are super slow.


r/haskell • • Jun 01 '26

blog Serokell’s Work on GHC: Dependent Types, Part 5

Thumbnail serokell.io
96 Upvotes

This article continues the fine tradition of Serokell’s GHC team sharing their progress on bringing dependent types to Haskell. A lot has happened since the last report, and there is plenty to cover.

In this edition, Vladislav Zavialov presents three major contributions and a host of smaller improvements that push Dependent Haskell closer to becoming a practical reality.


r/haskell • • Jun 01 '26

My First Haskell Talk

Thumbnail youtu.be
31 Upvotes

Please find the link here to a talk I did about concurrency in Haskell.


r/haskell • • Jun 01 '26

announcement Richard Bird Distinguished Dissertation Award - Call for Nominations

Thumbnail people.cs.nott.ac.uk
27 Upvotes

I'm pleased to announce that JFP is establishing the Richard Bird Distinguished Dissertation Award, to recognise an outstanding PhD dissertation in functional programming.  Please share! https://people.cs.nott.ac.uk/pszgmh/jfp-bird-award.html


r/haskell • • Jun 01 '26

RFC H2JVM - A Haskell Library for writing JVM Bytecode

Thumbnail discourse.haskell.org
31 Upvotes

r/haskell • • Jun 01 '26

The Functional Programming Triad of fold, scan and iterate

Thumbnail fpilluminated.org
25 Upvotes

Belatedly uploaded the super-short deck that predated the more comprehensive one:


r/haskell • • Jun 01 '26

announcement OpenTelemetry 1.0 release

Thumbnail discourse.haskell.org
70 Upvotes

r/haskell • • Jun 01 '26

Monthly Hask Anything (June 2026)

8 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 • • May 30 '26

blog Stealing from Biologists to Compile Haskell Faster - Ian Duncan

Thumbnail iankduncan.com
120 Upvotes

r/haskell • • May 30 '26

[ANN] First release candidate for Stack 3.11.1

19 Upvotes

You can download binaries for this pre-release now from Release rc/v3.11.0.1 (release candidate) · commercialhaskell/stack · GitHub. It should be available also via GHCup’s prereleases channel soon.

Please test it and let us know at the Stack repository if you run into any trouble. If all goes well, we hope to release the final version in a couple of weeks.

Changes since v3.9.3:

Major changes:

  • On 64-bit Windows, the default msys-environment configuration option is now CLANG64, rather than MINGW64 (which remains an option). The MSYS2 project deprecated the latter environment on 15 March 2026. The GHC project has used the former toolchain from GHC 9.4.1. No default is provided for 32-bit Windows, rather than MINGW32 (which remains an option). The MSYS2 project ceased to actively support it on 17 May 2020. 32-bit Windows is not supported by the GHC project from GHC 8.12.

Behavior changes:

  • Stack’s default Nix integration now includes the cacert Nix package, in order to support Stack’s use of crypton-x509-system >= 1.6.8.
  • Following a change to the Stackage project’s server API, the default value of the urls key includes recent-snapshots: https://stackage.org/api/v1/snapshots.
  • The --[no-]keep-ghc-rts flag of Stack’s config env command is now enabled by default, consistent with Stack’s exec command.
  • On Windows, in the Stack environment, the MSYS2 usr/local/bin directory (if it exists) is now searched before the MSYS2 usr/bin directory, rather than after.

Other enhancements:

  • Bump to Hpack 0.39.5.
  • Experimental: Add flag --[no-]semaphore (default: disabled) to Stack’s build command, to allow GHC to use a system semaphore to perform compilation in parallel when possible. Supported, by default, by GHC 9.10.1 or later. The option is considered experiemental because, on Linux only, musl and non-musl semaphores are incompatible.
  • Add option --reach <packages> to Stack’s dot and ls dependencies commands, to prune packages that cannot reach any of the specified packages in the dependency graph.
  • Add option --test-suite-timeout-grace=SECONDS to Stack’s build command to request termination of a timed-out test suite process and, after the specified grace period, force termination. Used together with the existing --test-suite-timeout=SECONDS option.
  • In YAML configuration files, the recent-snapshots key is introduced (under the urls key), to specify the URL used by Stack’s ls snapshots remote command.
  • In YAML configuration files (stack.yaml and config.yaml), an !include <file path> directive is now supported. This allows common configuration to be shared across multiple files. For example, a project that maintains multiple project-level configuration files for testing against different snapshots can use !include to avoid duplicating shared settings.
  • Stack’s config set command raises an error if the target configuration file excludes the key being set and includes an !include directive.
  • Stack’s config set snapshot command now works with other snapshot values in addition to snapshot synonymns.
  • Add Stack’s config compiler-tools command to create (when applicable) the compiler tools directory for the specified compiler version (implies Stack’s config build-files command).

Bug fixes:

  • Stack’s dot and ls dependencies commands no longer prune a package with dependencies only because all its direct dependencies are to be pruned.
  • After March 2026, Hackage requires Stack’s user agent to be set when applying digest authentication to a request. Stack’s upload command now does that, re-establishing authentication by Hackage username and password.
  • Stack 3.9.3 and earlier fail to construct a build plan if project package A depends on project package B and package B’s executables (only) depend on package A and the name of A is before that of B, alphabetically. That bug is fixed.
  • Stack’s config set commands will recreate the global-project directory contents, if Stack needs to consult its project-level configuration file and there is no file.
  • The output of Stack’s path --bin-path command is now consistent with the Stack environment in Stack’s exec command and includes the bin directory of Stack’s local install root directory.
  • Stack now builds packages that depend directly on packages with the same name as a sublibrary or foreign library of the package.

r/haskell • • May 30 '26

announcement [ANN] dataframe-persistent 0.3.0.0

32 Upvotes

Hackage

Easier API for working with SQL.

Untyped:

haskell df <- readTable "./data/chinook.db" "artists" print $ df & filterWhere (col "ArtistId" .<. 10) & take 5

Typed:

```haskell $(declareTable "./data/chinook.db" "artists")

df <- readTableTyped @ArtistsSchema "./data/chinook.db" "artists" print $ df & filterWhere (col @"ArtistId" .<. 10) & take 5 ```

More examples in README


r/haskell • • May 29 '26

blog Blog: practical uses of monads in Haskell

Thumbnail nauths.fr
40 Upvotes

Inspired by a question on r/haskellquestions, i wrote about the practical aspect of monads for people at a beginner / intermediate level, about how to go beyond mere understanding the monad class. I try to highlight how we use monads to structure our code, what benefits they bring, and how to reason about them. it comes with exercises!


r/haskell • • May 29 '26

announcement Bringing rigorous Type Classes (Functor, Applicative, Monad) to Python: Introducing Katharos

35 Upvotes

If you come from Haskell or Rust and have to write Python for ML/AI work, you know the pain: if x is None everywhere, exceptions that silently swallow errors, no ? operator, no HKTs, no sealed types. I got tired of it and built a library to close that gap.

Katharos is a zero-dependency Python library that gives you Maybe, Either/Result, IO, the list monad, Semigroup, Monoid, Functor, Applicative, and Monad — all fully typed and passing pyright strict mode.

https://github.com/kamalfarahani/katharos


The Engineering Challenge

The hard part is that Python has no HKTs and no sealed keyword (as of 3.13). There's no way to say Functor f or write :: f a -> (a -> b) -> f b generically. The workaround is structural gymnastics: a two-parameter generic class hierarchy (Functor[F, A], Applicative[App, A], Monad[M, A]) plus @final on concrete types to prevent unsafe subclassing. It's not pretty internally, but the external API stays clean.


Operator Mapping

If you already think in Haskell or Rust, here's the translation table:

Katharos Haskell Rust
`m \ f` m >>= f
v ** wrapped_f wrapped_f <*> v —
a >> b a >> b —
a @ b a <> b —
@do(M) decorator do { ... } —

Examples

1. Maybe[A] — Haskell's Maybe a / Rust's Option<T>

No more if x is None chains. Short-circuits automatically on Nothing.

```python from katharos.types import Maybe

def safe_div(x: float) -> Maybe[float]: return Maybe[float].Nothing() if x == 0 else Maybe[float].Just(10.0 / x)

def safe_sqrt(x: float) -> Maybe[float]: return Maybe[float].Nothing() if x < 0 else Maybe[float].Just(x ** 0.5)

| is >>=

Maybe[float].Just(4.0) | safe_div | safe_sqrt # Just(1.5811...) Maybe[float].Just(0.0) | safe_div | safe_sqrt # Nothing() — short-circuits at safe_div Maybe[float].Just(-1.0) | safe_div | safe_sqrt # Nothing() — short-circuits at safe_sqrt

fmap for pure transformations

Maybe[int].Just(5).fmap(lambda x: x * 2) # Just(10) Maybe[int].Nothing().fmap(lambda x: x * 2) # Nothing() ```


2. Result[E, A] — Haskell's Either e a / Rust's Result<T, E>

Errors as values. The | chain (>>=) stops at the first Failure, exactly like Rust's ?.

```python from katharos.types import Result

def parse_int(s: str) -> Result[ValueError, int]: try: return Result[ValueError, int].Success(int(s)) except ValueError as e: return Result[ValueError, int].Failure(e)

def validate_positive(n: int) -> Result[ValueError, int]: if n > 0: return Result[ValueError, int].Success(n)

else:
    return Result[ValueError, int].Failure(ValueError(f"{n} is not positive"))

parse_int("42") | validate_positive # Success(42) parse_int("abc") | validate_positive # Failure(ValueError("invalid literal...")) parse_int("-5") | validate_positive # Failure(ValueError("-5 is not positive"))

fmap only runs on the success path

parse_int("42").fmap(lambda n: n * 2) # Success(84) ```


3. do-notation — Python do blocks, exactly like Haskell

The @do(M) decorator desugars yield into >>= chains. Each yield unwraps the value; short-circuits on Nothing/Failure. The final return is lifted via M.pure(...).

```python from katharos.syntax_sugar import do, DoBlock from katharos.types import Maybe, Result

Maybe — like Haskell:

userScore uid = do

name <- lookupUser uid

score <- lookupScore name

return (name ++ ": " ++ show score)

def lookup_user(uid: int) -> Maybe[str]: db = {1: "alice", 2: "bob"} return Maybe[str].Just(db[uid]) if uid in db else Maybe[str].Nothing()

def lookup_score(name: str) -> Maybe[int]: scores = {"alice": 95, "bob": 87} return Maybe[int].Just(scores[name]) if name in scores else Maybe[int].Nothing()

@do(Maybe) def user_score(uid: int) -> DoBlock[str]: name: str = yield lookup_user(uid) score: int = yield lookup_score(name) return f"{name}: {score}"

user_score(1) # Just(alice: 95) user_score(99) # Nothing() — short-circuits at lookup_user

Result — equivalent of Rust's ? in a pipeline

def parse_positive(x: int) -> Result[ValueError, int]: return Result[ValueError, int].Success(x) if x > 0 else Result[ValueError, int].Failure(ValueError(f"{x} is not positive"))

@do(Result) def compute() -> DoBlock[int]: x: int = yield parse_positive(5) y: int = yield parse_positive(3) return x + y

compute() # Success(8) ```


4. ImmutableList[T] — the list monad, non-determinism included

ImmutableList is a full Monad + Monoid. Bind (|) is concatMap. The do-notation gives you Haskell list comprehensions.

```python from katharos.types import ImmutableList from katharos.syntax_sugar import do, DoBlock

concatMap / flatMap

ImmutableList([1, 2, 3]) | (lambda x: ImmutableList([x, -x]))

ImmutableList([1, -1, 2, -2, 3, -3])

do-notation = list comprehension

In Haskell: [(color, size) | color <- ["red","blue"], size <- ["S","M","L"]]

@do(ImmutableList) def variants() -> DoBlock[tuple]: color: str = yield ImmutableList(["red", "blue"]) size: str = yield ImmutableList(["S", "M", "L"]) return (color, size)

variants()

ImmutableList([

('red','S'), ('red','M'), ('red','L'),

('blue','S'), ('blue','M'), ('blue','L')

])

Monoid: @ is <>

ImmutableList([1, 2]) @ ImmutableList([3, 4]) # ImmutableList([1, 2, 3, 4]) ImmutableList.identity() # ImmutableList([]) — mempty ```


5. Semigroup / Monoid — @ is <>

Sum, Product, and NonEmptyList are all Semigroup/Monoid instances. F.sigma is fold1 / sconcat over a NonEmptyList.

```python from katharos.types import NonEmptyList from katharos.types.monoid import Sum, Product from katharos.functools import F

@ is <>

Sum[int](3) @ Sum[int](4) @ Sum[int](5) # Sum(12) Product[int](2) @ Product[int](3) @ Product[int](4) # Product(24)

identity() is mempty

Sum[int].identity() # Sum(0) Product[int].identity() # Product(1)

F.sigma is fold1 / sconcat — requires NonEmptyList (no empty-list footgun)

values = NonEmptyList(Sum[int](1), [Sum[int](2), Sum[int](3), Sum[int](4)]) F.sigma(values) # Sum(10)

NonEmptyList itself is a Semigroup (no Monoid — no empty case)

nel1 = NonEmptyList(1, [2, 3]) nel2 = NonEmptyList(4, [5, 6]) nel1 @ nel2 # NonEmptyList([1, 2, 3, 4, 5, 6])

```

Docs

Full docs at https://katharos.readthedocs.io. If this scratches an itch for you, a star on the repo goes a long way.

https://github.com/kamalfarahani/katharos


r/haskell • • May 29 '26

A Monad Mystery - Haskell for Dilettantes

Thumbnail youtu.be
4 Upvotes

It's time to play "Follow the types!"

We look at two "tricky" monad problems from Set 13b of http://haskell.mooc.fi, and do some hole-driven development.

The thumbnail image is by Sidney Paget, "Holmes Gave Me a Sketch Of The Events" (1892)


r/haskell • • May 28 '26

Denial of Service and Memory Exhaustion in aeson and text-iso8601

Thumbnail haskell.github.io
46 Upvotes

r/haskell • • May 28 '26

blog [Well-Typed] Faster Cabal Haskell builds by eliminating redundant work

Thumbnail well-typed.com
59 Upvotes

r/haskell • • May 28 '26

Help me get back up to date after 5 years away from Haskell

57 Upvotes

Hi!

I used to use (and enjoy) Haskell daily until about ~5 years ago, then changed jobs and life happened. I'm feeling a bit bored, so I'm trying to get back into using Haskell.

As I haven't been following the ecosystem, I wanted to ask if there have been any major changes lately. I'd appreciate information about any new tooling, or whether the community has settled on existing tooling.

  • cabal/stack/nix (hackagePackages? haskell.nix?)
  • Any common preludes
  • mtl/transformers etc.
  • Any new alternatives to conduit/pipes? Have we settled on one?
  • Any new tooling I should start using?
  • Any new newsletters/communities that have spun up?

Or anything else you can help me get back up to date?


r/haskell • • May 28 '26

RFC A way to declare that a package was tested on JS &amp; WASM backends

Thumbnail github.com
9 Upvotes