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

STAN-0302 is triggered on long contexts #505

Open
cdsmith opened this issue Mar 26, 2023 · 2 comments
Open

STAN-0302 is triggered on long contexts #505

cdsmith opened this issue Mar 26, 2023 · 2 comments

Comments

@cdsmith
Copy link

cdsmith commented Mar 26, 2023

The following code:

type Differentiable f =
  ( Functor f,
    GenericK f,
    GDifferentiable (RepK f),
    GBifunctor (GDiff (RepK f))
  )

triggers this message from stan in HLS:

 ✲ Name:        Big tuples
 ✲ Description: Using tuples of big size (>= 4) can decrease code readability
 ✲ Severity:    Style
 ✲ Category:    #AntiPattern #Syntax
Possible solutions:
  - Consider defining and using a custom data type to improve code comprehension
stan(STAN-0302)

However, this is not a tuple. It is a context, and there is no way to define a custom data type to improve code comprehension.

@tomjaguarpaw
Copy link
Collaborator

I agree this is a bug. Unfortunately stan does not have an active enough maintainership to tackle anything beyond keeping the project building. If you (or anyone) can work out how to fix this (and add a test) then I'll happily incorporate it.

I suppose the correct thing to do is to disable the check for big tuples if we're to the left of a =>.

@tomjaguarpaw
Copy link
Collaborator

I don't know for certain, but possibly the fix to this issue will be similar to the fix for #544

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

No branches or pull requests

2 participants