Skip to content

Typeclass inheritance syntax proposal #4

@ivanopagano

Description

@ivanopagano

in the type classes doc you suggest using the following syntax to imply type class "requirements", which introduces a previously unused notation:

type class Monoid[A] : Semigroup[A] {
  def empty: A
}

What would you think instead of re-using the existing type-bounds notation as in the following snippet?

type class Monoid[A: Semigroup] {
  def empty: A
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions