Originate / recouple

Declarative and type-safe API bridging. Write full-stack applications with ease.
MIT License
4 stars 1 forks source link

rename type variables #53

Closed soenkehahn closed 6 years ago

soenkehahn commented 6 years ago

This PR just renames a bunch of type variables.

Personally I never quite understood why best practices around variable names seem to not be applied to type parameters. Specifically, I think it's good to:

I hope I guessed all the names correctly given the abbreviations. Also GetVisitorResult seems long. What do people think?

astampoulis commented 6 years ago

@soenkehahn I like the rename, but I do agree that GetVisitorResult is too long. I haven't had an idea yet, but I'd like us to figure that out before merging. Question: do you think that having Get in the type variable name is better than having a postfix F? For me using that kind of a name is quite conventional, but I am not sure where I'm getting that convention from :smile:

sleexyz commented 6 years ago

I'm fine with all of the new variable names, with maybe the exception of GetVisitorResult.

Can we call GetVisitorResult something short like F, or V, because the whole thing is hack to encode HKT's anyways? I feel like short variable names are more revealing of the mechanics of these type level hacks than these "semantic" names.

In addition, we have a comment on top that explains the encoding of HKT's, which should motivate understanding of the F type parameter anyways.

Also, $Call<F, Input> is more IMO more readable than $Call<GetVisitorResult, Input> in a function signature just because of the sheer size of GetVisitorResult; sometimes we mention that parameter 3 times in a given function signature.

soenkehahn commented 6 years ago

I'll change GetVisitorResult to F and then merge. @sleexyz, @astampoulis: any objections?

sleexyz commented 6 years ago

sounds good

On Tue, Dec 5, 2017, 11:22 PM Sönke Hahn notifications@github.com wrote:

I'll change GetVisitorResult to F and then merge. @sleexyz https://github.com/sleexyz, @astampoulis https://github.com/astampoulis: any objections?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/Originate/recouple/pull/53#issuecomment-349537443, or mute the thread https://github.com/notifications/unsubscribe-auth/ABb5UcPSyJejSrlUa40VVbAI9nCKmuRzks5s9iSSgaJpZM4Q1hl8 .

astampoulis commented 6 years ago

@soenkehahn That sounds good to me too! :+1: