From dc9c829cdba186fd5bbf62ab27cfdb12145a0bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BE=AA?= Date: Sun, 27 Oct 2024 17:07:00 +1300 Subject: [PATCH] comment --- .../main/scala/chester/syntax/core/Term.scala | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/syntax/src/main/scala/chester/syntax/core/Term.scala b/syntax/src/main/scala/chester/syntax/core/Term.scala index ea612316..e8600d72 100644 --- a/syntax/src/main/scala/chester/syntax/core/Term.scala +++ b/syntax/src/main/scala/chester/syntax/core/Term.scala @@ -19,6 +19,29 @@ import chester.uniqid.* import scala.collection.immutable.HashMap import scala.language.implicitConversions +/* Type Hierarchy Naming Conventions: + * + * The codebase follows these suffix patterns: + * + * - *C (e.g. LocalVC): Abstract "case class-like" traits that define the structure and behavior + * for a specific term type. These contain the common fields and methods that will be + * implemented by concrete case classes. + * + * - *F (e.g. LocalVF): Function interfaces used for constructing terms. These define + * factory methods that create instances of the corresponding *C types. + * They enable flexible term construction while maintaining type safety. + * + * - *T (e.g. TermT): Abstract "trait-like" interfaces that define the core behavior + * for a category of terms. These represent the fundamental abstractions and typically + * extend other trait hierarchies. + * + * Example hierarchy: + * - TermT[Rec] - Base trait for all terms + * - LocalVC[Rec] - Structure for local variables + * - LocalV - Concrete implementation + * - LocalVF[Rec, ThisTree] - Factory for creating LocalV instances + */ + case class TermMeta(sourcePos: SourcePos) derives ReadWriter type OptionTermMeta = Option[TermMeta]