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

Massive issues with naming convention for generics throughout fp-core #38

Closed
JasonShin opened this issue Aug 13, 2019 · 2 comments
Closed
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@JasonShin
Copy link
Owner

The aim of this ticket is to come up with a standard for naming convention used for generics throughout fp-core.

Right now we are facing major issues with this and it eventually leads to incorrect type class signatures.

For example, I came up with below signature for traverse

trait Traverse<A, B, F, G>: HKT<G, B> + HKT3<G, F, B> + Applicative<A, F, B> {
    fn traverse<FB>(&self, f: FB) -> <Self as HKT3<G, F, B>>::Target2
    where
        FB: FnOnce(A) -> <Self as HKT<G, B>>::Target;
}

G here is used for Applicative and F is for Functor. However, due to the nature of Rust, which requires you to pass-through generics to its children, F in Apply is currently used for f (mappable) and it is already incorrect.

The ticket aims to standardise this process and come up with rules around generic name usage.

@JasonShin JasonShin added bug Something isn't working help wanted Extra attention is needed labels Aug 13, 2019
@JasonShin JasonShin self-assigned this Aug 13, 2019
@JasonShin
Copy link
Owner Author

This isn't causing any issues to the existing typeclasses but it will restrict us from scaling out (adding more typeclasses)

@JasonShin
Copy link
Owner Author

We can close this as the PR by @hemangandhi has solved this issue initially. This issue is an ongoing one and has to be part of the coding standard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant