-
Notifications
You must be signed in to change notification settings - Fork 43
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
Added "find" option that allows for regex searching in recipebook #123
Conversation
specified. Previously, view [recipe] -s was required even though it's an optional argument. I'm not sure if this was on purpose or not, but it's more useful to have a default parameter when listing recipes.
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.
A few nits so far, but looks good overall. Looking forward to seeing the final state! Thanks @dreamsmasher!
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.
Changes addressed in 1fdcd1e.
Added requested changes, and readded the Data.Monoid imports. Sorry about the failing build on GHC-8.2.2! |
I think we can drop GHC 8.2.2, compatibility with three major versions is already pretty good. Feel free to make an issue and/or a pre-PR for that if you prefer it to fixing the 8.2.2 build. |
Thanks for addressing those comments, this is looking pretty good! I'll test locally and merge once the build passes and the final comment gets resolved. |
Awesome, thank you so much @langston-barrett! All comments now resolved. |
@dreamsmasher It looks like the build is still failing. Could you remove GHC 8.2.2 from the build configuration? |
(We should also remove it from the supported list in the Cabal file) |
All checks passed! |
Also - any chance we could add the ‘hacktoberfest‘ tag back to this repo’s topics? New regulations just came out that only PR’s to repos with the tag will be accepted for the free shirts :/ |
I made #124 to track this. Does it need to be done before merging this?
Thanks! I just need to try it out locally now. |
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.
A few more tiny changes, otherwise looks good.
showRecipeHeader t r serv | ||
~~ newline ~~ List.unlines (showRecipeSteps r) | ||
where serv = case (maybeServings) of | ||
-- Nothing -> "Error: use a serving size greater than 0\n" |
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.
Let's go ahead and just delete this line
showRecipe t r maybeServings = | ||
showRecipeHeader t r serv | ||
~~ newline ~~ List.unlines (showRecipeSteps r) | ||
where serv = case (maybeServings) of |
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.
Unnecessary parens:
where serv = case (maybeServings) of | |
where serv = case maybeServings of |
~~ newline ~~ List.unlines (showRecipeSteps r) | ||
|
||
showRecipe t r maybeServings = | ||
showRecipeHeader t r serv |
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.
Instead of the where
with the case
, you can equivalently use
showRecipeHeader t r serv | |
showRecipeHeader t r (maybeServings <|> Just 1) |
where <|>
comes from Control.Applicative
.
Thanks @dreamsmasher! |
Implements #36. The hard part wasn't actually implementing the search function, it was integrating it into the app ;)
Right now it only supports a single search string at a time, and doesn't output colour. Otherwise, it matches the specification laid out in #36.
I had to add toStr to src/RichText's exports in order to get this to work, it's actually a useful function.
Builds successfully, passes all tests and elementary regex testing. Need to add unit tests too.