Îõ³h$"î!Õ.      !"#$%&'()*+,-None-.9>ÀÁÂÉÔ×Ùìò× attenuationAttenuable a b$ is satisfiable iff there exists an  a b. Since an Ò is unique for a given pair of types (as it's internally just a wrapper around a .% instance), any way of obtaining an 1 gives exactly the same result. This means all  instances that couldë exist for a pair of types are also identical. In turn, this means that even "incoherent" instances for Ž are actually coherent after all: any arbitrary choice of an instance gives the same result. As such, it's perfectly fine for instances of  to be marked  INCOHERENTä, as long as it results in good instance resolution behavior. This is used to provide some convenient "fallback" instances filling in the (numerous) gaps in the set of specific instances: specifically, automatic demotion of . to ; and automatic lifting of  across /s and 0s.¡The word "satisfiable" in the first paragraph is chosen carefully: not all instances that are satisfiable will be solved automatically by GHC. One can obtain  instances by  or by an entailment (±), for some types that wouldn't be solved by any of the "real" instances. In particular, this is useful for compositions of attenuations and for lifting attenuations across s and  Profunctors. attenuationAttenuation a b is a unidirectional 1 from a to b.8"Attenuate: reduce the force, effect, or value of." An  Attenuationß takes a stronger, stricter type to a weaker, more lax type. It's meant to sound a bit like 1<, while conveying that it weakens the type of its argument.äThis arises from newtypes that impose additional invariants on their representations: if we define Fin :: Nat -> Type as a newtype over 2, such as in  +https://hackage.haskell.org/package/fin-intfin-int, then it's safe to   Fins to 2s, and Fin s to other Fins with larger Nat parameters, but not vice versa. Within the module defining this Fin type, we can obtain . between any two Fin¤ types regardless of their roles, because their newtype constructors are in scope, but if we've taken appropriate precautions (namely not exporting the constructor), we can't obtain it outside the module. We can relax this and make the coercion "opt-in" by exporting it in the form of a 1 with a scary name like  unsafeCoFin!, but this is still error-prone./Instead, we introduce a newtype wrapper around 1¡ which restricts it to be used only in the forward direction, and carefully design its API so that it can only be obtained under the appropriate circumstances.Attenuation a b can be seen as a witness that a8 is, semantically and representationally, a subtype of b-: that is, any runtime object that inhabits a also inhabits b without any conversion. attenuationA witness that a occurs representationally in s% and that, when substituting it for b , you get t.ÉThese compose like Lenses from the "lens" package, so you can e.g. lift s through several Functors by   .co.co $ x. attenuationA constraint that behaves like type role f representational _. See also . attenuationA constraint that behaves like type role f _ representational. See also . attenuationA constraint that behaves like type role f representational.ÉThis means that if we have this constraint in context and GHC can solve . for some types a and b$, it will also lift the coercion to f a and f b. attenuationLift a 1 over a type constructor.  attenuationLift a 17 over the last-but-one parameter of a type constructor.  attenuationLift an % covariantly over a type constructor f.Although we don't use the /Ó constraint, it serves an important purpose: to guarantee that the type parameter a$ doesn't appear contravariantly in f a*; otherwise it'd be impossible to write a /Á instance. This is used as a standin for more-detailed "covariant" and "contravariant" type roles, which GHC doesn't have because there's no built-in notion of subtyping to use them with. 0 provides the actual lifting of coercions, and /* guarantees we've got the variance right.  attenuationLift an  covariantly over the left of a 0. Like with   and  Â, we require a not-actually-used constraint as proof that the type has the appropriate variance. Since there's not a commonly-used class for functors over the last-but-one parameter, we use 0æ. Sadly, this rules out types which are covariant in parameter -1 and contravariant in parameter -0.  attenuationLift an 2 covariantly over the last-but-one type parameter. Like with   and  Â, we require a not-actually-used constraint as proof that the type has the appropriate variance. Since there's not a commonly-used class for functors over the last-but-one parameter, we use 0æ. Sadly, this rules out types which are covariant in parameter -1 and contravariant in parameter -0.%Note that any particular type with a  Bifunctor f instance should also have  Functor (f x), so   should work on any type that  - works on, but in polymorphic contexts, the / instance may not be available.  attenuationLift an 2 contravariantly over the argument of a functiwon. attenuationLift an + covariantly over the result of a function.!This is just a specialization of  . attenuationLift an ( to a constraint within a subexpression.This is just specialization of  ; consider using that or (). attenuationTransitivity of s. See also the 3 instance. attenuation1Any type is unidirectionally-coercible to itself.   None'(-./>ÀÁÂÉÔÖ×Ùìò! attenuationAn operator form of . attenuationAn operator form of , by analogy to (4).  attenuationCoerce along an .6This is really, truly a coercion when it reaches Core.! attenuationAny coercible types have an ." attenuation1Any type is unidirectionally coercible to itself.# attenuationÄBidirectional coercions can be weakened to unidirectional coercions.$ attenuationLift an ) contravariantly over a type constructor f.Regarding the 5 constraint, see  =, and interchange mentions of covariance and contravariance.% attenuation/s across type constructors can be instantiated. This means Às across type constructors lift equality of type parameters to  of the applied result.This is analogous to how  Coercible f g works.& attenuation of 6 to any type. If you have 6’ appearing covariantly in a type, you can replace it with any other lifted type with a coercion, because the value can't contain any non-bottom 6- values (there are none), and any value that isÝ bottom can "work" (i.e. throw or fail to terminate) just as well at any other lifted type.For example, if you have a  [Doc Void] (from  *https://hackage.haskell.org/package/prettypretty×), you know it doesn't have any annotations (or they're errors), so you can use it as [Doc a]+ without actually traversing the list and Doc structure to apply   to all of the 6s.' attenuation of any type to 7. Similarly to &, you can weaken any type to 75 for free, since any value is a valid value of type 7.( attenuation'Coerce from a representational subtype a to its supertype b.) attenuation5* functors map attenuation contravariantly.* attenuations are transitive.+ attenuationIf /s in both directions exist, they're actually a 1.  !"#$%&'()*+ !"#+% $ &'()*None!Í, attenuationUnsafely access the internal 1 of an .- attenuationUnsafely invert an .,-,-8 !"#$%&'()*+,-./01 23456789:;<=>?@>AB>CD;<E>FG>HI>> J;<KÌ(attenuation-0.2.0-K1xBHz7JAUSBsX4AxFFQPvData.Type.AttenuationData.Type.Attenuation.InternalData.Type.Attenuation.UnsafeData.Constraint\\:-Data.Functor.Contravariant Contravariant Data.CoercecoercecontrawithDict Data.Voidabsurd Attenuable attenuation AttenuationVarianceRepresentational0Representational1Representationalreprep0cofstcosndcodomaincodomainwithAttenuationtransrefl$fCategorykAttenuation$fAttenuableTYPE(,,)(,,)$fAttenuableTYPE(,)(,)$fAttenuableTYPE->->$fAttenuableTYPEff$fAttenuableTYPEff0$fHasDictAttenuableAttenuation$fAttenuableTYPEaa$fAttenuablekab$fEqAttenuation$fOrdAttenuation$fShowAttenuation⊆:⊆: attenuateWith coerciblereprcoerinstattVoidattAny attenuatecontravariance transitivityisounsafeToCoercion unsafeSymghc-prim GHC.Types CoerciblebaseGHC.BaseFunctorData.Bifunctor BifunctorData.Type.CoercionCoercionIntControl.CategoryCategoryData.Type.Equality:~:VoidAny