Combining Effect Handlers in c(x)

I’m admitting that continuing making the c(x) language has grown into a full-blown side project again in past months, after a 10 year break… This post can be seen as a short tour into what the current implementation is capable of, but more precisely - how Effects work here, with a bunch of working examples! TLDR getOdd : Int -> Option Int // implementation omitted checkPositive : Int -> Throw Int // implementation omitted program : Int -> (MyIO || Throw || Option) Int program number = y <- read Int x <- getOdd number z <- checkPositive y return (x + z) myIOHandler = MyIO & has read = ... // custom read impl a <- read Int b <- myIOHandler (program a) print (show result) // 1 1 -> ok 2 // 2 1 -> none // 0 0 -> none // 1 9 -> exception "fail" Intro Shortly, it’s a language where you can write typelevel code with the same language as usual runtime code. Functions are unified with types, and runtime values can be dependencies for types as well, even though it’s statically typed and compiled. Previously I’ve been referring to it as a gradually typed language, but now I don’t think so: constraints and proofs can be established by minimal checks on runtime input. Once a constraint is established, the compiler can use to erase all type logic.

September 21, 2026 · 13 min · Vsevolod Kvachev

We Need Simpler Types

Dependent types, refinement types, gradual types, rank-n polymorphism, etc, – we are moving in the right direction

September 6, 2022 · 14 min · Vsevolod Kvachev

c(x) intro

Design and Implementation of Programming Language with Generalized Sets, Types, and Functions as First-Class Values

May 10, 2017 · 8 min · Vsevolod Kvachev