Skip to content

Move empty, automatically-solved classes to submodules of Prim #3179

Description

@hdgarrood

The following classes are currently defined inside typelevel-prelude, but since they are solved by the compiler and also since, afaik, they do not exist at runtime (because they have no methods), I think it is worth considering moving them into submodules of Prim:

  • RowToList
  • AppendSymbol
  • CompareSymbol
  • (ConsSymbol? it's in the compiler but not in typelevel-prelude yet)

If we do this, we should re-export these classes from the modules they exist in now to avoid unnecessary breakage or confusion. Note that we were previously discussing moving RowToList into Prelude in #3116; I'm suggesting going a little further here.

The benefit of this is that:

  • compiler magic should be as close to the compiler as possible; putting classes like this into Prim makes it easier to keep docs and things up to date if/when we want to change them, and means we don't have to worry about getting confusing errors when the installed versions of supporting libraries don't quite match what the compiler expects.
  • it means we don't have do any rearranging of the dependency hierarchy of libraries if we want to take advantage of new compiler magic in libraries which are low-down in the hierarchy. For example, the case of giving Record a its long-awaited Show instance by using RowToList; moving classes into submodules of Prim where possible should reduce the likelihood of similar issues arising in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions