effectful-streamly-http-tls: The HTTP effect of effectful-streamly-http, over TLS too

[ bsd3, control, library, network, web ] [ Propose Tags ] [ Report a vulnerability ]

An interpreter for the HTTP effect of effectful-streamly-http that speaks in clear and over TLS, through streamly-http-tls. It is apart so that programs that only speak in clear need not build a TLS stack.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0
Change log CHANGELOG.md
Dependencies base (>=4.19 && <4.22), bytestring (>=0.12 && <0.13), effectful-core (>=2.7.1 && <2.8), effectful-streamly-http (>=0.1 && <0.2), streamly-bytestring (>=0.2.3 && <0.3), streamly-core (>=0.3.3 && <0.4), streamly-http (>=0.1 && <0.2), streamly-http-tls (>=0.1 && <0.2), streamly-network-tls (>=0.1 && <0.2), text (>=2.1 && <2.2), tls (>=2.5 && <2.6) [details]
Tested with ghc ==9.8.4 || ==9.10.3 || ==9.12.4
License BSD-3-Clause
Author Xavier Dectot
Maintainer Xavier Dectot <xavier@wheredoibegin.fr>
Uploaded by GdeVolpiano at 2026-11-28T11:56:42Z
Category Network, Web, Control
Home page https://github.com/GuillaumedeVolpiano/effectful-streamly-http-tls
Source repo head: git clone https://github.com/GuillaumedeVolpiano/effectful-streamly-http-tls.git
Distributions
Downloads 4 total (4 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user [build log]
All reported builds failed as of 2026-11-28 [all 1 reports]

Readme for effectful-streamly-http-tls-0.1.0.0

[back to package description]

effectful-streamly-http-tls

An interpreter for the HTTP effect of effectful-streamly-http that speaks in clear and over TLS, through streamly-http-tls. It is a package apart so that programs that only speak in clear need not build a TLS stack.

{-# LANGUAGE OverloadedRecordDot #-}
{-# LANGUAGE OverloadedStrings #-}

import Effectful (runEff)
import Effectful.Error.Static (runErrorNoCallStack)
import Effectful.HTTP (HttpFailure, Response (..), Scheme (Https), defaultLimits,
                       fetch, get)
import Effectful.HTTP.TLS (Certificates (SystemCertificates), runHttp)

main :: IO ()
main = do
  outcome <- runEff . runErrorNoCallStack @HttpFailure . runHttp SystemCertificates defaultLimits $
    fetch Https (get "example.org" 443 "/")
  print (fmap (.status) outcome)

runHttp takes the authorities trusted to sign the certificates of the servers (SystemCertificates, or CertificatesFrom a file in PEM) and the limits of time and size. A certificate that is not accepted is a TlsFailed. The connections are kept from one request to the next for each server as long as the interpreter runs, which over TLS spares a handshake each time.

Building

To build against copies of the libraries this package is built on (effectful-streamly-http, streamly-http-tls and those under them) checked out next to this repository, pass --project-file=cabal.project.siblings.

Tested with GHC 9.8.4, 9.10.3 and 9.12.4, and effectful 2.7.1.