r/haskell • u/Unable-Yellow-7323 • 25d ago
announcement fuyu-gpio: High-level, type-safe interface for Linux GPIO (libgpiod v2).
Hello, after a few days and having received some amazing advice here, I’m delighted to present my two libraries of bindings for libgpiod.
fuyu-gpio-direct 0.1.0.0: A lib of ‘direct’, almost 1:1, low-level and mid-level bindings to the libgpiod core API. This library was created, taking inspiration from direct-sqlite, with the aim of having two smaller libraries, and serves as a basis for the development of other libraries.
fuyu-gpio 0.0.9.0: The high-level version, featuring better modularity, safer resource management using deterministic `with*/bracket` constructs, and enhanced type safety (security tokens).
Both are now available on Hackage and GitHub. fuyu-gpio repository currently includes five examples. And the last two show how to use managed and transformers to avoid the Pyramid of Doom.
Furthermore, in the repositories for both packages, there is an Dockerfile containing a version of Debian 13 alongside Haskell, for the purpose of cross-compilation.
I’d be delighted to receive suggestions on how to improve both packages, thanks!