-- | Validate the key of a metadata pair.
{#fun pure grpc_header_key_is_legal as isKeyValid
{ 'useAsCStringLen'* `B.ByteString'&} -> `Bool' #}
But the C code had been updated from char*, size_t to grpc_slice;
GRPCAPI int grpc_header_key_is_legal(grpc_slice slice);
Thus c2hs expects two arguments in the C function, but there was only one.
Naturally c2hs needs to fail generating the bindings, but the failure should be informative.
Currently it crashes at runtime with an error message which doesn't tell you where in your code you have a problem;
c2hs: src/C2HS/Gen/Bind.hs:(1426,5)-(1444,66): Non-exhaustive patterns in function addDft
Turning the incomplete patterns warnings in c2hs back on;
src/C2HS/Gen/Bind.hs:1426:5: warning: [-Wincomplete-patterns]
Pattern match(es) are non-exhaustive
In an equation for ‘addDft’:
Patterns not matched:
(CHSPlusParm _:_) []
(CHSParm _ _ True _ _ _ _:_) [_]
I had written this c2hs code;
But the C code had been updated from
char*, size_t
togrpc_slice
;Thus c2hs expects two arguments in the C function, but there was only one. Naturally c2hs needs to fail generating the bindings, but the failure should be informative.
Currently it crashes at runtime with an error message which doesn't tell you where in your code you have a problem;
Turning the incomplete patterns warnings in c2hs back on;
I also filed a bug to fix the incomplete patterns; https://github.com/haskell/c2hs/issues/179.