StdInstances

monocle.std.StdInstances

Attributes

Source:
All.scala
Graph
Supertypes
Known subtypes
object Monocle.type
object all.type

Members list

Concise view

Value members

Inherited methods

def chainToList[A]: Iso[Chain[A], List[A]]

Attributes

Inherited from:
ChainOptics
Source:
Chain.scala
final def chainToNec[A]: Prism[Chain[A], Type[A]]

Attributes

Inherited from:
NonEmptyChainOptics
Source:
NonEmptyChain.scala
def chainToVector[A]: Iso[Chain[A], Vector[A]]

Attributes

Inherited from:
ChainOptics
Source:
Chain.scala
final def failure[E, A]: Prism[Validated[E, A], E]

Attributes

Inherited from:
ValidatedOptics
Source:
Validated.scala
final def flip[A, B, C]: Iso[A => B => C, B => A => C]

Attributes

Inherited from:
FunctionOptics
Source:
Function.scala
final def flipped[A, B, C]: (A => B => C) => B => A => C

Attributes

Inherited from:
FunctionOptics
Source:
Function.scala
def listToVector[A]: Iso[List[A], Vector[A]]

Attributes

Inherited from:
ListOptics
Source:
List.scala
def mapToSet[K]: Iso[Map[K, Unit], Set[K]]

Attributes

Inherited from:
MapOptics
Source:
Map.scala
final def necToOneAnd[A]: Iso[Type[A], OneAnd[Chain, A]]

Attributes

Inherited from:
NonEmptyChainOptics
Source:
NonEmptyChain.scala
final def nelToOneAnd[A]: Iso[NonEmptyList[A], OneAnd[List, A]]

Attributes

Inherited from:
NonEmptyListOptics
Source:
NonEmptyList.scala
final def nevToOneAnd[A]: Iso[NonEmptyVector[A], OneAnd[Vector, A]]

Attributes

Inherited from:
NonEmptyVectorOptics
Source:
NonEmptyVector.scala
final def none[A]: Prism[Option[A], Unit]

Attributes

Inherited from:
OptionOptics
Source:
Option.scala
final def optNecToChain[A]: Iso[Option[Type[A]], Chain[A]]

Attributes

Inherited from:
NonEmptyChainOptics
Source:
NonEmptyChain.scala
final def optNelToList[A]: Iso[Option[NonEmptyList[A]], List[A]]

Attributes

Inherited from:
NonEmptyListOptics
Source:
NonEmptyList.scala

Attributes

Inherited from:
NonEmptyVectorOptics
Source:
NonEmptyVector.scala
final def optionToDisjunction[A]: Iso[Option[A], Either[Unit, A]]

Attributes

Inherited from:
OptionOptics
Source:
Option.scala
def pChainToList[A, B]: PIso[Chain[A], Chain[B], List[A], List[B]]

Attributes

Inherited from:
ChainOptics
Source:
Chain.scala
final def pChainToNec[A, B]: PPrism[Chain[A], Chain[B], Type[A], Type[B]]

Attributes

Inherited from:
NonEmptyChainOptics
Source:
NonEmptyChain.scala
def pChainToVector[A, B]: PIso[Chain[A], Chain[B], Vector[A], Vector[B]]

Attributes

Inherited from:
ChainOptics
Source:
Chain.scala
final def pFailure[E, A, F]: PPrism[Validated[E, A], Validated[F, A], E, F]

Attributes

Inherited from:
ValidatedOptics
Source:
Validated.scala
def pListToVector[A, B]: PIso[List[A], List[B], Vector[A], Vector[B]]

Attributes

Inherited from:
ListOptics
Source:
List.scala
final def pNecToOneAnd[A, B]: PIso[Type[A], Type[B], OneAnd[Chain, A], OneAnd[Chain, B]]

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

Attributes

Inherited from:
NonEmptyVectorOptics
Source:
NonEmptyVector.scala
final def pOptNecToChain[A, B]: PIso[Option[Type[A]], Option[Type[B]], Chain[A], Chain[B]]

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

Attributes

Inherited from:
NonEmptyVectorOptics
Source:
NonEmptyVector.scala
final def pOptionToDisjunction[A, B]: PIso[Option[A], Option[B], Either[Unit, A], Either[Unit, B]]

Attributes

Inherited from:
OptionOptics
Source:
Option.scala
final def pSome[A, B]: PPrism[Option[A], Option[B], A, B]

Attributes

Inherited from:
OptionOptics
Source:
Option.scala
final def pStdLeft[A, B, C]: PPrism[Either[A, B], Either[C, B], A, C]

Attributes

Inherited from:
EitherOptics
Source:
Either.scala
final def pStdRight[A, B, C]: PPrism[Either[A, B], Either[A, C], B, C]

Attributes

Inherited from:
EitherOptics
Source:
Either.scala
final def pSuccess[E, A, B]: PPrism[Validated[E, A], Validated[E, B], A, B]

Attributes

Inherited from:
ValidatedOptics
Source:
Validated.scala
def pTheseLeft[A, B, C]: POptional[Ior[A, B], Ior[C, B], A, C]

Attributes

Inherited from:
TheseOptics
Source:
These.scala
def pTheseRight[A, B, C]: POptional[Ior[A, B], Ior[A, C], B, C]

Attributes

Inherited from:
TheseOptics
Source:
These.scala
final def pTrySuccess[A, B]: PPrism[Try[A], Try[B], A, B]

Attributes

Inherited from:
TryOptics
Source:
Try.scala
final def pValidatedToDisjunction[E1, E2, A1, A2]: PIso[Validated[E1, A1], Validated[E2, A2], Either[E1, A1], Either[E2, A2]]

Attributes

Inherited from:
ValidatedOptics
Source:
Validated.scala

Attributes

Inherited from:
NonEmptyVectorOptics
Source:
NonEmptyVector.scala
final def some[A]: Prism[Option[A], A]

Attributes

Inherited from:
OptionOptics
Source:
Option.scala
final def stdLeft[A, B]: Prism[Either[A, B], A]

Attributes

Inherited from:
EitherOptics
Source:
Either.scala
final def stdRight[A, B]: Prism[Either[A, B], B]

Attributes

Inherited from:
EitherOptics
Source:
Either.scala
final def success[E, A]: Prism[Validated[E, A], A]

Attributes

Inherited from:
ValidatedOptics
Source:
Validated.scala
def theseLeft[A, B]: Optional[Ior[A, B], A]

Attributes

Inherited from:
TheseOptics
Source:
These.scala
def theseRight[A, B]: Optional[Ior[A, B], B]

Attributes

Inherited from:
TheseOptics
Source:
These.scala
def theseToDisjunction[A, B]: Prism[Ior[A, B], Either[A, B]]

Attributes

Inherited from:
TheseOptics
Source:
These.scala
final def tryFailure[A]: Prism[Try[A], Throwable]

Attributes

Inherited from:
TryOptics
Source:
Try.scala
final def trySuccess[A]: Prism[Try[A], A]

Attributes

Inherited from:
TryOptics
Source:
Try.scala
def tuple1Iso[A]: Iso[(A), A]

Attributes

Inherited from:
Tuple1Optics
Source:
Tuple1.scala
final def validationToDisjunction[E, A]: Iso[Validated[E, A], Either[E, A]]

Attributes

Inherited from:
ValidatedOptics
Source:
Validated.scala
final def vectorToNev[A]: Prism[Vector[A], NonEmptyVector[A]]

Attributes

Inherited from:
NonEmptyVectorOptics
Source:
NonEmptyVector.scala
final def withDefault[A](defaultValue: A): Iso[Option[A], A]

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:
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:
IntOptics
Source:
Int.scala

Attributes

Inherited from:
IntOptics
Source:
Int.scala

Attributes

Inherited from:
IntOptics
Source:
Int.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