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

Wider overview of type class hierarchy #151

Open
milesfrain opened this issue May 20, 2020 · 4 comments
Open

Wider overview of type class hierarchy #151

milesfrain opened this issue May 20, 2020 · 4 comments

Comments

@milesfrain
Copy link
Member

This "introductory text" might not be the best place for a visual aid describing the hierarchy of type classes, but I'd like to be able to link to one.

There's a partial diagram here: https://github.com/purescript/purescript-control
(created with purs hierarchy, but that requires all classes to be defined in a single file)

Something like haskell's Typeclassopedia, but targeted specifically for purescript would be really great.

@JordanMartinez
Copy link

I think it would be good to have it here, even if it appears as an Appendix. You could use my hierarchy, which is a bit more detailed than the one in purescript-control:

@milesfrain
Copy link
Member Author

Wow. Yours is really good.

Some wishlist items:

  • Hyperlinks to each pursuit page - I believe SVG text supports these.
  • Hover-text showing the class, members, and perhaps a few examples.
class Apply f <= Applicative f where
  pure :: forall a. a -> f a

pure 1 == Just 1
pure 1 == [1]
pure 1 == (1 : Nil)

Although I guess the examples should really just be on the pursuit page.

@JordanMartinez
Copy link

I've been wanting to convert this picture into an actual website. In addition to the actual type classes, it would show all of the instances of that type class. Thus, if you didn't understand what the abstract idea was, you could use the concrete implementations of it to build up to understanding that abstract concept.

So, imagine your "wish list" but in addition to hovering over it, it would show the definition for each instance as found in a given package set. Even better, it would visually show what's going on, so that one can understand how it affects control flow / usage.

@milesfrain
Copy link
Member Author

That would be incredibly useful.
This is also on the pursuit wishlist: purescript/pursuit#311

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants