Skip to content

Simplify tuple type Type *: EmptyTuple #5

Description

@marcelluethi

When tuples are redued to a Tuple1, the type inferred shows Type *: EmptyTuple.type.
This looks rather ugly in the type signature and may confuse the reader of the code.

One possible solution is to add a typlevel function Simplify

 type Simplify[T <: Tuple] <: Tuple = T match
    case h *: EmptyTuple => Tuple1[h]
    case _ => T

This function could be added to the typelevel computations to simplify the computed type.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions