Skip to content
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

Restore condition with non-generic type parameter #2173

Merged
merged 6 commits into from
Apr 1, 2022

Conversation

jindraivanek
Copy link
Contributor

No description provided.

@jindraivanek
Copy link
Contributor Author

Should be working solution, but probably need some DRY treatment.

@jindraivanek
Copy link
Contributor Author

jindraivanek commented Mar 30, 2022

Fix #2168

@jindraivanek jindraivanek marked this pull request as ready for review March 31, 2022 07:21
@jindraivanek
Copy link
Contributor Author

ready for review

@nojaf nojaf changed the title Fix #2168 Restore condition with non-generic type parameter Apr 1, 2022
Copy link
Contributor

@nojaf nojaf left a comment

Choose a reason for hiding this comment

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

Solid as usual! Thanks buddy!

@@ -599,6 +599,21 @@ let internal colPreEx f2 f1 (c: seq<'T>) f (ctx: Context) =
else
colEx f1 c f (f2 ctx)

/// Similar to col, but apply two more functions fStart, fEnd at the beginning and the end if the input sequence is bigger thn one item
let internal colSurr fStart fEnd f1 (c: list<'T>) f (ctx: Context) =
Copy link
Contributor

Choose a reason for hiding this comment

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

I was a bit unsure about this abstraction at first.
I'm not entirely convinced col f1 c f should be part of this abstraction.
At the same time, I have no example code where a more general abstraction would make sense, so let's just go with this.

else
g)
ctx

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll remove these additional newlines, triggers me a bit 🙈.

@nojaf
Copy link
Contributor

nojaf commented Apr 1, 2022

I changed the title due to this guidance, https://github.com/fsprojects/fantomas/blob/master/CONTRIBUTING.md#pull-request-title
Nitpick, I know 😅

@nojaf nojaf merged commit 7373a06 into fsprojects:master Apr 1, 2022
jindraivanek added a commit to jindraivanek/fantomas that referenced this pull request Apr 9, 2022
* test

* add TLongIdent option to TyparSupportsMember

* format :)

* DRY - new helper function: colSurr

* format

* Remove blank lines

Co-authored-by: nojaf <[email protected]>
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