-
Notifications
You must be signed in to change notification settings - Fork 37
Add example for newtype
parameter in routes
#57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add example for newtype
parameter in routes
#57
Conversation
Also add parens to previous examples that failed compilation.
GUIDE.md
Outdated
Using the following routes with a `newtype`: | ||
```purescript | ||
newtype PostId = PostID Int | ||
derive instance newtypePostID :: Newtype PostId _ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some inconsistent casing (PostId vs PostID).
GUIDE.md
Outdated
| PostBrowse String String | ||
``` | ||
|
||
It is possible to warp an `int` route parameter into a `PostId` using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo "warp"
GUIDE.md
Outdated
following function: | ||
```purescript | ||
postId :: forall f. MatchClass f => f PostId | ||
postId = pure wrap <*> int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrap <$> int
, but I would prefer PostId <$> int
.
GUIDE.md
Outdated
postId = pure wrap <*> int | ||
``` | ||
|
||
The created `postId` function can then be used like the `str` function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
str
isn't a function. I would say "parser" instead.
I've addressed Nate's feedback above, but we still need a changelog entry file, which can't be added in this PR AFAIK unless the original author adds that change. |
Also add parens to previous examples that failed compilation.