Inspection on too restrictive SPECIALIZE
- Dominant language
- Haskell
- Stars
- 597
- Forks
- 53
- PR merge metrics
- No merged PRs in 30d
Description
If you have a function of type:
```haskell
foo :: MonadIO m => m a
```
then the following specializations are either useless or too restrictive:
```haskell
{-# SPECIALIZE foo :: MonadIO m => m () #-}
{-# SPECIALIZE foo :: IO () #-}
```
The only correct one is:
```haskell
{-# SPECIALIZE foo :: IO a #-}
```
But since GHC doesn't warn on such cases, it's useful for Stan to provide such type of analysis.
Contributor guide
Research direction
Start by locating Stan's analysis of GHC SPECIALIZE pragmas and compare it with the examples in the issue. Add checks for useless or overly restrictive specialization signatures, including the three shown cases, and verify that the valid IO a specialization is accepted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100