optics-core-0.2: Optics as an abstract interface: core definitions

Safe HaskellNone
LanguageHaskell2010

Optics.Review

Contents

Description

A Review is a backwards Getter, i.e. a Review T B is just a function B -> T.

Synopsis

Formation

type Review t b = Optic' A_Review NoIx t b Source #

Type synonym for a review.

Introduction

unto :: (b -> t) -> Review t b Source #

An analogue of to for reviews.

Elimination

review :: Is k A_Review => Optic' k is t b -> b -> t Source #

Retrieve the value targeted by a Review.

>>> review _Left "hi"
Left "hi"

Computation

review (unto f) = f

Subtyping

data A_Review :: OpticKind Source #

Tag for a review.

Instances
ReversibleOptic A_Review Source # 
Instance details

Defined in Optics.Re

Associated Types

type ReversedOptic A_Review = (r :: Type) Source #

Methods

re :: AcceptsEmptyIndices "re" is => Optic A_Review is s t a b -> Optic (ReversedOptic A_Review) is b a t s Source #

Is A_ReversedLens A_Review Source # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Is A_Prism A_Review Source # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: proxy A_Prism A_Review p -> (Constraints A_Prism p -> r) -> Constraints A_Review p -> r Source #

Is An_Iso A_Review Source # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: proxy An_Iso A_Review p -> (Constraints An_Iso p -> r) -> Constraints A_Review p -> r Source #

type ReversedOptic A_Review Source # 
Instance details

Defined in Optics.Re