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

[proposal] Add type signatures to the spec. #138

Closed
scott-christopher opened this issue May 7, 2016 · 4 comments
Closed

[proposal] Add type signatures to the spec. #138

scott-christopher opened this issue May 7, 2016 · 4 comments

Comments

@scott-christopher
Copy link
Contributor

While writing up #137 I found that a type signature could potentially help convey some of the restrictions in a clearer and more succinct manner, especially around notions of covariance and contravariance.

I'd propose adopting the Haskell-ish signature format that appears to be at least somewhat common in the Fantasy Land space, where the method target type appears between the type constraints and the function argument types, separated by a ~>.

e.g.

sequence :: (Traversable t, Applicative f) => t (f a) ~> (a -> f a) -> f (t a)

Happy to open a PR if there's any interest in this.

@davidchambers
Copy link
Member

I would certainly appreciate this addition!

@rpominov
Copy link
Member

rpominov commented May 7, 2016

This would make spec much easier to read and understand. Not sure if it can be helpful but I took this approach in static-land. I've added a section that explains type signatures once, and then just used them in the rest of the spec.

@SimonRichardson
Copy link
Member

If you want to do this, just make a PR, I'm pretty sure it will be signed off without a hitch!

@SimonRichardson
Copy link
Member

This has been done!

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

No branches or pull requests

4 participants