h*(%      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrst 0.6.1  Safe-Inferred )1=> uvwxyz{| Safe-Inferred )1=>a Safe-Inferred )1=> Safe-Inferred )1=>z strongweakTrack multiple levels of weakening. Silly thought I had, don't think it's useful. strongweakGet 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 }  strongweak,Strength enumeration: is it strong, or weak?:Primarily interesting at the type level (using DataKinds). 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.  strongweakLift 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. strongweakStrip wrapper. strongweakStrip wrapper. 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.     Safe-Inferred )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./ strongweakA failure containing lots of detail. Use in concrete instances where you already have the s and  s needed.0 strongweakA failure. Use in abstract instances to avoid heavy contexts. (Remember that generic strengtheners should wrap these nicely anyway!)1 strongweakSome failures occurred when strengthening from one data type to another.Field indices are from 0 in the respective constructor. Field names are provided if are present in the type.?This is primarily intended to be used by generic strengtheners.2 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.3 strongweakAttempt to strengthen some  a" to its associated strong type a.6 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] Failure ... strongweakThis reports the weak and strong type, so no need to include those in the failure detail.; strongweak Succeed on , fail with given detail on .< strongweak)Strengthen one numeric type into another.n must be "wider" than m.? strongweak)Decomposer. Strengthen either side of an }.@ strongweak0Decomposer. Strengthen both elements of a tuple.A strongweak/Decomposer. Strengthen every element in a list.J strongweak Add wrapper.K strongweak Add wrapper.L strongweakStrengthen a plain list into a sized vector by asserting length.M strongweakStrengthen a plain list into a non-empty list by asserting non-emptiness.N strongweak,Assert a functor predicate to refine a type.O strongweak$Assert a predicate to refine a type./ strongweak weak type strongweak strong type strongweak weak value strongweakfailure description0 strongweakfailure description1  strongweakweak datatype name strongweakstrong datatype name strongweakweak constructor name strongweakstrong constructor name strongweakweak field index strongweakweak field name (if present) strongweakstrong field index strongweakstrong field name (if present) strongweakfailures2365<4./01789:;2365<4./01789:; Safe-Inferred)1=>jQ 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.Get the record name for a selector if present.On the type level, a 'Maybe Symbol' is stored for record names. But the reification is done using  fromMaybe "". So we have to inspect the resulting string to determine whether the field uses record syntax or not. (Silly.)Z strongweak? without the value (only used as a proxy). Lets us push our s into one place.[ strongweak? without the value (only used as a proxy). Lets us push our s into one place.\ strongweak? without the value (only used as a proxy). Lets us push our s into one place.^ strongweak?Strengthen sum types by casing and strengthening left or right._ strongweak"Nothing to do for empty datatypes.` strongweak1Enter a datatype, stripping its metadata wrapper.a strongweak&Strengthen a field using the existing 2 instance.b strongweakSpecial case: if source and target types are equal, copy the value through.c strongweak%Nothing to do for empty constructors.d strongweak4Enter a constructor, stripping its metadata wrapper.e strongweak9Strengthen product types by strengthening left and right.PQRSTUVWXYZ[\]WUVSTQRXYZ[\P] Safe-Inferred )1=>"h strongweakWeaken a value generically."The weak and strong types must be  compatible. See 6 for the definition of compatibility in this context.i strongweak7Weaken sum types by casing and weakening left or right.j strongweak1Weaken product types by weakening left and right.k strongweak"Weaken a field using the existing  instance.l strongweakSpecial case: if source and target types are equal, copy the value through.m strongweak%Nothing to do for empty constructors.n strongweak"Nothing to do for empty datatypes.o strongweakStrip all meta.fghhfg Safe-Inferred )1=>"X  23   23  Safe-Inferred )1=>%cp 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) TODO can't figure out a way around multiple standalone deriving declarations :(prqprq Safe-Inferred )1=>%hWpqrhWpqr !"#$%&'()*+, -./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~        strongweak-0.6.1-inplaceStrongweak.Util.TextStrongweak.Util.TypeableStrongweak.WeakenStrongweak.Strengthen.UnsafeStrongweak.StrengthenStrongweak.Generic.StrengthenStrongweak.Generic.WeakenStrongweak.Generic.Via strongweakPaths_strongweakNumeric.NaturalNaturalunsafeStrengthen StrongweakGenericStrongweak.GenerictshowtypeRep'SWDepthSWStrengthStrongWeakWeakenweaken liftWeakF$fWeakenEither $fWeaken(,) $fWeakenList $fWeakenInt64 $fWeakenInt32 $fWeakenInt16 $fWeakenInt8$fWeakenWord64$fWeakenWord32$fWeakenWord16 $fWeakenWord8 $fWeakenConst$fWeakenIdentity$fWeakenVector$fWeakenNonEmpty$fWeakenRefined1$fWeakenRefinedUnsafeStrengthen$fUnsafeStrengthenEither$fUnsafeStrengthen(,)$fUnsafeStrengthenList$fUnsafeStrengthenInt64$fUnsafeStrengthenInt32$fUnsafeStrengthenInt16$fUnsafeStrengthenInt8$fUnsafeStrengthenWord64$fUnsafeStrengthenWord32$fUnsafeStrengthenWord16$fUnsafeStrengthenWord8$fUnsafeStrengthenConst$fUnsafeStrengthenIdentity$fUnsafeStrengthenVector$fUnsafeStrengthenNonEmpty$fUnsafeStrengthenRefinedFailFailShow FailOther FailField Strengthen strengthenFailsResult restrengthen prettyFailfail1 failOtherfailShow maybeFailShowstrengthenBounded $fPrettyFail $fShowFail$fStrengthenEither$fStrengthen(,)$fStrengthenList$fStrengthenInt64$fStrengthenInt32$fStrengthenInt16$fStrengthenInt8$fStrengthenWord64$fStrengthenWord32$fStrengthenWord16$fStrengthenWord8$fStrengthenConst$fStrengthenIdentity$fStrengthenVector$fStrengthenNonEmpty$fStrengthenRefined1$fStrengthenRefined ProdArity GStrengthenS gstrengthenS GStrengthenC gstrengthenC GStrengthenD gstrengthenDstrengthenGeneric.> selName''conName' datatypeName'selName'natVal''$fGStrengthenCkkkwcdscd:+::+:$fGStrengthenCkkkwcdscdV1V1$fGStrengthenDkM1M1%$fGStrengthenSkkkkkwcdscdwccsccsiM1M1&$fGStrengthenSkkkkkwcdscdwccsccsiM1M10%$fGStrengthenSkkkkkwcdscdwccsccsiU1U1$fGStrengthenCkkkwcdscdM1M1*$fGStrengthenSkkkkTYPEwcdscdwccsccsi:*::*:GWeakengweaken weakenGeneric$fGWeakenk:+::+:$fGWeakenk:*::*:$fGWeakenkK1K1$fGWeakenkK1K10$fGWeakenkU1U1$fGWeakenkV1V1$fGWeakenkM1M1 GenericallySWunGenericallySW$fStrengthenGenericallySW$fWeakenGenericallySWversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDirgetDataFileName getSysconfDirbase Data.EitherEitherGHC.WordWord8GHC.BaseNonEmptyGHC.ShowShowData.Typeable.InternalTypeable failShowNoVal GHC.MaybeJustNothing GHC.GenericsconNameGHC.Err undefined datatypeNameselName Generically