p

sprout

package sprout

Source
package.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. sprout
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. trait Burry[O] extends AnyRef

    Helper for various sprout constructors, because going from your new type to your old type is always the same.

    Helper for various sprout constructors, because going from your new type to your old type is always the same.

    This is extremely handy when defining various contravariant functor typeclasses, e.g. various encoders, ordering, etc.

  2. trait NewType[O, N] extends OldType[O, N]

    The purpose of this type class is to give further application code a way to talk about this "new type" encoding.

    The purpose of this type class is to give further application code a way to talk about this "new type" encoding. So that converting to and from the underlying type can be done with as little boilerplate as possible in inter-op with 3rd party libraries, and other classes.

    O

    O for old type. i.e. the underlying runtime type

    N

    N for new type. i.e. the type that ought to live only in the compiler

    See also

    sprout.SproutShow as an example. We can easily provide a Show instance for N if the underlying representation has one. And it's opt in. This principle is then extended to a host of 3rd party libraries to eliminate boilerplate. See the sprout-interop github repo for many other examples.

  3. trait OldType[O, N] extends AnyRef

    See also

    sprout.NewType This typeclass is usefull for defining the contravariant functors. e.g. io.circe.Encoder for your new types.

  4. trait RefinedType[O, N, E] extends OldType[O, N]
  5. type RefinedTypeThrow[O, N] = RefinedType[O, N, Throwable]
  6. trait Sprout[O] extends TagNewType[O] with Burry[O]

    Intended to be mixed into an object, or in certain cases a class, for them to act as the containers and constructors for your new type.

    Intended to be mixed into an object, or in certain cases a class, for them to act as the containers and constructors for your new type.

    e.g.

    object FirstName extends Sprout[String]
    type FirstName = FirstName.Type
  7. trait SproutEq[OT] extends AnyRef
  8. trait SproutOrder[OT] extends AnyRef
  9. trait SproutRefined[O, E] extends Burry[O] with TagNewType[O]
  10. trait SproutRefinedSub[O, E] extends Burry[O] with TagSubType[O]
  11. trait SproutRefinedThrow[O] extends SproutRefined[O, Throwable]
  12. trait SproutShow[OT] extends AnyRef
  13. trait SproutSub[O] extends Burry[O] with TagSubType[O]
  14. trait TagNewType[O] extends AnyRef
  15. trait TagSubType[O] extends AnyRef

Value Members

  1. object NewType
  2. object OldType
  3. object RefinedType
  4. object RefinedTypeThrow

Inherited from AnyRef

Inherited from Any

Ungrouped