builders
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
builders.type
Members list
Value members
Concrete methods
Same as instanceFromLazyTypeClasses, except typed for the most common case of: summon[ TC[] ] => TC[]
Same as instanceFromLazyTypeClasses, except typed for the most common case of: summon[ TC[] ] => TC[]
Attributes
This is useful when you have some generic thing, and can create a representation of it from a Case. A common example would be the canonical scala JsonDecoder. Example json: { "MySubType": ... }
This function would allow you to match on a String
, and do Expr(kase.name)
in order to then use the child case decoder for MySubType
.
This is useful when you have some generic thing, and can create a representation of it from a Case. A common example would be the canonical scala JsonDecoder. Example json: { "MySubType": ... }
This function would allow you to match on a String
, and do Expr(kase.name)
in order to then use the child case decoder for MySubType
.
If you need to match on more than 1 thing, you probably want MatchBuilder.instance and/or MatchBuilder.value.
Hint: You are almost certainly going to want to call SumGeneric.typeClassInstance from within useCase.
Warning: This is currently only tested to work where useCase
.Expr[B] returns a constant. Ex: (??? : String) match { case "a" => ...; case "b" => ... }
Attributes
This is useful when you have an instance of A
, and want to do things differently depending on which sub-type of A
you have. A common example would be the canonical scala JsonEncoder. We are able to auto-derive all the child case JsonEncoders for myEnum: MyEnum
, but how do we know which one to call? This would then allow you to wrap a child JsonAST
in { "MySubType": ... }
. This function gives you an exhaustive match on myEnum: MyEnum
, the ability to use a child TC[_]
instance, and then modify that Expr.
This is useful when you have an instance of A
, and want to do things differently depending on which sub-type of A
you have. A common example would be the canonical scala JsonEncoder. We are able to auto-derive all the child case JsonEncoders for myEnum: MyEnum
, but how do we know which one to call? This would then allow you to wrap a child JsonAST
in { "MySubType": ... }
. This function gives you an exhaustive match on myEnum: MyEnum
, the ability to use a child TC[_]
instance, and then modify that Expr.
Hint: You are almost certainly going to want to call SumGeneric.typeClassInstance from within useCase.
If you need to match on more than 1 thing, you probably want MatchBuilder.instance and/or MatchBuilder.value.
Attributes
This will summon instances for all case children. If no instance is found, it will auto-derive the child instance in place.
This will summon instances for all case children. If no instance is found, it will auto-derive the child instance in place.
You should call withLazyTypeClasses[TC]
when you are trying to derive a TC[A]
. You should not call withLazyTypeClasses[OtherTC]
when you are trying to derive a TC[A]
.
Attributes
Similar to withLazyTypeClasses, except if no instance is found, a compile error will be created instead of auto-deriving.
Similar to withLazyTypeClasses, except if no instance is found, a compile error will be created instead of auto-deriving.
You should not call withLazyTypeClassesNoAutoDerive[TC]
when you are trying to derive a TC[A]
. You should call withLazyTypeClassesNoAutoDerive[OtherTC]
when you are trying to derive a TC[A]
.