!͍      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Safe/27refined.This is defined internally to avoid using the  package, which brings in a lot of very heavy and unnecessary transitive dependencies. We export the type and constructors here, in case a user should need it.refinedCase analysis for the  type.refined.Takes two default values and produces a tuple.refined%Coalesce with the provided operation.refined7BiMap and coalesce results with the provided operation. refinedA  Traversal of the first half of a , suitable for use with  Control.Lens. refinedA  Traversal of the second half of a , suitable for use with  Control.Lens. refined   =   (_ ->  ) (_ _ -> ) refined   =  (_ -> )  (_ _ -> ) refined   =  (_ -> ) (_ ->  ) (a b ->  (a, b))refined  =  .  refined  =  .  refined  =  .  refined map.refined  = over  refined  = over  refined Select all  constructors from a list.refined Select all  constructors from a list.refined Select all  constructors from a list.refined?Select each constructor and partition them into separate lists.  None.67=>?@AEHIMUVX_kK(refined( a is equivalent to )  a for any type a.)refinedA monad transformer that adds *s to other monads.The  and E functions yield computations that produce the given value, while >>=8 sequences two subcomputations, exiting on the first *.*refined)An exception encoding the way in which a b failed.+refinedA * for failures involving the ^ predicate.,refinedA * for failures involving the \ predicate.-refinedA * for failures involving the Y predicate..refinedA *- for failures involving all other predicates.refinedThe  of the ^ p type.refinedA " encoding which branch(es) of the \ failed: if the * came from the l! predicate, then this will be , if it came from the r predicate, this will be , and if it came from both l and r, this will be .refinedThe * for the l failure.refinedThe * for the l failure.refinedA custom message to display./refinedZA typeclass containing "safe" conversions between refined predicates where the target is weakerp than the source: that is, all values that satisfy the first predicate will be guarunteed to satisy the second.hTake care: writing an instance declaration for your custom predicates is the same as an assertion that 0 is safe to use:  instance / Pred1 Pred2 dFor most of the instances, explicit type annotations for the result value's type might be required.1refinedA b ensuring that the  is non-empty.2refinedA b. ensuring that the value is not equal to zero.3refined.An inclusive range of values from zero to one.4refinedA b: ensuring that the value is greater than or equal to zero.5refinedA b+ ensuring that the value is less than zero.6refinedA b7 ensuring that the value is less than or equal to zero.7refinedA b. ensuring that the value is greater than zero.8refinedA b! ensuring that the value is even.isRight (refine @Even @Int 32)TrueisLeft (refine @Even @Int 33)True:refinedA b ensuring that the value is odd.isRight (refine @Odd @Int 33)TrueisLeft (refine @Odd @Int 32)True<refinedA b) ensuring that the value is divisible by n.)isRight (refine @(DivisibleBy 3) @Int 12)True(isLeft (refine @(DivisibleBy 2) @Int 37)True>refinedA bs 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@refinedA bL 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)TrueBrefinedA bH 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)TrueDrefinedA b6 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)TrueFrefinedA bU 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)TrueHrefinedA bX 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)TrueJrefinedA bL 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)TrueLrefinedA bI 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)TrueNrefinedA b 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])TruePrefinedA b 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])TrueRrefinedA b ensuring that the A 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])TrueTrefinedA b ensuring that the E 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])TrueVrefinedA b ensuring that the B 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])TrueXrefined"The disjunction of two predicates.Yrefined"The disjunction of two predicates.&isRight (refine @(Or Even Odd) @Int 3)True:isRight (refine @(Or (LessThan 3) (GreaterThan 3)) @Int 2)True[refined"The conjunction of two predicates.\refined"The conjunction of two predicates./isLeft (refine @(And Positive Negative) @Int 3)True-isRight (refine @(And Positive Odd) @Int 203)True^refinedThe negation of a predicate.*isRight (refine @(Not NonEmpty) @[Int] [])True,isLeft (refine @(Not NonEmpty) @[Int] [1,2])True`refinedEA predicate which is satisfied for all types. Arguments passed to c in c ` x are not evaluated.'isRight (refine @IdPred @Int undefined)True&isLeft (refine @IdPred @Int undefined)FalsebrefinedPA typeclass which defines a runtime interpretation of a type-level predicate p for type x.crefinedCheck the value x according to the predicate p=, producing an error string if the value does not satisfy.drefined/A refinement type, which wraps a value of type x7, ensuring that it satisfies a type-level predicate p.refined FIXME: docfrefined!Helper function, stolen from the flow package.grefined!Helper function, stolen from the flow package.refined FIXME: docrefined FIXME: dochrefinedA smart constructor of a d- value. Checks the input value at runtime.irefined Constructs a d value at run-time, calling  0 if the value does not satisfy the predicate.jrefined Constructs a d value at run-time, calling 0 if the value does not satisfy the predicate.krefined Constructs a d value at run-time, calling  0 if the value does not satisfy the predicate.lrefined Constructs a d 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 <interactive>: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 IntIf it's not evident, 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./It may be useful to use this function with the `th-lift-instances` package at 6https://hackage.haskell.org/package/th-lift-instances/mrefinedExtracts the refined value.nrefinedReify a b, by turning it into a value-level predicate.orefinedIThis function helps type inference. It is equivalent to the following: instance Weaken (And l r) l prefinedIThis function helps type inference. It is equivalent to the following: instance Weaken (And l r) r qrefinedIThis function helps type inference. It is equivalent to the following: instance Weaken l (Or l r) rrefinedIThis function helps type inference. It is equivalent to the following: instance Weaken r (Or l r) srefined5Strengthen a refinement by composing it with another.trefinedFStrengthen a refinement by composing it with another inside of the ) monad.urefined Display a * as a  annvrefinedThe inverse of ).wrefined7Map the unwrapped computation using the given function. v (w f m) = f (v m)xrefined Constructs a computation in the ( monad. (The inverse of y).yrefinedRun a monadic action of type ( a, yielding an  * a.This is just defined as   v.zrefined$Constructor for computations in the ) movie. (The inverse of v).{refined One can use {6 inside of a monadic context to begin processing a *.|refined&A handler function to handle previous *7s and return to normal execution. A common idiom is: # do { action1; action2; action3 } ` catchRefine' handler$where the action functions can call {G. Note that handler and the do-block must have the same return type.}refinedA handler for a *.}* is useful for defining what behaviour c1 should have in the event of a predicate failure.refined Encode a * for use with Control.Exception.refinedPretty-print a *.refined1This instance makes sure to check the refinement.}refinedThe  of the b%. This can usually be given by using .refinedA  6 encoding a custom error message to be pretty-printed.W()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}Wdehijklmbcn^_\][YZX`aLMJKHIFGDE>?BC@A:;89<=765432VWTURS1PQNO/0opqrst*+,-.u)vzw(xy{|}fgX2[3f0g9 None NoneV T()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdhijklmnopqrstuvwxyz{|}Tdhijklmbcn^_\][YZX`aLMJKHIFGDE>?BC@A:;89<=765432VWTURS1PQNO/0opqrst*+,-.u)vzw(xy{|}NoneSXqrefined Constructs a d value at run-time, calling 0 if the value does not satisfy the predicate.$WARNING: this function is not total!refined Constructs a dz 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 dU types, magicking up the claim that one predicate is entirely equivalent to another.refined Reveal that x and d p x are  for all x and p simultaneously.Example reallyUnsafePredEquiv :: Coercion (Refined p x) (Refined q x) reallyUnsafePredEquiv = reallyUnsafeAllUnderlyingRefined Coercion ddNoneXkw NoneNonedede !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXYYZ[[\\]]^_  `abcdefghijklmnopqrstuvwxyz{|}~$refined-0.4.3-CLutmULy9KYIP9csYoCFTbRefined.Internal Refined.TheseRefined.Orphan.AesonRefined.UnsafeRefined.Orphan.QuickCheck Control.MonadreturnControl.Monad.CatchthrowMControl.Monad.Error throwErrorRefinedRefined.OrphanRefined.Unsafe.Type*prettyprinter-1.3.0-6qg3eRt5h66FauUzehlm4q"Data.Text.Prettyprint.Doc.InternalprettyTheseThisThatthese fromThese mergeThesemergeTheseWithheretherejustThisjustThat justTheseisThisisThatisThesemapThesemapThismapThatcatThiscatThatcatThesepartitionThese$fBifoldableThese$fTraversableThese$fFoldableThese $fNFDataThese $fMonadThese$fApplicativeThese$fFunctorThese$fBifunctorThese$fSemigroupThese $fEqThese $fOrdThese $fReadThese $fShowThese $fDataThese$fGenericThese$fGeneric1TheseRefineMRefineTRefineExceptionRefineNotExceptionRefineAndExceptionRefineOrExceptionRefineOtherExceptionWeakenweakenNonEmptyNonZero ZeroToOne NonNegativeNegative NonPositivePositiveEvenOdd DivisibleByNegativeFromTo NotEqualToEqualToFromToToFrom GreaterThanLessThan Descending Ascending SizeEqualToSizeGreaterThan SizeLessThan||Or&&AndNotIdPred Predicatevalidate|>.>refine refineThrow refineFail refineErrorrefineTHunrefinereifyPredicateandLeftandRightleftOrrightOr strengthen strengthenMdisplayRefineException runRefineT mapRefineTrefineM runRefineM exceptRefine throwRefine catchRefinethrowRefineOtherException $fLiftRefined$fWeakenFromToTo$fWeakenFromToFrom$fWeakenFromToFromTo$fWeakenFromFrom$fWeakenGreaterThanFrom$fWeakenGreaterThanGreaterThan $fWeakenToTo$fWeakenLessThanTo$fWeakenLessThanLessThan$fExceptionRefineException$fPrettyRefineException$fShowRefineException$fPredicateEvenx$fPredicateOddx$fPredicateDivisibleByx$fPredicateNegativeFromTox$fPredicateNotEqualTox$fPredicateEqualTox$fPredicateFromTox$fPredicateTox$fPredicateFromx$fPredicateGreaterThanx$fPredicateLessThanx$fPredicateDescendingt$fPredicateAscendingt$fPredicateSizeEqualTot$fPredicateSizeGreaterThant$fPredicateSizeLessThant$fPredicateOrx$fPredicateAndx$fPredicateNotx$fPredicateIdPredx $fReadRefined $fEqRefined$fFoldableRefined $fOrdRefined $fShowRefined$fGenericIdPred $fGenericNot $fGeneric1Not $fGenericAnd $fGeneric1And $fGenericOr $fGeneric1Or$fGenericSizeLessThan$fGenericSizeGreaterThan$fGenericSizeEqualTo$fGenericAscending$fGenericDescending$fGenericLessThan$fGenericGreaterThan $fGenericFrom $fGenericTo$fGenericFromTo$fGenericEqualTo$fGenericNotEqualTo$fGenericNegativeFromTo$fGenericDivisibleBy $fGenericOdd $fGenericEven$fGenericRefineException$fFunctorRefineT$fApplicativeRefineT$fMonadRefineT$fMonadFixRefineT$fMonadErrorRefineT$fMonadTransRefineT$fGenericRefineT$fGeneric1RefineT$fToJSONRefined$fFromJSONRefined unsafeRefinereallyUnsafeRefinereallyUnsafeUnderlyingRefinedreallyUnsafePredEquiv reallyUnsafeAllUnderlyingRefined$fArbitraryRefinedbase GHC.MaybeJustNothing Data.MaybeisJustData.Bifunctor BifunctorData.Functor.IdentityIdentityGHC.Basepure_RefineException_typeRep Data.TypeableTypeRep_RefineException_andChild_RefineException_orLChild_RefineException_orRChild_RefineException_message Data.FoldableFoldableOrderedincdecControl.Monad.FailfailDoc Data.EitherEither runIdentity.typeOf Data.VoidVoidGHC.Errerrorghc-prim GHC.Types Coercible