Skip to content

Commit 377aaf0

Browse files
authored
Minor clarifications to multi-arg example (#84)
1 parent 9b00fcc commit 377aaf0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ type BlogPost =
440440
}
441441
```
442442

443-
Our API tells us the author of the blog post as a string and whether we follow them as a boolean. This admits more cases than are actually possible -- you can't follow yourself, for example -- so we are more precise and model an `Author` as a sum type.
443+
Our API sends us the author of the blog post as a string and whether we follow them as a boolean. This admits more cases than are actually possible -- you can't follow yourself, for example -- so we are more precise and model an `Author` as a sum type.
444444

445445
When our application is running we know who the currently-authenticated user is, and we can use that information to determine the `Author` type. That means we can't decode an `Author` from `Json` alone -- we need more information.
446446

@@ -456,7 +456,7 @@ decodeJsonAuthor maybeUsername json = do
456456
-- user is logged in and is the author
457457
Just (Username username) | author == username -> You
458458
-- user is not the author, or no one is logged in, so use the `following` flag
459-
otherwise -> author # if following then Following else NotFollowing
459+
_ -> author # if following then Following else NotFollowing
460460
461461
decodeJsonBlogPost :: Maybe Username -> Json -> Either JsonDecodeError BlogPost
462462
decodeJsonBlogPost username json = do

0 commit comments

Comments
 (0)