Skip to content

pov: Improve code based on HLint's suggestions. #371

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

Merged
merged 1 commit into from
Sep 25, 2016
Merged

pov: Improve code based on HLint's suggestions. #371

merged 1 commit into from
Sep 25, 2016

Conversation

rbasso
Copy link
Contributor

@rbasso rbasso commented Sep 25, 2016

Related to #355.

where reparented = reparent (Zipper (crumbToGraph c) cs)

down :: Zipper a -> Maybe (Zipper a)
down (Zipper (Graph v (k:kids)) crumbs) = Just (Zipper k ((Crumb v [] kids):crumbs))
down (Zipper (Graph v (k:kids)) crumbs) = Just (Zipper k (Crumb v [] kids:crumbs))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think the spacing now makes it look deceptive? It makes it look as if the precedence is Crumb v [] (kids:crumbs), perhaps a space surrounding the : would be fitting? What say you?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree!
Gonna fix as soon as possible.

ps: Sorry for taking so long to answer. I'm temporarily with a very slow Internet connection (It takes at least a minute to load a GitHub page)

down _ = Nothing

right :: Zipper a -> Maybe (Zipper a)
right (Zipper here ((Crumb v lefts (r:rights)):cs)) = Just (Zipper r (shifted:cs))
right (Zipper here (Crumb v lefts (r:rights):cs)) = Just (Zipper r (shifted:cs))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question with the space here, I think

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rewrote both lines, adding spaces and substituting parenthesis by $.
I still don't like how it looks, but I expect it to be a little more readable.

@rbasso rbasso merged commit d118b11 into exercism:master Sep 25, 2016
@rbasso rbasso deleted the pov-hlint-improvement branch September 25, 2016 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants