Drasil icon indicating copy to clipboard operation
Drasil copied to clipboard

Merge typeclass methods in CodeInfoX.hs like in LanguagePolymorphic.hs

Open sarrasoussia opened this issue 7 months ago • 1 comments

On the issue https://github.com/JacquesCarette/Drasil/issues/3934#issue-2478660676 , @B-rando1 suggested merging the typeclass method implementations in the CodeInfoX.hs files, similar to the LanguagePolymorphic.hs renderer functions, for simplification.

I checked CodeInfoProc.hs and CodeInfoOO.hs and found several common typeclass instances:

  • SharedProg, ProgramSym, FileSym
  • BodySym, BlockSym, TypeSym, TypeElim
  • ScopeSym, VariableSym, VariableElim
  • ValueSym, Argument, Literal, MathConstant, VariableValue, CommandLineArgs
  • NumericExpression, BooleanExpression, Comparison, ValueExpression
  • FunctionSym
  • List, Set, InternalList
  • ThunkSym, ThunkAssign
  • VectorType, VectorDecl, VectorThunk, VectorExpression
  • StatementSym, AssignStatement, DeclStatement
  • IOStatement, StringStatement, FuncAppStatement, CommentStatement, ControlStatement
  • VisibilitySym, ParameterSym, MethodSym
  • ModuleSym

I'm thinking of refactoring all shared instance implementations into a new common module: Drasil.Shared.CodeInfoBase.

sarrasoussia avatar May 27 '25 20:05 sarrasoussia

You should make shorter titles and longer descriptions. And in descriptions, you can use github's code linking features to show use exactly what the problem is and what the solution will look like.

I am not completely sure what this issue suggests we do. Could you add more precision please?

JacquesCarette avatar May 28 '25 19:05 JacquesCarette