PrismLaws
Law equations for a Prism[S, A] — Optic[S, S, A, A, Either].
Ported from Monocle's monocle.law.PrismLaws. The getOption convenience mirrors Monocle's member of the same name, recovered from EO's primitive to: S => Either[S, A].
Attributes
- Source
- PrismLaws.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Value members
Abstract methods
The optic under test.
Concrete methods
modify(g) ∘ modify(f) == modify(f andThen g).
getOption survives a no-op modify: getOption(modify(identity)(s)) == getOption(s).
getOption survives a no-op modify: getOption(modify(identity)(s)) == getOption(s).
Attributes
- Source
- PrismLaws.scala
Mirror of Monocle's Prism.getOption.
modify(identity) == identity.
Hit ⇒ reverseGet(a) == s where getOption(s) == Some(a) — rebuild restores the source.
Hit ⇒ reverseGet(a) == s where getOption(s) == Some(a) — rebuild restores the source.
Attributes
- Source
- PrismLaws.scala
getOption(reverseGet(a)) == Some(a) — a built value always matches.
getOption(reverseGet(a)) == Some(a) — a built value always matches.
Attributes
- Source
- PrismLaws.scala