External Publication
Visit Post

Http-tower-hs — A Rust Tower-inspired middleware library for Haskell

Haskell Community [Unofficial] April 7, 2026
Source

Toying more with the idea of defining composite semi complex pipelines

github.com/jarlah/tower-hs

examples/arrow-pipeline/Main.hs

main

{-# LANGUAGE OverloadedStrings #-}

-- | Example: Arrow composition with HTTP services.
--
-- Demonstrates building a multi-step API pipeline using:
--
--   * @(&)@ for applying built-in resilience middleware (retry, timeout, etc.)
--   * @(>>>)@ for chaining services with different input\/output types
--   * @arr@ for pure transformations between steps
--   * @second@ for carrying data through the pipeline
--   * @(|||)@ for routing to different handlers based on a condition
--
-- Fetches a post from JSONPlaceholder, then fetches the post's author,
-- and combines both into a summary. All with automatic error short-circuiting —
-- if any step fails, the pipeline stops and returns the error.
--
-- Run with: @stack run example-arrow-pipeline@
module Main where

import Control.Arrow (arr, second, (|||))

This file has been truncated. show original

Looking at it however i need someone with actual experience with this to see if there is a valid use case for it. It allows great freedom for the use of the Service. But for what ? Cant just add stuff because its nice and shiny

My own conclusion at this point is that its not adding complexity to the package. But it might not be remotely useful unless in very specific corner cases.

Discussion in the ATmosphere

Loading comments...