mirror of
https://github.com/higherkindness/mu-haskell.git
synced 2024-09-11 14:36:01 +03:00
Support nested types in GRpc methods (#266)
This commit is contained in:
parent
62f9d155b8
commit
c94055c935
@ -86,18 +86,18 @@ pbMethodToType s (P.Method nm vr v rr r _)
|
|||||||
argToType P.Single (P.TOther ["google","protobuf","Empty"])
|
argToType P.Single (P.TOther ["google","protobuf","Empty"])
|
||||||
= [t| '[ ] |]
|
= [t| '[ ] |]
|
||||||
argToType P.Single (P.TOther a)
|
argToType P.Single (P.TOther a)
|
||||||
= [t| '[ 'ArgSingle ('Nothing :: Maybe Symbol) ('SchemaRef $(schemaTy s) $(textToStrLit (last a))) ] |]
|
= [t| '[ 'ArgSingle ('Nothing :: Maybe Symbol) ('SchemaRef $(schemaTy s) $(textToStrLit (T.intercalate "." a))) ] |]
|
||||||
argToType P.Stream (P.TOther a)
|
argToType P.Stream (P.TOther a)
|
||||||
= [t| '[ 'ArgStream ('Nothing :: Maybe Symbol) ('SchemaRef $(schemaTy s) $(textToStrLit (last a))) ] |]
|
= [t| '[ 'ArgStream ('Nothing :: Maybe Symbol) ('SchemaRef $(schemaTy s) $(textToStrLit (T.intercalate "." a))) ] |]
|
||||||
argToType _ _
|
argToType _ _
|
||||||
= fail "only message types may be used as arguments"
|
= fail "only message types may be used as arguments"
|
||||||
|
|
||||||
retToType P.Single (P.TOther ["google","protobuf","Empty"])
|
retToType P.Single (P.TOther ["google","protobuf","Empty"])
|
||||||
= [t| 'RetNothing |]
|
= [t| 'RetNothing |]
|
||||||
retToType P.Single (P.TOther a)
|
retToType P.Single (P.TOther a)
|
||||||
= [t| 'RetSingle ('SchemaRef $(schemaTy s) $(textToStrLit (last a))) |]
|
= [t| 'RetSingle ('SchemaRef $(schemaTy s) $(textToStrLit (T.intercalate "." a))) |]
|
||||||
retToType P.Stream (P.TOther a)
|
retToType P.Stream (P.TOther a)
|
||||||
= [t| 'RetStream ('SchemaRef $(schemaTy s) $(textToStrLit (last a))) |]
|
= [t| 'RetStream ('SchemaRef $(schemaTy s) $(textToStrLit (T.intercalate "." a))) |]
|
||||||
retToType _ _
|
retToType _ _
|
||||||
= fail "only message types may be used as results"
|
= fail "only message types may be used as results"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user