optics-core-0.4: Optics as an abstract interface: core definitions
Safe HaskellNone
LanguageHaskell2010

Optics.Coerce

Description

This module defines operations to coerce the type parameters of optics to a representationally equal type. For example, if we have

newtype MkInt = MkInt Int

and

l :: Lens' S Int

then

coerceA @Int @MkInt l :: Lens' S MkInt
Synopsis

Documentation

coerceS :: Coercible s s' => Optic k is s t a b -> Optic k is s' t a b Source #

Lift coerce to the s parameter of an optic.

coerceT :: Coercible t t' => Optic k is s t a b -> Optic k is s t' a b Source #

Lift coerce to the t parameter of an optic.

coerceA :: Coercible a a' => Optic k is s t a b -> Optic k is s t a' b Source #

Lift coerce to the a parameter of an optic.

coerceB :: Coercible b b' => Optic k is s t a b -> Optic k is s t a b' Source #

Lift coerce to the b parameter of an optic.