optics-core-0.4.1.1: 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 :: forall s s' k (is :: IxList) t a b. 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 :: forall t t' k (is :: IxList) s a b. 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 :: forall a a' k (is :: IxList) s t b. 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 :: forall b b' k (is :: IxList) s t a. 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.