Fix `Arithmetic` example (#107)

The instructions for testing the `Arithmetic` example were
out of date
This commit is contained in:
Gabriel Gonzalez 2020-09-04 12:04:30 -07:00 committed by GitHub
parent d7c3c3847a
commit d8f6e0b476
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -9,6 +9,7 @@
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-- | Generated by Haskell protocol buffer compiler. DO NOT EDIT!
module Arithmetic where
import qualified Prelude as Hs
import qualified Proto3.Suite.Class as HsProtobuf
@ -163,8 +164,8 @@ instance HsJSONPB.ToSchema TwoInts where
HsJSONPB.insOrdFromList
[("x", twoIntsX), ("y", twoIntsY)]}})
data OneInt = OneInt{oneIntResult :: Hs.Int32}
deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData)
newtype OneInt = OneInt{oneIntResult :: Hs.Int32}
deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData)
instance HsProtobuf.Named OneInt where
nameOf _ = (Hs.fromString "OneInt")

View File

@ -32,7 +32,7 @@ This library exposes quite a few modules, but you won't need to worry about most
To start out, we need to generate code for our protocol buffers and RPCs. The `compile-proto-file` command is provided as part of `proto3-suite`. You can either use `stack install` in the `proto3-suite` repository to install the command globally, or use `stack exec` from within the `grpc-haskell` directory.
```
$ stack exec -- compile-proto-file --proto examples/echo/echo.proto > examples/echo/echo-hs/Echo.hs
$ stack exec -- compile-proto-file --includeDir examples/tutorial --proto arithmetic.proto --out examples/tutorial
```
The `.proto` file compiler always names the generated module the same as the `.proto` file, capitalizing the first letter if it is not already. Since our proto file is `arithmetic.proto`, the generated code should be placed in `Arithmetic.hs`.