HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleproto-lens-0.7.1.5Haskell2010

Data.ProtoLens.Service.Types

This module provides typeclasses for describing protobuf service metadata. It is intended to be used by library authors to generating bindings against proto services for specific RPC backends.

  • 2 types
  • 3 classes
classclass (KnownSymbol (ServiceName s), KnownSymbol (ServicePackage s), HasAllMethods s (ServiceMethods s)) => Service (s :: k) where
#

Metadata describing a protobuf service. The s parameter is a phantom type generated by proto-lens.

The ServiceName and ServicePackage associated type can be used to generate RPC endpoint paths.

ServiceMethods is a promoted list containing every method defined on the service. As witnessed by the HasAllMethods superclass constraint here, this type can be used to discover every instance of HasMethod available for the service.

Associated types

classclass (KnownSymbol m, KnownSymbol (MethodName s m), Service s, Message (MethodInput s m), Message (MethodOutput s m)) => HasMethodImpl (s :: k) (m :: Symbol) where
#

Metadata describing a service method. The MethodInput and MethodOutput type families correspond to the Messages generated by proto-lens for the RPC as described in the protobuf.

IsClientStreaming and IsServerStreaming can be used to dispatch on library code which wishes to provide different interfaces depending on the type of streaming of the method.

Library code should use HasMethod instead of this class directly whenever the constraint will be exposed to the end user. HasMethod provides substantially friendlier error messages when used incorrectly.

Associated types

typetype HasMethod (s :: k) (m :: Symbol) = (RequireHasMethod s m (ListContains m (ServiceMethods s)), HasMethodImpl s m)
#

Helper constraint that expands to a user-friendly error message when m isn't actually a method provided by service s.

datadata StreamingType
#
Instances6Bounded, Enum, Eq, Ord, Read, Show