Constructive Programming

Types as guardrails for AI agents. We ship production code paired with LLMs, narrowed by construction.

What we do Book a scoping call

A type signature being narrowed three times: String (space for bugs: ∞), Int (bugs can still hide in an Int), and a domain-specific type alias (not so much when you clearly delimit your domain values).
Narrowing: the same shape that runs through every engagement.

You're a fit if you run a platform team using a typed language (C++, Rust, Scala, TypeScript) — typically Series B–D, 20–80 engineers — with a regression you can name, an improvement plan you've already postponed twice, and a real interest in letting LLMs accelerate the work without quietly eroding what types guarantee.

Consulting

For teams that can't afford another regressive improvement plan.

Constructive Programming partners with teams on their codebases, which have accumulated the usual debts of growth — typed boundaries treated as untyped, required fields treated as optional, 800-line objects nobody dares touch. For us, often, a single thread runs through every engagement: narrowing. Shrinking the set of values a type can hold so that fewer wrong programs compile, so thousands of lines of code go red and can be safely deleted. So the lines that do stay are that much easier for both humans and machines to reason about.

What is different about our practice: we ship production code paired with LLMs. Constructive programming principles are how we keep generative models useful — narrow types and machine-checked properties are the strictest guardrails an agent can be made to operate against, and they turn non-deterministic output into a verifiable artefact. We help teams adopt agent-native development strategies: pairing the non-deterministic behaviour of agents with the deterministic harnesses — static analysis, refinement types, property tests, goal-enriched context — that grant the ability to trust the output of a self-correcting development session.

The kinds of work we take on:

  • Architecture and advisory — design review through a cardinality lens; narrowing type signatures; identifying where capability-based abstractions, refinement types, or algebraic effects unlock simpler code.
  • IC contributions — embedded in your team to ship typed-FP features in Scala or Rust, with the same constructive discipline applied to PRs as to architecture.
  • Agent-native development — building the deterministic harness around your codebase (linters, types, properties, eval suites) so your team can move faster with LLMs and trust the output.
  • Workshops and training — distilled from a decade of constructive-programming workshops, tailored to your stack and team seniority.

Our three packaged offerings — Architecture review, Fractional advisory, Embedded IC — with cadence, deliverables, and how a scoping call goes.

Recent outcomes · 11h → 15min data pipeline at Otravo · P95 <20ms, 100% uptime, −30% infra at Bodireel · Total Program Cardinality static analysis at Royal Philips

Engagements range from a focused two-week review to a multi-month embedded role. Available for select engagements; based in the Netherlands; comfortable with EU MSAs and standard NDAs.

Book a scoping call

or email consulting@constructive.dev

Open source contributions

cats-eo

Existential optics for Scala 3, built on cats.

One Optic[S, T, A, B, F] trait unifies Lens, Prism, Optional, Traversal, Grate, AlgLens and Kaleidoscope. Discipline-checked laws, scoverage-driven quality, JMH benchmarks against Monocle, and circe + avro integrations with an observable-by-default Ior failure surface.

  • Stack Scala 3 + cats
  • Status Active — v0.1.0 (2026)

scala-cardinality

Counting type inhabitants — keep your types small.

A type-cardinality calculator for Scala ADTs (|T| over +, *, ^), plus a scalafix rule that flags sum types used as function arguments. Backs the "Keep Your Types Small" argument with code.

  • Stack Scala + scalafix
  • Status Dormant (2022)

All libraries →

A new functional language

Program against capabilities, not data structures.

Fixed takes recent advances in programming language design — algebraic effects with evidence passing, Perceus reference counting, functional-but-in-place updates — and pushes the whole language up to a capabilities level. You describe what your methods need in order to function (cap); the compiler picks the datastructures and machine layout. Properties (prop) live alongside the capabilities they govern; refinement types are first-class.

The design draws on Quine's predicate functor logic and Quantitative Type Theory. The language is still at Phase 0 — design — it is in flight, with eleven example programs exercising the language. The compiler (planned in Scala, targeting C) and the formal spec on their way.

Read the design

Long-form on type systems, optics, cardinality, and LLM-augmented engineering.

The ONE fp Design Pattern

Sep 2024

How functional programmers actually approach software architecture — under the misconceptions.

Poor man's Pi (types)

Mar 2023

Practical dependent typing in mainstream languages, without a specialised compiler.

More on Medium →