Open ceedubs opened 2 years ago
If this is for grab then I can do it.
@emilhotkowski Thanks that would be great! My inclination would be to add a view.signature
command to ucm. But I can't speak for others.
I'll add code that can handle this option, but if we choose differently it should be easy to fix PR.
a view.summary
version might be a separate option here that allows you to view summaries of types as well as terms.
so like unique type Nonempty a
might be the summary of unique type Nonempty a = Nonempty a [a]
or something like that.
We use something similar to this in the UI for showing results in the Finder (and eventually for hovers).
If we need something more complicated then what I thought than I'd need some guidance to implement this 🤪
I find that I'm often just interested in the type signature of a term, but when I
view myTerm
the implementation is long enough that I have to page back to see the type signature. It'd be nice to have an easy way to view just the type signature.For example instead of:
I'd want something like:
Some possible command names that come to mind:
signature List.map
view.signature List.map
view : List.map
(similar to usingfind :
to find by type, but I think that this is unnecessarily cryptic and don't really like it)type List.map
typeOf List.map
view.type List.map
NOTE: if the
fzf
completion options showed the type signature when doing the no-arg version ofview
that would probably be good enough for me and I don't know that I'd feel the need for a separate command.