Îõ³h$BU>|­      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬None7<ÊÎÑrefined/A refinement type, which wraps a value of type x.refinedrefinedrefinedrefinedrefinedrefinedrefinedNone /8>?ÀÁÂÇÉÊÖרÙàì9ú refined)An exception encoding the way in which a I failed. refinedA  for failures involving the E predicate. refinedA  for failures involving the C predicate. refinedA  for failures involving the @ predicate. refinedA  for failures involving the = predicate. refinedA à for failures involving all other predicates with custom exception.refinedA - for failures involving all other predicates.refinedÜA typeclass containing "safe" conversions between refined predicates where the target is weakerõ than the source: that is, all values that satisfy the first predicate will be guaranteed to satisy the second.êTake care: writing an instance declaration for your custom predicates is the same as an assertion that  is safe to use:  instance  Pred1 Pred2 æFor most of the instances, explicit type annotations for the result value's type might be required.refinedrefinedA I% ensuring that the type is non-empty.refinedA I% ensuring that the type is non-empty.refinedA I. ensuring that the value is not equal to zero.refined.An inclusive range of values from zero to one.refinedA I: ensuring that the value is greater than or equal to zero.refinedA I+ ensuring that the value is less than zero.refinedA I7 ensuring that the value is less than or equal to zero.refinedA I. ensuring that the value is greater than zero.refinedA I! ensuring that the value is even.isRight (refine @Even @Int 32)TrueisLeft (refine @Even @Int 33)TruerefinedrefinedA I? ensuring that the value is IEEE infinity or negative infinity.(isRight (refine @Infinite @Double (1/0))True)isRight (refine @Infinite @Double (-1/0))True'isLeft (refine @Infinite @Double 13.20)TruerefinedrefinedA I6 ensuring that the value is IEEE "not-a-number" (NaN).#isRight (refine @NaN @Double (0/0))True!isLeft (refine @NaN @Double 13.9)TruerefinedrefinedA I ensuring that the value is odd.isRight (refine @Odd @Int 33)TrueisLeft (refine @Odd @Int 32)True refined!refinedA I) ensuring that the value is divisible by n.)isRight (refine @(DivisibleBy 3) @Int 12)True(isLeft (refine @(DivisibleBy 2) @Int 37)True"refined#refinedA Ió ensuring that the value is greater or equal than a negative number specified as a type-level (positive) number n1 and less than a type-level (positive) number m.1isRight (refine @(NegativeFromTo 5 12) @Int (-3))True/isLeft (refine @(NegativeFromTo 4 3) @Int (-5))True$refined%refinedA IÌ ensuring that the value is not equal to the specified type-level number n.'isRight (refine @(NotEqualTo 6) @Int 5)True&isLeft (refine @(NotEqualTo 5) @Int 5)True&refined'refinedA IÈ ensuring that the value is equal to the specified type-level number n.$isRight (refine @(EqualTo 5) @Int 5)True#isLeft (refine @(EqualTo 6) @Int 5)True(refined)refinedA I6 ensuring that the value is within an inclusive range.'isRight (refine @(FromTo 0 16) @Int 13)True(isRight (refine @(FromTo 13 15) @Int 13)True(isRight (refine @(FromTo 13 15) @Int 15)True'isLeft (refine @(FromTo 13 15) @Int 12)True*refined+refinedA IÕ ensuring that the value is less than or equal to the specified type-level number.!isRight (refine @(To 23) @Int 17)True isLeft (refine @(To 17) @Int 23)True,refined-refinedA IØ ensuring that the value is greater than or equal to the specified type-level number."isRight (refine @(From 9) @Int 10)True#isRight (refine @(From 10) @Int 10)True"isLeft (refine @(From 11) @Int 10)True.refined/refinedA IÌ ensuring that the value is greater than the specified type-level number.*isRight (refine @(GreaterThan 65) @Int 67)True)isLeft (refine @(GreaterThan 65) @Int 65)True0refined1refinedA IÉ ensuring that the value is less than the specified type-level number.'isRight (refine @(LessThan 12) @Int 11)True&isLeft (refine @(LessThan 12) @Int 12)True2refined3refinedA I ensuring that the ­3 contains elements in a strictly descending order.6isRight (refine @Descending @[Int] [34, 21, 13, 8, 5])True5isLeft (refine @Descending @[Int] [5, 8, 13, 21, 34])True4refined5refinedA I ensuring that the ­2 contains elements in a strictly ascending order.5isRight (refine @Ascending @[Int] [5, 8, 13, 21, 34])True4isLeft (refine @Ascending @[Int] [34, 21, 13, 8, 5])True6refined7refinedA IÙ ensuring that the value has a length which is equal to the specified type-level number.2isRight (refine @(SizeEqualTo 4) @[Int] [1,2,3,4])True2isLeft (refine @(SizeEqualTo 35) @[Int] [1,2,3,4])True.isRight (refine @(SizeEqualTo 4) @Text "four")True.isLeft (refine @(SizeEqualTo 35) @Text "four")True8refined9refinedA IÝ ensuring that the value has a length which is greater than the specified type-level number.4isLeft (refine @(SizeGreaterThan 3) @[Int] [1,2,3])True8isRight (refine @(SizeGreaterThan 3) @[Int] [1,2,3,4,5])True/isLeft (refine @(SizeGreaterThan 4) @Text "Hi")True3isRight (refine @(SizeGreaterThan 4) @Text "Hello")True:refined;refinedA IÚ ensuring that the value has a length which is less than the specified type-level number.1isRight (refine @(SizeLessThan 4) @[Int] [1,2,3])True4isLeft (refine @(SizeLessThan 5) @[Int] [1,2,3,4,5])True-isRight (refine @(SizeLessThan 4) @Text "Hi")True/isLeft (refine @(SizeLessThan 4) @Text "Hello")True<refined=refined,The exclusive disjunction of two predicates.'isRight (refine @(Xor Even Odd) @Int 3)True6isLeft (refine @(Xor (LessThan 3) (EqualTo 2)) @Int 2)True'isLeft (refine @(Xor Even Even) @Int 2)True>refined?refined"The disjunction of two predicates.@refined"The disjunction of two predicates.&isRight (refine @(Or Even Odd) @Int 3)True:isRight (refine @(Or (LessThan 3) (GreaterThan 3)) @Int 2)True'isRight (refine @(Or Even Even) @Int 4)TrueArefinedBrefined"The conjunction of two predicates.Crefined"The conjunction of two predicates./isLeft (refine @(And Positive Negative) @Int 3)True-isRight (refine @(And Positive Odd) @Int 203)TrueDrefinedErefinedThe negation of a predicate.*isRight (refine @(Not NonEmpty) @[Int] [])True,isLeft (refine @(Not NonEmpty) @[Int] [1,2])TrueFrefinedGrefinedÅA predicate which is satisfied for all types. Arguments passed to J in J G x are not evaluated.'isRight (refine @IdPred @Int undefined)True&isLeft (refine @IdPred @Int undefined)FalseHrefinedIrefinedÐA typeclass which defines a runtime interpretation of a type-level predicate p for type x.JrefinedCheck the value x according to the predicate p, producing an error " if the value does not satisfy.Note: Jž is not intended to be used directly; instead, it is intended to provide the minimal means necessary for other utilities to be derived. As such, the ®Ä here should be interpreted to mean the presence or absence of a , and nothing else.KrefinedA smart constructor of a - value. Checks the input value at runtime.LrefinedLike Kš, but discards the refinement. This _can_ be useful when you only need to validate that some value at runtime satisfies some predicate. See also S.Mrefined Constructs a  value at run-time, calling 0 if the value does not satisfy the predicate.Nrefined Constructs a  value at run-time, calling 0 if the value does not satisfy the predicate.Orefined Constructs a  value at run-time, calling  0 if the value does not satisfy the predicate.Prefined Constructs a  value at compile-time using -XTemplateHaskell. For example: 2$$(refineTH 23) :: Refined Positive Int Refined 23&Here's an example of an invalid value: š$$(refineTH 0) :: Refined Positive Int :6:4: Value is not greater than 0 In the Template Haskell splice $$(refineTH 0) In the expression: $$(refineTH 0) :: Refined Positive Int In an equation for ˜@it™@: it = $$(refineTH 0) :: Refined Positive IntÅThe example above indicates a compile-time failure, which means that the checking was done at compile-time, thus introducing a zero-runtime overhead compared to a plain value construction.Note4: It may be useful to use this function with the  6https://hackage.haskell.org/package/th-lift-instances/th-lift-instances package.QrefinedLike Pñ, but immediately unrefines the value. This is useful when some value need only be refined at compile-time.RrefinedExtracts the refined value.SrefinedReify a I, by turning it into a value-level predicate.TrefinedÉThis function helps type inference. It is equivalent to the following: instance Weaken (And l r) l UrefinedÉThis function helps type inference. It is equivalent to the following: instance Weaken (And l r) r VrefinedÉThis function helps type inference. It is equivalent to the following: instance Weaken l (Or l r) WrefinedÉThis function helps type inference. It is equivalent to the following: instance Weaken r (Or l r) Xrefined5Strengthen a refinement by composing it with another.Yrefined Display a  as ¯7This function can be extremely useful for debugging s , especially deeply nested ones. Consider: Ò myRefinement = refine @(And (Not (LessThan 5)) (Xor (DivisibleBy 10) (And (EqualTo 4) (EqualTo 3) ) ) ) @Int 3 ßThis function will show the following tree structure, recursively breaking down every issue: — And (Not (LessThan 5)) (Xor (EqualTo 4) (And (EqualTo 4) (EqualTo 3))) œJ€J€J The predicate (Not (LessThan 5)) does not hold. ”J€J€J Xor (DivisibleBy 10) (And (EqualTo 4) (EqualTo 3)) œJ€J€J The predicate (DivisibleBy 10) failed with the message: Value is not divisible by 10 ”J€J€J And (EqualTo 4) (EqualTo 3) ”J€J€J The predicate (EqualTo 4) failed with the message: Value does not equal 4 Note: Equivalent to ° @ZrefinedA handler for a .Z* is useful for defining what behaviour J1 should have in the event of a predicate failure.×Typically the first argument passed to this function will be the result of applying ± to the first argument of J.[refinedA handler for a .[* is useful for defining what behaviour JÎ should have in the event of a predicate failure with a specific exception.\refinedAn implementation of J that always succeeds.Examples Ï data ContainsLetterE = ContainsLetterE instance Predicate ContainsLetterE ² where validate p t |   (== 'e') t = \ | otherwise = Just $ throwRefineException2 (typeRep p) "Text doesn't contain letter 'e'". ]refined^refined_refined`refinedarefinedbrefinedcrefineddrefinederefinedfrefined Encode a  for use with Control.Exception.Note: Equivalent to Y.grefinedNote: Equivalent to Y.hrefinedirefinedjrefinedkrefinedlrefinedmrefinednrefinedorefinedprefinedqrefinedrrefinedsrefinedtrefinedurefinedvrefinedwrefinedxrefinedyrefinedzrefined{refined|refined}refined~refinedrefined€refinedrefined‚refinedƒrefined„refined…refined†refined‡refinedˆrefined‰refinedŠrefined‹refined1This instance makes sure to check the refinement.ŒrefinedrefinedŽrefinedrefinedrefined‘refined’refined“refined”refined•refined–refined—refined˜refined™refinedšrefined›refinedœrefinedrefinedžrefinedŸrefined refined¡refined¢refined£refined¤refined¥refined¦refined§refinedZrefinedThe ³ of the I%. This can usually be given by using ±.refinedA    Void6 encoding a custom error message to be pretty-printed.[refinedThe ³ of the I%. This can usually be given by using ±.refinedA custom exception.Ö   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\ÖKLMNOPQRIJSEFCDB@A?=>GH12/0-.+,)*#$'(%& !";<9:785634TUVWX  YZ[\?2B3´0µ9 NoneÔÙò>b¨refined Constructs a  value at run-time, calling ¶0 if the value does not satisfy the predicate.$WARNING: this function is not total!©refined Constructs a ú value, completely ignoring any refinements! Use this only when you can manually prove that the refinement holds.ªrefinedÂA coercion between a type and any refinement of that type. See Data.Type.Coercion) for functions manipulating coercions.«refinedA coercion between two × types, magicking up the claim that one predicate is entirely equivalent to another.¬refined Reveal that x and  p x are · for all x and p simultaneously.Example €reallyUnsafePredEquiv :: Coercion (Refined p x) (Refined q x) reallyUnsafePredEquiv = reallyUnsafeAllUnderlyingRefined Coercion ¨©ª«¬©¨ª¬«¸ !"#$%%&&''(())**++,,--..//0011223344556677899:;;<<==>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¢¥¦¢§¨¢©ª¢«¬­®¯¢«°±²¢³´µ¶·¸$refined-0.6.2-HmSVphG0m88Ar5UsTlUH8VRefined.Unsafe.TypeRefinedRefined.UnsafeControl.Monad.CatchthrowMControl.Monad.FailfailControl.Monad.Error throwError Data.TextanyPPDoc$fLiftLiftedRepRefined $fEqRefined $fOrdRefined$fNFDataRefined $fShowRefined$fFoldableRefinedRefineExceptionRefineNotExceptionRefineAndExceptionRefineOrExceptionRefineXorExceptionRefineSomeExceptionRefineOtherExceptionWeakenweakenNonEmptyEmptyNonZero ZeroToOne NonNegativeNegative NonPositivePositiveEvenInfiniteNaNOdd DivisibleByNegativeFromTo NotEqualToEqualToFromToToFrom GreaterThanLessThan Descending Ascending SizeEqualToSizeGreaterThan SizeLessThanXor||Or&&AndNotIdPred Predicatevalidaterefinerefine_ refineThrow refineFail refineErrorrefineTH refineTH_unrefinereifyPredicateandLeftandRightleftOrrightOr strengthendisplayRefineExceptionthrowRefineOtherExceptionthrowRefineSomeExceptionsuccess$fWeakenFromToTo$fWeakenFromToFrom$fWeakenFromToFromTo$fWeakenFromFrom$fWeakenGreaterThanFrom$fWeakenGreaterThanGreaterThan $fWeakenToTo$fWeakenLessThanTo$fWeakenLessThanLessThan$fExceptionRefineException$fShowRefineException$fPredicateEvenx$fPredicateInfinitex$fPredicateNaNx$fPredicateOddx$fPredicateDivisibleByx$fPredicateNegativeFromTox$fPredicateNotEqualTox$fPredicateEqualTox$fPredicateFromTox$fPredicateTox$fPredicateFromx$fPredicateGreaterThanx$fPredicateLessThanx$fPredicateDescendingt$fPredicateAscendingt $fPredicateSizeEqualToByteString!$fPredicateSizeEqualToByteString0$fPredicateSizeEqualToText$fPredicateSizeEqualTot$$fPredicateSizeGreaterThanByteString%$fPredicateSizeGreaterThanByteString0$fPredicateSizeGreaterThanText$fPredicateSizeGreaterThant!$fPredicateSizeLessThanByteString"$fPredicateSizeLessThanByteString0$fPredicateSizeLessThanText$fPredicateSizeLessThant$fPredicateXorx$fPredicateOrx$fPredicateAndx$fPredicateNotx$fPredicateIdPredx$fArbitraryRefined$fToJSONRefined$fFromJSONRefined $fReadRefined$fGenericRefineException $fGenericEven$fGenericInfinite $fGenericNaN $fGenericOdd$fGenericDivisibleBy$fGenericNegativeFromTo$fGenericNotEqualTo$fGenericEqualTo$fGenericFromTo $fGenericTo $fGenericFrom$fGenericGreaterThan$fGenericLessThan$fGenericDescending$fGenericAscending$fGenericSizeEqualTo$fGenericSizeGreaterThan$fGenericSizeLessThan $fGenericXor$fGeneric1TYPEXor $fGenericOr$fGeneric1TYPEOr $fGenericAnd$fGeneric1TYPEAnd $fGenericNot$fGeneric1TYPENot$fGenericIdPred unsafeRefinereallyUnsafeRefinereallyUnsafeUnderlyingRefinedreallyUnsafePredEquiv reallyUnsafeAllUnderlyingRefinedbase Data.FoldableFoldable GHC.MaybeMaybeGHC.BaseStringGHC.Showshow Data.TypeabletypeRep text-1.2.3.2Data.Text.InternalTextTypeRep|>.>GHC.Errerrorghc-prim GHC.Types Coercible