Writing Haskell?

Haskell type errors or GHC upgrade breaking the build? We sort it out.

Haskell sits in a small set of codebases that run quietly for years and then need three days of specialist attention. A GHC bump that broke half the extra-deps, a monad transformer stack nobody remembers choosing, or a Servant handler whose type signature has filled the entire screen. We work through GHC messages, cabal plans and the actual program behaviour until the build goes green and a human can still read what is left.

  • Since 2015Fixing technology
  • FreeEstimates
  • US teamReal engineers

ghc-build.log

still failing

What it is

Haskell at a glance

Haskell is a pure, statically typed, lazily evaluated functional language with a type system built around type classes and monads. It emerged from an academic committee in 1990 and has been shaped by GHC, the de facto compiler, ever since. Modern Haskell runs on GHC 9.x with Cabal or Stack driving builds, and HLS providing editor integration good enough to make day to day work pleasant.

The language holds a durable niche in fintech, compiler and DSL work, formal methods, and a scattering of backend services at firms that value correctness arguments more than hiring speed. It is not a mass market language. The teams that commit to it tend to stay committed and ask for help with specific, sharp problems rather than general maintenance.

Type
Pure, statically typed, lazy functional language
First released
1990 Haskell 1.0, modern tooling since GHC 7
License
BSD style for GHC and most libraries, open source
Maintained by
GHC team, the Haskell Foundation, and library maintainers
Typically used for
Fintech, compilers, DSLs, backend services where correctness matters

The honest version

Haskell pros and cons

No technology is all upside. This is where Haskell earns its place and where it tends to cause trouble.

Where Haskell is strong

  • Types catch an unusual amount of real bugsPure functions, algebraic data types and exhaustive pattern matching turn whole classes of runtime issues into compile errors. Refactors are much safer than in dynamic or weaker static languages.
  • Equational reasoning is actually usefulBecause most code is pure, you can reason about it the way you would reason about algebra. Teams that lean into this write less code with fewer defects.
  • Modern tooling is goodHLS, GHC 9.x, Cabal or Stack, hpack and ghcup have made the editor and build experience closer to mainstream languages than it was ten years ago.
  • Great libraries in specific domainsServant for HTTP APIs, Persistent for databases, Conduit and Pipes for streaming, and QuickCheck for property tests are each strong in their own right.
  • GHC itself is a serious compilerBackends for native code, the LLVM toolchain and JavaScript through GHCJS or the newer JS backend, plus strong optimisation passes most teams never need to touch.

Where Haskell bites

  • The learning curve is real and steepMonads, monad transformers, type classes with higher kinds, laziness and purity all land on day one. Mid level engineers from other backgrounds should expect weeks, not days, before they ship.
  • Error messages improve slowlyType errors can run for dozens of lines before the real cause shows up. GHC 9.x has made them better; they are still intimidating for anyone new.
  • Hiring is a serious constraintThe talent pool is small, remote, and often matches a specific library choice rather than Haskell in general. Replacing a senior engineer can take a quarter.
  • Laziness surprises productionSpace leaks from unevaluated thunks accumulate under load. Diagnosing them needs profiling and a mental model most engineers only build after a real incident.
  • Ecosystem splits around Cabal and StackProjects pick one and live with the choice. Moving between them is possible but painful, and documentation often assumes the other tool.
  • Deployment surface is thinnerFewer hosted runtimes think about Haskell. Docker is normally the honest answer; serverless and container runtime support exists but has sharp edges.

Sound familiar?

Common Haskell problems we fix

The Haskell problems that bring people to us, and what you have once each one is fixed.

No instance for (Show (IO Int))

The type system is complaining about a missing instance

Most often an IO action that was supposed to be run and printed, not printed directly. Sometimes a derived instance that was never written. GHC's message points at the use site rather than the design.

Types line up, instances derived or written

cabal: Could not resolve dependencies

cabal or stack cannot solve the dependency graph

A recent GHC bumped a boot library past a bound in a transitive, or a package you depend on has not yet released for the new base version. Solver output is long; the fix is usually surgical.

Plan resolves against current GHC

ghc: panic! (the 'impossible' happened)

GHC itself has crashed

A code pattern that hits a bug in the compiler, often around type families, GADTs or newer language extensions. Usually workaroundable and worth reporting upstream.

Minimal reproducer found, workaround in place

Ambiguous type variable 'a0'

A type variable cannot be inferred

A polymorphic function called without enough context, or a Read called on a String the compiler cannot narrow. An explicit type signature or a type application resolves it.

Call sites unambiguous

space leak observed under load

The service is accumulating memory under load

A lazy field holding thunks that never evaluate, a State monad that never forces, or a stream consumer that is strict in the wrong place. Needs profiling, not guessing.

Steady memory under sustained load

Orphan instance warning

Orphan instances are spreading through the codebase

Instances defined in modules other than where the type or class lives. Builds still succeed; the behaviour of downstream code becomes order dependent and confusing.

Instances owned by the right module

Linker error during build

Build breaks after a GHC upgrade

Pre built binaries pinned to an older GHC, package stores that need clearing, or a Cabal project file that references a snapshot the current toolchain cannot provide.

Build clean against the chosen GHC

What we do

Haskell help, from one failing build to steady state

Reach us for one broken module, or hand us the whole GHC project.

Rescue
Build that will not go green after a GHC bump, a Servant handler whose types nobody can reconstruct, or a service with a space leak under load. We look at it with fresh eyes.
GHC and dependency upgrades
Staged upgrades across GHC minor and major versions, with the cabal or stack plan rewritten so the next bump is less painful than the last.
Performance and profiling
Space leaks, thunk accumulation and strictness problems traced with real profiling output rather than gut feeling, and fixed at the right layer.
Servant, Persistent and web service work
API handlers, database layers and streaming paths written so the types describe the behaviour and the behaviour matches the contract.
Build and CI cleanup
Cabal and Stack projects brought back to a reproducible state, with cached build layers so CI stops rebuilding the world for every commit.
Managed Tech
An ongoing arrangement covering GHC and HLS upgrades, dependency bumps, incident support and a Haskell engineer on call when the type checker and the clock disagree on priorities.

How it works

From first message to fixed

  1. Look Free estimate

    Tell us what's going wrong. We look at it, then tell you plainly what's wrong and what it will cost.

  2. Fix

    We fix the cause, not the symptom. If something is down, getting it back up comes first.

  3. Harden

    Backups, monitoring, updates and access, so the same problem can't quietly come back.

  4. Hand back or stay on

    You get a plain-language write-up. Or we stay on for hosting, upkeep and new work.

Often found together

Running Haskell alongside something else?

We work on the whole stack, so the problem can be wherever it actually is.

Questions

Haskell questions

Something else? Call+1 737 727 7327

Can you upgrade our project to a newer GHC?

Yes. We work from the current cabal or stack plan, bump GHC in a branch, resolve the inevitable library pins against the new base version, and only merge when the test suite passes and performance under load is unchanged or better. Major GHC jumps are usually done in stages.

Why is our Haskell service slowly leaking memory?

In almost every case, lazy evaluation accumulating thunks that nothing forces. A State monad threaded through a long loop, a record field that is lazy where it should be strict, or a lazy stream that is read in two halves. We profile the running service rather than guessing from the code alone.

Should we use Cabal or Stack?

Either, in current versions, is fine. Cabal with v2 commands is closer to what the GHC and Haskell Foundation tooling targets first, and we lean toward it on new projects. Existing Stack projects usually stay on Stack because the migration cost rarely pays back on its own.

Our Servant handler has a 40 line type signature. Is that normal?

It is common and not necessarily wrong. Servant encodes the API surface in types, so a complex endpoint has a complex signature. We can refactor into named sub types, pull parts into aliases, and clean up where the signature is actually telling you the design is doing too much.

Can you take over an existing Haskell service we inherited?

Yes. We start with the build and the test suite, bring both back to a reproducible state, document the modules and their intent, and then make behavioural changes. Haskell codebases are often small enough that a careful audit pays back within the first week.

How much does Haskell help cost?

Estimates arrive free of charge. Share the cabal file, a GHC error or a repository link, and we send a figure back before any code is touched.

Free estimate

Haskell giving you trouble?

Tell us what you're running and what's going wrong. A person reads it and comes back with an estimate.

  • No charge to find out what it will take
  • If it's urgent, say so

Replies come from a person. By sending, you authorize us to email you back. No marketing.