!7I      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Safe;None1:W<None%&',-.18=>?@AHMPSUVX_`khpredicate-typed.a typeclass for choosing which monad to run in predicate-typed&Extract 'a' from a list like container%predicate-typedinductive numbers&predicate-typedget bool from the typelevel(predicate-typedget ordering from the typelevel,predicate-typedgets length of a typelevel list.predicate-typed(get a list of Symbols from the typelevelgetSymbs @'["abc","def","g"]["abc","def","g"]0predicate-typed%get a list of Nats from the typelevelgetNats @'[10,12,1] [10,12,1]2predicate-typed typelevel Not3predicate-typed typelevel Or4predicate-typed typelevel And5predicate-typed/helper method to fail with an error if the True6predicate-typedtypelevel Null on Symbol7predicate-typedtype level Between8predicate-typedused by    and  and c to allow more flexible replacement These parallel the RegexReplacement (not exported) class in Text.Regex.PCRE.HeavyM but have overlappable instances which is problematic for this code so I use 8predicate-typed2convert type level regex option to the value level=predicate-typed2extract the regex options from the type level list?predicate-typed'Regex options for Rescan Resplit Re etc@predicate-typedForce pattern anchoringApredicate-typedCompile automatic callouts | Bsr_anycrlf -- R matches only CR, LF, or CrlF | Bsr_unicode -- ^ R matches all Unicode line endingsBpredicate-typedDo caseless matchingCpredicate-typed"dollar not to match newline at endDpredicate-typedmatches anything including NLEpredicate-typed%Allow duplicate names for subpatternsFpredicate-typed Ignore whitespace and # commentsGpredicate-typed,PCRE extra features (not much use currently)Hpredicate-typed#Force matching to be before newlineIpredicate-typedcaret and dollar match newlines within data | Newline_any -- ^ Recognize any Unicode newline sequence | Newline_anycrlf -- ^ Recognize CR, LF, and CrlF as newline sequencesJpredicate-typedSet CR as the newline sequenceKpredicate-typed Set CrlF as the newline sequenceLpredicate-typedSet LF as the newline sequenceMpredicate-typed=Disable numbered capturing parentheses (named ones available)Npredicate-typed Invert greediness of quantifiersOpredicate-typedRun in UTF--8 modePpredicate-typed+Do not check the pattern for UTF-8 validitypredicate-typeddisplay format for the treepredicate-typeddraw normal treepredicate-typed use unicodeQpredicate-typedcustomizable optionsSpredicate-typedlength of data to display for Tpredicate-typed debug levelUpredicate-typed1display the tree using the normal tree or unicodeVpredicate-typedhides one layer of a treeWpredicate-typedcolor palette usedXpredicate-typed1skip the tree entirely and display the end resultpredicate-typed4the color palette for displaying the expression treepredicate-typed a monomorphic container of treespredicate-typed)holds the result of running the predicatepredicate-typed*optional strings to include in the results[predicate-typed?contains the untyped result from evaluating the expression treepredicate-typedfails the entire evaluationpredicate-typedFalse predicatepredicate-typedTrue predicatepredicate-typed Any value\predicate-typed=contains the typed result from evaluating the expression treeapredicate-typed-represents the evaluation tree for predicatesbpredicate-typedthe child nodescpredicate-typedthe value at this root nodedpredicate-typed1detailed information eg input and output and textfpredicate-typedlens for accessing \ in aipredicate-typeda lens from typed \ to the untyped [jpredicate-typed&creates a Node for the evaluation treekpredicate-typed+creates a Boolean node for a predicate typenpredicate-typed get the value from BoolT or failopredicate-typed2converts a typed tree to an untyped on for displaypredicate-typed)converts a typed tree into an untyped oneppredicate-typed'convenience method to wrap a typed treeqpredicate-typedsee 2 : add more detail to the tree if there are errorsrpredicate-typedsee 2 : add less detail to the tree if there are errorspredicate-typedha helper method to add extra context on failure to the tree or extract the value at the root of the treetpredicate-typed'skip colors and just return the summaryupredicate-typed?skip the detail and just return the summary but keep the colorsvpredicate-typed5displays the detailed evaluation tree without colors.wpredicate-typed3displays the detailed evaluation tree using colors.xpredicate-typedsame as w but for a narrow displayypredicate-typedsame as w8 for a wider display and more lenient debug mode settingzpredicate-typedAdisplays the detailed evaluation tree using unicode and colors. (w works better on Windows){predicate-typedsame as z but for a narrow display|predicate-typed,helper method to limit the width of the tree}predicate-typed$helper method to set the debug level~predicate-typed!set display to unicode and colorspredicate-typedset a color palettepredicate-typedno colors are displayedcolor palettes$italics dont work but underline doespredicate-typeddefault color palettecolor palettes$italics dont work but underline doespredicate-typedcolor palettes$italics dont work but underline doespredicate-typedcolor palettes$italics dont work but underline doespredicate-typedcolor palettes$italics dont work but underline doespredicate-typed$fix PresentT Bool to TrueT or FalseTpredicate-typed*display all data regardless of debug levelpredicate-typed<more restrictive: only display data at debug level 1 or lesspredicate-typed+compile a regex using the type level symbolpredicate-typedWextract values from the trees or if there are errors returned a tree with added contextpredicate-typed,extract all root values from a list of treespredicate-typedprism from BoolT to Boolpredicate-typedboolean implicationTrue `imply` FalseFalseTrue `imply` TrueTrueFalse `imply` FalseTrueFalse `imply` TrueTruepredicate-typedLapplies a boolean binary operation against the values from two boolean treespredicate-typedget a Nat from the typelevelnat @1414predicate-typed:gets the Symbol from the typelevel >>> symb @"abc" "abc"predicate-typed"get the length of a typelevel listgetLen @'["abc","def","g"]3predicate-typedEcolors the result of the predicate based on the current color palettepredicate-typed3skip displaying the tree and just output the resultpredicate-typed display in unicode (non-Windows)predicate-typednormal displaypredicate-typed#strip ansi characters from a string]predicate-typedfailure with string^predicate-typedfalse predicate_predicate-typedtrue predicate`predicate-typednon predicate value   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRXSTUVWYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~abcdefgh\]^_`i[YZjklmnoqrQRXSTUVWstuvwxyz{|}~?@ABCDEFGHIJKLMNOP=>89:;<765432 01./,-*+()&'% !"#$p  9 9 None-.=>?@AHUVXky"predicate-typed9add a message to give more context to the evaluation tree!pe @(Msg "[somemessage] " Id) 999P [somemessage] Id 999 PresentT 999 pe @(Msg Id 999) "info message:"P info message:'999 PresentT 999predicate-typed0transparent predicate wrapper to make k of kind 6 so it can be in a promoted list (cant mix kinds) see   pl @'[W 123, Id] 99Present [123,99]PresentT [123,99]%pl @'[W "abc", W "def", Id, Id] "ghi"!Present ["abc","def","ghi","ghi"]"PresentT ["abc","def","ghi","ghi"]predicate-typedGidentity function that also displays the type information for debugging pl @IdT 23 Present 23 PresentT 23predicate-typed1identity function that displays the input unlike even more constraints than 1 so we might need to add explicit type signatures pl @Id 23 Present 23 PresentT 23predicate-typedidentity functionpl @I 23 Present 23 PresentT 23predicate-typedUThis is the core class. Each instance of this class can be combined into a dsl using  predicate-typedA specialised form of  that works only on predicatespredicate-typed9displays the evaluation tree in plain text without colorspredicate-typed)displays the evaluation tree using colorspredicate-typedsame as 2 but truncates the display tree horizontally: see xpredicate-typedsame as  but wider displaypredicate-typed:skips the evaluation tree and just displays the end resultpredicate-typedsame as  but with colorspredicate-typed6display the evaluation tree using unicode and colors  pu '(Id, "abc", 123) [1..4] @ predicate-typedsame as 2 but truncates the display tree horizontally: see z predicate-typed(converts the value to the corresponding pl @'Proxy 'x' Present ProxyPresentT Proxy predicate-typedBextracts the (a,b) from type level 'These a b' if the value exists$pl @('These Id Id) (These 123 "abc")Present (123,"abc")PresentT (123,"abc")%pl @('These Id 5) (These 123 "abcde")Present (123,5)PresentT (123,5)pl @('These Id Id) (This "aaa")Error 'These found ThisFailT "'These found This"pl @('These Id Id) (That "aaa")Error 'These found ThatFailT "'These found That" predicate-typed@extracts the 'b' from type level 'These a b' if the value existspl @('That Id) (That 123) Present 123 PresentT 123pl @('That Id) (This "aaa")Error 'That found ThisFailT "'That found This"pl @('That Id) (These 44 "aaa")Error 'That found TheseFailT "'That found These"predicate-typed@extracts the 'a' from type level 'These a b' if the value existspl @('This Id) (This 123) Present 123 PresentT 123pl @('This Id) (That "aaa")Error 'This found ThatFailT "'This found That" pl @('This Id) (These 999 "aaa")Error 'This found TheseFailT "'This found These"predicate-typedAextracts the 'b' from type level 'Either a b' if the value existspl @('Right Id) (Right 123) Present 123 PresentT 123pl @('Right Id) (Left "aaa")Error 'Right found LeftFailT "'Right found Left"predicate-typedAextracts the 'a' from type level 'Either a b' if the value existspl @('Left Id) (Left 123) Present 123 PresentT 123pl @('Left Id) (Right "aaa")Error 'Left found RightFailT "'Left found Right"predicate-typedexpects Nothing otherwise it fails if the value is Nothing then it returns 'Proxy a' as this provides more information than '()'pl @'Nothing Nothing Present ProxyPresentT Proxypl @'Nothing (Just True)Error 'Nothing found JustFailT "'Nothing found Just"predicate-typed>extracts the 'a' from type level 'Maybe a' if the value existspl @('Just Id) (Just 123) Present 123 PresentT 123pl @('Just Id) (Just True) Present True PresentT Truepl @('Just Id) NothingError 'Just found NothingFailT "'Just found Nothing"predicate-typed2runs each predicate in turn from the promoted listpl @'[1, 2, 3] 999Present [1,2,3]PresentT [1,2,3]pl @'[W 1, W 2, W 3, Id] 999Present [1,2,3,999]PresentT [1,2,3,999]predicate-typed=extracts the value level representation of the type level '[] pl @'[] False Present [] PresentT []predicate-typed=extracts the value level representation of the type level '() pl @'() () Present () PresentT ()predicate-typed:extracts the value level representation of the type level  pl @123 () Present 123 PresentT 123predicate-typed8extracts the value level representation of the promoted pl @'LT "not used" Present LT PresentT LT pl @'EQ () Present EQ PresentT EQpredicate-typed(run the predicates in a promoted 4-tuple pl @'(4, Id, "inj", 999) "hello"Present (4,"hello","inj",999)PresentT (4,"hello","inj",999)predicate-typed(run the predicates in a promoted 3-tuplepl @'(4, Id, "goodbye") "hello"Present (4,"hello","goodbye")PresentT (4,"hello","goodbye")predicate-typed5run the predicates in a promoted 2-tuple; similar to pl @'(Id, 4) "hello"Present ("hello",4)PresentT ("hello",4)predicate-typedpulls the type level  to the value level as a pl @"hello world" ()Present "hello world"PresentT "hello world"predicate-typedpulls the type level  to the value levelpl @'True "not used"TrueTrueT pl @'False ()FalseFalseTpredicate-typed () function pl @() "Asf" Present () PresentT ()predicate-typedreturns a tree of results    None,-.7:;<=>?@AHMPSVXkB(predicate-typedthe constraints that ) must adhere to)predicate-typedNa simple refinement type that ensures the predicate 'p' holds for the type 'a'#prtRefinedIO @(Between 10 14) ol 13 Right (Refined {unRefined = 13})#prtRefinedIO @(Between 10 14) ol 99 Left FalseP@prtRefinedIO @(Last >> Len == 4) ol ["one","two","three","four"]:Right (Refined {unRefined = ["one","two","three","four"]})UprtRefinedIO @(Re "^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$" Id) ol "141.213.1.99",Right (Refined {unRefined = "141.213.1.99"})RprtRefinedIO @(Re "^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$" Id) ol "141.213.1" Left FalsePprtRefinedIO @(Map (ReadP Int) (Resplit "\\." Id) >> Guard (Printf "bad length: found %d" Len) (Len == 4) >> 'True) ol "141.213.1""Left (FailP "bad length: found 3")prtRefinedIO @(Map (ReadP Int) (Resplit "\\." Id) >> Guard (Printf "bad length: found %d" Len) (Len == 4) >> GuardsN (Printf2 "octet %d out of range %d") 4 (Between 0 255) >> 'True) ol "141.213.1.444"'Left (FailP "octet 4 out of range 444")prtRefinedIO @(Map (ReadP Int) (Resplit "\\." Id) >> Guard (Printf "bad length: found %d" Len) (Len == 4) >> GuardsN (Printf2 "octet %d out of range %d") 4 (Between 0 255) >> 'True) ol "141.213.1x34.444"&Left (FailP "ReadP Int (1x34) failed")AprtRefinedIO @(Map ('[Id] >> ReadP Int) Id >> Luhn Id) ol "12344"%Right (Refined {unRefined = "12344"})AprtRefinedIO @(Map ('[Id] >> ReadP Int) Id >> Luhn Id) ol "12340" Left FalseP2prtRefinedIO @(Any (Prime Id) Id) ol [11,13,17,18]+Right (Refined {unRefined = [11,13,17,18]})2prtRefinedIO @(All (Prime Id) Id) ol [11,13,17,18] Left FalsePQprtRefinedIO @(Snd Id !! Fst Id >> Len > 5) ol (2,["abc","defghij","xyzxyazsfd"])@Right (Refined {unRefined = (2,["abc","defghij","xyzxyazsfd"])})RprtRefinedIO @(Snd Id !! Fst Id >> Len > 5) ol (27,["abc","defghij","xyzxyazsfd"])#Left (FailP "(!!) index not found")RprtRefinedIO @(Snd Id !! Fst Id >> Len <= 5) ol (2,["abc","defghij","xyzxyazsfd"]) Left FalseP+predicate-typed value for ),predicate-typed binary operation applied to two % values-predicate-typed%takes two values and lifts them into %& and then applies the binary operation.predicate-typedsame as , except we already have valid ) values as input/predicate-typedattempts to lift a refinement type to another refinement type by way of transformation function you can control both the predicate and the type0predicate-typedinvokes the callback with the ), value if 'a' is valid for the predicate 'p'2predicate-typedsame as 3 but prints the results3predicate-typed returns a ), value if 'a' is valid for the predicate 'p'4predicate-typedreturns a wrapper % around a possible ), value if 'a' is valid for the predicate 'p';predicate-typeda way to unsafely create a ) value<predicate-typeda way to unsafely create a ) value but run the predicate=predicate-typed instance for )>predicate-typed instance for )import Data.Timeimport Control.Lensimport Control.Arrow ((+++))-type K1 = Refined (ReadP Day >> 'True) Stringctype K2 = Refined (ReadP Day >> Between (ReadP' Day "2019-03-30") (ReadP' Day "2019-06-01")) Stringctype K3 = Refined (ReadP Day >> Between (ReadP' Day "2019-05-30") (ReadP' Day "2019-06-01")) String(r = unsafeRefined' ol "2019-04-23" :: K1DremoveAnsi $ (view _3 +++ view _3) $ B.decodeOrFail @K1 (B.encode r)"Refined {unRefined = "2019-04-23"}DremoveAnsi $ (view _3 +++ view _3) $ B.decodeOrFail @K2 (B.encode r)"Refined {unRefined = "2019-04-23"}DremoveAnsi $ (view _3 +++ view _3) $ B.decodeOrFail @K3 (B.encode r)Refined:FalsePFalse >> False | 2019-04-23|3+- P ReadP Day (2019-04-23) 2019-04-23 | 2019-04-23| || `- P Id "2019-04-23"|`- False False && True |$ +- False 2019-04-23 >= 2019-05-30 | | | +- P I | |9 | `- P ReadP Day (2019-05-30) 2019-05-30 | 2019-05-30 | | | `- P '2019-05-30 |$ `- True 2019-04-23 <= 2019-06-01 | +- P I |9 `- P ReadP Day (2019-06-01) 2019-06-01 | 2019-06-01 | `- P '2019-06-01?predicate-typed instance for ):set -XOverloadedStrings1eitherDecode' @(Refined (Between 10 14) Int) "13" Right (Refined {unRefined = 13})>removeAnsi $ eitherDecode' @(Refined (Between 10 14) Int) "16"Error in $: Refined:FalsePFalse True && False|+- True 16 >= 10| | | +- P I| | | `- P '10|`- False 16 <= 14 | +- P I | `- P '14@predicate-typed instance for )@reads @(Refined (Between 0 255) Int) "Refined {unRefined = 254}" [(Refined {unRefined = 254},"")]@reads @(Refined (Between 0 255) Int) "Refined {unRefined = 300}"[]%&'()*+,-./0123456789:;<)*(3%&'29:0145+/678,-.;<None%&',-.1:=>?@AHSUVXkcNpredicate-typed emulates  using c8 ie the input conversion and output formatting are noops`predicate-typedOconvenience type family for converting from a 4-tuple '(ip,op,fmt,i) to a Proxyapredicate-typedJconvenience type family for converting from a 4-tuple '(ip,op,fmt,i) to a c signaturebpredicate-typed$Provides the constraints on Refined3cpredicate-typed9Refinement type that differentiates the input from outputi is the input typeip converts i to PP ip i which is the internal typeop$ validates that internal type using PP op (PP ip i) ~ Boolfmt outputs the internal type PP fmt (PP ip i) ~ iPP fmt (PP ip i)& should be valid as input for Refined3Setting ip to Id and fmt to Id makes it equivalent to : see NSetting the input type i to c resembles the corresponding Read/Show instances but with an additional predicate on the read valueread- a string into an internal type and store in dvalidate d using the predicate opshow d$ and store that formatted result in edAlthough the most common scenario is String as input, you are free to choose any input type you likeAprtEval3 @(ReadBase Int 16) @(Lt 255) @(Printf "%x" Id) ol "00fe"+Right (Refined3 {r3In = 254, r3Out = "fe"})AprtEval3 @(ReadBase Int 16) @(Lt 253) @(Printf "%x" Id) ol "00fe"-Left Step 2. False Boolean Check(op) | FalsePAprtEval3 @(ReadBase Int 16) @(Lt 255) @(Printf "%x" Id) ol "00fg"<Left Step 1. Initial Conversion(ip) Failed | invalid base 16prtEval3 @(Map (ReadP Int) (Resplit "\\." Id)) @(Guard (Printf "found length=%d" Len) (Len >> Id == 4) >> 'True) @(Printfnt 4 "%03d.%03d.%03d.%03d") ol "198.162.3.1.5"6Left Step 2. Failed Boolean Check(op) | found length=5prtEval3 @(Map (ReadP Int) (Resplit "\\." Id)) @(Guard (Printf "found length=%d" Len) (Len >> Id == 4) >> 'True) @(Printfnt 4 "%03d.%03d.%03d.%03d") ol "198.162.3.1"BRight (Refined3 {r3In = [198,162,3,1], r3Out = "198.162.003.001"}) :m + Data.Time.Calendar.WeekDateuprtEval3 @(MkDay >> 'Just Id) @(Guard "expected a Sunday" (Thd Id == 7) >> 'True) @(UnMkDay (Fst Id)) ol (2019,10,13)ARight (Refined3 {r3In = (2019-10-13,41,7), r3Out = (2019,10,13)})prtEval3 @(MkDay' (Fst Id) (Snd Id) (Thd Id) >> 'Just Id) @(Guard "expected a Sunday" (Thd Id == 7) >> 'True) @(UnMkDay (Fst Id)) ol (2019,10,12)9Left Step 2. Failed Boolean Check(op) | expected a Sundaygtype T4 k = '(MkDay >> 'Just Id, Guard "expected a Sunday" (Thd Id == 7) >> 'True, UnMkDay (Fst Id), k))prtEval3P (Proxy @(T4 _)) ol (2019,10,12)9Left Step 2. Failed Boolean Check(op) | expected a Sunday)prtEval3P (Proxy @(T4 _)) ol (2019,10,13)ARight (Refined3 {r3In = (2019-10-13,41,7), r3Out = (2019,10,13)})fpredicate-typeddirectly load values into c4. It still checks to see that those values are validgpredicate-typeddirectly load values into c without any checkingjpredicate-typedwraps the parameters for c in a 4-tupleuseful for methods such as p and rkpredicate-typedsame as jN but checks to make sure the proxy is consistent with the Refined3C constraintlpredicate-typedTuse type application to set the parameters which then will be wrapped into a 4-tupleuseful for passing into z / ympredicate-typedsame as lN but checks to make sure the proxy is consistent with the Refined3C constraintopredicate-typed create a c4 value and pass it to a continuation to be processedThis first example reads a hex string and makes sure it is between 100 and 200 and then reads a binary string and adds the values together:set -XPolyKinds9type Base n p = '(ReadBase Int n, p, ShowBase 16, String)+base16 = Proxy @(Base 16 (Between 100 200))base2 = Proxy @(Base 2 'True)yprtRefinedTIO $ withRefined3TP base16 ol "a3" $ \x -> withRefined3TP base2 ol "1001110111" $ \y -> pure (r3In x + r3In y)7947this example fails as the the hex value is out of rangeoprtRefinedTIO $ withRefined3TP base16 o0 "a388" $ \x -> withRefined3TP base2 o0 "1001110111" $ \y -> pure (x,y)6*** Step 1. Success Initial Conversion(ip) [41864] ***!P ReadBase(Int,16) 41864 | "a388"|`- P Id "a388"'*** Step 2. False Boolean Check(op) ***False True && False|+- True 41864 >= 100| | | +- P I| | | `- P '100|`- False 41864 <= 200 | +- P I | `- P '2005failure msg[Step 2. False Boolean Check(op) | FalseP]rpredicate-typedcreate a wrapped c typeprtRefinedTIO $ newRefined3TP (Proxy @'(MkDay >> JustFail "asfd" Id, GuardSimple (Thd Id == 5) >> 'True, UnMkDay (Fst Id), (Int,Int,Int))) ol (2019,11,1)8Refined3 {r3In = (2019-11-01,44,5), r3Out = (2019,11,1)}tpredicate-typedattempts to cast a wrapped c to another c with different predicatesupredicate-typed*applies a binary operation to two wrapped c parametersvpredicate-typedsame as u! but uses a 4-tuple proxy insteadpredicate-typed emulates c but uses  reuses the mkProxy3 but returns Refined vs Refined3 using plain Refined to emulate Refined3 sort of we just output fmt instead of embedding it in Refined3 so 'ip' predicate gets us started: we store that 'PP ip i' in Refined then we run the boolean predicate 'op' which is successful if true then we run 'fmt' against 'PP ip i' and output both the Refined (PP p i) and the PP fmt (PP (ip i)) ie 'fmt' run against PP ip i if any of the three steps fails the process stops immediately and dumps out RResultspredicate-typed instance for cSencode (unsafeRefined3 @(ReadBase Int 16) @(Between 0 255) @(ShowBase 16) 254 "fe")"\"fe\"".encode (unsafeRefined3 @Id @'True @Id 123 123)"123"predicate-typed instance for cimport Control.Arrow ((+++))import Control.Lensimport Data.Time6type K1 = MakeR3 '(ReadP Day, 'True, ShowP Id, String)ltype K2 = MakeR3 '(ReadP Day, Between (ReadP' Day "2019-03-30") (ReadP' Day "2019-06-01"), ShowP Id, String)ltype K3 = MakeR3 '(ReadP Day, Between (ReadP' Day "2019-05-30") (ReadP' Day "2019-06-01"), ShowP Id, String))r = unsafeRefined3' ol "2019-04-23" :: K1DremoveAnsi $ (view _3 +++ view _3) $ B.decodeOrFail @K1 (B.encode r)2Refined3 {r3In = 2019-04-23, r3Out = "2019-04-23"}DremoveAnsi $ (view _3 +++ view _3) $ B.decodeOrFail @K2 (B.encode r)2Refined3 {r3In = 2019-04-23, r3Out = "2019-04-23"}DremoveAnsi $ (view _3 +++ view _3) $ B.decodeOrFail @K3 (B.encode r)1Refined3:Step 2. False Boolean Check(op) | FalseP;*** Step 1. Success Initial Conversion(ip) [2019-04-23] ***0P ReadP Day (2019-04-23) 2019-04-23 | 2019-04-23|`- P Id "2019-04-23"'*** Step 2. False Boolean Check(op) ***False False && True|!+- False 2019-04-23 >= 2019-05-30| | | +- P I| |6| `- P ReadP Day (2019-05-30) 2019-05-30 | 2019-05-30| || `- P '2019-05-30|!`- True 2019-04-23 <= 2019-06-01 | +- P I |6 `- P ReadP Day (2019-06-01) 2019-06-01 | 2019-06-01 | `- P '2019-06-01predicate-typed instance for caeitherDecode' @(Refined3 (ReadBase Int 16) (Id > 10 && Id < 256) (ShowBase 16) String) "\"00fe\""+Right (Refined3 {r3In = 254, r3Out = "fe"})rremoveAnsi $ eitherDecode' @(Refined3 (ReadBase Int 16) (Id > 10 && Id < 256) (ShowBase 16) String) "\"00fe443a\""=Error in $: Refined3:Step 2. False Boolean Check(op) | FalseP9*** Step 1. Success Initial Conversion(ip) [16663610] ***(P ReadBase(Int,16) 16663610 | "00fe443a"|`- P Id "00fe443a"'*** Step 2. False Boolean Check(op) ***False True && False|+- True 16663610 > 10| || +- P Id 16663610| | | `- P '10|`- False 16663610 < 256 | +- P Id 16663610 | `- P '256predicate-typed instance for cpreads @(Refined3 (ReadBase Int 16) (Between 0 255) (ShowBase 16) String) "Refined3 {r3In = 254, r3Out = \"fe\"}"*[(Refined3 {r3In = 254, r3Out = "fe"},"")]qreads @(Refined3 (ReadBase Int 16) (Between 0 255) (ShowBase 16) String) "Refined3 {r3In = 300, r3Out = \"12c\"}"[]mreads @(Refined3 (ReadBase Int 16) (Id < 0) (ShowBase 16) String) "Refined3 {r3In = -1234, r3Out = \"-4d2\"}".[(Refined3 {r3In = -1234, r3Out = "-4d2"},"")]reads @(Refined3 (Map (ReadP Int) (Resplit "\\." Id)) (Guard "len/=4" (Len == 4) >> 'True) (Printfnt 4 "%d.%d.%d.%d") String) "Refined3 {r3In = [192,168,0,1], r3Out = \"192.168.0.1\"}"=[(Refined3 {r3In = [192,168,0,1], r3Out = "192.168.0.1"},"")]4NOPSQRTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~4cdebNywx}~OPSQRZ[\]^_TUVWXYz{|jklm`anopqrstuvhigfNone %&',-.=>?@AHPSUVX_k ?predicate-typed leverages 8 for repeating predicates (passthrough method) same as DoN n p == FoldN n p Id but more efficientpl @(DoN 4 (Succ Id)) 'c' Present 'g' PresentT 'g'pl @(DoN 4 (Id <> " | ")) "abc"Present "abc | | | | "PresentT "abc | | | | "#pl @(DoN 4 (Id <> "|" <> Id)) "abc"IPresent "abc|abc|abc|abc|abc|abc|abc|abc|abc|abc|abc|abc|abc|abc|abc|abc"JPresentT "abc|abc|abc|abc|abc|abc|abc|abc|abc|abc|abc|abc|abc|abc|abc|abc"predicate-typedccreates a promoted list of predicates and then evaluates them into a list. see PP instance for '[k]pl @(Repeat 4 (Succ Id)) 'c'Present "dddd"PresentT "dddd"pl @(Repeat 4 "abc") ()!Present ["abc","abc","abc","abc"]"PresentT ["abc","abc","abc","abc"]predicate-typed similar to  /pl @(StripLeft "xyz" Id) ("xyzHello" :: String)Present Just "Hello"PresentT (Just "Hello"),pl @(StripLeft "xyz" Id) (T.pack "xyzHello")Present Just "Hello"PresentT (Just "Hello")#pl @(StripLeft "xyz" Id) "xywHello"Present NothingPresentT Nothing%pl @(StripRight "xyz" Id) "Hello xyz"Present Just "Hello "PresentT (Just "Hello ")'pl @(StripRight "xyz" Id) "xyzHelloxyw"Present NothingPresentT Nothingpl @(StripRight "xyz" Id) ""Present NothingPresentT Nothingpl @(StripRight "xyz" "xyz") ()Present Just ""PresentT (Just "")predicate-typed similar to   ,pl @(Trim (Snd Id)) (20," abc " :: String) Present "abc"PresentT "abc")pl @(Trim (Snd Id)) (20,T.pack " abc ") Present "abc"PresentT "abc"'pl @(TrimStart (Snd Id)) (20," abc ")Present "abc "PresentT "abc "%pl @(TrimEnd (Snd Id)) (20," abc ")Present " abc"PresentT " abc"pl @(TrimEnd " abc ") ()Present " abc"PresentT " abc"pl @(TrimEnd "") () Present "" PresentT ""pl @(Trim " ") () Present "" PresentT ""pl @(Trim "") () Present "" PresentT ""predicate-typed similar to pl @Join (Just (Just 20))Present Just 20PresentT (Just 20)pl @Join ["ab","cd","","ef"]Present "abcdef"PresentT "abcdef"predicate-typed similar to pl @Duplicate (20,"abc")Present (20,(20,"abc"))PresentT (20,(20,"abc"))predicate-typed similar to pl @Extract (Nothing,Just 20)Present Just 20PresentT (Just 20)pl @Extract (Identity 20) Present 20 PresentT 20predicate-typed similar to )pl @(Fst Id <|> Snd Id) (Nothing,Just 20)Present Just 20PresentT (Just 20))pl @(Fst Id <|> Snd Id) (Just 10,Just 20)Present Just 10PresentT (Just 10))pl @(Fst Id <|> Snd Id) (Nothing,Nothing)Present NothingPresentT Nothingpredicate-typed similar to +pl @(Fst Id <* Snd Id) (Just "abc",Just 20)Present Just "abc"PresentT (Just "abc")predicate-typed similar to &pl @(Fst Id <$ Snd Id) ("abc",Just 20)Present Just "abc"PresentT (Just "abc")predicate-typedprint a 3-tuple6pl @(Printf3 "fst=%s snd=%03d thd=%s") ("ab",123,"xx")Present "fst=ab snd=123 thd=xx" PresentT "fst=ab snd=123 thd=xx"predicate-typedprint a 2-tuple*pl @(Printf2 "fst=%s snd=%03d") ("ab",123)Present "fst=ab snd=123"PresentT "fst=ab snd=123"predicate-typed!Printfn prints an inductive tuple+pl @(Printfn "%s %s" Id) ("123",("def",()))Present "123 def"PresentT "123 def".pl @(Printfn "s=%s d=%03d" Id) ("ab",(123,()))Present "s=ab d=123"PresentT "s=ab d=123"predicate-typedreverses inductive tuples-pl @ReverseTupleN (1,('a',(True,("def",()))))#Present ("def",(True,('a',(1,()))))$PresentT ("def",(True,('a',(1,()))))pl @ReverseTupleN (1,('a',()))Present ('a',(1,()))PresentT ('a',(1,()))pl @ReverseTupleN (999,())Present (999,())PresentT (999,())predicate-typed3uses inductive tuples to replace variable argumentspredicate-typed similar to $pl @(Fst Id <> Snd Id) ("abc","def")Present "abcdef"PresentT "abcdef" pl @("abcd" <> "ef" <> Id) "ghi"Present "abcdefghi"PresentT "abcdefghi" pl @("abcd" <> "ef" <> Id) "ghi"Present "abcdefghi"PresentT "abcdefghi"/pl @(Wrap (SG.Sum _) Id <> FromInteger _ 10) 13Present Sum {getSum = 23}PresentT (Sum {getSum = 23})3pl @(Wrap (SG.Product _) Id <> FromInteger _ 10) 13"Present Product {getProduct = 130}%PresentT (Product {getProduct = 130})9pl @('(FromInteger _ 10,"def") <> Id) (SG.Sum 12, "_XYZ")%Present (Sum {getSum = 22},"def_XYZ")&PresentT (Sum {getSum = 22},"def_XYZ")predicate-typed similar to    for strings only.4The 'I' suffixed versions work are case insensitive. pl @(IsInfixI "abc" "axAbCd") ()TrueTrueT!pl @(IsPrefixI "abc" "aBcbCd") ()TrueTrueT pl @(IsPrefix "abc" "aBcbCd") ()FalseFalseT pl @(IsSuffix "bCd" "aBcbCd") ()TrueTrueTpredicate-typeddoes the directory exists,pl @(ReadEnv "PATH" >> 'Just Id >> 'True) ()TrueTrueTpredicate-typeddoes the directory existspl @(DirExists ".") ()TrueTrueTpredicate-typed similar to 4pl @(ReadFile ".ghci" >> 'Just Id >> Len >> Gt 0) ()TrueTrueTpl @(FileExists "xyzzy") ()FalseFalseTpredicate-typed similar to (pl @Sequence [Just 10, Just 20, Just 30]Present Just [10,20,30]PresentT (Just [10,20,30]):pl @Sequence [Just 10, Just 20, Just 30, Nothing, Just 40]Present NothingPresentT Nothingpredicate-typedtries each predicate ps and on the first match runs the corresponding qs but if there is no match on ps then runs the fail case epl @(Case (FailS "asdf" >> Snd Id >> Unproxy ) '[Lt 4,Lt 10,Same 50] '[Printf "%d is lt4" Id, Printf "%d is lt10" Id, Printf "%d is same50" Id] Id) 50Present "50 is same50"PresentT "50 is same50"pl @(Case (FailS "asdf" >> Snd Id >> Unproxy ) '[Lt 4,Lt 10,Same 50] '[Printf "%d is lt4" Id, Printf "%d is lt10" Id, Printf "%d is same50" Id] Id) 9Present "9 is lt10"PresentT "9 is lt10"pl @(Case (FailS "asdf" >> Snd Id >> Unproxy ) '[Lt 4,Lt 10,Same 50] '[Printf "%d is lt4" Id, Printf "%d is lt10" Id, Printf "%d is same50" Id] Id) 3Present "3 is lt4"PresentT "3 is lt4"pl @(Case (FailS "asdf" >> Snd Id >> Unproxy ) '[Lt 4,Lt 10,Same 50] '[Printf "%d is lt4" Id, Printf "%d is lt10" Id, Printf "%d is same50" Id] Id) 99 Error asdf FailT "asdf"predicate-typed leverages . for repeating predicates (passthrough method)(pl @(ParaNImpl 'True 4 (Succ Id)) [1..4]Present [2,3,4,5]PresentT [2,3,4,5]"pl @(ParaNLax 4 (Succ Id)) "azwxm"Present "b{xy"PresentT "b{xy"pl @(ParaN 4 (Succ Id)) "azwxm"-Error Para: data elements(5) /= predicates(4)/FailT "Para: data elements(5) /= predicates(4)"pl @(ParaN 4 (Succ Id)) "azwx"Present "b{xy"PresentT "b{xy"&pl @(ParaNLax 4 (FromEnum Id)) "azwxs"Present [97,122,119,120]PresentT [97,122,119,120]predicate-typedruns values in parallel unlike  which is serial)pl @(Para '[Id,Id + 1,Id * 4]) [10,20,30]Present [10,21,120]PresentT [10,21,120],pl @(Para '[Id,Id + 1,Id * 4]) [10,20,30,40]-Error Para: data elements(4) /= predicates(3)/FailT "Para: data elements(4) /= predicates(3)"7pl @(ParaLax '[Id,Id + 1,Id * 4]) [10,20,30,40,50,20,1]Present [10,21,120]PresentT [10,21,120]/pl @(ParaLax '[Id,Id + 1,Id * 4,Id]) [10,20,30]Present [10,21,120]PresentT [10,21,120]predicate-typeduses Printf to format outputpl @(Printf "value=%03d" Id) 12Present "value=012"PresentT "value=012"&pl @(Printf "%s" (Fst Id)) ("abc",'x') Present "abc"PresentT "abc"&pl @(Printf "%d" (Fst Id)) ("abc",'x')3Error Printf (IO e=printf: bad formatting char 'd')5FailT "Printf (IO e=printf: bad formatting char 'd')"predicate-typedintercalate two lists;pl @(Intercalate '["aB"] '["xxxx","yz","z","www","xyz"]) ()9Present ["xxxx","aB","yz","aB","z","aB","www","aB","xyz"]:PresentT ["xxxx","aB","yz","aB","z","aB","www","aB","xyz"]-pl @(Intercalate '[W 99,Negate 98] Id) [1..5]/Present [1,99,-98,2,99,-98,3,99,-98,4,99,-98,5]0PresentT [1,99,-98,2,99,-98,3,99,-98,4,99,-98,5]%pl @(Intercalate '[99,100] Id) [1..5]/Present [1,99,100,2,99,100,3,99,100,4,99,100,5]0PresentT [1,99,100,2,99,100,3,99,100,4,99,100,5]predicate-typed-Display a number at base 2 to 36, similar to  but supports signed numberspl @(ShowBase 16) 4077 Present "fed"PresentT "fed"pl @(ShowBase 16) (-255) Present "-ff"PresentT "-ff"pl @(ShowBase 2) 147Present "10010011"PresentT "10010011")pl @(ShowBase' 2 (Negate 147)) "whatever"Present "-10010011"PresentT "-10010011"predicate-typed2Read a number using base 2 through a maximum of 36pl @(ReadBase Int 16) "00feD" Present 4077 PresentT 4077pl @(ReadBase Int 16) "-ff" Present -255PresentT (-255)pl @(ReadBase Int 2) "10010011" Present 147 PresentT 147pl @(ReadBase Int 8) "Abff"Error invalid base 8FailT "invalid base 8"(supports negative numbers unlike readIntpredicate-typed"Luhn predicate check on last digitpl @(Luhn Id) [1,2,3,0]TrueTrueTpl @(Luhn Id) [1,2,3,4]FalseFalseT)pl @(GuardSimple (Luhn Id)) [15,4,3,1,99]9Error Luhn map=[90,2,3,8,6] sum=109 ret=9 | [15,4,3,1,99];FailT "Luhn map=[90,2,3,8,6] sum=109 ret=9 | [15,4,3,1,99]"predicate-typedGZip two lists optionally cycling the one of the lists to match the size,pl @(ZipL (Fst Id) (Snd Id)) ("abc", [1..5])1Present [('a',1),('b',2),('c',3),('a',4),('b',5)]2PresentT [('a',1),('b',2),('c',3),('a',4),('b',5)]0pl @(ZipL (Fst Id) (Snd Id)) ("abcdefg", [1..5])1Present [('a',1),('b',2),('c',3),('d',4),('e',5)]2PresentT [('a',1),('b',2),('c',3),('d',4),('e',5)]0pl @(ZipR (Fst Id) (Snd Id)) ("abcdefg", [1..5])APresent [('a',1),('b',2),('c',3),('d',4),('e',5),('f',1),('g',2)]BPresentT [('a',1),('b',2),('c',3),('d',4),('e',5),('f',1),('g',2)]predicate-typed/extract 'a' from '[a]' which I need for type PPpredicate-typed similar to  thats pads with  or & if one list is shorter than the other>the key is that all information about both lists are preserved0pl @(ZipThese (Fst Id) (Snd Id)) ("aBc", [1..5]);Present [These 'a' 1,These 'B' 2,These 'c' 3,That 4,That 5]<PresentT [These 'a' 1,These 'B' 2,These 'c' 3,That 4,That 5]3pl @(ZipThese (Fst Id) (Snd Id)) ("aBcDeF", [1..3])HPresent [These 'a' 1,These 'B' 2,These 'c' 3,This 'D',This 'e',This 'F']IPresentT [These 'a' 1,These 'B' 2,These 'c' 3,This 'D',This 'e',This 'F']"pl @(ZipThese Id Reverse) "aBcDeF"]Present [These 'a' 'F',These 'B' 'e',These 'c' 'D',These 'D' 'c',These 'e' 'B',These 'F' 'a']^PresentT [These 'a' 'F',These 'B' 'e',These 'c' 'D',These 'D' 'c',These 'e' 'B',These 'F' 'a']pl @(ZipThese Id '[]) "aBcDeF"?Present [This 'a',This 'B',This 'c',This 'D',This 'e',This 'F']@PresentT [This 'a',This 'B',This 'c',This 'D',This 'e',This 'F']pl @(ZipThese '[] Id) "aBcDeF"?Present [That 'a',That 'B',That 'c',That 'D',That 'e',That 'F']@PresentT [That 'a',That 'B',That 'c',That 'D',That 'e',That 'F']predicate-typed.extracts the first character from a non empty pl @(Char1 "aBc") () Present 'a' PresentT 'a'predicate-typed creates a singleton from a value pl @(Singleton (Char1 "aBc")) () Present "a" PresentT "a"pl @(Singleton Id) FalsePresent [False]PresentT [False](pl @(Singleton (Snd Id)) (False,"hello")Present ["hello"]PresentT ["hello"]predicate-typed'creates an empty list of the given typepl @(Id :+ EmptyList _) 99 Present [99] PresentT [99]predicate-typed similar to 9pl @(TheseIn Id Len (Fst Id + Length (Snd Id))) (This 13) Present 13 PresentT 13Npl @(TheseIn Id Len (Fst Id + Length (Snd Id))) (That "this is a long string") Present 21 PresentT 21Epl @(TheseIn Id Len (Fst Id + Length (Snd Id))) (These 20 "somedata") Present 28 PresentT 28pl @(TheseIn (MkLeftAlt _ Id) (MkRightAlt _ Id) (If (Fst Id > Length (Snd Id)) (MkLeft _ (Fst Id)) (MkRight _ (Snd Id)))) (That "this is a long string")%Present Right "this is a long string"(PresentT (Right "this is a long string")pl @(TheseIn (MkLeftAlt _ Id) (MkRightAlt _ Id) (If (Fst Id > Length (Snd Id)) (MkLeft _ (Fst Id)) (MkRight _ (Snd Id)))) (These 1 "this is a long string")%Present Right "this is a long string"(PresentT (Right "this is a long string")pl @(TheseIn (MkLeftAlt _ Id) (MkRightAlt _ Id) (If (Fst Id > Length (Snd Id)) (MkLeft _ (Fst Id)) (MkRight _ (Snd Id)))) (These 100 "this is a long string")Present Left 100PresentT (Left 100)predicate-typed predicate on pl @(IsThis Id) (This "aBc")TrueTrueTpl @(IsThis Id) (These 1 'a')FalseFalseTpl @(IsThese Id) (These 1 'a')TrueTrueTpredicate-typedinvokes &requires the OverloadedLists extension:set -XOverloadedLists0pl @(FromListExt (M.Map _ _)) [(4,"x"),(5,"dd")]#Present fromList [(4,"x"),(5,"dd")]&PresentT (fromList [(4,"x"),(5,"dd")])predicate-typedinvokes ,pl @ToListExt (M.fromList [(1,'x'),(4,'y')])Present [(1,'x'),(4,'y')]PresentT [(1,'x'),(4,'y')]pl @ToListExt (T.pack "abc") Present "abc"PresentT "abc"predicate-typed similar to "pl @(ToList' Id) ("aBc" :: String) Present "aBc"PresentT "aBc"pl @(ToList' Id) (Just 14) Present [14] PresentT [14]pl @(ToList' Id) Nothing Present [] PresentT []pl @(ToList' Id) (Left "xx") Present [] PresentT [] pl @(ToList' Id) (These 12 "xx")Present ["xx"]PresentT ["xx"]predicate-typed similar to pl @ToList ("aBc" :: String) Present "aBc"PresentT "aBc"pl @ToList (Just 14) Present [14] PresentT [14]pl @ToList Nothing Present [] PresentT []pl @ToList (Left "xx") Present [] PresentT []pl @ToList (These 12 "xx")Present ["xx"]PresentT ["xx"]predicate-typed similar to !pl @(IToList _) ("aBc" :: String)!Present [(0,'a'),(1,'B'),(2,'c')]"PresentT [(0,'a'),(1,'B'),(2,'c')]predicate-typed>compare two strings ignoring case using the given ordering 'o'predicate-typed/compare two values using the given ordering 'o'predicate-typed!compare two strings ignoring case&pl @(Fst Id ===~ Snd Id) ("abC","aBc") Present EQ PresentT EQ'pl @(Fst Id ===~ Snd Id) ("abC","DaBc") Present LT PresentT LTpredicate-typed similar to pl @(Fst Id ==! Snd Id) (10,9) Present GT PresentT GT)pl @(14 % 3 ==! Fst Id %- Snd Id) (-10,7) Present GT PresentT GTpl @(Fst Id ==! Snd Id) (10,11) Present LT PresentT LTEpl @(Snd Id ==! (Fst Id >> Snd Id >> Head' Id)) (('x',[10,12,13]),10) Present EQ PresentT EQ;pl @(Snd Id ==! Head' (Snd (Fst Id))) (('x',[10,12,13]),10) Present EQ PresentT EQpredicate-typed functionpl @(Not Id) FalseTrueTrueTpl @(Not Id) TrueFalseFalseTpl @(Not (Fst Id)) (True,22)FalseFalseTpredicate-typed implication;pl @(Fst Id ~> (Length (Snd Id) >= 4)) (True,[11,12,13,14])TrueTrueT>pl @(Fst Id ~> (Length (Snd Id) == 4)) (True,[12,11,12,13,14])FalseFalseT?pl @(Fst Id ~> (Length (Snd Id) == 4)) (False,[12,11,12,13,14])TrueTrueT<pl @(Fst Id ~> (Length (Snd Id) >= 4)) (False,[11,12,13,14])TrueTrueTpredicate-typed similar to <pl @(Fst Id || (Length (Snd Id) >= 4)) (False,[11,12,13,14])TrueTrueTDpl @(Not (Fst Id) || (Length (Snd Id) == 4)) (True,[12,11,12,13,14])FalseFalseTpredicate-typed similar to #pl @(Fst Id && Snd Id) (True, True)TrueTrueTpl @(Id > 15 && Id < 17) 16TrueTrueTpl @(Id > 15 && Id < 17) 30FalseFalseT;pl @(Fst Id && (Length (Snd Id) >= 4)) (True,[11,12,13,14])TrueTrueT>pl @(Fst Id && (Length (Snd Id) == 4)) (True,[12,11,12,13,14])FalseFalseTpredicate-typed"This is composition for predicates,pl @(Fst Id >> Succ (Id !! 0)) ([11,12],'x') Present 12 PresentT 12>pl @(Len *** Succ Id >> ShowP (First (Pred Id))) ([11,12],'x')Present "(1,'y')"PresentT "(1,'y')"predicate-typedjust run the effect but skip the value for example for use with Stdout so it doesnt interfere with the 'a' on the rhs unless there is an errorpredicate-typed similar to M but uses the root message of the False predicate case as the failure message"pl @(GuardSimple (Luhn Id)) [1..4]1Error Luhn map=[4,6,2,2] sum=14 ret=4 | [1,2,3,4]3FailT "Luhn map=[4,6,2,2] sum=14 ret=4 | [1,2,3,4]"%pl @(GuardSimple (Luhn Id)) [1,2,3,0]Present [1,2,3,0]PresentT [1,2,3,0]&pl @(GuardSimple (Len > 30)) [1,2,3,0] Error 4 > 30FailT "4 > 30"predicate-typed?'p' is the predicate and on failure of the predicate runs 'prt'$pl @(Guard "expected > 3" (Gt 3)) 17 Present 17 PresentT 17#pl @(Guard "expected > 3" (Gt 3)) 1Error expected > 3FailT "expected > 3"1pl @(Guard (Printf "%d not > 3" Id) (Gt 3)) (-99)Error -99 not > 3FailT "-99 not > 3"predicate-typed leverages . for repeating predicates (passthrough method)dpl @(GuardsN (Printf2 "id=%d must be between 0 and 255, found %d") 4 (Between 0 255)) [121,33,7,256]/Error id=4 must be between 0 and 255, found 2561FailT "id=4 must be between 0 and 255, found 256"cpl @(GuardsN (Printf2 "id=%d must be between 0 and 255, found %d") 4 (Between 0 255)) [121,33,7,44]Present [121,33,7,44]PresentT [121,33,7,44]predicate-typedfif a predicate fails then then the corresponding symbol and value will be passed to the print functionpl @(GuardsDetail "%s invalid: found %d" '[ '("hours", Between 0 23),'("minutes",Between 0 59),'("seconds",Between 0 59)]) [13,59,61]Error seconds invalid: found 61!FailT "seconds invalid: found 61"pl @(GuardsDetail "%s invalid: found %d" '[ '("hours", Between 0 23),'("minutes",Between 0 59),'("seconds",Between 0 59)]) [27,59,12]Error hours invalid: found 27FailT "hours invalid: found 27"pl @(GuardsDetail "%s invalid: found %d" '[ '("hours", Between 0 23),'("minutes",Between 0 59),'("seconds",Between 0 59)]) [23,59,12]Present [23,59,12]PresentT [23,59,12]predicate-typedGuards contain a type level list of tuples the action to run on failure of the predicate and the predicate itself Each tuple validating against the corresponding value in a value listGpl @(Guards '[ '("arg1 failed",Gt 4), '("arg2 failed", Same 4)]) [17,4]Present [17,4]PresentT [17,4]Gpl @(Guards '[ '("arg1 failed",Gt 4), '("arg2 failed", Same 5)]) [17,4]Error arg2 failedFailT "arg2 failed"Hpl @(Guards '[ '("arg1 failed",Gt 99), '("arg2 failed", Same 4)]) [17,4]Error arg1 failedFailT "arg1 failed"apl @(Guards '[ '(Printf2 "arg %d failed with value %d",Gt 4), '(Printf2 "%d %d", Same 4)]) [17,3] Error 2 3 FailT "2 3"Xpl @(GuardsQuick (Printf2 "arg %d failed with value %d") '[Gt 4, Ge 3, Same 4]) [17,3,5]Error arg 3 failed with value 5!FailT "arg 3 failed with value 5"[pl @(GuardsQuick (Printf2 "arg %d failed with value %d") '[Gt 4, Ge 3, Same 4]) [17,3,5,99]/Error Guards: data elements(4) /= predicates(3)1FailT "Guards: data elements(4) /= predicates(3)"predicate-typed similar to &pl @(QuotRem (Fst Id) (Snd Id)) (10,3) Present (3,1)PresentT (3,1)'pl @(QuotRem (Fst Id) (Snd Id)) (10,-3)Present (-3,1)PresentT (-3,1)(pl @(QuotRem (Fst Id) (Snd Id)) (-10,-3)Present (3,-1)PresentT (3,-1)'pl @(QuotRem (Fst Id) (Snd Id)) (-10,3)Present (-3,-1)PresentT (-3,-1)&pl @(QuotRem (Fst Id) (Snd Id)) (10,0)Error QuotRem zero denominator FailT "QuotRem zero denominator"predicate-typed similar to %pl @(DivMod (Fst Id) (Snd Id)) (10,3) Present (3,1)PresentT (3,1)&pl @(DivMod (Fst Id) (Snd Id)) (10,-3)Present (-4,-2)PresentT (-4,-2)&pl @(DivMod (Fst Id) (Snd Id)) (-10,3)Present (-4,2)PresentT (-4,2)'pl @(DivMod (Fst Id) (Snd Id)) (-10,-3)Present (3,-1)PresentT (3,-1)%pl @(DivMod (Fst Id) (Snd Id)) (10,0)Error DivMod zero denominatorFailT "DivMod zero denominator" predicate-typed similar to "pl @(Mod (Fst Id) (Snd Id)) (10,3) Present 1 PresentT 1"pl @(Mod (Fst Id) (Snd Id)) (10,0)Error Mod zero denominatorFailT "Mod zero denominator" predicate-typed similar to "pl @(Div (Fst Id) (Snd Id)) (10,4) Present 2 PresentT 2"pl @(Div (Fst Id) (Snd Id)) (10,0)Error Div zero denominatorFailT "Div zero denominator" predicate-typed similar to !pl @(Map Even Id) [9,-4,12,1,2,3]*Present [False,True,True,False,True,False]+PresentT [False,True,True,False,True,False](pl @(Map '(Even,Odd) Id) [9,-4,12,1,2,3]WPresent [(False,True),(True,False),(True,False),(False,True),(True,False),(False,True)]XPresentT [(False,True),(True,False),(True,False),(False,True),(True,False),(False,True)]predicate-typedcatch a failurePpl @(Catch (Succ Id) (Fst Id >> Second (ShowP Id) >> Printf2 "%s %s" >> 'LT)) GT Present LT PresentT LT@pl @(Catch' (Succ Id) (Second (ShowP Id) >> Printf2 "%s %s")) GT;Error Succ IO e=Prelude.Enum.Ordering.succ: bad argument GT=FailT "Succ IO e=Prelude.Enum.Ordering.succ: bad argument GT"@pl @(Catch' (Succ Id) (Second (ShowP Id) >> Printf2 "%s %s")) LT Present EQ PresentT EQmore flexible: takes a (String,x) and a proxy so we can still call 'False 'True now takes the FailT string and x so you can print more detail if you want need the proxy so we can fail without having to explicitly specify a typepredicate-typed$Fails the computation with a message+pl @(Failt Int (Printf "value=%03d" Id)) 99Error value=099FailT "value=099"<pl @(FailS (Printf2 "value=%03d string=%s")) (99,"somedata")Error value=099 string=somedata!FailT "value=099 string=somedata"predicate-typed similar to (pl @(Break (Ge 3) Id) [10,4,1,7,3,1,3,5]Present ([],[10,4,1,7,3,1,3,5]) PresentT ([],[10,4,1,7,3,1,3,5])(pl @(Break (Lt 3) Id) [10,4,1,7,3,1,3,5]Present ([10,4],[1,7,3,1,3,5])PresentT ([10,4],[1,7,3,1,3,5])predicate-typed similar to ,pl @(Partition (Ge 3) Id) [10,4,1,7,3,1,3,5]Present ([10,4,7,3,3,5],[1,1])PresentT ([10,4,7,3,3,5],[1,1])0pl @(Partition (Prime Id) Id) [10,4,1,7,3,1,3,5]Present ([7,3,3,5],[10,4,1,1])PresentT ([7,3,3,5],[10,4,1,1]).pl @(Partition (Ge 300) Id) [10,4,1,7,3,1,3,5]Present ([],[10,4,1,7,3,1,3,5]) PresentT ([],[10,4,1,7,3,1,3,5])0pl @(Partition (Id < 300) Id) [10,4,1,7,3,1,3,5]Present ([10,4,1,7,3,1,3,5],[]) PresentT ([10,4,1,7,3,1,3,5],[])predicate-typedNcreates a list of overlapping pairs of elements. requires two or more elementspl @Pairs [1,2,3,4]Present [(1,2),(2,3),(3,4)]PresentT [(1,2),(2,3),(3,4)] pl @Pairs []Error Pairs no data foundFailT "Pairs no data found" pl @Pairs [1]"Error Pairs only one element found$FailT "Pairs only one element found"predicate-typedif p then run q else run r>pl @(If (Gt 4) "greater than 4" "less than or equal to 4" ) 10Present "greater than 4"PresentT "greater than 4"<pl @(If (Gt 4) "greater than 4" "less than or equal to 4") 0!Present "less than or equal to 4""PresentT "less than or equal to 4"predicate-typed similar to pl @(Map (Pred Id) Id) [1..5]Present [0,1,2,3,4]PresentT [0,1,2,3,4]$predicate-typed similar to =pl @(Unfoldr (MaybeBool (Not Null) (SplitAt 2 Id)) Id) [1..5]Present [[1,2],[3,4],[5]]PresentT [[1,2],[3,4],[5]]pl @(IterateN 4 (Succ Id)) 4Present [4,5,6,7]PresentT [4,5,6,7])predicate-typed similar to >pl @(Scanl (Snd Id :+ Fst Id) (Fst Id) (Snd Id)) ([99],[1..5])EPresent [[99],[1,99],[2,1,99],[3,2,1,99],[4,3,2,1,99],[5,4,3,2,1,99]]FPresentT [[99],[1,99],[2,1,99],[3,2,1,99],[4,3,2,1,99],[5,4,3,2,1,99]]pl @(ScanN 4 Id (Succ Id)) 'c'Present "cdefg"PresentT "cdefg"pl @(FoldN 4 Id (Succ Id)) 'c' Present 'g' PresentT 'g'-predicate-typed similar to ,. returns a 3-tuple with the results so use    to extractZpl @PartitionThese [This 'a', That 2, This 'c', These 'z' 1, That 4, These 'a' 2, That 99])Present ("ac",[2,4,99],[('z',1),('a',2)])*PresentT ("ac",[2,4,99],[('z',1),('a',2)]).predicate-typed similar to Apl @PartitionEithers [Left 'a',Right 2,Left 'c',Right 4,Right 99]Present ("ac",[2,4,99])PresentT ("ac",[2,4,99])/pl @PartitionEithers [Right 2,Right 4,Right 99]Present ([],[2,4,99])PresentT ([],[2,4,99])(pl @PartitionEithers [Left 'a',Left 'c']Present ("ac",[])PresentT ("ac",[])'pl @PartitionEithers ([] @(Either _ _))Present ([],[])PresentT ([],[])1predicate-typed similar to pl @(EnumFromTo 2 5) ()Present [2,3,4,5]PresentT [2,3,4,5]pl @(EnumFromTo 'LT 'GT) ()Present [LT,EQ,GT]PresentT [LT,EQ,GT]pl @(EnumFromTo 'GT 'LT) () Present [] PresentT []0pl @(EnumFromTo (Pred Id) (Succ Id)) (SG.Max 10)>Present [Max {getMax = 9},Max {getMax = 10},Max {getMax = 11}]?PresentT [Max {getMax = 9},Max {getMax = 10},Max {getMax = 11}]2predicate-typed similar to  using pl @Null [1,2,3,4]FalseFalseT pl @Null []TrueTrueTpl @Null NothingTrueTrueT3predicate-typed similar to  using pl @IsEmpty [1,2,3,4]FalseFalseTpl @IsEmpty []TrueTrueTpl @IsEmpty LTFalseFalseTpl @IsEmpty EQTrueTrueT4predicate-typedpl @Unsnoc [1,2,3,4]Present Just ([1,2,3],4)PresentT (Just ([1,2,3],4)) pl @Unsnoc []Present NothingPresentT Nothingpl @Unsnoc ("xyz" :: T.Text)Present Just ("xy",'z')PresentT (Just ("xy",'z'))5predicate-typedpl @Uncons [1,2,3,4]Present Just (1,[2,3,4])PresentT (Just (1,[2,3,4])) pl @Uncons []Present NothingPresentT Nothingpl @Uncons (Seq.fromList "abc") Present Just ('a',fromList "bc")#PresentT (Just ('a',fromList "bc"))pl @Uncons ("xyz" :: T.Text)Present Just ('x',"yz")PresentT (Just ('x',"yz"))6predicate-typedsimilar to snoc%pl @(Snd Id +: Fst Id) (99,[1,2,3,4])Present [1,2,3,4,99]PresentT [1,2,3,4,99]pl @(Fst Id +: Snd Id) ([],5) Present [5] PresentT [5]pl @(EmptyT [] Id +: 5) 5 Present [5] PresentT [5]7predicate-typedsimilar to cons%pl @(Fst Id :+ Snd Id) (99,[1,2,3,4])Present [99,1,2,3,4]PresentT [99,1,2,3,4]pl @(Snd Id :+ Fst Id) ([],5) Present [5] PresentT [5]$pl @(123 :+ EmptyList _) "somestuff" Present [123]PresentT [123]9predicate-typed pl @(Ors Id) [False,False,False]FalseFalseT#pl @(Ors Id) [True,True,True,False]TrueTrueTpl @(Ors Id) []FalseFalseT;predicate-typed pl @(Ands Id) [True,True,True]TrueTrueT$pl @(Ands Id) [True,True,True,False]FalseFalseTpl @(Ands Id) []TrueTrueT>predicate-typed leveraging &pl @(Id !!! 2) ["abc","D","eF","","G"] Present "eF" PresentT "eF"'pl @(Id !!! 20) ["abc","D","eF","","G"]Error index not foundFailT "index not found"Gpl @(Id !!! "eF") (M.fromList (flip zip [0..] ["abc","D","eF","","G"])) Present 2 PresentT 2)pl @(Lookup Id 2) ["abc","D","eF","","G"]Present Just "eF"PresentT (Just "eF")*pl @(Lookup Id 20) ["abc","D","eF","","G"]Present NothingPresentT Nothing@predicate-typed similar to  leveraging %import qualified Data.Map.Strict as M%pl @(Id !! 2) ["abc","D","eF","","G"] Present "eF" PresentT "eF"&pl @(Id !! 20) ["abc","D","eF","","G"]Error (!!) index not foundFailT "(!!) index not found"Fpl @(Id !! "eF") (M.fromList (flip zip [0..] ["abc","D","eF","","G"])) Present 2 PresentT 2Bpredicate-typed similar to .pl @(Ix 4 "not found") ["abc","D","eF","","G"] Present "G" PresentT "G"/pl @(Ix 40 "not found") ["abc","D","eF","","G"]Present "not found"PresentT "not found"Epredicate-typed similar to 'pl @(Concat Id) ["abc","D","eF","","G"]Present "abcDeFG"PresentT "abcDeFG"3pl @(Concat (Snd Id)) ('x',["abc","D","eF","","G"])Present "abcDeFG"PresentT "abcDeFG"Ipredicate-typedsimilar to a limited form of 'pl @(FoldMap (SG.Sum _) Id) [44, 12, 3] Present 59 PresentT 59+pl @(FoldMap (SG.Product _) Id) [44, 12, 3] Present 1584 PresentT 1584Jpredicate-typed similar to 1pl @(MConcat Id) [SG.Sum 44, SG.Sum 12, SG.Sum 3]Present Sum {getSum = 59}PresentT (Sum {getSum = 59})Kpredicate-typed constructor(pl @(MkThese (Fst Id) (Snd Id)) (44,'x')Present These 44 'x'PresentT (These 44 'x')Mpredicate-typed constructorpl @(MkThat _ Id) 44Present That 44PresentT (That 44)Opredicate-typed constructorpl @(MkThis _ Id) 44Present This 44PresentT (This 44)Qpredicate-typed constructorpl @(MkRight _ Id) 44Present Right 44PresentT (Right 44)Spredicate-typed constructorpl @(MkLeft _ Id) 44Present Left 44PresentT (Left 44)Tpredicate-typed constructorpl @(MkJust Id) 44Present Just 44PresentT (Just 44)Wpredicate-typed similar to pl @(EmptyT Maybe Id) ()Present NothingPresentT Nothingpl @(EmptyT [] Id) () Present [] PresentT []%pl @(EmptyT [] (Char1 "x")) (13,True) Present "" PresentT ""/pl @(EmptyT (Either String) (Fst Id)) (13,True)Present Left ""PresentT (Left "")Zpredicate-typed similar to pl @(MEmptyT (SG.Sum Int)) ()Present Sum {getSum = 0}PresentT (Sum {getSum = 0})Bno Monoid for Maybe a unless a is also a monoid but can use empty![predicate-typed similar to pl @(Pure Maybe Id) 4Present Just 4PresentT (Just 4)pl @(Pure [] Id) 4 Present [4] PresentT [4]-pl @(Pure (Either String) (Fst Id)) (13,True)Present Right 13PresentT (Right 13)\predicate-typed similar to pl @(STimes 4 Id) (SG.Sum 3)Present Sum {getSum = 12}PresentT (Sum {getSum = 12})pl @(STimes 4 Id) "ab"Present "abababab"PresentT "abababab"_predicate-typed similar to  similar to aW but provides a Proxy to the result of 'q' and does not provide the surrounding context8pl @(MaybeIn "foundnothing" (ShowP (Pred Id))) (Just 20) Present "19" PresentT "19"7pl @(MaybeIn "found nothing" (ShowP (Pred Id))) NothingPresent "found nothing"PresentT "found nothing"`predicate-typed similar to !" but additionally provides 'p', '\q'= and 'r' the original input as the first element in the tuplebpl @(TheseX ((Fst (Fst Id) + Snd Id) >> ShowP Id) (ShowP Id) (Snd (Snd Id)) (Snd Id)) (9,This 123) Present "132"PresentT "132"Lpl @(TheseX '(Snd Id,"fromthis") '(Negate 99,Snd Id) (Snd Id) Id) (This 123)Present (123,"fromthis")PresentT (123,"fromthis")Spl @(TheseX '(Snd Id,"fromthis") '(Negate 99,Snd Id) (Snd Id) Id) (That "fromthat")Present (-99,"fromthat")PresentT (-99,"fromthat")Ypl @(TheseX '(Snd Id,"fromthis") '(Negate 99,Snd Id) (Snd Id) Id) (These 123 "fromthese")Present (123,"fromthese")PresentT (123,"fromthese")predicate-typed similar to 6 but additionally gives 'p' and 'q' the original inputNpl @(EitherX (ShowP (Fst (Fst Id) + Snd Id)) (ShowP Id) (Snd Id)) (9,Left 123) Present "132"PresentT "132"Opl @(EitherX (ShowP (Fst (Fst Id) + Snd Id)) (ShowP Id) (Snd Id)) (9,Right 'x')Present "((9,Right 'x'),'x')"PresentT "((9,Right 'x'),'x')"Jpl @(EitherX (ShowP Id) (ShowP (Second (Succ Id))) (Snd Id)) (9,Right 'x')Present "((9,Right 'x'),'y')"PresentT "((9,Right 'x'),'y')"predicate-typed&similar to either (const Nothing) Justpl @RightToMaybe (Right 13)Present Just 13PresentT (Just 13)pl @RightToMaybe (Left 13)Present NothingPresentT Nothingpredicate-typed&similar to either Just (const Nothing)pl @LeftToMaybe (Left 13)Present Just 13PresentT (Just 13)pl @LeftToMaybe (Right 13)Present NothingPresentT Nothingapredicate-typedMaybeX combinatorHpl @(MaybeX (Fst Id) (Fst (Fst Id) +: Snd Id) (Snd Id)) ([1..5],Just 99)Present [1,2,3,4,5,99]PresentT [1,2,3,4,5,99]Hpl @(MaybeX (Fst Id) (Fst (Fst Id) +: Snd Id) (Snd Id)) ([1..5],Nothing)Present [1,2,3,4,5]PresentT [1,2,3,4,5]predicate-typedMaybeXP combinatornpl @((Id &&& Snd Id) >> MaybeXP (Fst (Fst (Fst Id))) (Fst (Fst (Fst Id)) <> Snd Id) (Snd Id)) ("xx",Just "ya")Present "xxya"PresentT "xxya"npl @((Id &&& Fst Id) >> MaybeXP (Snd (Fst (Fst Id))) (Snd (Fst (Fst Id)) <> Snd Id) (Snd Id)) (Just "ya","xx")Present "xxya"PresentT "xxya"lpl @((Id &&& Snd Id) >> MaybeXP (Fst (Fst (Fst Id))) (Fst (Fst (Fst Id)) <> Snd Id) (Snd Id)) ("xx",Nothing) Present "xx" PresentT "xx"predicate-typed takes the head of a list or failsee   for other supported types eg 2pl @(HeadFail "dude" Id) [ "abc","def","asdfadf" ] Present "abc"PresentT "abc"!pl @(HeadFail "empty list" Id) []Error empty listFailT "empty list"predicate-typed;takes the head of a list or defaults to the monoid instancesee   for other supported types eg )pl @(HeadP '[ "abc","def","asdfadf" ]) () Present "abc"PresentT "abc"4pl @(HeadP (Snd Id)) (123,[ "abc","def","asdfadf" ]) Present "abc"PresentT "abc"pl @(HeadP (Snd Id)) (123,[]) Present () PresentT ()predicate-typed/takes the head or default of a list-like objectsee   for other supported types eg pl @(HeadDef 444 Id) [] Present 444 PresentT 444pl @(HeadDef 444 Id) [1..5] Present 1 PresentT 1pl @(HeadDef 444 Id) [1..5] Present 1 PresentT 14pl @(HeadDef (Char1 "w") Id) (Seq.fromList "abcdef") Present 'a' PresentT 'a'&pl @(HeadDef (Char1 "w") Id) Seq.empty Present 'w' PresentT 'w'predicate-typedsimilar to fmap sndpl @Fmap_2 (Just ("asf",13))Present Just 13PresentT (Just 13)predicate-typedsimilar to fmap fstpl @Fmap_1 (Just (13,"Asf"))Present Just 13PresentT (Just 13)to make this work we grab the fst or snd out of the Maybe so it is a head or not/ is a tail or not etc! we still have access to the whole original list so we dont lose anything!predicate-typed function+pl @(Elem (Fst Id) (Snd Id)) ('x',"abcdxy")TrueTrueT+pl @(Elem (Fst Id) (Snd Id)) ('z',"abcdxy")FalseFalseTpredicate-typed<filters a list 'q' keeping or removing those elements in 'p'!pl @(Keep '[5] '[1,5,5,2,5,2]) ()Present [5,5,5]PresentT [5,5,5]'pl @(Keep '[0,1,1,5] '[1,5,5,2,5,2]) ()Present [1,5,5,5]PresentT [1,5,5,5]#pl @(Remove '[5] '[1,5,5,2,5,2]) ()Present [1,2,2]PresentT [1,2,2])pl @(Remove '[0,1,1,5] '[1,5,5,2,5,2]) () Present [2,2]PresentT [2,2]$pl @(Remove '[99] '[1,5,5,2,5,2]) ()Present [1,5,5,2,5,2]PresentT [1,5,5,2,5,2]'pl @(Remove '[99,91] '[1,5,5,2,5,2]) ()Present [1,5,5,2,5,2]PresentT [1,5,5,2,5,2]!pl @(Remove Id '[1,5,5,2,5,2]) []Present [1,5,5,2,5,2]PresentT [1,5,5,2,5,2]Fpl @(Remove '[] '[1,5,5,2,5,2]) 44 -- works if you make this a number!Present [1,5,5,2,5,2]PresentT [1,5,5,2,5,2]predicate-typeda predicate on prime numberspl @(Prime Id) 2TrueTrueT#pl @(Map '(Id,Prime Id) Id) [0..12]Present [(0,False),(1,False),(2,True),(3,True),(4,False),(5,True),(6,False),(7,True),(8,False),(9,False),(10,False),(11,True),(12,False)]PresentT [(0,False),(1,False),(2,True),(3,True),(4,False),(5,True),(6,False),(7,True),(8,False),(9,False),(10,False),(11,True),(12,False)]predicate-typedbounded  functionpl @(ToEnumB Ordering LT) 2 Present GT PresentT GTpl @(ToEnumB Ordering LT) 6 Present LT PresentT LTpl @(ToEnumBF Ordering) 6Error ToEnum bounded failedFailT "ToEnum bounded failed"predicate-typedunsafe  functionpl @(ToEnum Char Id) 120 Present 'x' PresentT 'x'predicate-typed functionpl @(FromEnum Id) 'x' Present 120 PresentT 120predicate-typed unbounded  functionpl @(Pred Id) 13 Present 12 PresentT 12pl @(Pred Id) LT8Error Pred IO e=Prelude.Enum.Ordering.pred: bad argument:FailT "Pred IO e=Prelude.Enum.Ordering.pred: bad argument"predicate-typed unbounded  functionpl @(Succ Id) 13 Present 14 PresentT 14pl @(Succ Id) LT Present EQ PresentT EQpl @(Succ Id) GT8Error Succ IO e=Prelude.Enum.Ordering.succ: bad argument:FailT "Succ IO e=Prelude.Enum.Ordering.succ: bad argument"predicate-typedbounded  functionpl @(PredB' Id) (13 :: Int) Present 12 PresentT 12pl @(PredB' Id) LTError Pred bounded failedFailT "Pred bounded failed"predicate-typedbounded  functionpl @(SuccB' Id) (13 :: Int) Present 14 PresentT 14pl @(SuccB' Id) LT Present EQ PresentT EQpl @(SuccB 'LT Id) GT Present LT PresentT LTpl @(SuccB' Id) GTError Succ bounded failedFailT "Succ bounded failed"predicate-typedunassoc using "pl @Unassoc (These 123 (This 'x'))Present This (These 123 'x')PresentT (This (These 123 'x'))pl @Unassoc (99,('a',True))Present ((99,'a'),True)PresentT ((99,'a'),True)2pl @Unassoc (This 10 :: These Int (These Bool ()))Present This (This 10)PresentT (This (This 10))pl @Unassoc (Right (Right 123))Present Right 123PresentT (Right 123):pl @Unassoc (Left 'x' :: Either Char (Either Bool Double))Present Left (Left 'x')PresentT (Left (Left 'x'))predicate-typed assoc using  pl @Assoc (This (These 123 'x'))Present These 123 (This 'x')PresentT (These 123 (This 'x'))pl @Assoc ((99,'a'),True)Present (99,('a',True))PresentT (99,('a',True))pl @Assoc ((99,'a'),True)Present (99,('a',True))PresentT (99,('a',True))7pl @Assoc (Right "Abc" :: Either (Either () ()) String)Present Right (Right "Abc")PresentT (Right (Right "Abc"))pl @Assoc (Left (Left 'x'))Present Left 'x'PresentT (Left 'x')predicate-typed swaps using  pl @Swap (Left 123)Present Right 123PresentT (Right 123)pl @Swap (Right 123)Present Left 123PresentT (Left 123)pl @Swap (These 'x' 123)Present These 123 'x'PresentT (These 123 'x')pl @Swap (This 'x')Present That 'x'PresentT (That 'x')pl @Swap (That 123)Present This 123PresentT (This 123)pl @Swap (123,'x')Present ('x',123)PresentT ('x',123)pl @Swap (Left "abc")Present Right "abc"PresentT (Right "abc")pl @Swap (Right 123)Present Left 123PresentT (Left 123)predicate-typedreverses using  pl @ReverseL (T.pack "AbcDeF")Present "FeDcbA"PresentT "FeDcbA"!pl @ReverseL ("AbcDeF" :: String)Present "FeDcbA"PresentT "FeDcbA"predicate-typed similar to  pl @Reverse [1,2,4]Present [4,2,1]PresentT [4,2,1]pl @Reverse "AbcDeF"Present "FeDcbA"PresentT "FeDcbA"predicate-typedlift pure over a Functor#pl @(Pure2 (Either String)) [1,2,4]!Present [Right 1,Right 2,Right 4]"PresentT [Right 1,Right 2,Right 4]predicate-typedlift mempty over a FunctorIpl @(MEmptyT2 (SG.Product Int)) [Identity (-13), Identity 4, Identity 99]TPresent [Product {getProduct = 1},Product {getProduct = 1},Product {getProduct = 1}]UPresentT [Product {getProduct = 1},Product {getProduct = 1},Product {getProduct = 1}]predicate-typedsee : coerce over a functorHpl @(Coerce2 (SG.Sum Integer)) [Identity (-13), Identity 4, Identity 99]?Present [Sum {getSum = -13},Sum {getSum = 4},Sum {getSum = 99}]@PresentT [Sum {getSum = -13},Sum {getSum = 4},Sum {getSum = 99}]6pl @(Coerce2 (SG.Sum Integer)) (Just (Identity (-13)))!Present Just (Sum {getSum = -13})$PresentT (Just (Sum {getSum = -13}))4pl @(Coerce2 (SG.Sum Int)) (Nothing @(Identity Int))Present NothingPresentT Nothingpredicate-typed similar to  .pl @(Coerce (SG.Sum Integer)) (Identity (-13))Present Sum {getSum = -13}PresentT (Sum {getSum = -13})predicate-typedwraps a value (see   and  ):m + Data.List.NonEmptypl @(Wrap (SG.Sum _) Id) (-13)Present Sum {getSum = -13}PresentT (Sum {getSum = -13})pl @(Wrap SG.Any (Ge 4)) 13Present Any {getAny = True}PresentT (Any {getAny = True})3pl @(Wrap (NonEmpty _) (Uncons >> 'Just Id)) "abcd"Present 'a' :| "bcd"PresentT ('a' :| "bcd")predicate-typedunwraps a value (see  )pl @(Unwrap Id) (SG.Sum (-13)) Present -13PresentT (-13)predicate-typed similar to pl @(Signum Id) (-14) Present -1 PresentT (-1)pl @(Signum Id) 14 Present 1 PresentT 1pl @(Signum Id) 0 Present 0 PresentT 0predicate-typed similar to pl @(Abs Id) (-14) Present 14 PresentT 14pl @(Abs (Snd Id)) ("xx",14) Present 14 PresentT 14pl @(Abs Id) 0 Present 0 PresentT 0pl @(Abs (Negate 44)) "aaa" Present 44 PresentT 44predicate-typed similar to pl @(Negate Id) 14 Present -14PresentT (-14)%pl @(Negate (Fst Id * Snd Id)) (14,3) Present -42PresentT (-42)pl @(Negate (15 %- 4)) "abc"Present 15 % 4PresentT (15 % 4)pl @(Negate (15 % 3)) ()Present (-5) % 1PresentT ((-5) % 1)%pl @(Negate (Fst Id % Snd Id)) (14,3)Present (-14) % 3PresentT ((-14) % 3)predicate-typed creates a  valuepl @(Id < 21 % 5) (-3.1)TrueTrueTpl @(Id < 21 % 5) 4.5FalseFalseTpl @(Fst Id % Snd Id) (13,2)Present 13 % 2PresentT (13 % 2)pl @(13 % Id) 0Error MkRatio zero denominator FailT "MkRatio zero denominator"pl @(4 % 3 + 5 % 7) "asfd"Present 43 % 21PresentT (43 % 21)pl @(4 %- 7 * 5 %- 3) "asfd"Present 20 % 21PresentT (20 % 21)pl @(Negate (14 % 3)) ()Present (-14) % 3PresentT ((-14) % 3)pl @(14 % 3) ()Present 14 % 3PresentT (14 % 3)6pl @(Negate (14 % 3) ==! FromIntegral _ (Negate 5)) () Present GT PresentT GTpl @(14 -% 3 ==! 5 %- 1) "aa" Present GT PresentT GT)pl @(Negate (14 % 3) ==! Negate 5 % 2) () Present LT PresentT LTpl @(14 -% 3 * 5 -% 1) ()Present 70 % 3PresentT (70 % 3)pl @(14 % 3 ==! 5 % 1) () Present LT PresentT LTpl @(15 % 3 / 4 % 2) () Present 5 % 2PresentT (5 % 2)predicate-typedfractional divisionpl @(Fst Id / Snd Id) (13,2) Present 6.5 PresentT 6.5pl @(ToRational 13 / Id) 0Error (/) zero denominatorFailT "(/) zero denominator"pl @(12 % 7 / 14 % 5 + Id) 12.4Present 3188 % 245PresentT (3188 % 245)predicate-typed(addition, multiplication and subtractionpl @(Fst Id * Snd Id) (13,5) Present 65 PresentT 652pl @(Fst Id + 4 * Length (Snd Id) - 4) (3,"hello") Present 19 PresentT 19predicate-typedsimilar pl @(Pred Id +++ Id) (Left 13)Present Left 12PresentT (Left 12)*pl @(ShowP Id +++ Reverse) (Right "hello")Present Right "olleh"PresentT (Right "olleh")predicate-typedsimilar pl @(Pred Id ||| Id) (Left 13) Present 12 PresentT 12%pl @(ShowP Id ||| Id) (Right "hello")Present "hello"PresentT "hello"predicate-typed similar to %pl @(Pred Id *** ShowP Id) (13, True)Present (12,"True")PresentT (12,"True")predicate-typed similar to predicate-typed similar to  pl @(SplitAt 4 Id) "hello world"Present ("hell","o world")PresentT ("hell","o world")!pl @(SplitAt 20 Id) "hello world"Present ("hello world","")PresentT ("hello world","") pl @(SplitAt 0 Id) "hello world"Present ("","hello world")PresentT ("","hello world")1pl @(SplitAt (Snd Id) (Fst Id)) ("hello world",4)Present ("hell","o world")PresentT ("hell","o world")predicate-typedIsplit a list 'p' into parts using the lengths in the type level list 'ns'*pl @(SplitAts '[2,3,1,1] Id) "hello world"#Present ["he","llo"," ","w","orld"]$PresentT ["he","llo"," ","w","orld"]$pl @(SplitAts '[2] Id) "hello world"Present ["he","llo world"]PresentT ["he","llo world"]+pl @(SplitAts '[10,1,1,5] Id) "hello world" Present ["hello worl","d","",""]!PresentT ["hello worl","d","",""]predicate-typed pad 'q' with '\n' values from '\p'\pl @(PadL 5 999 Id) [12,13]Present [999,999,999,12,13]PresentT [999,999,999,12,13](pl @(PadR 5 (Fst Id) '[12,13]) (999,'x')Present [12,13,999,999,999]PresentT [12,13,999,999,999]+pl @(PadR 2 (Fst Id) '[12,13,14]) (999,'x')Present [12,13,14]PresentT [12,13,14]predicate-typed<create inductive tuples from a type level list of predicates6pl @(TupleI '[Id,ShowP Id,Pred Id,W "str", W 999]) 666,Present (666,("666",(665,("str",(999,())))))-PresentT (666,("666",(665,("str",(999,())))))Dpl @(TupleI '[W 999,W "somestring",W 'True, Id, ShowP (Pred Id)]) 232Present (999,("somestring",(True,(23,("22",())))))3PresentT (999,("somestring",(True,(23,("22",())))))predicate-typed&Convenient method to convert a 'p' or '\q' to a  based on a predicate '\b\'" if 'b' then Right 'p' else Left '\q\'Qpl @(EitherBool (Fst Id > 4) (Snd Id >> Fst Id) (Snd Id >> Snd Id)) (24,(-1,999))Present Right 999PresentT (Right 999)Hpl @(EitherBool (Fst Id > 4) (Fst (Snd Id)) (Snd (Snd Id))) (1,(-1,999))Present Left (-1)PresentT (Left (-1))predicate-typed.Convenient method to convert a value 'p' to a  based on a predicate '\b\' if '\b\' then Just 'p' else Nothingpl @(MaybeBool (Id > 4) Id) 24Present Just 24PresentT (Just 24) pl @(MaybeBool (Id > 4) Id) (-5)Present NothingPresentT Nothingpredicate-typedEprocesses a type level list predicates running each in sequence: see  0pl @(Do [Pred Id, ShowP Id, Id &&& Len]) 9876543Present ("9876542",7)PresentT ("9876542",7)=pl @(Do '[W 123, W "xyz", Len &&& Id, Pred Id *** Id<>Id]) ()Present (2,"xyzxyz")PresentT (2,"xyzxyz")predicate-typedconverts a value to a : the same as  '\'Proxy'pl @MkProxy 'x' Present ProxyPresentT Proxypredicate-typed> function where you need to provide the type 't' of the resultpl @(Floor Int Id) (23 % 5) Present 4 PresentT 4predicate-typed> function where you need to provide the type 't' of the resultpl @(Ceiling Int Id) (23 % 5) Present 5 PresentT 5predicate-typed> function where you need to provide the type 't' of the resultpl @(Truncate Int Id) (23 % 5) Present 4 PresentT 4predicate-typed> function where you need to provide the type 't' of the result#pl @(FromRational Rational Id) 23.5Present 47 % 2PresentT (47 % 2)predicate-typed functionpl @(ToRational Id) 23.5Present 47 % 2PresentT (47 % 2)predicate-typed> function where you need to provide the type 't' of the result#pl @(FromIntegral (SG.Sum _) Id) 23Present Sum {getSum = 23}PresentT (Sum {getSum = 23})predicate-typed > function where you need to provide the type 't' of the result"pl @(FromInteger (SG.Sum _) Id) 23Present Sum {getSum = 23}PresentT (Sum {getSum = 23}) pl @(FromInteger Rational 44) 12Present 44 % 1PresentT (44 % 1) pl @(FromInteger Rational Id) 12Present 12 % 1PresentT (12 % 1)predicate-typed!> function where you need to provide the type 't' of the result'pl @(FromStringP (Identity _) Id) "abc"Present Identity "abc"PresentT (Identity "abc")&pl @(FromStringP (Seq.Seq _) Id) "abc"Present fromList "abc"PresentT (fromList "abc")predicate-typed#similar to 6th element in a n-tuple$pl @(L6 Id) (10,"Abc",'x',True,1,99) Present 99 PresentT 99predicate-typed#similar to 5th element in a n-tuple!pl @(L5 Id) (10,"Abc",'x',True,1) Present 1 PresentT 1predicate-typed#similar to 4th element in a n-tuplepl @(L4 Id) (10,"Abc",'x',True) Present True PresentT True;pl @(L4 (Fst (Snd Id))) ('x',((10,"Abc",'x',999),"aa",1),9) Present 999 PresentT 999predicate-typed#similar to 3rd element in a n-tuplepl @(Thd Id) (10,"Abc",133) Present 133 PresentT 133 pl @(Thd Id) (10,"Abc",133,True) Present 133 PresentT 133predicate-typed similar to "pl @(Snd Id) (10,"Abc") Present "Abc"PresentT "Abc"pl @(Snd Id) (10,"Abc",True) Present "Abc"PresentT "Abc"predicate-typed similar to #pl @(Fst Id) (10,"Abc") Present 10 PresentT 10pl @(Fst Id) (10,"Abc",'x') Present 10 PresentT 10!pl @(Fst Id) (10,"Abc",'x',False) Present 10 PresentT 10predicate-typed similar to $ for  instancespl @(Length Id) (Left "aa") Present 0 PresentT 0pl @(Length Id) (Right "aa") Present 1 PresentT 1'pl @(Length (Right' Id)) (Right "abcd") Present 4 PresentT 4:pl @(Length (Thd (Snd Id))) (True,(23,'x',[10,9,1,3,4,2])) Present 6 PresentT 6predicate-typed similar to $pl @Len [10,4,5,12,3,4] Present 6 PresentT 6 pl @Len [] Present 0 PresentT 0predicate-typed sort a listOpl @(SortOn (Fst Id) Id) [(10,"abc"), (3,"def"), (4,"gg"), (10,"xyz"), (1,"z")]:Present [(1,"z"),(3,"def"),(4,"gg"),(10,"abc"),(10,"xyz")];PresentT [(1,"z"),(3,"def"),(4,"gg"),(10,"abc"),(10,"xyz")]Gpl @(SortBy (OrdP (Snd Id) (Fst Id)) Id) [(10,"ab"),(4,"x"),(20,"bbb")]&Present [(20,"bbb"),(10,"ab"),(4,"x")]'PresentT [(20,"bbb"),(10,"ab"),(4,"x")]!pl @(SortBy 'LT Id) [1,5,2,4,7,0]Present [1,5,2,4,7,0]PresentT [1,5,2,4,7,0]!pl @(SortBy 'GT Id) [1,5,2,4,7,0]Present [0,7,4,2,5,1]PresentT [0,7,4,2,5,1]pl @(SortBy ((Fst (Fst Id) ==! Fst (Snd Id)) <> (Snd (Fst Id) ==! Snd (Snd Id))) Id) [(10,"ab"),(4,"x"),(20,"bbb"),(4,"a"),(4,"y")]6Present [(4,"a"),(4,"x"),(4,"y"),(10,"ab"),(20,"bbb")]7PresentT [(4,"a"),(4,"x"),(4,"y"),(10,"ab"),(20,"bbb")]pl @(SortBy ((Fst (Fst Id) ==! Fst (Snd Id)) <> (Snd (Snd Id) ==! Snd (Fst Id))) Id) [(10,"ab"),(4,"x"),(20,"bbb"),(4,"a"),(4,"y")]6Present [(4,"y"),(4,"x"),(4,"a"),(10,"ab"),(20,"bbb")]7PresentT [(4,"y"),(4,"x"),(4,"a"),(10,"ab"),(20,"bbb")]predicate-typed similar to %pl @Max [10,4,5,12,3,4] Present 12 PresentT 12 pl @Max []Error empty listFailT "empty list"predicate-typed similar to &pl @Min [10,4,5,12,3,4] Present 3 PresentT 3 pl @Min []Error empty listFailT "empty list"predicate-typed similar to 'pl @Sum [10,4,5,12,3,4] Present 38 PresentT 38 pl @Sum [] Present 0 PresentT 0 predicate-typed uses the B of the given type 't' and 'p' which points to the content to readpl @(ReadP Rational) "4 % 5" Present 4 % 5PresentT (4 % 5)_pl @(ReadP' Day Id >> Between (ReadP' Day "2017-04-11") (ReadP' Day "2018-12-30")) "2018-10-12"TrueTrueT_pl @(ReadP' Day Id >> Between (ReadP' Day "2017-04-11") (ReadP' Day "2018-12-30")) "2016-10-12"FalseFalseT predicate-typed uncreate a ( returning year month and day$pl @(UnMkDay Id) (read "2019-12-30")Present (2019,12,30)PresentT (2019,12,30)predicate-typed create a (6 from three int values passed in as year month and daypl @MkDay (2019,12,30)Present Just (2019-12-30,1,1) PresentT (Just (2019-12-30,1,1))7pl @(MkDay' (Fst Id) (Snd Id) (Thd Id)) (2019,99,99999)Present NothingPresentT Nothingpl @MkDay (1999,3,13)Present Just (1999-03-13,10,6)!PresentT (Just (1999-03-13,10,6))predicate-typedUA convenience method to match against many different datetime formats to find a matchpl @(ParseTimes LocalTime '["%Y-%m-%d %H:%M:%S", "%m/%d/%y %H:%M:%S", "%B %d %Y %H:%M:%S", "%Y-%m-%dT%H:%M:%S"] "03/11/19 01:22:33") ()Present 2019-03-11 01:22:33PresentT 2019-03-11 01:22:33pl @(ParseTimes LocalTime (Fst Id) (Snd Id)) (["%Y-%m-%d %H:%M:%S", "%m/%d/%y %H:%M:%S", "%B %d %Y %H:%M:%S", "%Y-%m-%dT%H:%M:%S"], "03/11/19 01:22:33")Present 2019-03-11 01:22:33PresentT 2019-03-11 01:22:33predicate-typed similar to ) where 't' is the *H type, 'p' is the datetime format and 'q' points to the content to parse;pl @(ParseTimeP LocalTime "%F %T" Id) "2019-05-24 05:19:59"Present 2019-05-24 05:19:59PresentT 2019-05-24 05:19:59Mpl @(ParseTimeP LocalTime "%F %T" "2019-05-24 05:19:59") (Right "never used")Present 2019-05-24 05:19:59PresentT 2019-05-24 05:19:594keeping 'q' as we might want to extract from a tuplepredicate-typed@type level expression representing a formatted time similar to + using a type level  to get the formatting stringFpl @(FormatTimeP "%F %T" Id) (read "2019-05-24 05:19:59" :: LocalTime)Present "2019-05-24 05:19:59"PresentT "2019-05-24 05:19:59"Vpl @(FormatTimeP (Fst Id) (Snd Id)) ("the date is %d/%m/%Y", read "2019-05-24" :: Day) Present "the date is 24/05/2019"!PresentT "the date is 24/05/2019"predicate-typed similar to ,pl @(ShowP Id) [4,8,3,9]Present "[4,8,3,9]"PresentT "[4,8,3,9]"pl @(ShowP Id) 'x' Present "'x'"PresentT "'x'"pl @(ShowP (42 %- 10)) 'x'Present "(-21) % 5"PresentT "(-21) % 5"predicate-typedsplit a list into single valuespl @(Ones Id) [4,8,3,9]Present [[4],[8],[3],[9]]PresentT [[4],[8],[3],[9]]pl @(Ones Id) [] Present [] PresentT []predicate-typed similar to -pl @Tails [4,8,3,9](Present [[4,8,3,9],[8,3,9],[3,9],[9],[]])PresentT [[4,8,3,9],[8,3,9],[3,9],[9],[]] pl @Tails [] Present [[]] PresentT [[]]predicate-typed similar to .pl @Inits [4,8,3,9](Present [[],[4],[4,8],[4,8,3],[4,8,3,9]])PresentT [[],[4],[4,8],[4,8,3],[4,8,3,9]] pl @Inits [] Present [[]] PresentT [[]]predicate-typedconverts a string #$ value to upper casepl @ToUpper "HeLlO wOrld!"Present "HELLO WORLD!"PresentT "HELLO WORLD!"predicate-typedconverts a string #$ value to lower casepl @ToLower "HeLlO wOrld!"Present "hello world!"PresentT "hello world!"!predicate-typed]predicate for determining if the string is all digits >>> pl @IsNumber "213G" False FalseTpl @IsNumber "929"TrueTrueT#predicate-typedbpredicate for determining if a string is all lowercase >>> pl @IsLower "abcdef213" False FalseTpl @IsLower "abcdef"TrueTrueTpl @IsLower ""TrueTrueTpl @IsLower "abcdefG"FalseFalseT/predicate-typed(a predicate for determining if a string %$# belongs to the given character setpl @IsLower "abc"TrueTrueTpl @IsLower "abcX"FalseFalseTpl @IsLower (T.pack "abcX")FalseFalseTpl @IsHexDigit "01efA"TrueTrueTpl @IsHexDigit "01egfA"FalseFalseT/predicate-typedMA replacement function ([String] -> String) which yields the groups Used by  and  Requires Text.Show.Functions:m + Text.Show.Functionspl @(ReplaceAll "^(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)$" (MakeRR3 (Fst Id)) (Snd Id)) (\ys -> intercalate " | " $ map (show . succ . read @Int) ys, "141.201.1.22")Present "142 | 202 | 2 | 23"PresentT "142 | 202 | 2 | 23"0predicate-typedOA replacement function (String -> String) that yields the whole match Used by  and  Requires Text.Show.Functions:m + Text.Show.FunctionsXpl @(ReplaceAll "\\." (MakeRR2 (Fst Id)) (Snd Id)) (\x -> x <> ":" <> x, "141.201.1.22")Present "141.:.201.:.1.:.22"PresentT "141.:.201.:.1.:.22"1predicate-typedlA replacement function (String -> [String] -> String) which returns the whole match and the groups Used by  and  Requires Text.Show.Functions2predicate-typedSimple replacement string: see 5 and 30predicate-typed6replaces regex 's' with a string 's1' inside the value2pl @(ReplaceAllString "\\." ":" Id) "141.201.1.22"Present "141:201:1:22"PresentT "141:201:1:22"<predicate-typed$splits a string on a regex delimiter%pl @(Resplit "\\." Id) "141.201.1.22"Present ["141","201","1","22"]PresentT ["141","201","1","22"]<pl @(Resplit (Singleton (Fst Id)) (Snd Id)) (':', "12:13:1")Present ["12","13","1"]PresentT ["12","13","1"]>predicate-typed similar to ?B but gives the column start and ending positions instead of values?pl @(RescanRanges "^(\\d{2}):(\\d{2}):(\\d{2})$" Id) "13:05:25"%Present [((0,8),[(0,2),(3,5),(6,8)])]&PresentT [((0,8),[(0,2),(3,5),(6,8)])]@predicate-typedLruns a regex matcher returning the original values and optionally any groups9pl @(Rescan "^(\\d{2}):(\\d{2}):(\\d{2})$" Id) "13:05:25"'Present [("13:05:25",["13","05","25"])](PresentT [("13:05:25",["13","05","25"])]Epl @(Rescan (Snd Id) "13:05:25") ('a',"^(\\d{2}):(\\d{2}):(\\d{2})$")'Present [("13:05:25",["13","05","25"])](PresentT [("13:05:25",["13","05","25"])]Bpredicate-typedrepresents a predicate using a $ as a regular expression evaluates A% and returns True if there is a match/pl @(Re "^\\d{2}:\\d{2}:\\d{2}$" Id) "13:05:25"TrueTrueTCpredicate-typed1 equivalentpl @Unzip (zip [1..5] "abcd")Present ([1,2,3,4],"abcd")PresentT ([1,2,3,4],"abcd")Dpredicate-typed similar to 2pl @(Any Even Id) [1,5,11,5,3]FalseFalseTpl @(Any Even Id) [1,5,112,5,3]TrueTrueTpl @(Any Even Id) []FalseFalseTEpredicate-typed similar to 3pl @(All Even Id) [1,5,11,5,3]FalseFalseTpl @(All Odd Id) [1,5,11,5,3]TrueTrueTpl @(All Odd Id) []TrueTrueTJpredicate-typed:a type level predicate for all negative elements in a listKpredicate-typed:a type level predicate for all positive elements in a listpl @AllPositive [1,5,10,2,3]TrueTrueTpl @AllPositive [0,1,5,10,2,3]FalseFalseTpl @AllPositive [3,1,-5,10,2,3]FalseFalseT!pl @AllNegative [-1,-5,-10,-2,-3]TrueTrueTLpredicate-typedThis is the same as N but where 'r' is Npredicate-typed?A predicate that determines if the value is between 'p' and 'q'&pl @(Between' 5 8 Len) [1,2,3,4,5,5,7]TrueTrueTpl @(Between 5 8) 6TrueTrueTpl @(Between 5 8) 9FalseFalseTpl @(10 % 4 <..> 40 % 5) 4TrueTrueTpl @(10 % 4 <..> 40 % 5) 33FalseFalseTOpredicate-typed5a type level predicate for a strictly decreasing listPpredicate-typed6a type level predicate for a monotonic decreasing listQpredicate-typed5a type level predicate for a strictly increasing listRpredicate-typed6a type level predicate for a monotonic increasing listpl @Asc "aaacdef"TrueTrueTpl @Asc [1,2,3,4,5,5,7]TrueTrueTpl @Asc' [1,2,3,4,5,5,7]FalseFalseTpl @Asc "axacdef"FalseFalseT6a type level predicate for a monotonic increasing listpredicate-typedBActs as a proxy in this dsl where you can explicitly set the Type.OIt is passed around as an argument to help the type checker when needed. see  , ,       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQR;9RQPONMLEDKGIJFHAB?@=>;<9:785634210/$%&'()*+,-.#"!       CD   1E32UVT^]0/ysrqa_.RSPQxwponmlkJ\:8GFHYZXBA@?>=<|{~z}7654-,+*vuNOLMKjihgfedcbt`)('&%$#"!  C[IW*1034446441231111657588874444444444447662233M4None,-.=>?HSUVXkr _predicate-typed;take any valid Read/Show instance and turn it into a valid c:m + Data.Ratio*prtEval3P (readshow @Rational) ol "13 % 3"2Right (Refined3 {r3In = 13 % 3, r3Out = "13 % 3"})+prtEval3P (readshow @Rational) ol "13x % 3"QLeft Step 1. Initial Conversion(ip) Failed | ReadP Ratio Integer (13x % 3) failedFprtEval3P (readshow' @Rational @(Between (3 % 1) (5 % 1))) ol "13 % 3"2Right (Refined3 {r3In = 13 % 3, r3Out = "13 % 3"})QprtEval3P (Proxy @(ReadShow' Rational (Between (11 %- 2) (3 %- 1)))) ol "-13 % 3"8Right (Refined3 {r3In = (-13) % 3, r3Out = "(-13) % 3"})CprtEval3P (Proxy @(ReadShow' Rational (Id > (15 % 1)))) ol "13 % 3"-Left Step 2. False Boolean Check(op) | FalsePprtEval3P (Proxy @(ReadShow' Rational (Guard (Printf "invalid=%3.2f" (FromRational Double Id)) (Id > (15 % 1)) >> 'True))) ol "13 % 3"4Left Step 2. Failed Boolean Check(op) | invalid=4.33CprtEval3P (Proxy @(ReadShow' Rational (Id > (11 % 1)))) ol "13 % 3"-Left Step 2. False Boolean Check(op) | FalseP0let tmString = "2018-10-19 14:53:11.5121359 UTC"!let tm = read tmString :: UTCTime)prtEval3P (readshow @UTCTime) ol tmStringdRight (Refined3 {r3In = 2018-10-19 14:53:11.5121359 UTC, r3Out = "2018-10-19 14:53:11.5121359 UTC"}):m + Data.Aeson6prtEval3P (readshow @Value) ol "String \"jsonstring\""NRight (Refined3 {r3In = String "jsonstring", r3Out = "String \"jsonstring\""})-prtEval3P (readshow @Value) ol "Number 123.4">Right (Refined3 {r3In = Number 123.4, r3Out = "Number 123.4"})apredicate-typedSconvert a string from a given base 'i' and store it internally as a base 'j' string(prtEval3P (Proxy @(BaseIJ 16 2)) ol "fe"2Right (Refined3 {r3In = "11111110", r3Out = "fe"}))prtEval3P (Proxy @(BaseIJ 16 2)) ol "fge"<Left Step 1. Initial Conversion(ip) Failed | invalid base 16YprtEval3P (Proxy @(BaseIJ' 16 2 (GuardSimple (ReadBase Int 2 < 1000) >> 'True))) ol "ffe"3Left Step 2. Failed Boolean Check(op) | 4094 < 1000cpredicate-typed noop falseepredicate-typed noop truefpredicate-typed Luhn check&prtEval3P (Proxy @(LuhnT 4)) ol "1230"3Right (Refined3 {r3In = [1,2,3,0], r3Out = "1230"})&prtEval3P (Proxy @(LuhnT 4)) ol "1234"SLeft Step 2. Failed Boolean Check(op) | Luhn map=[4,6,2,2] sum=14 ret=4 | [1,2,3,4] uses builtin kpredicate-typedTconvert a string from a given base 'i' and store it internally as an base 10 integerprtEval3P base16 ol "00fe"+Right (Refined3 {r3In = 254, r3Out = "fe"})3prtEval3P (basen' @16 @(Between 100 400)) ol "00fe"+Right (Refined3 {r3In = 254, r3Out = "fe"})CprtEval3P (basen' @16 @(GuardSimple (Id < 400) >> 'True)) ol "f0fe"3Left Step 2. Failed Boolean Check(op) | 61694 < 400spredicate-typed'read in an ipv4 address and validate itprtEval3P ip ol "001.223.14.1"ARight (Refined3 {r3In = [1,223,14,1], r3Out = "001.223.014.001"}) prtEval3P ip ol "001.223.14.999"SLeft Step 2. Failed Boolean Check(op) | guard(4) octet out of range 0-255 found 999"prtEval3P ip ol "001.223.14.999.1"=Left Step 1. Initial Conversion(ip) Failed | Regex no resultsprtEval3P ip ol "001.257.14.1"SLeft Step 2. Failed Boolean Check(op) | guard(2) octet out of range 0-255 found 257xpredicate-typedread in an ssnprtEval3P ssn ol "134-01-2211"=Right (Refined3 {r3In = [134,1,2211], r3Out = "134-01-2211"})prtEval3P ssn ol "666-01-2211"MLeft Step 2. Failed Boolean Check(op) | number for group 1 invalid: found 666prtEval3P ssn ol "666-01-2211"MLeft Step 2. Failed Boolean Check(op) | number for group 1 invalid: found 666prtEval3P ssn ol "667-00-2211"KLeft Step 2. Failed Boolean Check(op) | number for group 2 invalid: found 0prtEval3P ssn ol "666-01-2211"MLeft Step 2. Failed Boolean Check(op) | number for group 1 invalid: found 666prtEval3P ssn ol "991-22-9999"MLeft Step 2. Failed Boolean Check(op) | number for group 1 invalid: found 9914predicate-typedcredit card with luhn algorithm!prtEval3P cc11 ol "1234-5678-901"-Left Step 2. False Boolean Check(op) | FalseP!prtEval3P cc11 ol "1234-5678-903"JRight (Refined3 {r3In = [1,2,3,4,5,6,7,8,9,0,3], r3Out = "1234-5678-903"})#pl @(Ccip >> Ccop 11) "79927398713"TrueTrueT#pl @(Ccip >> Ccop 10) "79927398713"%Error expected 10 digits but found 11'FailT "expected 10 digits but found 11"~predicate-typedread in a valid datetime9prtEval3P (datetime1 @LocalTime) ol "2018-09-14 02:57:04"LRight (Refined3 {r3In = 2018-09-14 02:57:04, r3Out = "2018-09-14 02:57:04"})9prtEval3P (datetime1 @LocalTime) ol "2018-09-14 99:98:97"?Left Step 2. Failed Boolean Check(op) | hours invalid: found 999prtEval3P (datetime1 @LocalTime) ol "2018-09-14 23:01:97"ALeft Step 2. Failed Boolean Check(op) | seconds invalid: found 97?prtEval3P (Proxy @(DateTime1 UTCTime)) ol "2018-09-14 99:98:97"PRight (Refined3 {r3In = 2018-09-18 04:39:37 UTC, r3Out = "2018-09-18 04:39:37"})predicate-typedread in a time and validate itprtEval3P hms ol "23:13:59"8Right (Refined3 {r3In = [23,13,59], r3Out = "23:13:59"})prtEval3P hms ol "23:13:60"ALeft Step 2. Failed Boolean Check(op) | seconds invalid: found 60prtEval3P hms ol "26:13:59"?Left Step 2. Failed Boolean Check(op) | hours invalid: found 26predicate-typed8ensures that two numbers are in a given range (emulates )!prtEval3P (between @10 @16) ol 14(Right (Refined3 {r3In = 14, r3Out = 14})!prtEval3P (between @10 @16) ol 17-Left Step 2. False Boolean Check(op) | FalseP!prtEval3P (between @10 @16) o0 17-Left Step 2. False Boolean Check(op) | FalseP3*** Step 1. Success Initial Conversion(ip) [17] ***P Id 17'*** Step 2. False Boolean Check(op) ***False True && False|+- True 17 >= 10| | | +- P I| | | `- P '10|`- False 17 <= 16 | +- P I | `- P '160\]^_`abcdefghijklmnopqrstuvwxyz{|}~0~ywrvutonml|}{zgfxsqpkja`_^]\hiedcb Nones}   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRXSTUVWYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRNone &'->HXk%predicate-typed creates a " refinement type with terse output r>$$(refinedTH 123) :: Refined (Between 100 125) Int Refined {unRefined = 123} it :: Refined (Between 100 125) Int 4>$$(refinedTH 99) :: Refined (Between 100 125) Int  interactive&:8:4: error: * refinedTH: predicate failed with FalseP * In the Template Haskell splice $$(refinedTH 99) In the expression: $$(refinedTH 99) :: Refined (Between 100 125) Int In an equation for 'it': it = $$(refinedTH 99) :: Refined (Between 100 125) Int predicate-typed creates a  refinement type*allows you to specify display options (eg z for unicode / w for ansi) v>$$(refinedTH' o2 123) :: Refined (Between 100 125) Int Refined {unRefined = 123} it :: Refined (Between 100 125) Int H>$$(refinedTH' o2 99) :: Refined (FailS "asdf" >> Between 100 125) Int  interactive=:116:4: error: * [Error asdf] lhs failed >> | `- [Error asdf] Fail asdf | `- P 'asdf refinedTH: predicate failed with FailP "asdf" * In the Template Haskell splice $$(refinedTH' o0 99) In the expression: $$(refinedTH' o2 99) :: Refined (FailS "asdf" >> Between 100 125) Int predicate-typed creates a &&" refinement type with terse output _>$$(refined3TH 100) :: Refined3 Id (Between 100 125) Id Int Refined3 {r3In = 100, r3Out = 100} predicate-typed creates a && refinement type*allows you to specify display options (eg z for unicode / w for ansi) c>$$(refined3TH' o2 100) :: Refined3 Id (Between 100 125) Id Int Refined3 {r3In = 100, r3Out = 100} @>$$(refined3TH' o2 99) :: Refined3 Id (Between 100 125) Id Int  interactiveP:127:4: error: * *** Step 1. Success Initial Conversion(ip) [99] *** P Id 99 *** Step 2. False Boolean Check(op) *** False False && True | +- False 99 >= 100 | | | +- P I | | | `- P '100 | `- True 99 <= 125 | +- P I | `- P '125 refined3TH: predicate failed with Step 2. False Boolean Check(op) | FalseP * In the Template Haskell splice $$(refined3TH' o2 99) In the expression: $$(refined3TH' o2 99) :: Refined3 Id (Between 100 125) Id Int In an equation for 'it': it = $$(refined3TH' o2 99) :: Refined3 Id (Between 100 125) Id Int 5'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^__`abcdefghijklmnopqrstuvwwxyz{|}~~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnoppqrstuvwxyz{|}~&      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~        !!!!         ! !"#$]%&'()*+,-./0123456789:;<=>?@A?@B?CDEFGHIJKLMLNLO PQRST*U V W X Y Z [L\]^_`_abcdefghfijfikflmnopqr stuvw.predicate-typed-0.2.0.0-8il5ggQ5CII7dojyosNoThPredicate.TH_OrphansPredicate.UtilPredicate.CorePredicate.RefinedPredicate.Refined3Predicate.PreludePredicate.Refined3HelperPredicate.Util_THPaths_predicate_typed Predicate ReplaceImplDoMain>> Control.Arrow&&&GHC.BaseStringRefinedT stripLeft stripRightstrip stripStartstripEnd Control.Monadjoin Data.Alignalign Data.Listorsands Data.ThesemergeTheseWithData.Text.LensIsText Data.TextRefined3 $fLiftUTCTime $fLiftFixed$fLiftTimeOfDay$fLiftLocalTime $fLiftDay$fLiftDiffTime MonadEvalrunIOcatchit catchitNFliftEvalConsTMapTSumTIfTFlipT%&%% TupleLenT ReverseTupleC ReverseTupleP reverseTupleC TupleListD tupleListD TupleListTLenT IntersperseTRepeatTGetOrdgetOrd OrderingPCgtCgeCeqCleCltCneToNGetBoolgetBool GetOrdering getOrderingGetThesegetTheseGetLengetLenPGetSymbsgetSymbsGetNatsgetNatsNotTOrTAndTFailIfTNullTBetweenTRRRR1RR2RR3GetROptsgetROptsROptAnchored Auto_calloutCaselessDollar_endonlyDotallDupnamesExtendedExtra Firstline Multiline Newline_cr Newline_crlf Newline_lfNo_auto_captureUngreedyUtf8 No_utf8_checkPOptsoWidthoDebugoDispoHideoColoroLitePEBoolPBoolTFailTFalseTTrueTPresentTTT_tBool _tStrings_tForesttBooltStringstForestboolT2PmkNodemkNodeB mkNodeSkipPgetValLRFromTTgetValLRfromTThh getValueLRgetValueLRHidedefOptsololco0o2o2no3ouounsetwsetdsetusetccolor0color1color2color3color4fixBoolTshow01lit01show01'lit01'showLit0showLit1show0show3show1 compileRegex splitAndAlign_FailT _PresentT_FalseT_TrueTimply evalBinStrictnatsymbgetLen showThesecolorMeprtTTIOprtTTprtTreeprtImplfixLite prtTreePureliteunicodenormalprettyRationalfixit prefixMsgshowT prettyOrd removeAnsi$fFoldableBoolT $fFoldableTT $fShowPOpts $fGetROpts[]$fGetROptNo_utf8_check $fGetROptUtf8$fGetROptUngreedy$fGetROptNo_auto_capture$fGetROptNewline_lf$fGetROptNewline_crlf$fGetROptNewline_cr$fGetROptMultiline$fGetROptFirstline$fGetROptExtra$fGetROptExtended$fGetROptDupnames$fGetROptDotall$fGetROptDollar_endonly$fGetROptCaseless$fGetROptAuto_callout$fGetROptAnchored $fGetROpts:$fShowRR $fGetNats[]: $fGetNats[][] $fGetSymbs[]:$fGetSymbs[][] $fGetLenk: $fGetLenk[]$fGetThesexyThese$fGetThesexyThat$fGetThesexyThis$fGetOrderingGT$fGetOrderingEQ$fGetOrderingLT$fGetBoolFalse $fGetBoolTrue $fGetOrdCne $fGetOrdClt $fGetOrdCle $fGetOrdCeq $fGetOrdCge $fGetOrdCgt$fTupleListDSa$fTupleListDZa$fReverseTupleC(,)$fReverseTupleC(,)0$fReverseTupleC(,)1$fReverseTupleC(,)2$fReverseTupleC(,)3$fReverseTupleC(,)4$fReverseTupleC(,)5$fReverseTupleC(,)6$fReverseTupleC(,)7$fReverseTupleC(,)8$fReverseTupleC(,)9$fReverseTupleC(,)10$fReverseTupleC() $fMonadEvalIO$fMonadEvalIdentity $fShowBoolP $fEqBoolP$fShowPE$fShowTT $fShowDisp$fEqDisp $fShowROpt$fEqROpt $fOrdROpt $fEnumROpt $fBoundedROpt$fShowOrderingP $fEqOrderingP$fEnumOrderingP$fBoundedOrderingP $fEqBoolT $fShowBoolTMsgWIdTIdIPPPevalevalBool evalQuickpepe2pe2npe3plplcpupunrunPQ$fPProxyProxya$fPTheseTheseThese$fPTheseThatThese$fPTheseThisThese$fPEitherRightEither$fPEitherLeftEither$fPMaybeNothingMaybe$fPMaybeJustMaybe$fP[]:a$fP[]:a0$fP[][]a$fP()()a$fPNatna$fPOrderingcmpa$fP(,,,)(,,,)a $fP(,,)(,,)a $fP(,)(,)a $fPSymbolsa $fPBoolba $fPTYPEProxya $fPTYPE()a $fPTYPEIa $fPTYPEIda $fPTYPEIdTa $fPTYPEMsga $fPTYPEWaRefinedT unRefinedTRefinedC unRefined arbRefinedrapplyrapply0rapply1convertRefinedT withRefinedTwithRefinedTIO prtRefinedIO newRefined newRefinedT newRefinedTIOunRavelT unRavelTIO unRavelTI prtRefinedTIO prtRefinedT unsafeRefinedunsafeRefined'$fToJSONRefined$fBinaryRefined$fFromJSONRefined $fReadRefined$fMonadError[]RefinedT $fShowRefined $fEqRefined$fGenericRefined $fLiftRefined$fFunctorRefinedT$fApplicativeRefinedT$fMonadRefinedT$fMonadContRefinedT$fMonadWriterRefinedT$fShowRefinedT$fMonadIORefinedT$fMonadTransRefinedTRefinedEmulateMsg3m3Descm3Shortm3LongRResultsRFRTFRTFalseRTTrueFRTTrueTResultsXFXTFXTFalseXTTrueFXTTrueT MkProxy3TMakeR3 Refined3Cr3Inr3OutunsafeRefined3'unsafeRefined3 arbRefined3arbRefined3WithmkProxy3 mkProxy3' mkProxy3P mkProxy3P'withRefined3TIO withRefined3TwithRefined3TP newRefined3T newRefined3TPnewRefined3TPIOconvertRefined3TPrapply3rapply3P prtEval3PIOprtEval3 prtEval3Peval3Peval3eval3Mprt3IOprt3prt3Impleval3PXeval3X$fToJSONRefined3$fBinaryRefined3$fFromJSONRefined3$fReadRefined3 $fShowMsg3 $fShowResults $fEqResults$fShowRResults$fEqMsg3$fLiftRefined3 $fEqRefined3$fShowRefined3DoNRepeat StripLeft StripRightStripLRTrimEnd TrimStartTrim&$Join DuplicateExtract<|>*><*<$Printf3'Printf3Printf2 PrintfntLaxPrintfntPrintfn ReverseTupleNSapaSapa'<> IsSuffixIIsInfixI IsPrefixIIsSuffixIsInfixIsPrefixStdinStderrStdout WriteFile WriteFile' AppendFileTimeZtTimeUtc ReadEnvAllReadEnv DirExistsReadDir FileExistsReadFileHHideTraverseSequenceCase''Case'CaseParaNLaxParaNToParaParaLaxParaToGuardsGuards'Printf IntercalateShowBase ShowBase' ReadBaseIntReadBase ReadBase'LuhnZipTruncZipRZipLZipTheseChar1 Singleton EmptyList EmptyList'TheseIdTheseInIsTheseIsThatIsThis FromListExtFromList ToListExtToList'ToListIToListIToList'CmpICmp===~OrdIOrdAOrdA'==!OrdPNot~>||&&<<>||>Skip GuardSimple ExitWhen'ExitWhenGuard'Guard GuardsNLaxGuardsN GuardsDetailGuardsQuickLax GuardsQuick GuardsLaxGuardsOnePRemQuotQuotRemDivModModDivOddEvenCatch'CatchUnproxyHoleFailPrt2FailPrtFailSFailtFailpFailSpanBreakFilterBy PartitionPairsIf ConcatMapMap IterateNUntil IterateNWhile IterateWhile IterateUntilIterateNUnfoldrFoldlFoldNScanNAScanNScanlThesesThatsThissPartitionThesePartitionEithers CatMaybesMapMaybe EnumFromToNullIsEmptyUnsnocUncons+::+Ors'OrsAnds'AndsLookup'!!!Lookup!!IxLIx'IxProxyTProxyT'ConcatMax'Min'Sum'FoldMapMConcatMkTheseMkThatMkThat'MkThisMkThis'MkRightMkRight'MkLeftMkLeft'MkJust MkNothing MkNothing'EmptyTMEmptyPMEmptyTMEmptyT'PureSTimesIsJust IsNothingMaybeInTheseXMaybeX TheseFailThesePTheseDefThatFailThatPThatDefThisFailThisPThisDef RightFailRightPRightDefLeftFailLeftPLeftDefJustFailJustPJustDefTheseIn'That'This'Right'Left'Just' LookupFailLookupP LookupDef LookupFail'LookupP' LookupDef' JustDef''' JustDef''JustDef'InitFailInitPInitDefLastFailLastPLastDefTailFailTailPTailDefHeadFailHeadPHeadDefFmap_2Fmap_1Init'Last'Tail'Head'ElemKeepRemovePrimeToEnumBFToEnumBToEnumB'ToEnumToEnum'FromEnumPredSuccPredB'PredBSuccB'SuccBUnassocAssocSwapReverseLReverse MkLeftAlt MkRightAltPure2MEmptyT2 MEmptyT2'Coerce2CoerceWrapWrap'UnwrapSignumAbsNegate-%%-%/<~<=~/=~==~>=~>~NeLtLeSameGeGt<<=/===>=>*-+Dup+++IsRightIsLeftEitherIn|||SecondFirst***LastInitHeadTailDropTakeSplitAtSplitAtsPadRPadLTupleI EitherBool MaybeBoolMkProxyFloorFloor'CeilingCeiling'Truncate Truncate' FromRational FromRational' ToRational FromIntegral FromIntegral' FromInteger FromInteger' FromStringP FromStringP'L6L5L4L3ThdL2SndL1FstLengthLen SortOnDescSortOnSortByMaxMinSumReadP'ReadPReadP''UnMkDayMkDayMkDay' ParseTimes ParseTimes' ParseTimeP ParseTimeP' FormatTimePShowPOnesTailsInitsToUpperToLowerIsLatin1 IsSeparator IsOctDigit IsHexDigit IsControl IsPunctuationIsSpaceIsNumberIsUpperIsLowerCharSetCLowerCUpperCNumberCSpace CPunctuationCControl CHexDigit COctDigit CSeparatorCLatin1MakeRR3MakeRR2MakeRR1MakeRRReplaceOneStringReplaceOneString'ReplaceAllStringReplaceAllString' ReplaceOne ReplaceOne' ReplaceAll ReplaceAll'ResplitResplit' RescanRanges RescanRanges'RescanRescan'ReRe'UnzipAnyAll AllNegative' AllPositive'NegativePositive AllNegative AllPositiveBetween'<..>BetweenDesc'DescAsc'Asc $fPTYPERe'x$fPTYPERescan'x$fPTYPERescanRanges'x$fPTYPEResplit'x$fPTYPEReplaceImplx$fPTYPEMakeRRx$fPTYPEMakeRR1x$fPTYPEMakeRR2x$fPTYPEMakeRR3x$fPTYPEIsCharSeta$fGetCharSetCLatin1$fGetCharSetCSeparator$fGetCharSetCOctDigit$fGetCharSetCHexDigit$fGetCharSetCControl$fGetCharSetCPunctuation$fGetCharSetCNumber$fGetCharSetCUpper$fGetCharSetCLower$fPTYPEToLowera$fPTYPEToUppera$fPTYPEInits[]$fPTYPETails[] $fPTYPEOnesx $fPTYPEShowPx$fPTYPEFormatTimePx$fPTYPEParseTimeP'a$fPTYPEParseTimes'a$fPTYPEMkDay'x$fPTYPEUnMkDayx$fPTYPEReadP''x $fPTYPESum[] $fPTYPEMin[] $fPTYPEMax[] $fPTYPELenas$fPTYPELengthx$fExtractL1C(,,,,,)$fExtractL1C(,,,,)$fExtractL1C(,,,)$fExtractL1C(,,)$fExtractL1C(,) $fPTYPEFstx$fExtractL2C(,,,,,)$fExtractL2C(,,,,)$fExtractL2C(,,,)$fExtractL2C(,,)$fExtractL2C(,) $fPTYPESndx$fExtractL3C(,,,,,)$fExtractL3C(,,,,)$fExtractL3C(,,,)$fExtractL3C(,,)$fExtractL3C(,) $fPTYPEThdx$fExtractL4C(,,,,,)$fExtractL4C(,,,,)$fExtractL4C(,,,)$fExtractL4C(,,)$fExtractL4C(,) $fPTYPEL4x$fExtractL5C(,,,,,)$fExtractL5C(,,,,)$fExtractL5C(,,,)$fExtractL5C(,,)$fExtractL5C(,) $fPTYPEL5x$fExtractL6C(,,,,,)$fExtractL6C(,,,,)$fExtractL6C(,,,)$fExtractL6C(,,)$fExtractL6C(,) $fPTYPEL6x$fPTYPEFromStringP'a$fPTYPEFromInteger'a$fPTYPEFromIntegral'a$fPTYPEToRationalx$fPTYPEFromRational'a$fPTYPETruncate'x$fPTYPECeiling'x$fPTYPEFloor'x$fPTYPEMkProxya$fPTYPEMaybeBoola$fPTYPEEitherBoola$fPTYPETupleIa$fPTYPETupleIa0 $fPTYPEPada$fPTYPESplitAtsx$fPTYPESplitAta $fPTYPE***(,)$fPTYPE|||Either$fPTYPE+++Either$fGetBinOpBAdd$fGetBinOpBSub$fGetBinOpBMult $fPTYPEBina $fPTYPE/a $fPTYPE%x$fPTYPENegatex $fPTYPEAbsx$fPTYPESignumx$fPTYPEUnwrapx $fPTYPEWrap'x$fPTYPECoercea$fPTYPECoerce2f$fPTYPEMEmptyT2'f $fPTYPEPure2f$fPTYPEReverseas$fPTYPEReverseLt $fPTYPESwapp $fPTYPEAssocp$fPTYPEUnassocp $fPTYPESuccBx $fPTYPEPredBx $fPTYPESuccx $fPTYPEPredx$fPTYPEFromEnumx$fPTYPEToEnum'x$fPTYPEToEnumB'a $fPTYPEPrimex$fPTYPEKeepImplx $fPTYPEElema$fPTYPEFmap_1f$fPTYPEFmap_2f$fPTYPEMaybeXPx$fPTYPELeftToMaybeEither$fPTYPERightToMaybeEither$fPTYPEThisToMaybeThese$fPTYPEThatToMaybeThese$fPTYPETheseToMaybeThese$fPTYPEEitherXx$fPTYPETheseXx$fPTYPEMaybeInMaybe$fPTYPESTimesa $fPTYPEPurex$fPTYPEMEmptyT'a$fPTYPEEmptyTx$fPTYPEMkNothing'a$fPTYPEMkJustx$fPTYPEMkLeft'x$fPTYPEMkRight'x$fPTYPEMkThis'x$fPTYPEMkThat'x$fPTYPEMkThesea$fPTYPEProxyT'a $fPTYPEIx[] $fPTYPEIxLa$fPTYPELookupa $fPTYPEAndsx $fPTYPEOrsx $fPTYPE:+x $fPTYPE+:x$fPTYPEUnconss$fPTYPEUnsnocs$fPTYPEIsEmptyas $fPTYPENullas$fPTYPEEnumFromTox$fPTYPEPartitionEithers[]$fPTYPEPartitionThese[] $fPTYPEScanlx$fPTYPEUnfoldra $fPTYPEIfa$fPTYPEPairs[]$fPTYPEPartitiona $fPTYPEBreaka $fPTYPEFaila $fPTYPEHolea$fPTYPEUnproxyProxy $fPTYPECatchx $fPTYPEDiva $fPTYPEModa$fPTYPEDivModa$fPTYPEQuotRema$fPTYPEGuardsImpl[]$fPTYPEGuardsImpl[]0$fPTYPEGuardsImplW[]$fPTYPEGuardsImplX[]$fPTYPEGuardsImplX[]0$fPTYPEGuardsImplXX[] $fPTYPEGuarda$fPTYPEGuardSimplea $fPTYPESkipa $fPTYPE>>a $fPTYPEDoa $fPTYPE&&a $fPTYPE||a $fPTYPE~>a $fPTYPENotx $fPTYPEOrdPa $fPTYPEOrdIa $fPTYPECmpa $fPTYPECmpIa$fPTYPEToListt$fPTYPEToListExtl$fPTYPEFromList[]$fPTYPEFromListExtl $fPTYPEIsThx$fPTYPETheseInThese$fPTYPEEmptyList'x $fPTYPEChar1a$fPTYPEToList'x$fPTYPEIToList'x $fPTYPEMapx$fPTYPEConcatx$fPTYPEMConcatx$fPTYPEZipThesea $fPTYPEZipa $fPTYPELuhnx$fPTYPEReadBase'x$fPTYPEShowBase'x$fPTYPEIntercalatex$fPTYPEPrintfx$fPTYPEGuardsNImpl[]$fPTYPEParaImpl[]$fPTYPEParaImpl[]0$fPTYPEParaImpl[]1$fPTYPEParaImplW[]$fPTYPEParaNImpl[]$fPTYPECaseImplx$fPTYPECaseImplx0$fPTYPECaseImplx1$fPTYPECaseImplx2$fPTYPECaseImplx3 $fPTYPECasex$fPTYPESequencet $fPTYPEHidex$fPTYPESortByx$fPTYPEReadFilex$fPTYPEReadDirx$fPTYPEReadEnvx$fPTYPEReadEnvAlla$fPTYPETimeUtca$fPTYPETimeZta$fGetFHandleFStderr$fGetFHandleFStdout$fGetModeWFWrite$fGetModeWFWriteForce$fGetModeWFAppend$fGetFHandleFOther$fPTYPEWriteFileImpla $fPTYPEStdina$fPTYPEIsFixImplx $fPTYPE<>x $fPrintC(,) $fPrintC()$fPTYPETupleListImpl[]$fPTYPEReverseTupleNtp$fPTYPEPrintfnx $fPTYPE<$x $fPTYPE<*x $fPTYPE<|>x$fPTYPEExtractt$fPTYPEDuplicatet $fPTYPEJoint $fPTYPE&x $fPTYPE$x $fPTYPETrim'x$fPTYPEStripLRx$fPTYPERepeata $fPTYPEDoNa $fShowCharSet $fShowBinOp $fEqBinOp $fShowWFMode $fEqWFMode $fShowFHandle ReadShowR' ReadShow' ReadShowRReadShowBaseIJ'BaseIJOkNotROkNotOkROkLuhnTLuhnRBetweenRBetweenNBaseN'BaseN DateTimeN DateTimeFmtsDateNDateFmts Ip4StrictREOctetREHmsREIpHmsfmtHmsopHmsipHmsSsn DateTime1CC11Ccnccncc11 datetime1ssnhmsipbase16basenbasen'daten datetimenbetweenokoknotreadshow readshow' refinedTH refinedTH' refined3TH refined3TH'version getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName)pcre-heavy-1.0.0.2-1rN9F2WyVKx9VHFJqpcO24Text.Regex.PCRE.HeavysubgsubGetROptDisp NormalDispUnicode showLitImplPColorHolder_pBool _pStringsFailPFalsePTruePPresentPfromTTHgetValueLRImpl valsFromTTs_boolTghc-prim GHC.TypesTypebase Data.ProxyProxyNatOrderingSymbolBoolconst(QuickCheck-2.13.2-8nV7osDGiuU4p27xQv2fwBTest.QuickCheck.Arbitrary arbitrary$aeson-1.4.5.0-36mBXjfsHvfDHOxMEoZc6oData.Aeson.Types.ToJSONToJSONbinary-0.8.6.0Data.Binary.ClassBinaryData.Aeson.Types.FromJSONFromJSONGHC.ReadReadTrim'$comonad-5.0.5-5F1giUaUd8bHELpBYPA3h3Control.Comonad duplicateextractPrintC IsFixImpl Data.OldList isInfixOf isPrefixOf isSuffixOf System.IOreadFileData.Traversable sequenceACaseImpl ParaNImplParaImplNumeric showIntAtBaseZipExtractAFromList"these-1.0.1-5oUWp8dUzepKo9d8w7Bh09ThisThattheseIsThTheseGHC.ExtsfromListtoList Data.Foldable"lens-4.17.1-I91pwvtGK51FAHQjK6rMJAControl.Lens.IndexeditoList GHC.Classescomparenot GuardsNImpl GuardsImplX GuardsImplGHC.RealquotRemdivModmoddivevenGHC.Listbreak partitionmapunfoldrscanlpartitionThese Data.EitherpartitionEithersGHC.Enum enumFromTonullFoldableControl.Lens.EmptyAsEmptyControl.Lens.ConsunsnocunconslookupControl.Lens.AtIxedconcatfoldMapmconcatRightLeft GHC.MaybeJustemptymemptypurestimes Data.MaybemaybeEitherX RightToMaybe LeftToMaybeMaybeXPcontainers-0.6.0.1Data.Sequence.InternalSeqelemKeepImpltoEnumfromEnumpredsuccassoc-1-C3gSRfWgVFgn0jyLSEt3SData.Bifunctor.AssocunassocassocData.Bifunctor.SwapswapControl.Lens.Internal.Iso reversingreverseGHC.PrimcoerceControl.Lens.WrappedWrappedGHC.NumsignumabsnegateRationalBinsplitAtPadEitherMaybefloorceilingtruncate fromRational toRational fromIntegral fromInteger Data.String fromString Data.Tuplesndfstlengthmaximumminimumsum time-1.8.0.2Data.Time.Calendar.DaysDayData.Time.Format.Parse parseTimeM ParseTimeData.Time.Format formatTimeGHC.Showshowtailsinits IsCharSetunzipanyallCcip