{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreibnoygzg5ggpjbgjf7wpbvizooc6fufh4snvqkj2uxqpx3uhncleq",
    "uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3miv3elvn5oq2"
  },
  "path": "/t/http-tower-hs-a-rust-tower-inspired-middleware-library-for-haskell/13892#post_13",
  "publishedAt": "2026-04-07T05:12:38.000Z",
  "site": "https://discourse.haskell.org",
  "textContent": "Here’s some rewrites of your example from OP, edited:\n\n\n    import Data.Functor ((<&>)) -- (<&>) = flip (<$>), like how (&) = flip ($)\n\n    client <- newClient\n          <&> withBearerAuth \"my-token\"\n          . withRequestId\n          . withRetry (exponentialBackoff 3 0.5 2.0)\n          . withTimeout 5000\n          . withCircuitBreaker config breaker\n          . withValidateStatus (\\c -> c >= 200 && c < 300)\n          . withTracing\n\n\n\n    import Data.Function ((&))\n\n    client <- newClient\n    let configured = client\n          & withBearerAuth \"my-token\"\n          & withRequestId\n          & withRetry (exponentialBackoff 3 0.5 2.0)\n          & withTimeout 5000\n          & withCircuitBreaker config breaker\n          & withValidateStatus (\\c -> c >= 200 && c < 300)\n          & withTracing\n\n\nBy the way, it might also be useful to give your `Service` type a `Functor` instance (can be derived automatically) and a `Profunctor` instance. If someone was writing a binding to a remote HTTP API, it’d provide a good way to lift a `Service Http.Request Http.Response` into a `Service MyBinding.SomeRequest MyBinding.SomeResponse`.",
  "title": "Http-tower-hs — A Rust Tower-inspired middleware library for Haskell"
}