haskell / haskell/haskell-language-server

Suggestions or actions to use type synonyms

Open
#506 5 comments 2 reactions 0 assignees View on GitHub
type: enhancement
Dominant language
Haskell
Stars
3k
Forks
455
Avg merge
4d 3h
Merged PRs (30d)
12

Description

It would perhaps be nice if HLS suggested using in scope type synonyms sometimes.

To make an example using the `hnix` package: if I use the excellent code action `Define funArity :: Fix (Compose (Ann SrcSpan) NExprF) -> Int` I end up with the unhuman given type sig, when `funArity :: NExprLoc -> Int` would be much nicer.

It's probably quite hard to come up with the perfect rule here, but how do people feel about a heuristic along the lines of:

- The sig is in scope
- The types are equal
- Using the synonym is much shorter

(Better but more difficult would be to calculate the preference in existing code (user and library) between the synonym and the expanded version)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.