h&JH      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH Safe-Inferredexplainable-predicatesComputes the best bipartite matching of the elements in the two lists, given the compatibility function.Returns matched pairs, then unmatched lhs elements, then unmatched rhs elements.+bipartiteMatching (==) [1 .. 5] [6, 5 .. 2]#([(2,2),(3,3),(4,4),(5,5)],[1],[6]) Safe-Inferred8 Iexplainable-predicates*A value together with its source location.Jexplainable-predicates?Annotates a value with its source location from the call stack.Kexplainable-predicates Formats a I L to include its source location.Mexplainable-predicatesReturns all ways to choose one element from a list, and the corresponding remaining list.Nexplainable-predicates3Checks if one sequence is a subsequence of another.Oexplainable-predicatesRemoves all module names from Template Haskell names in the given value, so that it will pretty-print more cleanly.IPJKMNO Safe-Inferred1F:explainable-predicatesA predicate, which tests values and either accepts or rejects them. This is similar to a -> Q, but also can describe itself and explain why an argument does or doesn't match. explainable-predicatesSame as , except throws a  instead of returning a Q. explainable-predicatesAn infix synonym for . eq 1 ==~ 1True eq 2 ==~ 1False explainable-predicatesA  that accepts anything at all.accept anything "foo"Trueaccept anything undefinedTrue explainable-predicatesA # that accepts only the given value.accept (eq "foo") "foo"Trueaccept (eq "foo") "bar"False explainable-predicatesA + that accepts anything but the given value.accept (neq "foo") "foo"Falseaccept (neq "foo") "bar"Trueexplainable-predicatesA 4 that accepts anything greater than the given value.accept (gt 5) 4Falseaccept (gt 5) 5Falseaccept (gt 5) 6Trueexplainable-predicatesA  that accepts anything greater than or equal to the given value.accept (geq 5) 4Falseaccept (geq 5) 5Trueaccept (geq 5) 6Trueexplainable-predicatesA 1 that accepts anything less than the given value.accept (lt 5) 4Trueaccept (lt 5) 5Falseaccept (lt 5) 6Falseexplainable-predicatesA = that accepts anything less than or equal to the given value.accept (leq 5) 4Trueaccept (leq 5) 5Trueaccept (leq 5) 6Falseexplainable-predicatesA  that accepts R values of S x, where x matches the given child ."accept (just (eq "value")) NothingFalse)accept (just (eq "value")) (Just "value")True/accept (just (eq "value")) (Just "wrong value")Falseexplainable-predicatesA Predicate that accepts R values of T . Unlike  , this doesn't require U or V instances.accept nothing NothingTrue!accept nothing (Just "something")Falseexplainable-predicatesA  that accepts an W value of X x, where x matches the given child .)accept (left (eq "value")) (Left "value")True*accept (left (eq "value")) (Right "value")False/accept (left (eq "value")) (Left "wrong value")Falseexplainable-predicatesA  that accepts an W value of Y x, where x matches the given child .+accept (right (eq "value")) (Right "value")True1accept (right (eq "value")) (Right "wrong value")False*accept (right (eq "value")) (Left "value")Falseexplainable-predicatesA  that accepts pairs whose elements satisfy the corresponding child s.2accept (zipP (eq "foo") (eq "bar")) ("foo", "bar")True2accept (zipP (eq "foo") (eq "bar")) ("bar", "foo")Falseexplainable-predicatesA  that accepts 3-tuples whose elements satisfy the corresponding child s.accept (zip3P (eq "foo") (eq "bar") (eq "qux")) ("foo", "bar", "qux")Trueaccept (zip3P (eq "foo") (eq "bar") (eq "qux")) ("qux", "bar", "foo")Falseexplainable-predicatesA  that accepts 3-tuples whose elements satisfy the corresponding child s.7accept (zip4P (eq 1) (eq 2) (eq 3) (eq 4)) (1, 2, 3, 4)True7accept (zip4P (eq 1) (eq 2) (eq 3) (eq 4)) (4, 3, 2, 1)Falseexplainable-predicatesA  that accepts 3-tuples whose elements satisfy the corresponding child s.accept (zip5P (eq 1) (eq 2) (eq 3) (eq 4) (eq 5)) (1, 2, 3, 4, 5)Trueaccept (zip5P (eq 1) (eq 2) (eq 3) (eq 4) (eq 5)) (5, 4, 3, 2, 1)Falseexplainable-predicatesA 8 that accepts anything accepted by both of its children.'accept (lt "foo" `andP` gt "bar") "eta"True'accept (lt "foo" `andP` gt "bar") "quz"False)accept (lt "foo" `andP` gt "bar") "alpha"Falseexplainable-predicatesA : that accepts anything accepted by either of its children.&accept (lt "bar" `orP` gt "foo") "eta"False&accept (lt "bar" `orP` gt "foo") "quz"True(accept (lt "bar" `orP` gt "foo") "alpha"Trueexplainable-predicatesA  that inverts another , accepting whatever its child rejects, and rejecting whatever its child accepts.(accept (notP (eq "negative")) "positive"True(accept (notP (eq "negative")) "negative"Falseexplainable-predicatesA  that accepts Ls or string-like values matching a regular expression. The expression must match the entire argument.You should not use % , because regular expression syntax itself is still case-sensitive even when the text you are matching is not. Instead, use .'accept (matchesRegex "x{2,5}y?") "xxxy"True&accept (matchesRegex "x{2,5}y?") "xyy"False)accept (matchesRegex "x{2,5}y?") "wxxxyz"Falseexplainable-predicatesA  that accepts Ls or string-like values matching a regular expression in a case-insensitive way. The expression must match the entire argument.You should use this instead of % , because regular expression syntax itself is still case-sensitive even when the text you are matching is not.6accept (matchesCaseInsensitiveRegex "x{2,5}y?") "XXXY"True5accept (matchesCaseInsensitiveRegex "x{2,5}y?") "XYY"False8accept (matchesCaseInsensitiveRegex "x{2,5}y?") "WXXXYZ"Falseexplainable-predicatesA  that accepts Ls or string-like values containing a match for a regular expression. The expression need not match the entire argument.You should not use % , because regular expression syntax itself is still case-sensitive even when the text you are matching is not. Instead, use  .(accept (containsRegex "x{2,5}y?") "xxxy"True'accept (containsRegex "x{2,5}y?") "xyy"False*accept (containsRegex "x{2,5}y?") "wxxxyz"True explainable-predicatesA  that accepts Ls or string-like values containing a match for a regular expression in a case-insensitive way. The expression need match the entire argument.You should use this instead of % , because regular expression syntax itself is still case-sensitive even when the text you are matching is not.7accept (containsCaseInsensitiveRegex "x{2,5}y?") "XXXY"True6accept (containsCaseInsensitiveRegex "x{2,5}y?") "XYY"False9accept (containsCaseInsensitiveRegex "x{2,5}y?") "WXXXYZ"True!explainable-predicatesA 9 that accepts sequences that start with the given prefix.$accept (startsWith "fun") "fungible"True$accept (startsWith "gib") "fungible"False"explainable-predicatesA 7 that accepts sequences that end with the given suffix.!accept (endsWith "ow") "crossbow"True"accept (endsWith "ow") "trebuchet"False#explainable-predicatesA  that accepts sequences that contain the given (consecutive) substring.accept (hasSubstr "i") "team"False$accept (hasSubstr "i") "partnership"True$explainable-predicatesA  that accepts sequences that contain the given (not necessarily consecutive) subsequence..accept (hasSubsequence [1..5]) [1, 2, 3, 4, 5]Trueaccept (hasSubsequence [1..5]) [0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0]True/accept (hasSubsequence [1..5]) [2, 3, 5, 7, 11]False%explainable-predicates Transforms a  on L8s or string-like types to match without regard to case.5accept (caseInsensitive startsWith "foo") "FOOTBALL!"True1accept (caseInsensitive endsWith "ball") "soccer"False)accept (caseInsensitive eq "time") "TIME"True2accept (caseInsensitive gt "NOTHING") "everything"False&explainable-predicatesA $ that accepts empty data structures.accept isEmpty ([] :: [Int])Trueaccept isEmpty [1, 2, 3]Falseaccept isEmpty ""Trueaccept isEmpty "gas tank"False'explainable-predicatesA ( that accepts non-empty data structures.accept nonEmpty ([] :: [Int])Falseaccept nonEmpty [1, 2, 3]Trueaccept nonEmpty ""Falseaccept nonEmpty "gas tank"True(explainable-predicatesA  that accepts data structures whose number of elements match the child .#accept (sizeIs (lt 3)) ['a' .. 'f']False#accept (sizeIs (lt 3)) ['a' .. 'b']True)explainable-predicatesA  that accepts data structures whose contents each match the corresponding & in the given list, in the same order..accept (elemsAre [lt 3, lt 4, lt 5]) [2, 3, 4]True1accept (elemsAre [lt 3, lt 4, lt 5]) [2, 3, 4, 5]False/accept (elemsAre [lt 3, lt 4, lt 5]) [2, 10, 4]False*explainable-predicatesA  that accepts data structures whose contents each match the corresponding ! in the given list, in any order.7accept (unorderedElemsAre [eq 1, eq 2, eq 3]) [1, 2, 3]True7accept (unorderedElemsAre [eq 1, eq 2, eq 3]) [2, 3, 1]True:accept (unorderedElemsAre [eq 1, eq 2, eq 3]) [1, 2, 3, 4]False4accept (unorderedElemsAre [eq 1, eq 2, eq 3]) [1, 3]False+explainable-predicatesA  that accepts data structures whose elements each match the child .accept (each (gt 5)) [4, 5, 6]Falseaccept (each (gt 5)) [6, 7, 8]Trueaccept (each (gt 5)) []True,explainable-predicatesA  that accepts data structures which contain at least one element matching the child ."accept (contains (gt 5)) [3, 4, 5]False"accept (contains (gt 5)) [4, 5, 6]Trueaccept (contains (gt 5)) []False-explainable-predicatesA  that accepts data structures whose elements all satisfy the given child s.8accept (containsAll [eq "foo", eq "bar"]) ["bar", "foo"]True1accept (containsAll [eq "foo", eq "bar"]) ["foo"]False?accept (containsAll [eq "foo", eq "bar"]) ["foo", "bar", "qux"]True Each child ; must be satisfied by a different element, so repeating a  requires that two different matching elements exist. If you want a  to match multiple elements, instead, you can accomplish this with , p1 `` , p2 `` ....;accept (containsAll [startsWith "f", endsWith "o"]) ["foo"]Falseaccept (contains (startsWith "f") `andP` contains (endsWith "o")) ["foo"]True.explainable-predicatesA  that accepts data structures whose elements all satisfy one of the child s.2accept (containsOnly [eq "foo", eq "bar"]) ["foo"]True9accept (containsOnly [eq "foo", eq "bar"]) ["foo", "bar"]True9accept (containsOnly [eq "foo", eq "bar"]) ["foo", "qux"]False,Each element must satisfy a different child 4. If you want multiple elements to match the same ), instead, you can accomplish this with + (p1 `` p2 `` ...).9accept (containsOnly [eq "foo", eq "bar"]) ["foo", "foo"]False6accept (each (eq "foo" `orP` eq "bar")) ["foo", "foo"]True/explainable-predicates Transforms a  on a list of keys into a  on map-like data structures.This is equivalent to ; (Z [ \ ]), but more readable.,accept (keys (each (eq "foo"))) [("foo", 5)]True8accept (keys (each (eq "foo"))) [("foo", 5), ("bar", 6)]False0explainable-predicates Transforms a  on a list of values into a  on map-like data structures.This is equivalent to ; (Z ^ \ ]), but more readable.6accept (values (each (eq 5))) [("foo", 5), ("bar", 5)]True6accept (values (each (eq 5))) [("foo", 5), ("bar", 6)]False1explainable-predicatesA  that accepts values of _ types that are close to the given number. The expected precision is scaled based on the target value, so that reasonable rounding error is accepted but grossly inaccurate results are not.The following naive use of   fails due to rounding:*accept (eq 1.0) (sum (replicate 100 0.01))FalseThe solution is to use 1/, which accounts for rounding error. However, 1 doesn't accept results that are far enough off that they likely arise from incorrect calculations instead of rounding error.0accept (approxEq 1.0) (sum (replicate 100 0.01))True4accept (approxEq 1.0) (sum (replicate 100 0.009999))False2explainable-predicatesA & that accepts positive numbers of any `ered a type.accept positive 1Trueaccept positive 0Falseaccept positive (-1)False3explainable-predicatesA & that accepts negative numbers of any `ered a type.accept negative 1Falseaccept negative 0Falseaccept negative (-1)True4explainable-predicatesA * that accepts non-positive numbers of any `ered a type.accept nonPositive 1Falseaccept nonPositive 0Trueaccept nonPositive (-1)True5explainable-predicatesA * that accepts non-negative numbers of any `ered a type.accept nonNegative 1Trueaccept nonNegative 0Trueaccept nonNegative (-1)False6explainable-predicatesA $ that accepts finite numbers of any _ type.accept finite 1.0Trueaccept finite (0 / 0)Falseaccept finite (1 / 0)False7explainable-predicatesA & that accepts infinite numbers of any _ type.accept infinite 1.0Falseaccept infinite (0 / 0)Falseaccept infinite (1 / 0)True8explainable-predicatesA  that accepts NaN values of any _ type.accept nAn 1.0Falseaccept nAn (0 / 0)Trueaccept nAn (1 / 0)False9explainable-predicatesA conversion from a -> Q to 3. This is a fallback that can be used to build a  that checks anything at all. However, its description will be less helpful than standard s. You can use :; instead to get better descriptions using Template Haskell.accept (is even) 3Falseaccept (is even) 4True:explainable-predicates)A Template Haskell splice that acts like 9, but receives a quoted expression at compile time and has a more helpful explanation.accept $(qIs [| even |]) 3Falseaccept $(qIs [| even |]) 4Trueshow $(qIs [| even |])"even";explainable-predicatesA combinator to lift a  to work on a property or computed value of the original value. The explanations are less helpful that standard predicates like (. You can use << instead to get better explanations using Template Haskell.accept (with abs (gt 5)) (-6)Trueaccept (with abs (gt 5)) (-5)False*accept (with reverse (eq "olleh")) "hello"True,accept (with reverse (eq "olleh")) "goodbye"False<explainable-predicates)A Template Haskell splice that acts like ;, but receives a quoted typed expression at compile time and has a more helpful explanation.'accept ($(qWith [| abs |]) (gt 5)) (-6)True'accept ($(qWith [| abs |]) (gt 5)) (-5)False4accept ($(qWith [| reverse |]) (eq "olleh")) "hello"True6accept ($(qWith [| reverse |]) (eq "olleh")) "goodbye"False show ($(qWith [| abs |]) (gt 5)) "abs: > 5"=explainable-predicatesA  that accepts values with a given nested value. This is intended to match constructors with arguments. You can use >< instead to get better explanations using Template Haskell.accept (inBranch "Left" (\case {Left x -> Just x; _ -> Nothing}) positive) (Left 1)Trueaccept (inBranch "Left" (\case {Left x -> Just x; _ -> Nothing}) positive) (Left 0)Falseaccept (inBranch "Left" (\case {Left x -> Just x; _ -> Nothing}) positive) (Right 1)False>explainable-predicatesA Template Haskell splice which, given a constructor for an abstract data type, writes a 5 that matches on that constructor and applies other s to its fields.accept $(qADT 'Nothing) NothingTrue accept $(qADT 'Nothing) (Just 5)False(accept ($(qADT 'Just) positive) (Just 5)True'accept ($(qADT 'Just) positive) NothingFalse(accept ($(qADT 'Just) positive) (Just 0)False?explainable-predicatesA Template Haskell splice that turns a quoted pattern into a predicate that accepts values that match the pattern.-accept $(qMatch [p| Just (Left _) |]) NothingFalse5accept $(qMatch [p| Just (Left _) |]) (Just (Left 5))True6accept $(qMatch [p| Just (Left _) |]) (Just (Right 5))False#show $(qMatch [p| Just (Left _) |])"Just (Left _)"@explainable-predicates Converts a  to a new type. Typically used with visible type application, as in the examples below.%accept (typed @String anything) "foo"True,accept (typed @String (sizeIs (gt 5))) "foo"False+accept (typed @String anything) (42 :: Int)FalseAexplainable-predicatesUse ; or < instead of b to get better explanations.  !"#$%&'()*+,-./0123456789:;<=>?@   !"#$%&'()*+,-./0123456789:;<=>?@ Safe-InferredG[EFGEFG Safe-InferredHHexplainable-predicates [0 .. x] `satisfies` (containsAll [eq 1, eq 2])  *** Failed! Falsified (after 1 test): Positive {getPositive = 1} Missing: 2 HH      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYPZ[PZ\PZ]W^_P`aPbcPbdPbePQfPghPQiPjkPglPmnW^oPpqPrs5explainable-predicates-0.1.2.3-8zLWjqcr0HPABcX0LKCDpu$Test.Predicates.Internal.FlowMatcherTest.PredicatesTest.Predicates.HUnitTest.Predicates.QuickCheckTest.Predicates.Internal.UtilbipartiteMatchingPredicateFailure Predicate showPredicate showNegationacceptexplainacceptIO==~anythingeqneqgtgeqltleqjustnothingleftrightzipPzip3Pzip4Pzip5PandPorPnotP matchesRegexmatchesCaseInsensitiveRegex containsRegexcontainsCaseInsensitiveRegex startsWithendsWith hasSubstrhasSubsequencecaseInsensitiveisEmptynonEmptysizeIselemsAreunorderedElemsAreeachcontains containsAll containsOnlykeysvaluesapproxEqpositivenegative nonPositive nonNegativefiniteinfinitenAnisqIswithqWithinBranchqADTqMatchtyped$fContravariantPredicate$fShowPredicate$fExceptionPredicateFailure$fShowPredicateFailureassertSatisfied@?~ shouldSatisfy satisfiesLocatedlocatewithLocbaseGHC.BaseStringchoicesisSubsequenceOfremoveModNamesLocghc-prim GHC.TypesBool GHC.MaybeMaybeJustNothing GHC.ClassesEqGHC.ShowShow Data.EitherEitherLeftRightmap Data.Tuplefst.GHC.ExtstoListsnd GHC.Float RealFloatOrdGHC.NumNumData.Functor.Contravariant contramap