zyla.neutrino.re

Maciej Bielecki

Software Developer

Projects

Contact

[email protected]

Recent posts

Starting interactive bash with an initial command

February 22, 2026

Suppose you want to spawn a new interactive shell and provide an initial command to run. But it should still behave as if you typed the command yourself. For demonstration purposes let’s assume the command you want is just vim. Turns out it’s not so easy. Bash doesn’t have a built-in option for that. You might try the following: vim; bash On the surface, it works; you exit vim, you get to the interactive shell.

How much power is there in `json-schema`?

March 10, 2024

I was reading the json-schema spec, and it caught my attention that it supports recursion. Recursion frequently gives rise to non-trivial computational power. So the question is: where does json-schema lie on the automata hierarchy? Referencing subschema definitions reminds me of state transitions in a finite state machine. In the next paragraph we’ll explore how we can express any FSM using json-schema. With that we can build a little tool to compile a regular expression to an equivalent JSON Schema, which can then be interpreted by any json-schema validator.

TypoParsec - a parser combinator library for TLH

September 13, 2016

In the previous post, we have written a toy example program in Type Level Haskell. This was hardly satisfying; time to write something more sophisticated - a parser. Since Haskellers know better than to handwrite parsers, we will make a small parser combinator library, taking inspiration from parsec. This post is Literate Haskell. You can copy’n’paste it and watch your CPU heat up while GHC checks these bloated types. Boilerplate out of the way!

Type level Haskell, with IO

September 6, 2016

GHC is awesome. It actually implements not one, but two1 programming languages. The Haskell type system (with some extensions) allows arbitrary computation. From now on I will refer to that Haskell subset as Type level Haskell, or TLH. There were several attempts to make use of this beast2, but writing complete programs in it is remarkably difficult due to lack of built-in IO facilities. In this post I will demonstrate how to write a simple command line program which reads lines from standard input and writes lines to standard output.

What can you find in a Hakyll site

January 1, 0001

Like anyone who publishes on the Web these days, I use a static site generator. My site doesn’t have a lot of content - currently (before writing this post) weighs about 100K total, most of which is probably due to Haskell syntax highlighting. So how much does the executable generating it weigh? 99 megabytes. This much code1 is used to generate so little content. After updating to a new Stackage release, it took 13 minutes to compile all on a 4-core machine.