# Learn

**URL:** https://discourse.haskell.org/c/learn/5.md?no_subcategories=false&page=2

[Latest](https://discourse.haskell.org/latest.md) · [Categories](https://discourse.haskell.org/categories.md) · [Tags](https://discourse.haskell.org/tags.md)

**Page:** 3

---

## [Game engine for 2d games](https://discourse.haskell.org/t/game-engine-for-2d-games/13977)

<div class="topic-metadata">

**Author:** [@Swordlash](https://discourse.haskell.org/u/Swordlash)\
**Replies:** 9\
**Last updated:** [May 20, 2026, 3:32pm UTC](https://discourse.haskell.org/t/game-engine-for-2d-games/13977 "2026-05-20T15:32:01Z")

</div>

If I wanted to create an indie 2d game, is there a reasonably high level game engine / library for that purpose?

---

## [How to parse specific syntax elements and discard the rest?](https://discourse.haskell.org/t/how-to-parse-specific-syntax-elements-and-discard-the-rest/14047)

<div class="topic-metadata">

**Author:** [@leana8959](https://discourse.haskell.org/u/leana8959)\
**Replies:** 7\
**Last updated:** [May 14, 2026, 2:41pm UTC](https://discourse.haskell.org/t/how-to-parse-specific-syntax-elements-and-discard-the-rest/14047 "2026-05-14T14:41:15Z")

</div>

Hello, I’m trying to write a tool to analyze nix files, notably rewriting/analyzing the path literals. I would like to parse a nix file into a list of path literals and the location they can be found. With this data I …

---

## [Is it okay to use the cabal solver to conditionally define dependencies and instances like this?](https://discourse.haskell.org/t/is-it-okay-to-use-the-cabal-solver-to-conditionally-define-dependencies-and-instances-like-this/14103)

<div class="topic-metadata">

**Author:** [@clinton](https://discourse.haskell.org/u/clinton)\
**Replies:** 3\
**Last updated:** [May 14, 2026, 8:06am UTC](https://discourse.haskell.org/t/is-it-okay-to-use-the-cabal-solver-to-conditionally-define-dependencies-and-instances-like-this/14103 "2026-05-14T08:06:31Z")

</div>

Edit: In hindsight this approach will result in a circular dependency between alice and alice-bob-instances anyway so won’t work. Edit 2: Also see my reply below where I admit that just having the orphan package is the …

---

## [Is there an idiomatic Haskell?](https://discourse.haskell.org/t/is-there-an-idiomatic-haskell/14042)

<div class="topic-metadata">

**Author:** [@andre.mesquita](https://discourse.haskell.org/u/andre.mesquita)\
**Replies:** 10\
**Last updated:** [May 12, 2026, 6:22pm UTC](https://discourse.haskell.org/t/is-there-an-idiomatic-haskell/14042 "2026-05-12T18:22:28Z")

</div>

Hi there! I’m starting a company, I’m using Haskell and I’m happy with it. Things are going good, the features I develop work, I write tests, everything feels in place, I’ve got no complaints about my current workflow, …

---

## [Conduit to yield first lines from file without leaking space or file handles?](https://discourse.haskell.org/t/conduit-to-yield-first-lines-from-file-without-leaking-space-or-file-handles/14030)

<div class="topic-metadata">

**Author:** [@tomjaguarpaw](https://discourse.haskell.org/u/tomjaguarpaw)\
**Replies:** 16\
**Last updated:** [May 11, 2026, 12:31pm UTC](https://discourse.haskell.org/t/conduit-to-yield-first-lines-from-file-without-leaking-space-or-file-handles/14030 "2026-05-11T12:31:12Z")

</div>

Would a conduit expert be able to write me a conduit that takes in file names and yields the first n lines from each file without leaking space or file handles? I have the following, but it leaks file handles and crashes…

---

## [What is the most ergonomic library to diff data structures in a test suite these days?](https://discourse.haskell.org/t/what-is-the-most-ergonomic-library-to-diff-data-structures-in-a-test-suite-these-days/13989)

<div class="topic-metadata">

**Author:** [@tchoutri](https://discourse.haskell.org/u/tchoutri)\
**Replies:** 12\
**Last updated:** [May 11, 2026, 1:34am UTC](https://discourse.haskell.org/t/what-is-the-most-ergonomic-library-to-diff-data-structures-in-a-test-suite-these-days/13989 "2026-05-11T01:34:20Z")

</div>

I have a huge record of feature flags and some of my tests ensure that these all have the expected value. However using any “naïve” equality assertion in my test suite, I’m finding myself with unreadable dumps on my scre…

---

## [Problems using Stack in a MSYS2 shell](https://discourse.haskell.org/t/problems-using-stack-in-a-msys2-shell/13939)

<div class="topic-metadata">

**Author:** [@mpilgrem](https://discourse.haskell.org/u/mpilgrem)\
**Replies:** 7\
**Last updated:** [May 7, 2026, 1:22pm UTC](https://discourse.haskell.org/t/problems-using-stack-in-a-msys2-shell/13939 "2026-05-07T13:22:41Z")

</div>

@drbean, picking up your question here: Stack tries to create temporary folder in drive root? - #16 by drbean Stack comes with an MSYS2 environment on Windows, so I’ll use that to experiment rather than creating a dup…

---

## [How to filter out vibe-coded dependencies](https://discourse.haskell.org/t/how-to-filter-out-vibe-coded-dependencies/13918)

<div class="topic-metadata">

**Author:** [@hasufell](https://discourse.haskell.org/u/hasufell)\
**Replies:** 77\
**Last updated:** [May 5, 2026, 9:07am UTC](https://discourse.haskell.org/t/how-to-filter-out-vibe-coded-dependencies/13918 "2026-05-05T09:07:16Z")

</div>

Since people seem to already publish vibe coded projects to hackage I’m starting to wonder how I can make sure my dependency graph never includes such packages. There’s no label on hackage and most READMEs have no discl…

---

## [Why don't we have an "\`import\` what you use" commandment in Haskell?](https://discourse.haskell.org/t/why-dont-we-have-an-import-what-you-use-commandment-in-haskell/13969)

<div class="topic-metadata">

**Author:** [@enlico](https://discourse.haskell.org/u/enlico)\
**Replies:** 5\
**Last updated:** [May 4, 2026, 7:30pm UTC](https://discourse.haskell.org/t/why-dont-we-have-an-import-what-you-use-commandment-in-haskell/13969 "2026-05-04T19:30:01Z")

</div>

I’ve recently come across Haskell PVP - Leaking instances, where there’s an example of a package C, which explicitly depends on package B, which in turns explicitly depends on package A (this means that C implicitly de…

---

## [Haskell Interactive Notebook](https://discourse.haskell.org/t/haskell-interactive-notebook/14032)

<div class="topic-metadata">

**Author:** [@LARM-TECHs](https://discourse.haskell.org/u/LARM-TECHs)\
**Replies:** 7\
**Last updated:** [May 4, 2026, 10:19am UTC](https://discourse.haskell.org/t/haskell-interactive-notebook/14032 "2026-05-04T10:19:25Z")

</div>

:notebook: Haskell Notebook for VS Code — Seeking Community Feedback What I’m building A lightweight VS Code extension for interactive Haskell notebooks (\`.ihsnb\` → i for interactive | hs for haskell | nb for notebook)…

---

## [Free-like data structure:](https://discourse.haskell.org/t/free-like-data-structure/14012)

<div class="topic-metadata">

**Author:** [@ashokkimmel](https://discourse.haskell.org/u/ashokkimmel)\
**Replies:** 9\
**Last updated:** [May 2, 2026, 12:00am UTC](https://discourse.haskell.org/t/free-like-data-structure/14012 "2026-05-02T00:00:57Z")

</div>

data Free f a = Pure a | Free (Free f (f a)) deriving Functor -- f (a -\> b) -\> a -\> f b (??) :: Functor f =\> f (a -\> b) -\> a -\> f b fab ?? a = fmap ($ a) fab -- Copied fro Control.Lens instance Functor f =\> Appl…

---

## [Why aren't modules prefixed their package name?](https://discourse.haskell.org/t/why-arent-modules-prefixed-their-package-name/14025)

<div class="topic-metadata">

**Author:** [@superstar64](https://discourse.haskell.org/u/superstar64)\
**Replies:** 8\
**Last updated:** [May 1, 2026, 9:38pm UTC](https://discourse.haskell.org/t/why-arent-modules-prefixed-their-package-name/14025 "2026-05-01T21:38:58Z")

</div>

This follows from discussion on the Functional Programming Discord. In Java, Python and various other languages, modules are always prefixed with their package name. For example: import org.springframework. ... from Jav…

---

## [Cabal -finfo-table-map not working? GHC 9.10.3](https://discourse.haskell.org/t/cabal-finfo-table-map-not-working-ghc-9-10-3/13999)

<div class="topic-metadata">

**Author:** [@tobz619](https://discourse.haskell.org/u/tobz619)\
**Replies:** 2\
**Last updated:** [April 30, 2026, 7:07am UTC](https://discourse.haskell.org/t/cabal-finfo-table-map-not-working-ghc-9-10-3/13999 "2026-04-30T07:07:16Z")

</div>

Cabal 3.16.0.0 I’m trying to profile some code a la this and this I can’t seem to get the table map info to show on the detailed page of eventlog2html? In my cabal file for the game-engine-profile executable I have: …

---

## [Boxed Sums (GHC)](https://discourse.haskell.org/t/boxed-sums-ghc/13979)

<div class="topic-metadata">

**Author:** [@ashokkimmel](https://discourse.haskell.org/u/ashokkimmel)\
**Replies:** 4\
**Last updated:** [April 27, 2026, 11:23pm UTC](https://discourse.haskell.org/t/boxed-sums-ghc/13979 "2026-04-27T23:23:28Z")

</div>

Do these exist anywhere in GHC? Is there a reason that they don’t exist (assuming they don’t)? Would they be useful as a replacement to nested Either?

---

## [Modern Haskell → C translation approaches?](https://discourse.haskell.org/t/modern-haskell-c-translation-approaches/13941)

<div class="topic-metadata">

**Author:** [@Markus\_Puura](https://discourse.haskell.org/u/Markus_Puura)\
**Replies:** 9\
**Last updated:** [April 25, 2026, 12:04am UTC](https://discourse.haskell.org/t/modern-haskell-c-translation-approaches/13941 "2026-04-25T00:04:36Z")

</div>

Hello everyone, I’m looking for ways to translate modern Haskell code into relatively modern, portable C code. I previously experimented with the old -fvia-C option from unregistered GHC builds, but it no longer seems …

---

## [Simple per-project setup](https://discourse.haskell.org/t/simple-per-project-setup/12930)

<div class="topic-metadata">

**Author:** [@bcardiff](https://discourse.haskell.org/u/bcardiff)\
**Replies:** 36\
**Last updated:** [April 19, 2026, 7:54pm UTC](https://discourse.haskell.org/t/simple-per-project-setup/12930 "2026-04-19T19:54:08Z")

</div>

TLDR: Could we have a per-project file that GHCup and editor plugins could use as a single source of truth for the expected toolchain version? I’ve been trying to find a simple setup for GHC, Cabal, HLS with VSCode sup…

---

## [Stack tries to create temporary folder in drive root?](https://discourse.haskell.org/t/stack-tries-to-create-temporary-folder-in-drive-root/12155)

<div class="topic-metadata">

**Author:** [@Pat](https://discourse.haskell.org/u/Pat)\
**Replies:** 16\
**Last updated:** [April 16, 2026, 7:13pm UTC](https://discourse.haskell.org/t/stack-tries-to-create-temporary-folder-in-drive-root/12155 "2026-04-16T19:13:00Z")

</div>

This is a very newbie question, so, my apologies, but I am at my wit’s end trying to figure this out. I’m using stack version 3.1.1 for windows and, try as I might, I cannot avoid getting the following error: Already d…

---

## [Type level programming: Dealing with ambiguous type error](https://discourse.haskell.org/t/type-level-programming-dealing-with-ambiguous-type-error/13828)

<div class="topic-metadata">

**Author:** [@AriFordsham](https://discourse.haskell.org/u/AriFordsham)\
**Replies:** 12\
**Last updated:** [April 14, 2026, 8:08am UTC](https://discourse.haskell.org/t/type-level-programming-dealing-with-ambiguous-type-error/13828 "2026-04-14T08:08:33Z")

</div>

I’m trying to use the vec package to implement a stack machine: Instructions are tagged with the number of their parmeters and return values, and the evaluator pops the parameters off the Vec stack, evaluates the instruc…

---

## [Would keyword arguments conflict with currying in Haskell?](https://discourse.haskell.org/t/would-keyword-arguments-conflict-with-currying-in-haskell/13906)

<div class="topic-metadata">

**Author:** [@Shantanu-sg-01](https://discourse.haskell.org/u/Shantanu-sg-01)\
**Replies:** 8\
**Last updated:** [April 12, 2026, 4:15pm UTC](https://discourse.haskell.org/t/would-keyword-arguments-conflict-with-currying-in-haskell/13906 "2026-04-12T16:15:01Z")

</div>

Hi all, I was thinking about keyword arguments (like in Python) and why Haskell doesn’t support them. It seems that keyword arguments could improve readability at the call site, especially when multiple parameters have…

---

## [Shader Pipeline: PrimShader and Random Face Colours](https://discourse.haskell.org/t/shader-pipeline-primshader-and-random-face-colours/13904)

<div class="topic-metadata">

**Author:** [@tobz619](https://discourse.haskell.org/u/tobz619)\
**Replies:** 3\
**Last updated:** [April 7, 2026, 10:44pm UTC](https://discourse.haskell.org/t/shader-pipeline-primshader-and-random-face-colours/13904 "2026-04-07T22:44:27Z")

</div>

While building my toy rasterizer I was thinking that I could implement various stages like so: type VertexShader = ViewSpace -\> ViewSpace type PrimShader = forall f. Functor f =\> f ViewSpace -\> f ViewSpace type MeshShad…

---

## [Type equality in GADT/TypeFamily context](https://discourse.haskell.org/t/type-equality-in-gadt-typefamily-context/13876)

<div class="topic-metadata">

**Author:** [@dyaitskov](https://discourse.haskell.org/u/dyaitskov)\
**Replies:** 7\
**Last updated:** [April 5, 2026, 1:28am UTC](https://discourse.haskell.org/t/type-equality-in-gadt-typefamily-context/13876 "2026-04-05T01:28:16Z")

</div>

Hi, How to make GHC to type-check the last branch of pop ? GHC understands that x == c in Just Refl case, but it cannon unify default branch with last type family case. {-# LANGUAGE GADTs #-} {-# LANGUAGE RankNTypes …

---

## [Users of Stack and Nix: seeking feeback on sensible defaults](https://discourse.haskell.org/t/users-of-stack-and-nix-seeking-feeback-on-sensible-defaults/13826)

<div class="topic-metadata">

**Author:** [@mpilgrem](https://discourse.haskell.org/u/mpilgrem)\
**Replies:** 3\
**Last updated:** [March 28, 2026, 4:51am UTC](https://discourse.haskell.org/t/users-of-stack-and-nix-seeking-feeback-on-sensible-defaults/13826 "2026-03-28T04:51:01Z")

</div>

Users of both Stack and the Nix package manager, I am seeking feedback on sensible defaults for Stack, as follows: On the NixOS operating system, Stack’s Nix integration is currently enabled by default. Is that still …

---

## [Functional Programming Practice Platform](https://discourse.haskell.org/t/functional-programming-practice-platform/13686)

<div class="topic-metadata">

**Author:** [@augyg](https://discourse.haskell.org/u/augyg)\
**Replies:** 1\
**Last updated:** [March 27, 2026, 7:48pm UTC](https://discourse.haskell.org/t/functional-programming-practice-platform/13686 "2026-03-27T19:48:31Z")

</div>

Hello, this week I am excited to be deploying a fun project I’ve been working on to the Ace platform. It is essentially hackerrank or an exercism except that the inputs we have are not limited to simple values but instea…

---

## [Parse literate Haskell file](https://discourse.haskell.org/t/parse-literate-haskell-file/13839)

<div class="topic-metadata">

**Author:** [@marcosh](https://discourse.haskell.org/u/marcosh)\
**Replies:** 1\
**Last updated:** [March 24, 2026, 12:22am UTC](https://discourse.haskell.org/t/parse-literate-haskell-file/13839 "2026-03-24T00:22:08Z")

</div>

tldr: is it possible to parse a literate Haskell file with parseModuleEpAnnsWithCppInternal? longer question: I’m trying to contribute to doctest-parallel so that it is able to handle literate Haskell files. Currently …

---

## [The fastest way to feed ghc type errors to LLM](https://discourse.haskell.org/t/the-fastest-way-to-feed-ghc-type-errors-to-llm/13827)

<div class="topic-metadata">

**Author:** [@jhrcek](https://discourse.haskell.org/u/jhrcek)\
**Replies:** 12\
**Last updated:** [March 21, 2026, 9:36am UTC](https://discourse.haskell.org/t/the-fastest-way-to-feed-ghc-type-errors-to-llm/13827 "2026-03-21T09:36:56Z")

</div>

I see couple of Haskellers around here embracing agentic coding especially since the jump of capabilities we got in claude 4.5/6 releases. I’ve also been experimenting with claude-code recently and saw some sparks of gre…

---

## [How to practically enable \`-Wmissing-import-lists\`?](https://discourse.haskell.org/t/how-to-practically-enable-wmissing-import-lists/13810)

<div class="topic-metadata">

**Author:** [@clinton](https://discourse.haskell.org/u/clinton)\
**Replies:** 6\
**Last updated:** [March 16, 2026, 9:48pm UTC](https://discourse.haskell.org/t/how-to-practically-enable-wmissing-import-lists/13810 "2026-03-16T21:48:09Z")

</div>

Edit: On further thought I think I might be able to achieve the below using hlint importStyle directives, but that’s WIP. Will post results here. But I will leave the original post if people have a simpler way of workin…

---

## [Fancy Haskell advice: Add recursion to a strongly-typed stack machine](https://discourse.haskell.org/t/fancy-haskell-advice-add-recursion-to-a-strongly-typed-stack-machine/13607)

<div class="topic-metadata">

**Author:** [@AriFordsham](https://discourse.haskell.org/u/AriFordsham)\
**Replies:** 7\
**Last updated:** [March 12, 2026, 11:18pm UTC](https://discourse.haskell.org/t/fancy-haskell-advice-add-recursion-to-a-strongly-typed-stack-machine/13607 "2026-03-12T23:18:12Z")

</div>

Hi all, I’ve built a small stack machine that uses the type system to guarantee no stack underflow: data FreeCat k a b where End :: FreeCat k a a (:\*) :: k a b -\> FreeCat k b c -\> FreeCat k a c infixr 5 :\* (\<:\>) …

---

## [Synthesizing \`RuntimeRep\`-indexed type class instances in a GHC plugin to simulate monomorphization](https://discourse.haskell.org/t/synthesizing-runtimerep-indexed-type-class-instances-in-a-ghc-plugin-to-simulate-monomorphization/13774)

<div class="topic-metadata">

**Author:** [@Ro5bert](https://discourse.haskell.org/u/Ro5bert)\
**Replies:** 5\
**Last updated:** [March 12, 2026, 10:15am UTC](https://discourse.haskell.org/t/synthesizing-runtimerep-indexed-type-class-instances-in-a-ghc-plugin-to-simulate-monomorphization/13774 "2026-03-12T10:15:36Z")

</div>

Motiviation GHC Haskell has a nice runtime representation system, centered around RuntimeRep and TYPE :: RuntimeRep -\> \* in GHC.Exts, that enables representation-polymorphic abstractions. Unfortunately, this control over…

---

## [Compilation error using MicroHS (main.c eval.c)](https://discourse.haskell.org/t/compilation-error-using-microhs-main-c-eval-c/13777)

<div class="topic-metadata">

**Author:** [@feature-not-a-bug](https://discourse.haskell.org/u/feature-not-a-bug)\
**Replies:** 3\
**Last updated:** [March 10, 2026, 11:18pm UTC](https://discourse.haskell.org/t/compilation-error-using-microhs-main-c-eval-c/13777 "2026-03-10T23:18:06Z")

</div>

I’ve dipped my toes into MicroHs and I’m running into a compilation error when I try to invoke it from an external directory. The Haskell code is simply the default hello world from a cabal init ( ../MicroHs/bin/mhs -…

---

## [Fork \`basement\`? As \`baseplate\`?](https://discourse.haskell.org/t/fork-basement-as-baseplate/12415)

<div class="topic-metadata">

**Author:** [@mpilgrem](https://discourse.haskell.org/u/mpilgrem)\
**Replies:** 82\
**Last updated:** [March 9, 2026, 5:20am UTC](https://discourse.haskell.org/t/fork-basement-as-baseplate/12415 "2026-03-09T05:20:29Z")

</div>

This is a similar story to the memory package (see: Fork \`memory\`? As \`memoria\` or \`Memory\`?; and Improving \`memory\` with better abstractions. basement is a direct dependency of memory). That is, I understand that th…

[Previous page](https://discourse.haskell.org/c/learn/5.md?no_subcategories=false&page=1)

[Next page](https://discourse.haskell.org/c/learn/5.md?no_subcategories=false&page=3)
