git.iko.soy/typeable/servant
on master help sign in
tutorial: Make "Position" type consistent

I think this change was just overlooked in https://github.com/haskell-servant/servant/pull/355 Without this change, running the server from Server.lhs and client from Client.lhs will result in something like decodeError = "Error in $: The key \"x\" was not found

commite26f12355529390b00835e4051d7019335ab066b authorArash Rouhani <arashrk@vng.com.vn> dateTue 24 Jan 2017, 11:33 (10 years ago) parent89cb306
1 file changed+3−3
doc/tutorial/Client.lhs+3−3
doc/tutorial/Client.lhs+3−3
@@ -27,8 +27,8 @@ Also, we need examples for some domain specific data types:
2727
2828``` haskell
2929data Position = Position
30− { x :: Int
31− , y :: Int
30+ { xCoord :: Int
31+ , yCoord :: Int
3232 } deriving (Show, Generic)
3333
3434instance FromJSON Position
@@ -135,7 +135,7 @@ run = do
135135Here's the output of the above code running against the appropriate server:
136136
137137``` bash
138−Position {x = 10, y = 10}
138+Position {xCoord = 10, yCoord = 10}
139139HelloMessage {msg = "Hello, servant"}
140140Email {from = "great@company.com", to = "alp@foo.com", subject = "Hey Alp, we miss you!", body = "Hi Alp,\n\nSince you've recently turned 26, have you checked out our latest haskell, mathematics products? Give us a visit!"}
141141```