Îõ³h,+í(“      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„ … † ‡ ˆ ‰ Š ‹ Œ  Ž   ‘ ’ 0.11.0 None )1=>ÀÁËÎÛ䣓”•–—˜™šNone )1=>ÀÁËÎÛäåNone )1=>ÀÁËÎÛä  strongweakáA "via type" newtype for defining strongweak instances for zero-invariant, coercible newtypes. Use like so:  deriving via  a instance  (› a)  strongweak The type of a after weakening n times. strongweak Weaken some a, relaxing certain invariants.See  Strongweak! for class design notes and laws. strongweak The weakened type for some type. strongweak Weaken some a to its associated weak type  a. strongweakÓLift a function on a weak type to the associated strong type by weakening first.  strongweak%Decomposer. Weaken either side of an œ.  strongweak,Decomposer. Weaken both elements of a tuple.  strongweak+Decomposer. Weaken every element in a list. strongweak&Weaken sized vectors into plain lists. strongweak(Weaken non-empty lists into plain lists. strongweak&Strip refined functor type refinement. strongweakStrip refined type refinement.None )1=>ÀÁËÎÛä - strongweakUnsafely transform a  a to an a, without asserting invariants.Naturally, you must only even considerÏ using this if you have a guarantee that your value is safe to treat as strong..For example, you may unsafely strengthen some   n into a ? by unsafely coercing the value, ignoring the possibility that n >= 255.”What happens if it turns out you're lying to the computer and your weak value doesn't fit in its strong counterpart? That depends on the strengthen.)Numeric coercions should safely overflow.Some will raise an error (e.g. ž).ÀÁËÎÛäš/ strongweak+A failure encountered during strengthening.ñStrengthening can involve multiple distinct checks. In such cases, you may record multiple failures in a single /Ù by placing them in the inner failure list and noting their meaning in the detail field.1 strongweakOptional wrapped failures.The textä type acts as an index. Its meaning depends on the failure in question, and should be explained in 2.2 strongweakDetail on strengthen failure.–We use a list here for the cases where you want multiple lines of detail. Separating with a newline would make prettifying later harder, so we delay.=Note that this should probably never be empty. TODO consider NonEmpty, but fairly unimportant.3 strongweakAttempt to strengthen some  a, asserting certain invariants.We take © as a superclass in order to maintain strong/weak type pair consistency. We choose this dependency direction because we treat the strong type as the "canonical" one, so Ž is the more natural (and straightforward) class to define. That does mean the instances for this class are a little confusingly worded. Alas.See  Strongweak! for class design notes and laws.4 strongweakAttempt to strengthen some  a" to its associated strong type a.5 strongweak0Weaken a strong value, then strengthen it again.0Potentially useful if you have previously used 4 and now wish to check the invariants. For example:7restrengthen $ unsafeStrengthen @(Vector 2 Natural) [0]Left ...6 strongweak#Shorthand for failing a strengthen.7 strongweak:Shorthand for failing a strengthen with no inner failures.8 strongweak)Strengthen one numeric type into another.n must be "wider" than m.Ÿ m is for error printing.9 strongweak)Decomposer. Strengthen either side of an œ.: strongweak0Decomposer. Strengthen both elements of a tuple.; strongweak/Decomposer. Strengthen every element in a list.D strongweakÀStrengthen a plain list into a sized vector by asserting length.E strongweakÉStrengthen a plain list into a non-empty list by asserting non-emptiness.F strongweak:Strengthen a type by refining it with a functor predicate.G strongweak2Strengthen a type by refining it with a predicate. 675834/021. 3458/021.76None")1=>ÀÁËÎÛäõO strongweak/Generic strengthening at the constructor level.S strongweak3Generic strengthening at the constructor sum level.U strongweak,Generic strengthening at the datatype level.W strongweakStrengthen a value generically."The weak and strong types must be  compatible. See 6 for the definition of compatibility in this context.Y strongweak?Strengthen sum types by casing and strengthening left or right.Z strongweak"Nothing to do for empty datatypes.[ strongweakÀStrengthen a generic data type, replacing its metadata wrapping.] strongweakÆSpecial case: data type and constructor names are equivalent: simplify^ strongweakËSpecial case: if source and target types are equivalent, just replace meta.¹Note that we have to expand the metadata awkwardly for the overlapping instances to work correctly. (There should be a better way to write this, but it's purely style, so light TODO.)_ strongweak%Nothing to do for empty constructors.` strongweak4Enter a constructor, stripping its metadata wrapper.e strongweak=Special case: both types had a record name, and they're equalf strongweak&Strengthen a field using the existing 3 instance.g strongweak9Strengthen product types by strengthening left and right. XWSTUVOPLQRMN WUVSTQROPMNXLNone )1=>ÀÁËÎÛä›j strongweakWeaken a value generically."The weak and strong types must be  compatible. See 6 for the definition of compatibility in this context.k strongweak7Weaken sum types by casing and weakening left or right.l strongweak1Weaken product types by weakening left and right.m strongweak"Weaken a field using the existing  instance.n strongweakËSpecial case: if source and target types are equal, copy the value through.o strongweak%Nothing to do for empty constructors.p strongweak"Nothing to do for empty datatypes.q strongweakStrip all meta.jhijhiNone)1=>ÀÁËÎÛäÐv strongweakInverted inductive case.n must not be 0.w strongweak Inductive case.n must not be 0.x strongweakInductive case. n /= 0, else this explodes.y strongweak"Zero case: return the value as-is.wvrstutuvrswNone )1=>ÀÁËÎÛä!Ö| strongweak7When weakening (or strengthening), chain the operation n times.?You may achieve this without extra newtypes by nesting uses of Ø. However, strongweak generics can't handle this, forcing you to write manual instances.|Ç provides this nesting behaviour in a type. In return for adding a boring newtype layer to the strong representation, you can chain weakening and strengthenings without having to write them manually.The type works as follows: •Weakened (WeakenN 0 a) = a Weakened (WeakenN 1 a) = Weakened a Weakened (WeakenN 2 a) = Weakened (Weakened a) Weakened (WeakenN n a) = WeakenedN n a ,And so on. (This type is only much use from n = 2 onwards.)|}~|}~ None )1=>ÀÁËÎÛä$^„ strongweakShortcut for a … -wrapped |.… strongweakëGet either the strong or weak representation of a type, depending on the type-level "switch" provided.6This is intended to be used in data types that take a †7 type. Define your type using strong fields wrapped in SW sË. You then get the weak representation for free, using the same definition. Ãdata A (s :: Strength) = A { a1 :: SW s Word8 , a2 :: String } † strongweak2Strength enumeration: it's either strong, or weak.:Primarily interesting at the type level (using DataKinds).…„†‡ˆ†ˆ‡…„ None )1=>ÀÁËÎÛä(‰ strongweakŒ where the type takes a † in its last type var./Shorter instances for types of a certain shape.7Regrettably, use of this requires UndecidableInstances.Œ strongweak DerivingVia" wrapper for strongweak instances. We can't use  ê conveniently because we need to talk about two data types, not one -- we would have to do something like   (Tagged w s)Î, which is ugly. So we instead define our own adorable little "via type" here! Use like so:  data XYZ (s :: Strength) = XYZ { xyz1 :: SW s Word8 , xyz2 :: Word8 , xyz3 :: () } deriving stock Generic deriving via (GenericallySW (XYZ 'Strong) (XYZ 'Weak)) instance Weaken (XYZ 'Strong) deriving via (GenericallySW (XYZ 'Strong) (XYZ 'Weak)) instance Strengthen (XYZ 'Strong) 7Regrettably, use of this requires UndecidableInstances.WjŒŽ‰Š‹jWŒŽ‰Š‹None )1=>ÀÁËÎÛä(P…„†‡ˆ34|}~34|}~†ˆ‡…„¡ !"#$%&'()*+,-./0123456789:;<=>?@@@A@BCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŒŒŽ‘’ “  ” • – — — —˜ ™ ™ ™š › œ  ž Ÿ   ¡ ¢ £ ¤ ¥ ¦§¨©§ª«§¬­§®¯§°±§²³´strongweak-0.11.0-inplaceStrongweak.Util.TypeNatsStrongweak.WeakenStrongweak.Strengthen.UnsafeStrongweak.StrengthenStrongweak.Strengthen.GenericStrongweak.Weaken.GenericStrongweak.WeakenN.InternalStrongweak.WeakenNStrongweak.StrengthStrongweak.Generic strongweakPaths_strongweakNumeric.NaturalNaturalunsafeStrengthen StrongweakGenericSWnatVal'' SWCoercibly unSWCoercibly WeakenedNWeakenWeakenedweaken liftWeakF$fWeakenEither$fWeakenTuple2 $fWeakenList $fWeakenInt64 $fWeakenInt32 $fWeakenInt16 $fWeakenInt8$fWeakenWord64$fWeakenWord32$fWeakenWord16 $fWeakenWord8$fWeakenVector$fWeakenNonEmpty$fWeakenRefined1$fWeakenRefined$fWeakenSWCoercibly $fWeakenConst$fWeakenIdentityUnsafeStrengthen$fUnsafeStrengthenEither$fUnsafeStrengthenTuple2$fUnsafeStrengthenList$fUnsafeStrengthenInt64$fUnsafeStrengthenInt32$fUnsafeStrengthenInt16$fUnsafeStrengthenInt8$fUnsafeStrengthenWord64$fUnsafeStrengthenWord32$fUnsafeStrengthenWord16$fUnsafeStrengthenWord8$fUnsafeStrengthenVector$fUnsafeStrengthenNonEmpty$fUnsafeStrengthenRefined$fUnsafeStrengthenSWCoercibly$fUnsafeStrengthenConst$fUnsafeStrengthenIdentityStrengthenFailure'StrengthenFailurestrengthenFailInnerstrengthenFailDetail Strengthen strengthen restrengthenfailStrengthenfailStrengthen1strengthenBounded$fStrengthenEither$fStrengthenTuple2$fStrengthenList$fStrengthenInt64$fStrengthenInt32$fStrengthenInt16$fStrengthenInt8$fStrengthenWord64$fStrengthenWord32$fStrengthenWord16$fStrengthenWord8$fStrengthenVector$fStrengthenNonEmpty$fStrengthenRefined1$fStrengthenRefined$fStrengthenSWCoercibly$fShowStrengthenFailure$fStrengthenConst$fStrengthenIdentity ProdArity ReifySelector reifySelector GStrengthenS gstrengthenS ReifyCstrs reifyCstrs GStrengthenC gstrengthenC GStrengthenD gstrengthenDstrengthenGeneric.>$fGStrengthenCkwdnsdn:+::+:$fGStrengthenCkwdnsdnV1V1$fGStrengthenDkM1M1$fReifyCstrsldlcrdrc$fReifyCstrsdcdc$fGStrengthenSkiM1M1$fGStrengthenSkiU1U1$fGStrengthenCkwcdscdM1M1$fReifySelectoriNothingJust$fReifySelectoriJustNothing$fReifySelectoriNothingNothing$fReifySelectoriJustJust$fReifySelectoriJustJust0$fGStrengthenSkiM1M10$fGStrengthenSki:*::*:GWeakengweaken weakenGeneric$fGWeakenk:+::+:$fGWeakenk:*::*:$fGWeakenkK1K1$fGWeakenkK1K10$fGWeakenkU1U1$fGWeakenkV1V1$fGWeakenkM1M1StrengthenWeakenNstrengthenWeakenN WeakenWeakenN weakenWeakenN weakenedNRL1 weakenedNLR1$fWeakenWeakenNna$fWeakenWeakenN0a$fStrengthenWeakenNna$fStrengthenWeakenN0aWeakenN unWeakenN$fStrengthenWeakenN$fWeakenWeakenN $fShowWeakenN $fOrdWeakenN $fEqWeakenNSWNStrengthStrongWeakGenericallySW0unGenericallySW0 GenericallySWunGenericallySW$fStrengthenGenericallySW$fWeakenGenericallySW$fStrengthenGenericallySW0$fWeakenGenericallySW0 getBinDir getDataDirgetDataFileName getDynLibDir getLibDir getLibexecDir getSysconfDirversionbaseData.Functor.IdentityIdentity Data.EitherEitherGHC.WordWord8GHC.BaseNonEmptyGHC.Bits FiniteBits GHC.Generics Generically