HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulegrapesy-1.1.1Haskell2010

Network.GRPC.Common.Compression

Public Compression API

Intended for qualified import.

import Network.GRPC.Common.Compression (Compression(..))
import Network.GRPC.Common.Compression qualified as Compr
  • 3 types
  • 7 values
  • Packagegrapesy-1.1.1
  • Exports10
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceCompression.hs

Definition

2 declarations
datadata Compression
#

Compression scheme

Constructors

Instances1Show
  • Show CompressionDefined in grpc-spec-1.0.0 · Network.GRPC.Spec.Compression
datadata CompressionId
#

Compression ID

The gRPC specification defines

Content-Coding → "identity" / "gzip" / "deflate" / "snappy" / {custom}
Instances6Eq, Ord, Show, IsString, Generic, Rep

Standard compression schemes

2 declarations

Negotation

2 declarations
datadata Negotation
#

Compression negotation

Constructors

  • Negotation
    • offer :: NonEmpty CompressionId

      Which algorithms should be offered (in this order) to the peer?

      This should normally always include Identity (see choose); but see insist.

    • choose :: NonEmpty CompressionId -> Compression

      Choose compression algorithm

      We will run this only once per open connection, when the server first tells us their list of supported compression algorithms. Unless compression negotation has taken place, no compression should be used.

      This cannot fail: the least common denominator is to use no compression. This must be allowed, because the gRPC specification anyway allows a per-message flag to indicate whether the message is compressed or not; thus, even if a specific compression algorithm is negotiated, there is no guarantee anything is compressed.

    • supported :: Map CompressionId Compression

      All supported compression algorithms

Instances1Default

Specific negotation strategies

Insist on the specified algorithm, no matter what the peer offers

This is dangerous: if the peer does not support the specified algorithm, it will be unable to decompress any messages. Primarily used for testing.

See also only.