Îõ³h$C­?¼±      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°None .7<ÉÊÎø refined/A refinement type, which wraps a value of type x.refinedrefinedrefinedrefinedrefinedrefinedrefinedrefinedNone ./8>?ÀÁÂÇÉÊÖרÙàì;4¢ refined)An exception encoding the way in which a J failed. refinedA   for failures involving the F predicate. refinedA   for failures involving the D predicate. refinedA   for failures involving the A 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 satisfy 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 J% ensuring that the type is non-empty.refinedA J! ensuring that the type is empty.refinedA J. ensuring that the value is not equal to zero.refined.An inclusive range of values from zero to one.refinedA J: ensuring that the value is greater than or equal to zero.refinedA J+ ensuring that the value is less than zero.refinedA J7 ensuring that the value is less than or equal to zero.refinedA J. ensuring that the value is greater than zero.refinedA J! ensuring that the value is even.isRight (refine @Even @Int 32)TrueisLeft (refine @Even @Int 33)TruerefinedrefinedA J? 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 J6 ensuring that the value is IEEE "not-a-number" (NaN).#isRight (refine @NaN @Double (0/0))True!isLeft (refine @NaN @Double 13.9)Truerefined refinedA J ensuring that the value is odd.isRight (refine @Odd @Int 33)TrueisLeft (refine @Odd @Int 32)True!refined"refinedA J) ensuring that the value is divisible by n.)isRight (refine @(DivisibleBy 3) @Int 12)True(isLeft (refine @(DivisibleBy 2) @Int 37)True#refined$refinedA Jó 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 JÌ 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 JÈ 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 J6 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 JÕ 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 JØ 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/refined0refinedA JÌ 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)True1refined2refinedA JÉ 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)True3refined4refinedA J 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])True5refined6refinedA J 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])True7refined8refinedA JÙ 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")True9refined:refinedA JÝ 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 JÚ 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.Arefined"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)TrueBrefinedCrefined"The conjunction of two predicates.Drefined"The conjunction of two predicates./isLeft (refine @(And Positive Negative) @Int 3)True-isRight (refine @(And Positive Odd) @Int 203)TrueErefinedFrefinedThe negation of a predicate.*isRight (refine @(Not NonEmpty) @[Int] [])True,isLeft (refine @(Not NonEmpty) @[Int] [1,2])TrueGrefinedHrefinedÅA predicate which is satisfied for all types. Arguments passed to K in K H x are not evaluated.'isRight (refine @IdPred @Int undefined)True&isLeft (refine @IdPred @Int undefined)FalseIrefinedJrefinedÐA typeclass which defines a runtime interpretation of a type-level predicate p for type x.KrefinedCheck the value x according to the predicate p, producing an error  " if the value does not satisfy.Note: Kž 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.LrefinedA smart constructor of a - value. Checks the input value at runtime.MrefinedLike Lš, but discards the refinement. This _can_ be useful when you only need to validate that some value at runtime satisfies some predicate. See also U.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 run-time, calling  0 if the value does not satisfy the predicate.QrefinedLike LÂ, but, when the value doesn't satisfy the predicate, returns a ; value with the predicate negated, instead of returning  .$isRight (refineEither @Even @Int 42)True#isLeft (refineEither @Even @Int 43)TrueRrefined 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.SrefinedLike Rñ, but immediately unrefines the value. This is useful when some value need only be refined at compile-time.TrefinedExtracts the refined value.UrefinedReify a J, by turning it into a value-level predicate.VrefinedÉThis function helps type inference. It is equivalent to the following: instance Weaken (And l r) l WrefinedÉThis function helps type inference. It is equivalent to the following: instance Weaken (And l r) r XrefinedÉThis function helps type inference. It is equivalent to the following: instance Weaken l (Or l r) YrefinedÉThis function helps type inference. It is equivalent to the following: instance Weaken r (Or l r) Zrefined5Strengthen a refinement by composing it with another.[refined 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 ´ @ \refinedA handler for a  .\* is useful for defining what behaviour K1 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 K.]refinedA handler for a  .]* is useful for defining what behaviour KÎ should have in the event of a predicate failure with a specific exception.^refinedAn implementation of K 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`refinedarefinedbrefinedcrefineddrefinederefinedfrefinedgrefinedhrefined Encode a   for use with Control.Exception.Note: Equivalent to [.irefinedNote: Equivalent to [.jrefinedkrefinedlrefinedmrefinednrefinedorefinedprefinedqrefinedrrefinedsrefinedtrefinedurefinedvrefinedwrefinedxrefinedyrefinedzrefined{refined|refined}refined~refinedrefined€refinedrefined‚refinedƒrefined„refined…refined†refined‡refinedˆrefined‰refinedŠrefined‹refinedŒrefinedŽrefinedrefined1This instance makes sure to check the refinement.refined‘refined’refined“refined”refined•refined–refined—refined˜refined™refinedšrefined›refinedœrefinedrefinedžrefinedŸrefined refined¡refined¢refined£refined¤refined¥refined¦refined§refined¨refined©refinedªrefined«refined\refinedThe · of the J%. This can usually be given by using µ.refinedA    Void6 encoding a custom error message to be pretty-printed.]refinedThe · of the J%. This can usually be given by using µ.refinedA custom exception.×  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^×LMNOPQRSTJKUFGDECAB@>?HI2301./,-*+$%()&' !"#<=:;896745VWXYZ [\]^@2C3¸0¹9 None.?ÉÔÙò?¢¬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 ¬­®¯°­¬®°¯¼ !"#$%&&''(())**++,,--..//0011223344556677889::;<<==>>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨¦©ª¦«¬¦­®¦¯°±²³¦¯´µ¶¦·¸¹º»¼"refined-0.7-84vVWhLSW3C8CZz4QPYI6kRefined.Unsafe.TypeRefinedRefined.UnsafeControl.Monad.CatchthrowMControl.Monad.FailfailControl.Monad.Error throwError Data.TextanyPPDoc$fLiftLiftedRepRefined $fEqRefined $fOrdRefined$fHashableRefined$fNFDataRefined $fShowRefined$fFoldableRefinedRefineExceptionRefineNotExceptionRefineAndExceptionRefineOrExceptionRefineXorExceptionRefineSomeExceptionRefineOtherExceptionWeakenweakenNonEmptyEmptyNonZero ZeroToOne NonNegativeNegative NonPositivePositiveEvenInfiniteNaNOdd DivisibleByNegativeFromTo NotEqualToEqualToFromToToFrom GreaterThanLessThan Descending Ascending SizeEqualToSizeGreaterThan SizeLessThanXor||Or&&AndNotIdPred Predicatevalidaterefinerefine_ refineThrow refineFail refineError refineEitherrefineTH refineTH_unrefinereifyPredicateandLeftandRightleftOrrightOr strengthendisplayRefineExceptionthrowRefineOtherExceptionthrowRefineSomeExceptionsuccess$fWeakenTYPETYPEFromToTo$fWeakenTYPETYPEFromToFrom$fWeakenTYPETYPEFromToFromTo$fWeakenTYPETYPEFromFrom$fWeakenTYPETYPEGreaterThanFrom&$fWeakenTYPETYPEGreaterThanGreaterThan$fWeakenTYPETYPEToTo$fWeakenTYPETYPELessThanTo $fWeakenTYPETYPELessThanLessThan$fExceptionRefineException$fShowRefineException$fPredicateTYPEEvenx$fPredicateTYPEInfinitex$fPredicateTYPENaNx$fPredicateTYPEOddx$fPredicateTYPEDivisibleByx$fPredicateTYPENegativeFromTox$fPredicateTYPENotEqualTox$fPredicateTYPEEqualTox$fPredicateTYPEFromTox$fPredicateTYPETox$fPredicateTYPEFromx$fPredicateTYPEGreaterThanx$fPredicateTYPELessThanx$fPredicateTYPEDescendingt$fPredicateTYPEAscendingt$$fPredicateTYPESizeEqualToByteString%$fPredicateTYPESizeEqualToByteString0$fPredicateTYPESizeEqualToText$fPredicateTYPESizeEqualTot($fPredicateTYPESizeGreaterThanByteString)$fPredicateTYPESizeGreaterThanByteString0"$fPredicateTYPESizeGreaterThanText$fPredicateTYPESizeGreaterThant%$fPredicateTYPESizeLessThanByteString&$fPredicateTYPESizeLessThanByteString0$fPredicateTYPESizeLessThanText$fPredicateTYPESizeLessThant$fPredicateTYPEXorx$fPredicateTYPEOrx$fPredicateTYPEAndx$fPredicateTYPENotx$fPredicateTYPEIdPredx$fArbitraryRefined$fToJSONKeyRefined$fToJSONRefined$fFromJSONKeyRefined$fFromJSONRefined $fReadRefined$fGenericRefineException $fGenericEven$fGenericInfinite $fGenericNaN $fGenericOdd$fGenericDivisibleBy$fGenericNegativeFromTo$fGenericNotEqualTo$fGenericEqualTo$fGenericFromTo $fGenericTo $fGenericFrom$fGenericGreaterThan$fGenericLessThan$fGenericDescending$fGenericAscending$fGenericSizeEqualTo$fGenericSizeGreaterThan$fGenericSizeLessThan $fGenericXor$fGeneric1kXor $fGenericOr $fGeneric1kOr $fGenericAnd$fGeneric1kAnd $fGenericNot$fGeneric1kNot$fGenericIdPred unsafeRefinereallyUnsafeRefinereallyUnsafeUnderlyingRefinedreallyUnsafePredEquiv reallyUnsafeAllUnderlyingRefinedbase Data.FoldableFoldable GHC.MaybeMaybeGHC.BaseStringGHC.Showshow Data.TypeabletypeRep text-1.2.3.2Data.Text.InternalTextTypeRep|>.>GHC.Errerrorghc-prim GHC.Types Coercible