{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreihs2luaevyc3sh32t6q2wtlu54et5n23yv3gay35hcu5hddrbr4vy",
"uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3miw7q3h5ixy2"
},
"path": "/t/http-tower-hs-a-rust-tower-inspired-middleware-library-for-haskell/13892#post_19",
"publishedAt": "2026-04-07T12:48:08.000Z",
"site": "https://discourse.haskell.org",
"tags": [
"github.com/jarlah/tower-hs",
"examples/arrow-pipeline/Main.hs",
"main",
"show original",
"@arr",
"@second",
"@stack"
],
"textContent": "Toying more with the idea of defining composite semi complex pipelines\n\ngithub.com/jarlah/tower-hs\n\n#### examples/arrow-pipeline/Main.hs\n\nmain\n\n\n {-# LANGUAGE OverloadedStrings #-}\n\n -- | Example: Arrow composition with HTTP services.\n --\n -- Demonstrates building a multi-step API pipeline using:\n --\n -- * @(&)@ for applying built-in resilience middleware (retry, timeout, etc.)\n -- * @(>>>)@ for chaining services with different input\\/output types\n -- * @arr@ for pure transformations between steps\n -- * @second@ for carrying data through the pipeline\n -- * @(|||)@ for routing to different handlers based on a condition\n --\n -- Fetches a post from JSONPlaceholder, then fetches the post's author,\n -- and combines both into a summary. All with automatic error short-circuiting —\n -- if any step fails, the pipeline stops and returns the error.\n --\n -- Run with: @stack run example-arrow-pipeline@\n module Main where\n\n import Control.Arrow (arr, second, (|||))\n\n\nThis file has been truncated. show original\n\nLooking 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\n\nMy 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.",
"title": "Http-tower-hs — A Rust Tower-inspired middleware library for Haskell"
}