Sums that have a constructor with a field of the given type.
Methods
_Typed :: Prism' s aA prism that projects a constructor uniquely identifiable by the type of its field.
Example3 expressions dog ^? _Typed @DogJust (MkDog {name = "Shep", age = Age 3})cat ^? _Typed @(Name, Age)Just ("Mog",Age 5)dog ^? _Typed @Age......... The type Animal contains multiple constructors whose fields are of type Age.... The choice of constructor is thus ambiguous, could be any of:... Duck... Turtle...
injectTyped :: a -> sInject by type.
projectTyped :: s -> Maybe aProject by type.
Instances3AsType
Context a s => AsType a sDefined in generic-optics-2.2.1.0 · Data.Generics.Sum.TypedAsType Void aDefined in generic-optics-2.2.1.0 · Data.Generics.Sum.TypedSee Note [Uncluttering type signatures] >>> :t _Typed
Int _TypedInt :: AsType Int s => Prism' s IntAsType a VoidDefined in generic-optics-2.2.1.0 · Data.Generics.Sum.TypedSee Note [Uncluttering type signatures] >>> :t _Typed _Typed :: AsType a s => Prism' s a