-
Notifications
You must be signed in to change notification settings - Fork 9
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
Make Kårres properly display when there is no lunch #131
Conversation
src/Model/Karen.hs
Outdated
@@ -108,6 +108,7 @@ parse lang = | |||
>=> mapM menuParser | |||
) | |||
) | |||
>=> pure . filter ((/= "stängt") . _mFood) |
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.
Could instead lens for it to be more inline with the rest of the code
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.
Could also use filterM
and make the fetch a pure
data Menu = Menu | ||
{ _mName :: Text | ||
, _mFood :: Text | ||
} | ||
deriving (Eq, Show) |
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.
data Menu = Menu | |
{ _mName :: Text | |
, _mFood :: Text | |
} | |
deriving (Eq, Show) | |
data Menu = Menu | |
{ _mName :: Text | |
, _mFood :: Text | |
} | |
deriving (Eq, Show) | |
makeLenses ''Menu |
would create lenses with the names mName
and mFood
.
src/Model/Karen.hs
Outdated
@@ -108,6 +110,7 @@ parse lang = | |||
>=> mapM menuParser | |||
) | |||
) | |||
>=> filterM (((/= "stängt") <$>) <$> (^.^ mFood)) |
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.
(^.^) :: Monad m => s -> Getting a s a -> m a | ||
(^.^) = (pure .) . (^.) | ||
infixl 8 ^.^ |
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.
They are so happy now ^.^
deriving (Eq, Show) | ||
|
||
makeLenses ''Menu |
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.
Lenses are good to be inline with the style of code in this repo
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.
LGTM
Snälla nej |
This fixes #130 |
No description provided.