diff --git a/README.md b/README.md index 9c9d4af..a2dcac0 100644 --- a/README.md +++ b/README.md @@ -440,7 +440,7 @@ type BlogPost = } ``` -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. +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. 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. @@ -456,7 +456,7 @@ decodeJsonAuthor maybeUsername json = do -- user is logged in and is the author Just (Username username) | author == username -> You -- user is not the author, or no one is logged in, so use the `following` flag - otherwise -> author # if following then Following else NotFollowing + _ -> author # if following then Following else NotFollowing decodeJsonBlogPost :: Maybe Username -> Json -> Either JsonDecodeError BlogPost decodeJsonBlogPost username json = do