[generics-rep] Trivial genericShow blows up the call stack
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 25/100
- Type d'issue
- Bug
- Clarté
- À clarifier
- Activité
- À l'abandon
- Domaine
- backend
Piste de recherche
Start by reading the genericShow and generic representation code referenced in the stack trace, then reproduce the failure with the VVis and Frame definitions in the issue. Trace why deriving Show for the nested generic types recurses until the stack overflows; done means identifying the cause and confirming a fix prevents the overflow for this example.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
I have the following code in my library:
data VVis a
= Fill a (Frame a)
| ...
derive instance genericVVis :: Generic (VVis a) _
instance showVVis :: Show a => Show (VVis a) where
show = genericShow
data Frame a = Frame
{ frameMax :: a
, frameMin :: a
}
derive instance genericFrame :: Generic (Frame a) _
instance showFrame :: Show a => Show (Frame a) where
show = genericShow
If I now load my code in a REPL and create the following trivial value:
> Fill 2.0 (Frame {frameMax: 1.0, frameMin: 0.0})
return new Data_Show.Show(Data_Generic_Rep_Show.genericShow(genericVVis)(Data_Generic_Rep_Show.genericShowSum(Data_Generic_Rep_Show.genericShowConstructor(Data_Generic_Rep_Show.genericShowArgsProduct(Data_Generic_Rep_Show.genericShowArgsArgument(dictShow))(Data_Generic_Rep_Show.genericShowArgsArgument(showFrame(dictShow))))(new Data_Symbol.IsSymbol(function () {
^
RangeError: Maximum call stack size exceeded
...
This is a very small value, so I don't understand why this is blowing up the call stack. Could somebody help me understand please?
- Langage dominant
- PureScript
- Étoiles
- 168
- Forks
- 90
- Merge moyen
- 3 j 1 h
- PR mergées (30 j)
- 1
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Aucun guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de purescript/purescript-prelude
-
Difficulté 2/5 1-3 heures Accessibilité débutants 57/100
purescript/purescript-prelude#317 · 1 réaction ·
-
Int bottom is not safeOuverte
Difficulté 3/5 1-2 jours Accessibilité débutants 32/100
purescript/purescript-prelude#312 · 5 commentaires ·
-
add liftCompare & friendsOuverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
purescript/purescript-prelude#310 · 5 commentaires ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 24/100
purescript/purescript-prelude#308 · 2 commentaires ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
purescript/purescript-prelude#307 · 1 commentaire · 1 réaction ·
Toutes les issues de purescript/purescript-prelude
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
-
ManageSieve proxy: a backend's NO/BYE greeting is skipped as a capability line and reported as EOFOuvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
Mend: dependency security vulnerability
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
-
Mend: dependency security vulnerability
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
ManageIQ/manageiq-pods#1476 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
prime-radiant-inc/evener#6366 ·
Les mainteneurs répondent en général sous 1 jour