StdInstances
monocle.std.StdInstances
trait StdInstances extends BigDecimalOptics with BigIntOptics with ByteOptics with CharOptics with DoubleOptics with EitherOptics with FunctionOptics with IntOptics with ListOptics with LongOptics with MapOptics with OptionOptics with StringOptics with Tuple1Optics with TryOptics with ChainOptics with TheseOptics with NonEmptyChainOptics with NonEmptyListOptics with NonEmptyVectorOptics with ValidatedOptics
Attributes
- Source:
- All.scala
- Graph
- Supertypes
- trait ValidatedOpticstrait NonEmptyVectorOpticstrait NonEmptyListOpticstrait NonEmptyChainOpticstrait TheseOpticstrait ChainOpticstrait TryOpticstrait Tuple1Opticstrait StringOpticstrait OptionOpticstrait MapOpticstrait LongOpticstrait ListOpticstrait IntOpticstrait FunctionOpticstrait EitherOpticstrait DoubleOpticstrait CharOpticstrait ByteOpticstrait BigIntOpticstrait BigDecimalOpticsclass Objecttrait Matchableclass Any
- Known subtypes
Members list
Concise view
Value members
Inherited methods
Attributes
- Inherited from:
- ChainOptics
- Source:
- Chain.scala
Attributes
- Inherited from:
- NonEmptyChainOptics
- Source:
- NonEmptyChain.scala
Attributes
- Inherited from:
- ChainOptics
- Source:
- Chain.scala
Attributes
- Inherited from:
- ValidatedOptics
- Source:
- Validated.scala
Attributes
- Inherited from:
- FunctionOptics
- Source:
- Function.scala
Attributes
- Inherited from:
- FunctionOptics
- Source:
- Function.scala
Attributes
- Inherited from:
- ListOptics
- Source:
- List.scala
Attributes
- Inherited from:
- NonEmptyChainOptics
- Source:
- NonEmptyChain.scala
Attributes
- Inherited from:
- NonEmptyListOptics
- Source:
- NonEmptyList.scala
Attributes
- Inherited from:
- NonEmptyVectorOptics
- Source:
- NonEmptyVector.scala
Attributes
- Inherited from:
- OptionOptics
- Source:
- Option.scala
Attributes
- Inherited from:
- NonEmptyChainOptics
- Source:
- NonEmptyChain.scala
Attributes
- Inherited from:
- NonEmptyListOptics
- Source:
- NonEmptyList.scala
Attributes
- Inherited from:
- NonEmptyVectorOptics
- Source:
- NonEmptyVector.scala
Attributes
- Inherited from:
- OptionOptics
- Source:
- Option.scala
Attributes
- Inherited from:
- ChainOptics
- Source:
- Chain.scala
Attributes
- Inherited from:
- NonEmptyChainOptics
- Source:
- NonEmptyChain.scala
Attributes
- Inherited from:
- ChainOptics
- Source:
- Chain.scala
Attributes
- Inherited from:
- ValidatedOptics
- Source:
- Validated.scala
Attributes
- Inherited from:
- ListOptics
- Source:
- List.scala
Attributes
- Inherited from:
- NonEmptyChainOptics
- Source:
- NonEmptyChain.scala
final def pNelToOneAnd[A, B]: PIso[NonEmptyList[A], NonEmptyList[B], OneAnd[List, A], OneAnd[List, B]]
Attributes
- Inherited from:
- NonEmptyListOptics
- Source:
- NonEmptyList.scala
final def pNevToOneAnd[A, B]: PIso[NonEmptyVector[A], NonEmptyVector[B], OneAnd[Vector, A], OneAnd[Vector, B]]
Attributes
- Inherited from:
- NonEmptyVectorOptics
- Source:
- NonEmptyVector.scala
Attributes
- Inherited from:
- NonEmptyChainOptics
- Source:
- NonEmptyChain.scala
final def pOptNelToList[A, B]: PIso[Option[NonEmptyList[A]], Option[NonEmptyList[B]], List[A], List[B]]
Attributes
- Inherited from:
- NonEmptyListOptics
- Source:
- NonEmptyList.scala
final def pOptNevToVector[A, B]: PIso[Option[NonEmptyVector[A]], Option[NonEmptyVector[B]], Vector[A], Vector[B]]
Attributes
- Inherited from:
- NonEmptyVectorOptics
- Source:
- NonEmptyVector.scala
Attributes
- Inherited from:
- OptionOptics
- Source:
- Option.scala
Attributes
- Inherited from:
- OptionOptics
- Source:
- Option.scala
Attributes
- Inherited from:
- EitherOptics
- Source:
- Either.scala
Attributes
- Inherited from:
- EitherOptics
- Source:
- Either.scala
Attributes
- Inherited from:
- ValidatedOptics
- Source:
- Validated.scala
Attributes
- Inherited from:
- TheseOptics
- Source:
- These.scala
Attributes
- Inherited from:
- TheseOptics
- Source:
- These.scala
Attributes
- Inherited from:
- ValidatedOptics
- Source:
- Validated.scala
Attributes
- Inherited from:
- NonEmptyVectorOptics
- Source:
- NonEmptyVector.scala
Attributes
- Inherited from:
- OptionOptics
- Source:
- Option.scala
Attributes
- Inherited from:
- EitherOptics
- Source:
- Either.scala
Attributes
- Inherited from:
- EitherOptics
- Source:
- Either.scala
Attributes
- Inherited from:
- ValidatedOptics
- Source:
- Validated.scala
Attributes
- Inherited from:
- TheseOptics
- Source:
- These.scala
Attributes
- Inherited from:
- TheseOptics
- Source:
- These.scala
Attributes
- Inherited from:
- TheseOptics
- Source:
- These.scala
Attributes
- Inherited from:
- Tuple1Optics
- Source:
- Tuple1.scala
Attributes
- Inherited from:
- ValidatedOptics
- Source:
- Validated.scala
Attributes
- Inherited from:
- NonEmptyVectorOptics
- Source:
- NonEmptyVector.scala
Creates an Iso that maps None
to defaultValue
and inversely.
Creates an Iso that maps None
to defaultValue
and inversely.
val defaultTo0 = withDefault(0)
defaultTo0.get(None) == 0
defaultTo0.get(Some(1)) == 1
defaultTo0.reverseGet(0) == None
defaultTo0.reverseGet(1) == Some(1)
withDefault
is a valid Iso only if we consider the set of A
without defaultValue
. For example, Some(0)
breaks the round-trip property of Iso:
defaultTo0.reverseGet(defaultTo0.get(Some(0))) == None
Attributes
- See also:
This method is called
non
in Haskell Lens.- Inherited from:
- OptionOptics
- Source:
- Option.scala
Inherited fields
Attributes
- Inherited from:
- BigDecimalOptics
- Source:
- BigDecimal.scala
Attributes
- Inherited from:
- BigDecimalOptics
- Source:
- BigDecimal.scala
Attributes
- Inherited from:
- BigIntOptics
- Source:
- BigInt.scala
Attributes
- Inherited from:
- BigIntOptics
- Source:
- BigInt.scala
Attributes
- Inherited from:
- BigIntOptics
- Source:
- BigInt.scala
Attributes
- Inherited from:
- BigIntOptics
- Source:
- BigInt.scala
Attributes
- Inherited from:
- BigIntOptics
- Source:
- BigInt.scala
Attributes
- Inherited from:
- ByteOptics
- Source:
- Byte.scala
Attributes
- Inherited from:
- CharOptics
- Source:
- Char.scala
Attributes
- Inherited from:
- DoubleOptics
- Source:
- Double.scala
Attributes
- Inherited from:
- DoubleOptics
- Source:
- Double.scala
Attributes
- Inherited from:
- LongOptics
- Source:
- Long.scala
Attributes
- Inherited from:
- LongOptics
- Source:
- Long.scala
Attributes
- Inherited from:
- LongOptics
- Source:
- Long.scala
Attributes
- Inherited from:
- LongOptics
- Source:
- Long.scala
Attributes
- Inherited from:
- StringOptics
- Source:
- String.scala
Attributes
- Inherited from:
- StringOptics
- Source:
- String.scala
Attributes
- Inherited from:
- StringOptics
- Source:
- String.scala
Attributes
- Inherited from:
- StringOptics
- Source:
- String.scala
Attributes
- Inherited from:
- StringOptics
- Source:
- String.scala
Attributes
- Inherited from:
- StringOptics
- Source:
- String.scala
Attributes
- Inherited from:
- PlatformSpecificStringOptics (hidden)
- Source:
- PlatformSpecificString.scala
Attributes
- Inherited from:
- StringOptics
- Source:
- String.scala