effect icon indicating copy to clipboard operation
effect copied to clipboard

Improve Clarity in the Naming and Purpose of `Data`, `Case`, and `Schema.data`

Open gcanti opened this issue 2 years ago • 4 comments

I would like to address some concerns regarding the naming of Data and Case:

  • It seems that Data is associated with enabling comparability through Equal. However, the name itself does not effectively convey its intended purpose, possibly leading to confusion.

  • The term Case is used to describe a datatype that shares similarities with a case class in Scala. This reference could be puzzling and unclear to many, potentially causing confusion among developers.

  • (consequently, the purpose of Schema.data lacks clarity and does not effectively communicate its meaning.)

Proposed Actions:

  • Discuss and clarify the purpose and naming of Data, Case to ensure they are intuitive and meaningful.
  • Explore alternative names or concepts that provide better clarity and understanding.

/cc @schickling

gcanti avatar Oct 11 '23 13:10 gcanti

I don't even use either cause it's not clear to me what they're for. And no documentation on them

joshamaju avatar Oct 24 '23 10:10 joshamaju

  1. Data stands for Data Type, those are known with different names depending on the language (Data Objects, Value Objects, Case Objects, Immutable Objects)

  2. Case is a leftover, it should represent a "Case" so something that should be used in a union but we are using Tagged to convey that meaning so references to Case are to be removed

I am open to different names for 1 but none of the other known names (Value, Case) is as good in my view, the objective of those types is for them to be immutable objects that compare by value

mikearnaldi avatar Oct 24 '23 21:10 mikearnaldi

@joshamaju the Data module is documented here https://www.effect.website/docs/data-types/data

gcanti avatar Oct 25 '23 06:10 gcanti

@gcanti Great, thanks

joshamaju avatar Oct 25 '23 07:10 joshamaju