The example use of `Bound.Name` is needed.
- Dominant language
- Haskell
- Stars
- 130
- Forks
- 30
- PR merge metrics
- No merged PRs in 30d
Description
The problem is, GHC can't figure out how to `fmap` the first `a` out of `Scope (Name a ()) Program a`.
The `>>>=` operator will leave the `Name a ()` intact as well.
I can make it `Name MyName ()`, but this kinda defeats the purpose of the `Name` wrapper.
If the `Scope' (bound :: *) (f :: * -> * -> *) (name :: *) (a :: *)` is a `Bifunctor` instead, thus preserving the names by default, this would allow us to keep the oldest names, erase them with `lmap (const ())` or do any possible mapping separately from the current name set.
The `Monad` instance in that case would allow to only work with "latest" names.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the GHC type-inference problem involving Scope (Name a ()) Program a, then read the definitions of Bound.Name, Scope', (>>>=), and the current Monad instance. Compare the proposed Bifunctor behavior with the existing API and determine which name-preservation cases need coverage. Done means the intended naming behavior and example usage are agreed and documented by tests or an example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100