Annotation that may be applied to methods on a type that is annotated with @typeclass
.
Annotation that may be applied to methods on a type that is annotated with @typeclass
.
Annotation that may be applied to methods on a type that is annotated with @typeclass
.
Doing so changes the code generation strategy used when generating the syntax ops type.
Instead of the type class method name being used, the name specified on this annotation is used.
If alias
is true, two methods are generated, one with the original name and one with the
specified name.
Annotation that may be applied to a trait or class of one type parameter to generate boilerplate that makes the type class easier to use.
Annotation that may be applied to a trait or class of one type parameter to generate boilerplate that makes the type class easier to use.
The only type parameter must either by a proper type or a unary type constructor. Types of other shapes, like binary type constructors, are not currently supported.
As a result of adding this annotation, the following code is generated in the companion:
MyTypeClass[Type]
as a
shortcut for implicitly[MyTypeClass[Type]]
.Ops
, which provides object oriented style forwarding
methods -- aka, syntax -- for the methods defined directly on the type class.AllOps
, which extends Ops
and the Ops
traits for any
super types.ToMyTypeClassOps
, which provides an implicit conversion
that enables use of the Ops
trait.ops
, which provides an implicit conversion to the
AllOps
trait.As a result, the ops can be used by either importing MyTypeClass.ops._
or
by mixing MyTypeClass.ToMyTypeClassOps
in to a type.
Annotation that may be applied to methods on a type that is annotated with
@typeclass
.Doing so results in the method being excluded from the generated syntax ops type.