!{       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                      ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                                                                       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                  ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                                                                           ! ! ! !! "! #! $! %! &! '! (! )! *! +! ,! -! .! /! 0! 1! 2! 3! 4! 5! 6! 7! 8! 9! :! ;! <! =! >! ?! @! A! B! C! D! E! F" G" H" I" J" K" L" M" N# O# P# Q# R# S# T# U# V# W# X# Y# Z# [# \# ]# ^# _# `# a# b# c# d# e# f# g# h# i# j# k# l# m# n# o# p# q# r# s# t# u# v# w# x# y# z# {# |# }# ~# # # # # # # # # # # # # $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $'%Safe> None&',-.;=>?@AHMSUVX_kM` predicate-typedget  from the typelevelpredicate-typed#wrapper for a Show instance around predicate-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 predicate-typed*extract replacement options from typelevelpredicate-typed'simple regex string replacement options predicate-typed2convert type level regex option to the value levelpredicate-typed2extract the regex options from the type level listpredicate-typed'Regex options for Rescan Resplit Re etcpredicate-typedForce pattern anchoringpredicate-typedCompile automatic callouts | BsrAnycrlf -- R matches only CR, LF, or CrlF | BsrUnicode -- ^ R matches all Unicode line endings predicate-typedDo caseless matching!predicate-typed"dollar not to match newline at end"predicate-typedmatches anything including NL#predicate-typed%Allow duplicate names for subpatterns$predicate-typed Ignore whitespace and # comments%predicate-typed,PCRE extra features (not much use currently)&predicate-typed#Force matching to be before newline'predicate-typedcaret and dollar match newlines within data | NewlineAny -- ^ Recognize any Unicode newline sequence | NewlineAnycrlf -- ^ Recognize CR, LF, and CrlF as newline sequences(predicate-typedSet CR as the newline sequence)predicate-typed Set CrlF as the newline sequence*predicate-typedSet LF as the newline sequence+predicate-typed=Disable numbered capturing parentheses (named ones available),predicate-typed Invert greediness of quantifiers-predicate-typedRun in UTF--8 mode.predicate-typed+Do not check the pattern for UTF-8 validity/predicate-typedget   from the typelevel predicate-typed(get a list of Symbols from the typelevelgetSymbs @'["abc","def","g"]["abc","def","g"] predicate-typed%get a list of Nats from the typelevelgetNats @'[10,12,1] [10,12,1]1predicate-typed"try to convert a list to a n-tuple4predicate-typed)extract the eighth element from a n-tuple7predicate-typed*extract the seventh element from a n-tuple:predicate-typed(extract the sixth element from a n-tuple=predicate-typed(extract the fifth element from a n-tuple@predicate-typed)extract the fourth element from a n-tupleCpredicate-typed(extract the third element from a n-tupleFpredicate-typed)extract the second element from a n-tupleIpredicate-typed(extract the first element from a n-tupleVpredicate-typedtype family to extract a from a list of aWpredicate-typedtype family to extract t from t aXpredicate-typedtype family to extract a from t aYpredicate-typedextract i2 part of 5 tuple from the type level for use with (Zpredicate-typedextract fmt2 part of 5 tuple from the type level for use with ([predicate-typedextract op2 part of 5 tuple from the type level for use with (\predicate-typedextract ip2 part of 5 tuple from the type level for use with (]predicate-typedextract opts2 part of 5 tuple from the type level for use with (^predicate-typedextract i2 part of 4 tuple from the type level for use with )_predicate-typedextract op2 part of 4 tuple from the type level for use with )`predicate-typedextract ip2 part of 4 tuple from the type level for use with )apredicate-typedextract opts2 part of 4 tuple from the type level for use with )bpredicate-typedExtract a from a list-like containercpredicate-typed  at the type leveldpredicate-typed ! at the type level for a list of  epredicate-typed'if' at the type levelfpredicate-typed  at the type levellpredicate-typedtakes a list of size n, and converts it to an inductive tuple. see  *toITupleListC @4 [10,12,13,1]Right (10,(12,(13,(1,()))))toITupleListC @2 ["ab","cc"]Right ("ab",("cc",()))toITupleListC @10 [10,12,13,1]0Left "toITupleListC: expected exactly 10 values"toITupleListC @2 [10,12,13,1]/Left "toITupleListC: expected exactly 2 values"opredicate-typed9takes a flat n-tuple and creates an inductive tuple. see  +toITupleC (123,'x',False,"abc")(123,('x',(False,("abc",()))))toITupleC (123,'x')(123,('x',()))rpredicate-typedlength of a type level listspredicate-typed-Intersperse a symbol inside a list of symbolsupredicate-typedRepeat an expression n timesvpredicate-typedextract x from the typelevelxpredicate-typed"all the ways to compare two valuespredicate-typedget ordering from the typelevelpredicate-typedget   from typelevelpredicate-typed'get the length of a typelevel containergetLen @'["abc","def","g"]3 getLen @'[]0getLen @(9 ':| '[1,2,3])4getLen @('These 9 "Asfs")1getLen @('This 1)0predicate-typedtypelevel boolean Notpredicate-typedtypelevel boolean Orpredicate-typedtypelevel boolean Andpredicate-typed,helper method that fails with msg when Falsepredicate-typed-helper method that fails with a msg when Truepredicate-typedtype level Betweenpredicate-typeddisplay constructor name for  predicate-typedshow the type as a stringpredicate-typedboolean implication True ~> FalseFalse True ~> TrueTrueFalse ~> FalseTrue False ~> TrueTruepredicate-typedprime predicate isPrime 7True isPrime 6Falsepredicate-typed prime factorsprimeFactors 100 [2,2,5,5]primeFactors 123[3,41]predicate-typed primes streamtake 10 primeStream[2,3,5,7,11,13,17,19,23,29]predicate-typed pretty print  predicate-typedshow the kind as a stringpredicate-typedget a Nat from the typelevelnat @1414predicate-typed"gets the Symbol from the typelevel symb @"abc""abc"predicate-typed(compile a regex using type level optionspredicate-typeddisplay regex optionspredicate-typed'convenience method for optional displaypredicate-typeddraw a tree using unicodepredicate-typed?strip ansi characters from a string and print it (for doctests) predicate-typed4convert a list of at least 12 elements to a 12-tuple predicate-typed4convert a list of at least 11 elements to a 11-tuplepredicate-typed4convert a list of at least 10 elements to a 10-tuplepredicate-typed2convert a list of at least 9 elements to a 9-tuplepredicate-typed2convert a list of at least 8 elements to a 8-tuplepredicate-typed2convert a list of at least 7 elements to a 7-tuplepredicate-typed2convert a list of at least 6 elements to a 6-tuplepredicate-typed2convert a list of at least 5 elements to a 5-tuplepredicate-typed2convert a list of at least 4 elements to a 4-tuplepredicate-typed2convert a list of at least 3 elements to a 3-tuplepredicate-typed2convert a list of at least 2 elements to a 2-tuple % !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~usrfedcbhgtVXWUTSRQPOMLN/0xyz{|}~vwopqlmnijk123a`_^]\[ZYIJKFGHCDE@AB=>?:;<789456% !"#$&'()*+,-. g9 h9 t71None-1:HNone!&',-.14567;=>?@ACHMSUVX_kvycpredicate-typed9contains the untyped result from evaluating an expressiondpredicate-typedevaluation failedepredicate-typedFalse predicatefpredicate-typedTrue predicategpredicate-typed Any valuempredicate-typeduntyped child node for opredicate-typed)holds the result of running the predicateppredicate-typed*optional strings to include in the resultsypredicate-typed7contains the typed result from evaluating an expression predicate-typed&concatenate two strings with delimiterjamSS "xyz" "abc" "xyz | abc"jamSS "" "abc""abc"jamSS "xyz" """xyz" jamSS "" """"predicate-typedsemigroup for ValPTrueP <> FalseP <> ValPValPValP <> TrueP <> FalsePFalseP/FailP "abc" <> (TrueP <> FalseP) <> FailP "def"FailP "abc | def"1(FailP "abc" <> TrueP) <> (FalseP <> FailP "def")FailP "abc | def",FailP "" <> (TrueP <> FalseP) <> FailP "def" FailP "def"&FailP "abc" <> FailP "" <> FailP "def"FailP "abc | def")FailP "abc" <> FailP "xyz" <> FailP "def"FailP "abc | xyz | def"predicate-typed  instance for Valreads @(Val Int) "Val 123"[(Val 123,"")]!reads @(Val Bool) "Val False abc"[(Val False," abc")]/reads @(Val Bool) "Fail \"some error message\"" [(Fail "some error message","")]1reads @(Val Double) "Fail \"some error message\"" [(Fail "some error message","")]Dtyped tree holding the results of evaluating a type level expressionpredicate-typed display valuepredicate-typedthe value at this root nodepredicate-typed1detailed information eg input and output and textpredicate-typedthe child nodespredicate-typedmonoid instance for ymempty :: Val (Maybe [Int]) Val Nothing%import qualified Data.Semigroup as SGmempty :: SG.Sum IntSum {getSum = 0}predicate-typedsemigroup instance for yBVal 123 <> (Val 456 <> Val 789) == (Val 123 <> Val 456) <> Val 789TrueVal True <> Val False Val FalseVal True <> Val TrueVal True3Fail "abc" <> (Val True <> Val False) <> Fail "def"Fail "abc | def"5(Fail "abc" <> Val True) <> (Val False <> Fail "def")Fail "abc | def"0Fail "" <> (Val True <> Val False) <> Fail "def" Fail "def"#Fail "abc" <> Fail "" <> Fail "def"Fail "abc | def"LVal False <> (Val True <> Val False) == (Val False <> Val True) <> Val FalseTruepredicate-typedmconcat  options at the type levelLx = getOpt @(OptT '[ 'OMsg "test", 'ORecursion 123, OU, OL, 'OMsg "field2"])oMsg x["test","field2"] oRecursion x123predicate-typed#option synonyms to save a keystrokepredicate-typed"extract options from the typelevelpredicate-typedDisplay optionspredicate-typedmemptypredicate-typedset display widthpredicate-typed>set text to add context to a failure message for refined typespredicate-typed set recursion limit eg for regexpredicate-typedset effects for messagespredicate-typedmappendpredicate-typedset color palettepredicate-typedturn on colorspredicate-typedturn off colorspredicate-typed ansi displaypredicate-typedunicode displaypredicate-typeddebug mode return nothingpredicate-typeddebug mode return one linepredicate-typeddebug mode normalpredicate-typeddebug mode verbosepredicate-typedcomposite: no messagespredicate-typedcomposite: lite versionpredicate-typedcomposite: ansi + colorspredicate-typed%composite: ansi + colors + backgroundpredicate-typedcomposite: ansi + no colorspredicate-typed"composite: ansi + colors + verbosepredicate-typed%composite: ansi + no colors + verbosepredicate-typedcomposite: unicode + colorspredicate-typed(composite: unicode + colors + backgroundpredicate-typedcomposite: unicode + no colorspredicate-typed%composite: unicode + colors + verbosepredicate-typed(composite: unicode + no colors + verbosepredicate-typed.a typeclass for choosing which monad to run in hasIO @IOTruehasIO @IdentityFalsepredicate-typedcolor palettespredicate-typed.how much detail to show in the expression treepredicate-typed(one line summary used mainly for testingpredicate-typedLone line summary with additional context from the top of the evaluation treepredicate-typed4outputs the evaluation tree but skips noisy subtreespredicate-typed"outputs the entire evaluation treepredicate-typeddisplay format for the treepredicate-typeddraw normal treepredicate-typed use unicode predicate-typed4the color palette for displaying the expression treepredicate-typed7customizable options for running a typelevel expressionpredicate-typedlength of data to display for  predicate-typed debug levelpredicate-typed1display the tree using the normal tree or unicodepredicate-typedcolor palette usedpredicate-typedmessages associated with typepredicate-typed max recursionpredicate-typedother message effectspredicate-typed no colorspredicate-typed#final set of options using Identity predicate-typed elide the  % wrapper so it acts like a normal ADTpredicate-typed&creates a Node for the evaluation treepredicate-typed&creates a Node for the evaluation tree predicate-typed&creates a Node for the evaluation tree predicate-typed check that c value is consistent with y apredicate-typedfix the c! value for the Bool case: ie use f and eCfixTTBool (TT ValP (Val True) "x" []) == TT TrueP (Val True) "x" []TrueQfixTTBool (TT FalseP (Fail "abc") "x" []) == TT (FailP "abc") (Fail "abc") "x" []Truepredicate-typed+creates a Boolean node for a predicate typepredicate-typed(convenience method to pull parts out of predicate-typed5convenience method to pull out the return value from predicate-typed4converts a typed tree to an untyped tree for displaypredicate-typedRdecorate the tree with more detail when there are errors but inline the error node predicate-typedcombine options ala monoid predicate-typed(set maximum display width of expressions predicate-typed&set title message for the display tree predicate-typed+set maximum recursion eg when running regex predicate-typedset color of title message predicate-typedturn on/off colors predicate-typeddisplay type eg  or  predicate-typed,create color palette for the expression tree predicate-typedset debug modepredicate-typeddefault options predicate-typedLdefault title message color and boundaries between multipart refine messagespredicate-typedverbose debug flagpredicate-typed9more restrictive: only display data in verbose debug modepredicate-typedOextract values from the trees or if there are errors return a tree with context predicate-typedpretty print a treepredicate-typedrender c value with colors predicate-typedrender y value with colors predicate-typedEcolors the result of the predicate based on the current color palettepredicate-typed display tree predicate-typedextract message part from tree predicate-typedrender numbered tree predicate-typed prefix text in front of ttString predicate-typedtraversal for DVerbosehas _DVerbose (getOpt @OU)Falsehas _DVerbose (getOpt @OUV)Truepredicate-typedconvert typelevel options to t(oDisp &&& fst . oColor &&& oWidth) (getOpt @(OA ':# OU ':# OA ':# 'OWidth 321 ':# Color4 ':# 'OMsg "test message"))(Ansi,("color4",321)),oMsg (getOpt @('OMsg "abc" ':# 'OMsg "def")) ["abc","def"]KoOther (getOpt @('OOther 'False 'Red 'White ':# 'OOther 'True 'Red 'Black))(True,Red,Black)#a = show (getOpt @('OEmpty ':# OU))$b = show (getOpt @(OU ':# 'OEmpty));c = show (getOpt @OU) a==b && b==cTruepredicate-typed&deal with possible recursion on a listpredicate-typed)deal with possible recursion on two listspredicate-typedpretty print a messagepredicate-typedoverride options for " so we dont lose error informationpredicate-typed?render a string for messages using optional color and underlinepredicate-typed<message to display when the length of a foldable is exceededpredicate-typedprism for Val TrueVal True ^? _TrueJust ()Val False ^? _TrueNothingpredicate-typedprism for Val False(_True # ()) ^? _TrueJust ()(_False # ()) ^? _FalseJust ()Val False ^? _FalseJust ()Val True ^? _FalseNothingpredicate-typediso for yVal 123 ^. _ValEither Right 123,Val 123 & _ValEither %~ right' (show . succ) Val "124"8Fail "abc" & _ValEither %~ ((<>"def") +++ (show . succ)) Fail "abcdef"2Right 1.2 & from _ValEither %~ fmap (show . (*10)) Right "12.0"Val True ^. _ValEither Right TrueFail "abc" ^. _ValEither Left "abc"Left "abc" ^. from _ValEither Fail "abc"_ValEither # Right False Val False0[Just (Val 'x')] ^. mapping (mapping _ValEither)[Just (Right 'x')](Just (Fail "abcd") ^. mapping _ValEitherJust (Left "abcd")predicate-typeda lens from typed y to the untyped cVal True ^. val2PValPVal 123 ^. val2PValPFail "abc" ^. val2P FailP "abc"predicate-typeda lens from typed y Bool to the untyped cVal True ^. val2PBoolTruePVal False ^. val2PBoolFalsePFail "abc" ^. val2PBool FailP "abc"predicate-typed1lens that keeps ValP in sync with Val for TT Bool_(TT ValP (Val True) "xxx" [] & ttValBool %~ \b -> fmap not b) == TT FalseP (Val False) "xxx" []Truea(TT ValP (Val True) "xxx" [] & ttValBool .~ Fail "abc") == TT (FailP "abc") (Fail "abc") "xxx" []TrueO(TT ValP (Val True) "xxx" [] & ttValBool %~ id) == TT TrueP (Val True) "xxx" []TrueQ(TT FalseP (Val True) "xxx" [] & ttValBool %~ id) == TT TrueP (Val True) "xxx" []Truepredicate-typed9lens from TT to Val that also keeps ValP in sync with ValL(TT FalseP (Val True) "xxx" [] & ttVal %~ id) == TT ValP (Val True) "xxx" []True[(TT FalseP (Val 123) "xxx" [] & ttVal .~ Fail "aa") == TT (FailP "aa") (Fail "aa") "xxx" []TrueZ(TT (FailP "sdf") (Val 123) "xxx" [] & ttVal %~ fmap show) == TT ValP (Val "123") "xxx" []True$predicate-typed monoid opts%predicate-typed ' instance for evaluating the expression&predicate-typed ' instance for evaluating the expressionpredicate-typed set underlinepredicate-typedset foreground colorpredicate-typedset background color predicate-typedname of color palettepredicate-typedFail foreground colorpredicate-typedFail background colorpredicate-typedFalse foreground colorpredicate-typedFalse background colorpredicate-typedTrue foreground colorpredicate-typedTrue background colorpredicate-typedPresent foreground colorpredicate-typedPresent background color cdgefmnopqrstyz{|}     yz{mnop}|cdgefqsrt      6None-.=>?@AHPUVXkofRpredicate-typed6third element in a tuple followed by the third elementpz @L33 (1,2,('c',4,False)) Val FalseSpredicate-typed7third element in a tuple followed by the second elementpz @L32 (1,2,('c',4))Val 4Tpredicate-typed6third element in a tuple followed by the first elementpz @L31 (1,2,('c',4))Val 'c'Upredicate-typed7second element in a tuple followed by the third elementpz @L23 ('x',(10,"ss",4.5),2)Val 4.5Vpredicate-typed8second element in a tuple followed by the second elementpz @L22 ('z',(10,"ss",4.5),2)Val "ss"Wpredicate-typed7second element in a tuple followed by the first elementpz @L21 ('x',(10,"ss",4.5),2)Val 10Xpredicate-typed6first element in a tuple followed by the third elementpz @L13 ((10,"ss",4.5),2)Val 4.5Ypredicate-typed7first element in a tuple followed by the second elementpz @L12 ((10,"ss"),2)Val "ss"Zpredicate-typed6first element in a tuple followed by the first elementpz @L11 ((10,"ss"),2)Val 10[predicate-typed similar to ,-.pz @(Coerce (SG.Sum Integer)) (Identity (-13))Val (Sum {getSum = -13})pl @(Coerce SG.Any) True?Present Any {getAny = True} (Coerce Any {getAny = True} | True)Val (Any {getAny = True})pl @(Coerce Bool) (SG.Any True)0Present True (Coerce True | Any {getAny = True})Val TrueJpz @(Proxy 'True >> Coerce (Proxy 'False)) () ^!? acts . _Val . to typeRep Just 'FalseOpz @(Proxy Int >> Coerce (Proxy (String,Char))) () ^!? acts . _Val . to typeRepJust ([Char],Char)import qualified GHC.Exts as GEHpz @(Proxy GE.Any >> Coerce (Proxy Int)) () ^!? acts . _Val . to typeRepJust IntQpz @(Proxy '(_,_) >> Coerce (Proxy '(Float,Int))) () ^!? acts . _Val . to typeRepJust ('(,) * * Float Int)\predicate-typed similar to  pz @(Pure Maybe Id) 4 Val (Just 4)pz @(Pure [] Id) 4Val [4](pz @(Pure (Either String) Fst) (13,True)Val (Right 13)pl @(Pure Maybe Id) 'x'&Present Just 'x' (Pure Just 'x' | 'x')Val (Just 'x')pl @(Pure (Either _) Id) 'x'(Present Right 'x' (Pure Right 'x' | 'x')Val (Right 'x')$pl @(Pure (Either _) Id >> Swap) 'x'>Present Left 'x' ((>>) Left 'x' | {Swap Left 'x' | Right 'x'})Val (Left 'x')%pl @(Pure (Either ()) Id >> Swap) 'x'>Present Left 'x' ((>>) Left 'x' | {Swap Left 'x' | Right 'x'})Val (Left 'x'))pl @(Pure (Either String) Id >> Swap) 123>Present Left 123 ((>>) Left 123 | {Swap Left 123 | Right 123})Val (Left 123)]predicate-typed similar to  + for expressions taking exactly on argument.pl @(Id & L1 & Singleton & Length) (13,"xyzw")Present 1 (Length 1 | [13])Val 1pl @(2 & (&&&) "abc") ()Present ("abc",2) ('("abc",2)) Val ("abc",2)pl @(2 & '(,) "abc") ()Present ("abc",2) ('("abc",2)) Val ("abc",2)pl @('(,) 4 $ '(,) 7 $ "aa") ()$Present (4,(7,"aa")) ('(4,(7,"aa")))Val (4,(7,"aa"))+pl @(L3 $ L2 $ Fst) ((1,("X",9,'a')),(3,4))#Present 'a' (Thd 'a' | ("X",9,'a'))Val 'a'^predicate-typedlike ./[ for expressions taking exactly on argument ie this doesnt work: pz @('(,) $ 4 $ 'True) () pl @(L1 $ L2 $ Id) ((1,2),(3,4))Present 3 (Fst 3 | (3,4))Val 3)pl @((<=) 4 $ L1 $ L2 $ Id) ((1,2),(3,4))False (4 <= 3) Val Falsepz @('(,) 4 $ 'True) () Val (4,True)_predicate-typed swaps using  pz @Swap (Left 123)Val (Right 123)pz @Swap (Right 123)Val (Left 123)pz @Swap (These 'x' 123)Val (These 123 'x')pz @Swap (This 'x')Val (That 'x')pz @Swap (That 123)Val (This 123)pz @Swap (123,'x') Val ('x',123)pz @Swap (Left "abc")Val (Right "abc")pz @Swap (Right 123)Val (Left 123)pl @Swap (Right "asfd")5Present Left "asfd" (Swap Left "asfd" | Right "asfd")Val (Left "asfd")pl @Swap (12,"asfd")4Present ("asfd",12) (Swap ("asfd",12) | (12,"asfd"))Val ("asfd",12)pz @Swap (True,12,"asfd")Val (True,"asfd",12)`predicate-typedboolean implication3pz @(Fst ~> (Length Snd >= 4)) (True,[11,12,13,14])Val True6pz @(Fst ~> (Length Snd == 4)) (True,[12,11,12,13,14]) Val False7pz @(Fst ~> (Length Snd == 4)) (False,[12,11,12,13,14])Val True4pz @(Fst ~> (Length Snd >= 4)) (False,[11,12,13,14])Val Trueapredicate-typed#short circuit version of boolean Or!pl @(Id > 10 ||~ FailT _ "ss") 11True (True ||~ _ | (11 > 10))Val Truepz @(Id > 10 ||~ Id == 9) 9Val Truepl @(Id > 10 ||~ Id > 9) 9.False (False ||~ False | (9 > 10) ||~ (9 > 9)) Val Falsebpredicate-typed similar to  4pz @(Fst || (Length Snd >= 4)) (False,[11,12,13,14])Val True:pz @(Not Fst || (Length Snd == 4)) (True,[12,11,12,13,14]) Val Falsecpredicate-typed$short circuit version of boolean And pl @(Id > 10 &&~ FailT _ "ss") 9False (False &&~ _ | (9 > 10)) Val Falsepl @(Id > 10 &&~ Id == 12) 11#False (True &&~ False | (11 == 12)) Val Falsepl @(Id > 10 &&~ Id == 11) 11True (True &&~ True)Val Truedpredicate-typed similar to  pz @(Fst && Snd) (True, True)Val Truepz @(Id > 15 && Id < 17) 16Val Truepz @(Id > 15 && Id < 17) 30 Val False3pz @(Fst && (Length Snd >= 4)) (True,[11,12,13,14])Val True6pz @(Fst && (Length Snd == 4)) (True,[12,11,12,13,14]) Val Falseepredicate-typedQprocesses a type level list predicates running each in sequence with infixl: see &0.pz @(DoL [Pred, ShowP Id, Id &&& Len]) 9876543Val ("9876542",7)pz @(DoL [2,3,4]) ()Val 4pl @(DoL '[4,5,6]) ()Present 6 ((>>) 6 | {'6})Val 6fpredicate-typedQprocesses a type level list predicates running each in sequence with infixr: see &0-pz @(Do [Pred, ShowP Id, Id &&& Len]) 9876543Val ("9876542",7):pz @(Do '[W 123, W "xyz", Len &&& Id, Pred *** Id<>Id]) ()Val (2,"xyzxyz");pl @(Do '[Succ,Id,ShowP Id,Ones,Map (ReadBase Int 8)]) 1239HPresent [1,2,4,0] ((>>) [1,2,4,0] | {Map [1,2,4,0] | ["1","2","4","0"]}) Val [1,2,4,0];pl @(Do '[Pred,Id,ShowP Id,Ones,Map (ReadBase Int 8)]) 1239.Error invalid base 8 (Map(i=3, a="8") excnt=1)Fail "invalid base 8"pl @(Do '[4,5,6]) ()Present 6 ((>>) 6 | {'6})Val 6+pl @(Do '["abc", "Def", "ggg", "hhhhh"]) ()+Present "hhhhh" ((>>) "hhhhh" | {'"hhhhh"}) Val "hhhhh"pl @(Do '[ 'LT, 'EQ, 'GT ]) ()Present GT ((>>) GT | {'GT})Val GT$pl @(Do '[4 % 4,22 % 1 ,12 -% 4]) ()<Present (-3) % 1 ((>>) (-3) % 1 | {Negate (-3) % 1 | 3 % 1})Val ((-3) % 1)pl @(Do '[1,2,3]) ()Present 3 ((>>) 3 | {'3})Val 3gpredicate-typed similar to  pz @(Map Pred) [1..5]Val [0,1,2,3,4]hpredicate-typed similar to   for foldablepz @(Map' Pred Id) [1..5]Val [0,1,2,3,4]ipredicate-typed#similar to 8th element in a n-tuple-pz @(L8 Id) (10,"Abc",'x',True,1,99,True,'a')Val 'a'jpredicate-typed#similar to 7th element in a n-tuple(pz @(L7 Id) (10,"Abc",'x',True,1,99,'a')Val 'a'kpredicate-typed#similar to 6th element in a n-tuple$pz @(L6 Id) (10,"Abc",'x',True,1,99)Val 99lpredicate-typed#similar to 5th element in a n-tuple!pz @(L5 Id) (10,"Abc",'x',True,1)Val 1mpredicate-typed#similar to 4th element in a n-tuplepz @(L4 Id) (10,"Abc",'x',True)Val True0pz @(L4 L21) ('x',((10,"Abc",'x',999),"aa",1),9)Val 999$pl @(L4 Id) (99,'a',False,"someval");Present "someval" (L4 "someval" | (99,'a',False,"someval")) Val "someval"opredicate-typed#similar to 3rd element in a n-tuplepz @Thd (10,"Abc",133)Val 133pz @Thd (10,"Abc",133,True)Val 133pl @Thd (99,'a',False,1.3).Present False (Thd False | (99,'a',False,1.3)) Val Falseqpredicate-typed similar to  pz @Snd (10,"Abc") Val "Abc"pz @Snd (10,"Abc",True) Val "Abc"pl @Snd (99,'a',False,1.3)*Present 'a' (Snd 'a' | (99,'a',False,1.3))Val 'a'spredicate-typed similar to  pz @Fst (10,"Abc")Val 10pz @Fst (10,"Abc",'x')Val 10pz @Fst (10,"Abc",'x',False)Val 10pl @Fst (99,'a',False,1.3)(Present 99 (Fst 99 | (99,'a',False,1.3))Val 99tpredicate-typed similar to  pl @(Any Even) [1,5,11,5,3]False (Any(5)) Val Falsepl @(Any Even) [1,5,112,5,3]True (Any(5) i=2 (0 == 0))Val Truepz @(Any Even) [] Val False*pl @(Fst >> Any (Gt 3)) ([10,12,3,5],"ss")(True ((>>) True | {Any(4) i=0 (10 > 3)})Val Truepl @(Any (Same 2)) [1,4,5]False (Any(3)) Val Falsepl @(Any (Same 2)) [1,4,5,2,1]True (Any(5) i=3 (2 == 2))Val Trueupredicate-typed similar to  ,pl @(All (Between 1 8 Id)) [7,3,4,1,2,9,0,1]False (All(8) i=5 (9 <= 8)) Val Falsepz @(All Odd) [1,5,11,5,3]Val Truepz @(All Odd) []Val True"run @OANV @(All Even) [1,5,11,5,3]4False All(5) i=0 (1 == 0)|+- False i=0: 1 == 0| || +- P 1 `mod` 2 = 1| | || | +- P Id 1| | | | | `- P '2| | | `- P '0|+- False i=1: 1 == 0| || +- P 5 `mod` 2 = 1| | || | +- P Id 5| | | | | `- P '2| | | `- P '0|+- False i=2: 1 == 0| || +- P 11 `mod` 2 = 1| | || | +- P Id 11| | | | | `- P '2| | | `- P '0|+- False i=3: 1 == 0| || +- P 5 `mod` 2 = 1| | || | +- P Id 5| | | | | `- P '2| | | `- P '0|`- False i=4: 1 == 0 | +- P 3 `mod` 2 = 1 | | | +- P Id 3 | | | `- P '2 | `- P '0 Val False*pl @(Fst >> All (Gt 3)) ([10,12,3,5],"ss"))False ((>>) False | {All(4) i=2 (3 > 3)}) Val Falsepl @(All (Lt 3)) [1 .. 10]False (All(10) i=2 (3 < 3)) Val Falsevpredicate-typed=A operator predicate that determines if the value is between p and qpz @(5 <..> 8) 6Val Truepz @(10 % 4 <..> 40 % 5) 4Val Truepz @(10 % 4 <..> 40 % 5) 33 Val Falsewpredicate-typed4A predicate that determines if the value is between p and q%pz @(Between 5 8 Len) [1,2,3,4,5,5,7]Val Truepl @(Between 5 8 Id) 9False (9 <= 8) Val False#pl @(Between L11 L12 Snd) ((1,4),3)True (1 <= 3 <= 4)Val True$pl @(Between L11 L12 Snd) ((1,4),10)False (10 <= 4) Val Falsexpredicate-typed(gets the singleton value from a foldablepl @OneP [10..15]"Error OneP:expected one element(6)#Fail "OneP:expected one element(6)" pl @OneP [10]Present 10 (OneP)Val 10 pl @OneP []&Error OneP:expected one element(empty)'Fail "OneP:expected one element(empty)"pl @OneP (Just 10)Present 10 (OneP)Val 10pl @OneP Nothing&Error OneP:expected one element(empty)'Fail "OneP:expected one element(empty)"ypredicate-typedEFails the computation with a message where the input value is a Proxy pz @(Ix 3 (FailP "oops")) "abcd"Val 'd'pz @(Ix 3 (FailP "oops")) "abc" Fail "oops"zpredicate-typed8Fails the computation with a message (wraps the type in )+pz @(FailT Int (PrintF "value=%03d" Id)) 99Fail "value=099"{predicate-typedOFails the computation with a message for simple failures: doesnt preserve types>pz @(FailS (PrintT "value=%03d string=%s" Id)) (99,"somedata") Fail "value=099 string=somedata"|predicate-typedJFails the computation with a message but allows you to set the output type5pz @('False || (Fail 'True "failed")) (99,"somedata") Fail "failed";pz @('False || (Fail (Hole Bool) "failed")) (99,"somedata") Fail "failed"8pz @('False || (Fail (Hole _) "failed")) (99,"somedata") Fail "failed"}predicate-typed  function on a boolean$pz @('[ 'True] >> Head >> IdBool) ()Val Truepz @(Fst >> IdBool) (False,22) Val Falsepl @(Head >> IdBool) [True]True ((>>) True | {IdBool})Val Truepan @(Head >> Id) [True] P (>>) True|+- P Head True| `- P Id TrueVal Truepan @(Head >> IdBool) [True]True (>>) True|+- P Head True|`- True IdBoolVal True~predicate-typed  functionpz @(Not Id) FalseVal Truepz @(Not Id) True Val Falsepz @(Not Fst) (True,22) Val Falsepl @(Not (Lt 3)) 13True (Not (13 < 3))Val Truepl @(Not 'True) ()False (Not ('True)) Val Falsepredicate-typed similar to   for   instancespz @(Length Id) (Left "aa")Val 0pz @(Length Id) (Right "aa")Val 1"pz @(Length Right') (Right "abcd")Val 4/pz @(Length L23) (True,(23,'x',[10,9,1,3,4,2]))Val 6predicate-typed similar to  pz @Len [10,4,5,12,3,4]Val 6 pz @Len []Val 0pz @(Pairs >> Len > 2) "abcdef"Val Truepredicate-typed"used internally for type inferencepredicate-typedwraps a value (see   and  )pz @(Wrap (SG.Sum _) Id) (-13)Val (Sum {getSum = -13})pz @(Wrap SG.Any (Ge 4)) 13Val (Any {getAny = True})(import Data.List.NonEmpty (NonEmpty(..))3pz @(Wrap (NonEmpty _) (Uncons >> 'Just Id)) "abcd"Val ('a' :| "bcd")pl @(Wrap (SG.Sum _) Id) 137Present Sum {getSum = 13} (Wrap Sum {getSum = 13} | 13)Val (Sum {getSum = 13})*pl @(Wrap (SG.Sum _) Id >> STimes 4 Id) 13BPresent Sum {getSum = 52} ((>>) Sum {getSum = 52} | {getSum = 13})Val (Sum {getSum = 52})&pl @(Wrap _ 13 <> Id) (SG.Sum @Int 12)VPresent Sum {getSum = 25} (Sum {getSum = 13} <> Sum {getSum = 12} = Sum {getSum = 25})Val (Sum {getSum = 25})predicate-typedunwraps a value (see  )pz @Unwrap (SG.Sum (-13)) Val (-13)(pl @(Unwrap >> '(Id, 'True)) (SG.Sum 13)1Present (13,True) ((>>) (13,True) | {'(13,True)}) Val (13,True)predicate-typedflipped version of predicate-typedinfixl version of predicate-typedcompose expressions#pz @(L11 >> Not Id) ((True,12),'x') Val False(pz @(L12 >> Succ >> Dup) ((True,12),'x') Val (13,13)(pz @(10 >> '(Id,"abc") >> Second Len) () Val (10,3)predicate-typed.override the display width for the expression ppredicate-typedActs as a proxy for a Type.predicate-typedrun the expression p but remove the subtreespredicate-typed9add a message to give more context to the evaluation tree#pan @(MsgI "[somemessage] " Id) 999P [somemessage] Id 999Val 999"pan @(MsgI Id 999) "info message:"P info message:'999Val 999predicate-typed9add a message to give more context to the evaluation tree!pan @(Msg "[somemessage]" Id) 999P [somemessage] Id 999Val 999!pan @(Msg Id 999) "info message:"P info message: '999Val 999predicate-typed-transparent wrapper to turn kind k into kind  B eg useful for putting in a promoted list (cant mix kinds) see fpz @'[W 123, Id] 99 Val [123,99]%pz @'[W "abc", W "def", Id, Id] "ghi"Val ["abc","def","ghi","ghi"]predicate-typedGidentity function that also displays the type information for debugging pz @IdT 23Val 23predicate-typedidentity function pz @Id 23Val 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-typed:skips the evaluation tree and just displays the end result(evaluate the type level expression in IO.pl @(Between 4 10 Id) 7 & mapped . _Val %~ notTrue (4 <= 7 <= 10) Val False@eval (Proxy @'True) defOpts 7 & mapped . ttValBool . _Val %~ notNTT {_ttValP = FalseP, _ttVal = Val False, _ttString = "'True", _ttForest = []}predicate-typedsame as # but adds context to the end result(evaluate the type level expression in IO.pl @(Between 4 10 Id) 7 & mapped . _Val %~ notTrue (4 <= 7 <= 10) Val False@eval (Proxy @'True) defOpts 7 & mapped . ttValBool . _Val %~ notNTT {_ttValP = FalseP, _ttVal = Val False, _ttString = "'True", _ttForest = []}predicate-typed9displays the evaluation tree in plain text without colors(evaluate the type level expression in IO.pl @(Between 4 10 Id) 7 & mapped . _Val %~ notTrue (4 <= 7 <= 10) Val False@eval (Proxy @'True) defOpts 7 & mapped . ttValBool . _Val %~ notNTT {_ttValP = FalseP, _ttVal = Val False, _ttString = "'True", _ttForest = []}predicate-typedEdisplays the evaluation tree in plain text without colors and verbose(evaluate the type level expression in IO.pl @(Between 4 10 Id) 7 & mapped . _Val %~ notTrue (4 <= 7 <= 10) Val False@eval (Proxy @'True) defOpts 7 & mapped . ttValBool . _Val %~ notNTT {_ttValP = FalseP, _ttVal = Val False, _ttString = "'True", _ttForest = []}predicate-typedCdisplays the evaluation tree using colors without background colors(evaluate the type level expression in IO.pl @(Between 4 10 Id) 7 & mapped . _Val %~ notTrue (4 <= 7 <= 10) Val False@eval (Proxy @'True) defOpts 7 & mapped . ttValBool . _Val %~ notNTT {_ttValP = FalseP, _ttVal = Val False, _ttString = "'True", _ttForest = []}predicate-typed4displays the evaluation tree using background colors(evaluate the type level expression in IO.pl @(Between 4 10 Id) 7 & mapped . _Val %~ notTrue (4 <= 7 <= 10) Val False@eval (Proxy @'True) defOpts 7 & mapped . ttValBool . _Val %~ notNTT {_ttValP = FalseP, _ttVal = Val False, _ttString = "'True", _ttForest = []}predicate-typed and verbose(evaluate the type level expression in IO.pl @(Between 4 10 Id) 7 & mapped . _Val %~ notTrue (4 <= 7 <= 10) Val False@eval (Proxy @'True) defOpts 7 & mapped . ttValBool . _Val %~ notNTT {_ttValP = FalseP, _ttVal = Val False, _ttString = "'True", _ttForest = []}predicate-typed6display the evaluation tree using unicode and colors  pu '(Id, "abc", 123) [1..4] @(evaluate the type level expression in IO.pl @(Between 4 10 Id) 7 & mapped . _Val %~ notTrue (4 <= 7 <= 10) Val False@eval (Proxy @'True) defOpts 7 & mapped . ttValBool . _Val %~ notNTT {_ttValP = FalseP, _ttVal = Val False, _ttString = "'True", _ttForest = []}predicate-typedLdisplays the evaluation tree using unicode and colors with background colors(evaluate the type level expression in IO.pl @(Between 4 10 Id) 7 & mapped . _Val %~ notTrue (4 <= 7 <= 10) Val False@eval (Proxy @'True) defOpts 7 & mapped . ttValBool . _Val %~ notNTT {_ttValP = FalseP, _ttVal = Val False, _ttString = "'True", _ttForest = []}predicate-typed and verbose(evaluate the type level expression in IO.pl @(Between 4 10 Id) 7 & mapped . _Val %~ notTrue (4 <= 7 <= 10) Val False@eval (Proxy @'True) defOpts 7 & mapped . ttValBool . _Val %~ notNTT {_ttValP = FalseP, _ttVal = Val False, _ttString = "'True", _ttForest = []}predicate-typedaevaluate a typelevel expression (use type applications to pass in the options and the expression)run @OZ @Id 123Val 1234run @('OMsg "field1" ':# OL) @('Left Id) (Right 123)"field1 >>> Error 'Left found RightFail "'Left found Right"Rrun @(OptT '[ 'OMsg "test", OU, 'OEmpty, OL, 'OMsg "field2"]) @(FailT _ "oops") ()test | field2 >>> Error oops Fail "oops"predicate-typed.run expression with multiple options in a list1runs @'[OL, 'OMsg "field2"] @'( 'True, 'False) ()/field2 >>> Present (True,False) ('(True,False))Val (True,False)Lruns @'[ 'OMsg "test", OU, 'OEmpty, OL, 'OMsg "field2"] @(FailT _ "oops") ()test | field2 >>> Error oops Fail "oops"predicate-typed-convenience method to evaluate one expressionpredicate-typedZconvenience method to evaluate two expressions using the same input and return the resultspredicate-typedbconvenience method to evaluate two boolean expressions using the same input and return the resultspredicate-typedBevaluate a boolean expressions but hide the results unless verbosepredicate-typed:evaluate a expressions but hide the results unless verbosepredicate-typed'converts the type to the corresponding  +pz @'Proxy 'x' ^!? acts . _Val . to typeRep Just Char*pz @'Proxy 45 ^!? acts . _Val . to typeRep Just Integer-pz @'Proxy "abc" ^!? acts . _Val . to typeRep Just [Char]&pz @(Pop1' (Proxy ToEnum) 'Proxy 2) LTVal GTpredicate-typed#extracts the (a,b) from type level  These a b if the value exists$pz @('These Id Id) (These 123 "abc")Val (123,"abc")%pz @('These Id 5) (These 123 "abcde") Val (123,5)pz @('These Id Id) (This "aaa")Fail "'These found This"pz @('These Id Id) (That "aaa")Fail "'These found That"predicate-typed extracts the b from type level  These a b if the value existspz @('That Id) (That 123)Val 123pz @('That Id) (This "aaa")Fail "'That found This"pz @('That Id) (These 44 "aaa")Fail "'That found These"predicate-typed extracts the a from type level  These a b if the value existspl @('This Id) (This 12)Present 12 (This)Val 12pz @('This Id) (That "aaa")Fail "'This found That" pz @('This Id) (These 999 "aaa")Fail "'This found These"pl @('This Id) (That 12)Error 'This found ThatFail "'This found That"predicate-typed extracts the b from type level  Either a b if the value existspl @('Right Id) (Right 123)Present 123 (Right)Val 123(pz @('Right Id >> Snd) (Right ('x',123))Val 123pz @('Right Id) (Left "aaa")Fail "'Right found Left"pl @('Right Id) (Left 123)Error 'Right found LeftFail "'Right found Left"predicate-typed extracts the a from type level  Either a b if the value existspz @('Left Id) (Left 123)Val 123pz @('Left Snd) ('x', Left 123)Val 123pz @('Left Id) (Right "aaa")Fail "'Left found Right"pl @('Left Id) (Left 123)Present 123 (Left)Val 123pl @('Left Id) (Right 123)Error 'Left found RightFail "'Left found Right"predicate-typedNexpects Nothing otherwise it fails if the value is Nothing then it returns Proxy a" as this provides type informationpz @'Nothing Nothing Val Proxypz @'Nothing (Just True)Fail "'Nothing found Just"predicate-typedtries to extract a from Maybe a otherwise it fails: similar to 12pz @('Just Id) (Just "abc") Val "abc"pl @('Just Id >> Id) (Just 123)!Present 123 ((>>) 123 | {Id 123})Val 123pl @('Just Id) (Just [1,2,3]).Present [1,2,3] ('Just [1,2,3] | Just [1,2,3]) Val [1,2,3]pl @('Just Id) (Just 10)Present 10 ('Just 10 | Just 10)Val 10pl @('Just Id) NothingError 'Just(empty)Fail "'Just(empty)"pz @('Just Fst) (Just 123,'x')Val 123predicate-typed2runs each predicate in turn from the promoted listpz @'[1, 2, 3] 999 Val [1,2,3]pz @'[W 1, W 2, W 3, Id] 999Val [1,2,3,999]predicate-typed=extracts the value level representation of the type level '[] pz @'[] FalseVal []predicate-typed=extracts the value level representation of the type level '() pz @'() ()Val ()predicate-typed:extracts the value level representation of the type level   pz @123 ()Val 123predicate-typed8extracts the value level representation of the promoted  pz @'LT "not used"Val LT pz @'EQ ()Val EQpredicate-typed(run the predicates in a promoted 8-tuple.pz @'(4, Id, "inj", 999, 'LT, 1, 2, 3) "hello""Val (4,"hello","inj",999,LT,1,2,3)predicate-typed(run the predicates in a promoted 7-tuple+pz @'(4, Id, "inj", 999, 'LT, 1, 2) "hello" Val (4,"hello","inj",999,LT,1,2)predicate-typed(run the predicates in a promoted 6-tuple(pz @'(4, Id, "inj", 999, 'LT, 1) "hello"Val (4,"hello","inj",999,LT,1)predicate-typed(run the predicates in a promoted 5-tuple%pz @'(4, Id, "inj", 999, 'LT) "hello"Val (4,"hello","inj",999,LT)predicate-typed(run the predicates in a promoted 4-tuple pz @'(4, Id, "inj", 999) "hello"Val (4,"hello","inj",999)predicate-typed(run the predicates in a promoted 3-tuplepz @'(4, Id, "goodbye") "hello"Val (4,"hello","goodbye") pan @'( 'True, 'False, 123) TrueP '(,,)| +- True 'True|+- False 'False| `- P '123Val (True,False,123)predicate-typed5run the predicates in a promoted 2-tuple; similar to 34pz @'(Id, 4) "hello"Val ("hello",4)predicate-typedpulls the type level   to the value level as a .5pz @"hello world" ()Val "hello world"predicate-typedpulls the type level   to the value levelpz @'True "not used"Val True pz @'False () Val Falsepredicate-typedcreate a Proxy for a kind tpz @(Proxy 4) () Val Proxypz @(Proxy Int) () Val Proxy"pz @(Proxy "abc" >> Pop0 Id ()) () Val "abc"predicate-typed  [] function pz @[] "Asf"Val []predicate-typed  () function pz @() "Asf"Val ()predicate-typedproxy for the expressionpredicate-typeddisplay optionspredicate-typedvaluepredicate-typedreturns a tree of resultsTRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Thgf\[x|yz{rpnsqomlkjiZYXWVUTSRdcba`~wvut}^]e_ ]1^0`1a2b2c3d3v4111None&',-.1:=>?@AHISUVXkBpredicate-typedZAn ADT that summarises the results of evaluating Refined3 representing all possible statesIpredicate-typedCtype family for converting from a 5-tuple '(opts,ip,op,fmt,i) to a K typeJpredicate-typed$Provides the constraints on Refined3Kpredicate-typedLike &)H but additionally reconstructs the output value to a standardized formatopts are the display optionsip converts i to PP ip i* which is the internal type and stored in Lop$ validates that internal type using PP op (PP ip i) ~ Boolfmt outputs the internal type PP fmt (PP ip i) ~ i and stored in Mi is the input typePP fmt (PP ip i)& should be valid as input for Refined3Setting ip to Id and fmt to Id is equivalent to 66Setting the input type i to .5c resembles the corresponding Read/Show instances but with an additional predicate on the read valueread a string using ip$ into an internal type and store in Lvalidate L using the predicate opshow L using fmt$ and store that formatted result in M]Although a common scenario is String as input, you are free to choose any input type you likeNpredicate-typeddirectly load values into K4. It still checks to see that those values are validOpredicate-typeddirectly load values into K without any checkingPpredicate-typed create a KE generator using a generator to restrict the values (so it completes)_g = genRefined3 @OAN @(ReadP Int Id) @(Between 10 100 Id && Even) @(ShowP Id) (choose (10,100))xs <- generate (vectorOf 10 g)=all (\x -> let y = r3In x in y >= 0 && y <= 100 && even y) xsTrueQpredicate-typed create a K generator using a proxyRpredicate-typedcreates a 5-tuple proxy (see X W)Quse type application to set the 5-tuple or set the individual parameters directlyset the 5-tuple directly<eg1 = mkProxy3 @'(OL, ReadP Int Id, Gt 10, ShowP Id, String)newRefined3P eg1 "24"Right (Refined3 24 "24")Kskip the 5-tuple and set each parameter individually using type application:eg2 = mkProxy3 @_ @OL @(ReadP Int Id) @(Gt 10) @(ShowP Id)newRefined3P eg2 "24"Right (Refined3 24 "24")Spredicate-typedsame as R: but checks to make sure the proxy is consistent with the J constraintTpredicate-typedsame as U but passes in the proxyUpredicate-typedsame as W but runs in IOVpredicate-typedsame as W] but skips the proxy and allows you to set each parameter individually using type applicationEnewRefined3 @OZ @(ReadBase Int 16) @(Lt 255) @(PrintF "%x" Id) "00fe"Right (Refined3 254 "fe")qnewRefined3 @OZ @(ReadBase Int 16) @(GuardBool (PrintF "0x%X is too large" Id) (Lt 253)) @(PrintF "%x" Id) "00fe"9Left Step 2. Failed Boolean Check(op) | 0xFE is too largeEnewRefined3 @OZ @(ReadBase Int 16) @(Lt 255) @(PrintF "%x" Id) "00fg"<Left Step 1. Failed Initial Conversion(ip) | invalid base 16newRefined3 @OL @(Map' (ReadP Int Id) (Resplit "\\.")) @(Msg "length invalid:" (Len == 4)) @(PrintL 4 "%03d.%03d.%03d.%03d" Id) "198.162.3.1.5"?Left Step 2. False Boolean Check(op) | {length invalid: 5 == 4}newRefined3 @OZ @(Map' (ReadP Int Id) (Resplit "\\.")) @(GuardBool (PrintF "found length=%d" Len) (Len == 4)) @(PrintL 4 "%03d.%03d.%03d.%03d" Id) "198.162.3.1.5"6Left Step 2. Failed Boolean Check(op) | found length=5newRefined3 @OZ @(Map' (ReadP Int Id) (Resplit "\\.")) @(GuardBool (PrintF "found length=%d" Len) (Len == 4)) @(PrintL 4 "%03d.%03d.%03d.%03d" Id) "198.162.3.1"0Right (Refined3 [198,162,3,1] "198.162.003.001") :m + Data.Time.Calendar.WeekDatetnewRefined3 @OZ @(MkDayExtra Id >> 'Just Id) @(GuardBool "expected a Sunday" (Thd == 7)) @(UnMkDay Fst) (2019,10,13)/Right (Refined3 (2019-10-13,41,7) (2019,10,13))onewRefined3 @OL @(MkDayExtra Id >> 'Just Id) @(Msg "expected a Sunday:" (Thd == 7)) @(UnMkDay Fst) (2019,10,12)BLeft Step 2. False Boolean Check(op) | {expected a Sunday: 6 == 7}~newRefined3 @OZ @(MkDayExtra' Fst Snd Thd >> 'Just Id) @(GuardBool "expected a Sunday" (Thd == 7)) @(UnMkDay Fst) (2019,10,12)9Left Step 2. Failed Boolean Check(op) | expected a Sunday_newRefined3 @OL @(ParseTimeP TimeOfDay "%-H:%-M:%-S") @'True @(FormatTimeP "%H:%M:%S") "1:15:7"$Right (Refined3 01:15:07 "01:15:07")^newRefined3 @OL @(ParseTimeP TimeOfDay "%-H:%-M:%-S") @'True @(FormatTimeP "%H:%M:%S") "1:2:x"_Left Step 1. Failed Initial Conversion(ip) | ParseTimeP TimeOfDay (%-H:%-M:%-S) failed to parsenewRefined3 @OL @(Rescan "^(\\d{1,2}):(\\d{1,2}):(\\d{1,2})$" >> L2 Head >> Map (ReadP Int Id)) @(All (0 <..> 59) && Len == 3) @(PrintL 3 "%02d:%02d:%02d" Id) "1:2:3"#Right (Refined3 [1,2,3] "01:02:03")newRefined3 @OL @(Resplit "\\." >> Map (ReadP Int Id)) @(BoolsN "oops" 4 (Between 0 255 Id)) @(PrintL 4 "%03d.%03d.%03d.%03d" Id) "13.2.1.251"/Right (Refined3 [13,2,1,251] "013.002.001.251")newRefined3 @OZ @(Resplit "\\." >> Map (ReadP Int Id)) @(BoolsN "oops" 4 (Between 0 255 Id)) @(PrintL 4 "%03d.%03d.%03d.%03d" Id) "13.2.1.259"6Left Step 2. Failed Boolean Check(op) | Bool(3) [oops]newRefined3 @OZ @(Resplit "\\." >> Map (ReadP Int Id)) @(BoolsN "oops" 4 (Between 0 255 Id)) @(PrintL 4 "%03d.%03d.%03d.%03d" Id) "13.2.1.253.1"JLeft Step 2. Failed Boolean Check(op) | Bools:invalid length(5) expected 4Wpredicate-typedLcreate a Refined3 using a 5-tuple proxy and aggregate the results on failureftype T4 k = '(OZ, MkDayExtra Id >> 'Just Id, GuardBool "expected a Sunday" (Thd == 7), UnMkDay Fst, k))newRefined3P (Proxy @(T4 _)) (2019,10,12)9Left Step 2. Failed Boolean Check(op) | expected a Sunday)newRefined3P (Proxy @(T4 _)) (2019,10,13)/Right (Refined3 (2019-10-13,41,7) (2019,10,13))Xpredicate-typed3create a Refined3 value using a 5-tuple proxy (see R)use R/ to package all the types together as a 5-tuple predicate-typed7creates Refined3 value but skips the initial conversionZpredicate-typed  instance for K[predicate-typed  instance for Kimport Control.Arrow ((+++))import Control.Lensimport Data.Time>type K1 = MakeR3 '(OAN, ReadP Day Id, 'True, ShowP Id, String)utype K2 = MakeR3 '(OAN, ReadP Day Id, Between (ReadP Day "2019-05-30") (ReadP Day "2019-06-01") Id, ShowP Id, String)&r = unsafeRefined3' "2019-04-23" :: K1DremoveAnsi $ (view _3 +++ view _3) $ B.decodeOrFail @K1 (B.encode r) Refined3 2019-04-23 "2019-04-23"DremoveAnsi $ (view _3 +++ view _3) $ B.decodeOrFail @K2 (B.encode r)ERefined3:Step 2. False Boolean Check(op) | {2019-05-30 <= 2019-04-23};*** Step 1. Success Initial Conversion(ip) (2019-04-23) ***P ReadP Day 2019-04-23|`- P Id "2019-04-23"'*** Step 2. False Boolean Check(op) ***False 2019-05-30 <= 2019-04-23|+- P Id 2019-04-23|+- P ReadP Day 2019-05-30| || `- P '"2019-05-30"|`- P ReadP Day 2019-06-01 | `- P '"2019-06-01"\predicate-typed  instance for Knxs <- generate (vectorOf 10 (arbitrary @(Refined3 OAN (ReadP Int Id) (1 <..> 120 && Even) (ShowP Id) String)))<all (\x -> let y = r3In x in y /= 0 && r3Out x == show y) xsTrue]predicate-typed  instance for K import qualified Data.Aeson as AfA.eitherDecode' @(Refined3 OZ (ReadBase Int 16) (Id > 10 && Id < 256) (ShowBase 16) String) "\"00fe\""Right (Refined3 254 "fe")xremoveAnsi $ A.eitherDecode' @(Refined3 OAN (ReadBase Int 16) (Id > 10 && Id < 256) (ShowBase 16) String) "\"00fe443a\""YError in $: Refined3:Step 2. False Boolean Check(op) | {True && False | (16663610 < 256)}9*** Step 1. Success Initial Conversion(ip) (16663610) ***P ReadBase(Int,16) 16663610|`- P Id "00fe443a"'*** Step 2. False Boolean Check(op) ***&False True && False | (16663610 < 256)|+- True 16663610 > 10| || +- P Id 16663610| | | `- P '10|`- False 16663610 < 256 | +- P Id 16663610 | `- P '256^predicate-typed  instance for K import qualified Data.Aeson as ATA.encode (unsafeRefined3' @OZ @(ReadBase Int 16) @(0 <..> 0xff) @(ShowBase 16) "fe")"\"fe\""1A.encode (unsafeRefined3' @OZ @Id @'True @Id 123)"123"_predicate-typed  instance for K_reads @(Refined3 OZ (ReadBase Int 16) (0 <..> 0xff) (ShowBase 16) String) "Refined3 254 \"fe\""[(Refined3 254 "fe","")]`reads @(Refined3 OZ (ReadBase Int 16) (0 <..> 0xff) (ShowBase 16) String) "Refined3 300 \"12c\""[]`reads @(Refined3 OZ (ReadBase Int 16) (Id < 0) (ShowBase 16) String) "Refined3 (-1234) \"-4d2\""[(Refined3 (-1234) "-4d2","")]reads @(Refined3 OZ (Map' (ReadP Int Id) (Resplit "\\.")) (GuardBool "len/=4" (Len == 4)) (PrintL 4 "%d.%d.%d.%d" Id) String) "Refined3 [192,168,0,1] \"192.168.0.1\""+[(Refined3 [192,168,0,1] "192.168.0.1","")]`predicate-typed  instance for Refined3XpureTryTest $ fromString @(Refined3 OL (ReadP Int Id) (Id > 12) (ShowP Id) String) "523"Right (Refined3 523 "523")VpureTryTest $ fromString @(Refined3 OL (ReadP Int Id) (Id > 12) (ShowP Id) String) "2"Left ()<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYKLMJ<=>?@ABCDEFGXYVTWURSIHONPQNone&',-.1:=>?@AHISUVXkipredicate-typed?type family for converting from a 4-tuple '(opts,ip,op,i) to a v typeppredicate-typedZAn ADT that summarises the results of evaluating Refined2 representing all possible statesupredicate-typed$Provides the constraints on Refined2vpredicate-typedSRefinement type for specifying an input type that is different from the output typeopts are the display optionsip converts i to PP ip i which is the internal type in wop$ validates that internal type using PP op (PP ip i) ~ Booli& is the input type which is stored in x]Although a common scenario is String as input, you are free to choose any input type you likeypredicate-typeddirectly load values into v4. It still checks to see that those values are validzpredicate-typeddirectly load values into v without any checking{predicate-typed create a vE generator using a generator to restrict the values (so it completes)Gg = genRefined2 @OAN @(ToEnum Day) @(UnMkDay Id >> Snd == 10) arbitraryxs <- generate (vectorOf 10 g)kall (\x -> let y = toEnum @Day (fromIntegral (r2Out x)) in view _2 (toGregorian y) == 10 && y == r2In x) xsTrue|predicate-typed create a v generator using a proxy~predicate-typedsame as  but runs in IOpredicate-typed$pure version for extracting Refined23newRefined2 @OZ @(ReadBase Int 16) @(Lt 255) "00fe"Right (Refined2 254 "00fe")_newRefined2 @OZ @(ReadBase Int 16) @(GuardBool (PrintF "0x%X is too large" Id) (Lt 253)) "00fe"9Left Step 2. Failed Boolean Check(op) | 0xFE is too large3newRefined2 @OZ @(ReadBase Int 16) @(Lt 255) "00fg"<Left Step 1. Failed Initial Conversion(ip) | invalid base 16jnewRefined2 @OL @(Map' (ReadP Int Id) (Resplit "\\.")) @(Msg "length invalid:" (Len == 4)) "198.162.3.1.5"?Left Step 2. False Boolean Check(op) | {length invalid: 5 == 4}}newRefined2 @OZ @(Map' (ReadP Int Id) (Resplit "\\.")) @(GuardBool (PrintF "found length=%d" Len) (Len == 4)) "198.162.3.1.5"6Left Step 2. Failed Boolean Check(op) | found length=5{newRefined2 @OZ @(Map' (ReadP Int Id) (Resplit "\\.")) @(GuardBool (PrintF "found length=%d" Len) (Len == 4)) "198.162.3.1",Right (Refined2 [198,162,3,1] "198.162.3.1") :m + Data.Time.Calendar.WeekDateenewRefined2 @OZ @(MkDayExtra Id >> 'Just Id) @(GuardBool "expected a Sunday" (Thd == 7)) (2019,10,13)/Right (Refined2 (2019-10-13,41,7) (2019,10,13))`newRefined2 @OL @(MkDayExtra Id >> 'Just Id) @(Msg "expected a Sunday:" (Thd == 7)) (2019,10,12)BLeft Step 2. False Boolean Check(op) | {expected a Sunday: 6 == 7}onewRefined2 @OZ @(MkDayExtra' Fst Snd Thd >> 'Just Id) @(GuardBool "expected a Sunday" (Thd == 7)) (2019,10,12)9Left Step 2. Failed Boolean Check(op) | expected a SundaynewRefined2 @OL @Id @'True 22Right (Refined2 22 22)|newRefined2 @OL @(ReadP UTCTime Id) @(Between (MkDay '(2020,5,2)) (MkDay '(2020,5,7)) (MkJust ToDay)) "2020-05-04 12:13:14Z"?Right (Refined2 2020-05-04 12:13:14 UTC "2020-05-04 12:13:14Z")|newRefined2 @OL @(ReadP UTCTime Id) @(Between (MkDay '(2020,5,2)) (MkDay '(2020,5,7)) (MkJust ToDay)) "2020-05-08 12:13:14Z"KLeft Step 2. False Boolean Check(op) | {Just 2020-05-08 <= Just 2020-05-07}predicate-typedcreates a 4-tuple proxy (see  )Quse type application to set the 4-tuple or set the individual parameters directlyset the 4-tuple directly2eg1 = mkProxy2 @'(OL, ReadP Int Id, Gt 10, String)newRefined2P eg1 "24"Right (Refined2 24 "24")Kskip the 4-tuple and set each parameter individually using type application.eg2 = mkProxy2 @_ @OL @(ReadP Int Id) @(Gt 10)newRefined2P eg2 "24"Right (Refined2 24 "24")predicate-typedsame as : but checks to make sure the proxy is consistent with the u constraintpredicate-typed  instance for vpredicate-typed  instance for vimport Control.Arrow ((+++))import Data.Time2type K1 = Refined2 OAN (ReadP Day Id) 'True Stringktype K2 = Refined2 OAN (ReadP Day Id) (Between (ReadP Day "2019-05-30") (ReadP Day "2019-06-01") Id) String&r = unsafeRefined2' "2019-04-23" :: K1DremoveAnsi $ (view _3 +++ view _3) $ B.decodeOrFail @K1 (B.encode r) Refined2 2019-04-23 "2019-04-23"DremoveAnsi $ (view _3 +++ view _3) $ B.decodeOrFail @K2 (B.encode r)ERefined2:Step 2. False Boolean Check(op) | {2019-05-30 <= 2019-04-23};*** Step 1. Success Initial Conversion(ip) (2019-04-23) ***P ReadP Day 2019-04-23|`- P Id "2019-04-23"'*** Step 2. False Boolean Check(op) ***False 2019-05-30 <= 2019-04-23|+- P Id 2019-04-23|+- P ReadP Day 2019-05-30| || `- P '"2019-05-30"|`- P ReadP Day 2019-06-01 | `- P '"2019-06-01"predicate-typed  instance for v :m + Data.Time.Calendar.WeekDatekxs <- generate (vectorOf 10 (arbitrary @(Refined2 OAN (ToEnum Day) (L2 (ToWeekDate Id) == "Tuesday") Int)))Zall (\x -> let y = toEnum @Day (r2Out x) in view _3 (toWeekDate y) == 2 && r2In x == y) xsTruepredicate-typed  instance for v import qualified Data.Aeson as AXA.eitherDecode' @(Refined2 OZ (ReadBase Int 16) (Id > 10 && Id < 256) String) "\"00fe\""Right (Refined2 254 "00fe")jremoveAnsi $ A.eitherDecode' @(Refined2 OAN (ReadBase Int 16) (Id > 10 && Id < 256) String) "\"00fe443a\""YError in $: Refined2:Step 2. False Boolean Check(op) | {True && False | (16663610 < 256)}9*** Step 1. Success Initial Conversion(ip) (16663610) ***P ReadBase(Int,16) 16663610|`- P Id "00fe443a"'*** Step 2. False Boolean Check(op) ***&False True && False | (16663610 < 256)|+- True 16663610 > 10| || +- P Id 16663610| | | `- P '10|`- False 16663610 < 256 | +- P Id 16663610 | `- P '256predicate-typed  instance for v import qualified Data.Aeson as AHA.encode (unsafeRefined2 @OZ @(ReadBase Int 16) @(0 <..> 0xff) 254 "fe")"\"fe\""5A.encode (unsafeRefined2 @OZ @Id @'True @Int 123 123)"123"predicate-typed  instance for vQreads @(Refined2 OZ (ReadBase Int 16) (0 <..> 0xff) String) "Refined2 254 \"fe\""[(Refined2 254 "fe","")]Rreads @(Refined2 OZ (ReadBase Int 16) (0 <..> 0xff) String) "Refined2 300 \"12c\""[]Rreads @(Refined2 OZ (ReadBase Int 16) (Id < 0) String) "Refined2 (-1234) \"-4d2\""[(Refined2 (-1234) "-4d2","")]reads @(Refined2 OZ (Map' (ReadP Int Id) (Resplit "\\.")) (GuardBool "len/=4" (Len == 4)) String) "Refined2 [192,168,0,1] \"192.168.0.1\""+[(Refined2 [192,168,0,1] "192.168.0.1","")]predicate-typed  instance for Refined2MpureTryTest $ fromString @(Refined2 OL (ReadP Int Id) (Id > 12) String) "523"Right (Refined2 523 "523")KpureTryTest $ fromString @(Refined2 OL (ReadP Int Id) (Id > 12) String) "2"Left ()ijklmnopqrstuvwxyz{|}~vwxujklmnopqrst}~i{|zyNone,-.:;<=>?@AHIMSUVXk3Dpredicate-typedthe constraints that  must adhere topredicate-typed4a simple refinement type that ensures the predicate p holds for the type apredicate-typedextract the value from Refinedpredicate-typedcreate 3 generator using a generator to restrict the valuespredicate-typed returns a  value if a is valid for the predicate p)newRefined @OL @(ReadP Int Id > 99) "123"Right (Refined "123")6left m0Long $ newRefined @OL @(ReadP Int Id > 99) "12"Left "False (12 > 99)"%newRefined @OZ @(Between 10 14 Id) 13Right (Refined 13)4left m0BoolE $ newRefined @OZ @(Between 10 14 Id) 99Left (Right False)?newRefined @OZ @(Last >> Len == 4) ["one","two","three","four"],Right (Refined ["one","two","three","four"])QnewRefined @OZ @(Re "^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$") "141.213.1.99"Right (Refined "141.213.1.99")]left m0BoolE $ newRefined @OZ @(Re "^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$") "141.213.1"Left (Right False)left m0BoolE $ newRefined @OZ @(Map' (ReadP Int Id) (Resplit "\\.") >> GuardBool (PrintF "bad length: found %d" Len) (Len == 4)) "141.213.1"!Left (Left "bad length: found 3")left m0BoolE $ newRefined @OZ @(Map' (ReadP Int Id) (Resplit "\\.") >> GuardBool (PrintF "bad length: found %d" Len) (Len == 4) && BoolsN (PrintT "octet %d out of range %d" Id) 4 (0 <..> 0xff)) "141.213.1.444"0Left (Left "Bool(3) [octet 3 out of range 444]")left m0BoolE $ newRefined @OZ @(Map' (ReadP Int Id) (Resplit "\\.") >> GuardBool (PrintF "bad length: found %d" Len) (Len == 4) && BoolsN (PrintT "octet %d out of range %d" Id) 4 (0 <..> 0xff)) "141.213.1x34.444"Left (Left "ReadP Int (1x34)")?newRefined @OZ @(Map ('[Id] >> ReadP Int Id) >> IsLuhn) "12344"Right (Refined "12344")Nleft m0BoolE $ newRefined @OZ @(Map ('[Id] >> ReadP Int Id) >> IsLuhn) "12340"Left (Right False)+newRefined @OZ @(Any IsPrime) [11,13,17,18]Right (Refined [11,13,17,18]):left m0BoolE $ newRefined @OZ @(All IsPrime) [11,13,17,18]Left (Right False)JnewRefined @OZ @(Snd !! Fst >> Len > 5) (2,["abc","defghij","xyzxyazsfd"])2Right (Refined (2,["abc","defghij","xyzxyazsfd"]))Zleft m0BoolE $ newRefined @OZ @(Snd !! Fst >> Len > 5) (27,["abc","defghij","xyzxyazsfd"])"Left (Left "(!!) index not found")Zleft m0BoolE $ newRefined @OZ @(Snd !! Fst >> Len <= 5) (2,["abc","defghij","xyzxyazsfd"])Left (Right False)VnewRefined @OU @((Id $$ 13) > 100) (\x -> x * 14) ^? _Right . to unRefined . to ($ 99) Just 1386predicate-typedcreate an unsafe $ value without running the predicatepredicate-typedcreate an unsafe ! value and also run the predicatepredicate-typed  instance for predicate-typed  instance for Exs <- generate (vectorOf 10 (arbitrary @(Refined OAN (Id /= 0) Int)))all ((/=0) . unRefined) xsTrueCxs <- generate (vectorOf 10 (arbitrary @(Refined OAN IsPrime Int)))all (isPrime . unRefined) xsTruepredicate-typed  instance for predicate-typed  instance for import Data.Timeimport Control.Lensimport Control.Arrow ((+++))3type K1 = Refined OZ (ReadP Day Id >> 'True) Stringgtype K2 = Refined OAN (Between (ReadP Day "2019-05-30") (ReadP Day "2019-06-01") (ReadP Day Id)) String)r = unsafeRefined' @OZ "2019-04-23" :: K1DremoveAnsi $ (view _3 +++ view _3) $ B.decodeOrFail @K1 (B.encode r)Refined "2019-04-23"DremoveAnsi $ (view _3 +++ view _3) $ B.decodeOrFail @K2 (B.encode r)4Refined(Binary:get):False (2019-05-30 <= 2019-04-23)False 2019-05-30 <= 2019-04-23|+- P ReadP Day 2019-04-23| || `- P Id "2019-04-23"|+- P ReadP Day 2019-05-30| || `- P '"2019-05-30"|`- P ReadP Day 2019-06-01 | `- P '"2019-06-01"predicate-typed  instance for  import qualified Data.Aeson as A9A.eitherDecode' @(Refined OZ (Between 10 14 Id) Int) "13"Right (Refined 13)GremoveAnsi $ A.eitherDecode' @(Refined OAN (Between 10 14 Id) Int) "16"8Error in $: Refined(FromJSON:parseJSON):False (16 <= 14)False 16 <= 14| +- P Id 16|+- P '10|`- P '14predicate-typed  instance for 2reads @(Refined OZ (0 <..> 299) Int) "Refined 254"[(Refined 254,"")]2reads @(Refined OZ (0 <..> 299) Int) "Refined 300"[]1reads @(Refined OZ 'True Int) "Refined (-123)xyz"[(Refined (-123),"xyz")]predicate-typed  instance for RefinedNpureTryTest $ fromString @(Refined OL (ReadP Int Id >> Id > 244) String) "523"Right (Refined "523")MpureTryTest $ fromString @(Refined OL (ReadP Int Id >> Id > 244) String) "52"Left ()None&',-.1:;=>?@AHIMSUVXkQpredicate-typedcreates a 4-tuple proxy (see  )Quse type application to set the 4-tuple or set the individual parameters directlyset the 4-tuple directly2eg1 = mkProxy2 @'(OL, ReadP Int Id, Gt 10, String)newRefined5P eg1 "24"Right (Refined5 24)Kskip the 4-tuple and set each parameter individually using type application.eg2 = mkProxy2 @_ @OL @(ReadP Int Id) @(Gt 10)newRefined5P eg2 "24"Right (Refined5 24)?type family for converting from a 4-tuple '(opts,ip,op,i) to a  typepredicate-typedSRefinement type for specifying an input type that is different from the output typeopts are the display optionsip converts i to PP ip i which is storedop$ validates that internal type using PP op (PP ip i) ~ BooliA is the input type which is discarded after converting to PP ip ipredicate-typedextract the value from predicate-typeddirectly load values into 4. It still checks to see that those values are validpredicate-typeddirectly load values into  without any checkingpredicate-typed create a E generator using a generator to restrict the values (so it completes)predicate-typed create a  generator using a proxypredicate-typedsame as  but runs in IOpredicate-typed$pure version for extracting Refined53newRefined5 @OZ @(ReadBase Int 16) @(Lt 255) "00fe"Right (Refined5 254)_newRefined5 @OZ @(ReadBase Int 16) @(GuardBool (PrintF "0x%X is too large" Id) (Lt 253)) "00fe"9Left Step 2. Failed Boolean Check(op) | 0xFE is too large3newRefined5 @OZ @(ReadBase Int 16) @(Lt 255) "00fg"<Left Step 1. Failed Initial Conversion(ip) | invalid base 16jnewRefined5 @OL @(Map' (ReadP Int Id) (Resplit "\\.")) @(Msg "length invalid:" (Len == 4)) "198.162.3.1.5"?Left Step 2. False Boolean Check(op) | {length invalid: 5 == 4}}newRefined5 @OZ @(Map' (ReadP Int Id) (Resplit "\\.")) @(GuardBool (PrintF "found length=%d" Len) (Len == 4)) "198.162.3.1.5"6Left Step 2. Failed Boolean Check(op) | found length=5{newRefined5 @OZ @(Map' (ReadP Int Id) (Resplit "\\.")) @(GuardBool (PrintF "found length=%d" Len) (Len == 4)) "198.162.3.1"Right (Refined5 [198,162,3,1]) :m + Data.Time.Calendar.WeekDateenewRefined5 @OZ @(MkDayExtra Id >> 'Just Id) @(GuardBool "expected a Sunday" (Thd == 7)) (2019,10,13)"Right (Refined5 (2019-10-13,41,7))`newRefined5 @OL @(MkDayExtra Id >> 'Just Id) @(Msg "expected a Sunday:" (Thd == 7)) (2019,10,12)BLeft Step 2. False Boolean Check(op) | {expected a Sunday: 6 == 7}onewRefined5 @OZ @(MkDayExtra' Fst Snd Thd >> 'Just Id) @(GuardBool "expected a Sunday" (Thd == 7)) (2019,10,12)9Left Step 2. Failed Boolean Check(op) | expected a SundaynewRefined5 @OL @Id @'True 22Right (Refined5 22)|newRefined5 @OL @(ReadP UTCTime Id) @(Between (MkDay '(2020,5,2)) (MkDay '(2020,5,7)) (MkJust ToDay)) "2020-05-04 12:13:14Z"(Right (Refined5 2020-05-04 12:13:14 UTC)|newRefined5 @OL @(ReadP UTCTime Id) @(Between (MkDay '(2020,5,2)) (MkDay '(2020,5,7)) (MkJust ToDay)) "2020-05-08 12:13:14Z"KLeft Step 2. False Boolean Check(op) | {Just 2020-05-08 <= Just 2020-05-07}predicate-typed  instance for predicate-typed  instance for predicate-typed  instance for  :m + Data.Time.Calendar.WeekDatebxs <- generate (vectorOf 10 (arbitrary @(Refined5 OAN (ReadP Int Id) (Negate 10 <..> 10) String))).all (\x -> unRefined5 x `elem` [-10 .. 10]) xsTruepredicate-typed  instance for  import qualified Data.Aeson as ASA.eitherDecode' @(Refined5 OZ (ReadBase Int 16) (Id > 10 && Id < 256) String) "123"Right (Refined5 123)^removeAnsi $ A.eitherDecode' @(Refined5 OL (ReadBase Int 16) (Id > 10 && Id < 256) String) "9"EError in $: Refined5:false boolean check | {False && True | (9 > 10)}FalseSA.eitherDecode' @(Refined5 OZ (ReadBase Int 16) (Id > 10 && Id < 256) String) "254"Right (Refined5 254)cremoveAnsi $ A.eitherDecode' @(Refined5 OAN (ReadBase Int 16) (Id > 10 && Id < 256) String) "12345"JError in $: Refined5:false boolean check | {True && False | (12345 < 256)}#False True && False | (12345 < 256)|+- True 12345 > 10| || +- P Id 12345| | | `- P '10|`- False 12345 < 256 | +- P Id 12345 | `- P '256predicate-typed  instance for  import qualified Data.Aeson as AIA.encode (unsafeRefined5' @OZ @(ReadBase Int 16) @(Between 0 255 Id) 254)"254"1A.encode (unsafeRefined5 @OZ @Id @'True @Int 123)"123"predicate-typed  instance for Jreads @(Refined5 OZ (ReadBase Int 16) (0 <..> 0xff) String) "Refined5 254"[(Refined5 254,"")]Jreads @(Refined5 OZ (ReadBase Int 16) (0 <..> 0xff) String) "Refined5 300"[]Greads @(Refined5 OZ (ReadBase Int 16) (Id < 0) String) "Refined5 -1234"[(Refined5 (-1234),"")]zreads @(Refined5 OZ (Map' (ReadP Int Id) (Resplit "\\.")) (GuardBool "len/=4" (Len == 4)) String) "Refined5 [192,168,0,1]"[(Refined5 [192,168,0,1],"")]Xreads @(Refined5 OZ (ReadP Rational Id) (Id > Negate 4 % 3) String) "Refined5 (-10 % 9)"[(Refined5 ((-10) % 9),"")]Xreads @(Refined5 OZ (ReadP Rational Id) (Id > Negate 4 % 3) String) "Refined5 (-10 % 6)"[]predicate-typed  instance for Refined5MpureTryTest $ fromString @(Refined5 OL (ReadP Int Id) (Id > 12) String) "523"Right (Refined5 523)KpureTryTest $ fromString @(Refined5 OL (ReadP Int Id) (Id > 12) String) "2"Left ()   None&',-.=>?@AHSUVXkoߡpredicate-typed6create inductive tuples from a list of the exact size n9pz @(ToITupleList 4 >> EachITuple Succ) ['a','c','y','B']Val ('b',('d',('z',('C',()))))&pz @(ToITupleList 4) ['a','c','y','B']Val ('a',('c',('y',('B',())))).pz @(Take 10 Id >> ToITupleList 10) ['a'..'z']BVal ('a',('b',('c',('d',('e',('f',('g',('h',('i',('j',()))))))))))predicate-typedreverse an inductive tuple0pz @ReverseITuple (1.4,(1,(2,(False,('x',())))))"Val ('x',(False,(2,(1,(1.4,())))))predicate-typed(create inductive tuples from flat tuples1pz @(ToITuple >> EachITuple Succ) (1,2,False,'x')Val (2,(3,(True,('y',()))))predicate-typedrun p with inductive tuples/pz @(EachITuple Succ) (False,(2,(LT,('c',()))))Val (True,(3,(EQ,('d',()))))@pz @(EachITuple (Id + (4 >> FromIntegral _))) (1,(1/4,(5%6,()))) Val (5 % 1,(17 % 4,(29 % 6,())))Hpz @(ToITuple >> EachITuple (Id + (4 >> FromIntegral _))) (1000,1/4,5%6)#Val (1004 % 1,(17 % 4,(29 % 6,())))epz @(ToITuple >> EachITuple ((Id >> FromIntegral _) + (4 >> FromIntegral _))) (1000::Integer,17::Int)Val (1004,(21,()))Mpz @(ToITuple >> EachITuple (Dup >> Fst<>Snd)) (SG.Min 1,SG.First 'x',"abcd")?Val (Min {getMin = 1},(First {getFirst = 'x'},("abcdabcd",())))predicate-typedcreate a n tuple from a listpz @(Tuple' 4) "abcdefg"Val (Right ('a','b','c','d'))pz @(Tuple' 4) "abc"Val (Left "abc")pz @(Tuple' 4) [] Val (Left [])pl @(Tuple' 4) "abc"5Present Left "abc" (Tuple'(4) not enough elements(3))Val (Left "abc"):set -XPolyKindsCtype F n i = ChunksOf' n i Id >> Map (Tuple' n) >> PartitionEitherspz @(F 3 1) [1..7];Val ([[6,7],[7]],[(1,2,3),(2,3,4),(3,4,5),(4,5,6),(5,6,7)])predicate-typedcreate a n tuple from a listpz @(Tuple 4) "abcdefg"Val ('a','b','c','d')pz @(Tuple 4) "abc"&Fail "Tuple(4) not enough elements(3)""pz @(Fst >> Tuple 3) ([1..5],True) Val (1,2,3)&pz @(Lift (Tuple 3) Fst) ([1..5],True) Val (1,2,3)predicate-typed similar to 78+pz @('(4,2) >> On (**) (FromIntegral _)) ()Val 16.0?pz @(On (+) (Id * Id) >> Id ** (1 % 2 >> FromRational _)) (3,4)Val 5.0predicate-typedapplies p8 to the first and second slot of an n-tuple (similar to )-pl @(Fst >> Both Len) (("abc",[10..17]),True)#Present (3,8) ((>>) (3,8) | {Both}) Val (3,8)*pl @(Lift (Both Pred) Fst) ((12,'z'),True))Present (11,'y') ((>>) (11,'y') | {Both}) Val (11,'y')pl @(Both Succ) (4,'a')Present (5,'b') (Both) Val (5,'b')import Data.Time5pl @(Both (ReadP Day Id)) ("1999-01-01","2001-02-12")&Present (1999-01-01,2001-02-12) (Both)Val (1999-01-01,2001-02-12)predicate-typedapplies p to lhs of the tuple and q to the rhs and then Ors them together,pl @(Sum > 44 |+ Id < 2) ([5,6,7,8,14,44],9)True (True (|+) False)Val True'pl @(Sum > 44 |+ Id < 2) ([5,6,7,14],9)1False (False (|+) False | (32 > 44) (|+) (9 < 2)) Val False'pl @(Sum > 44 |+ Id < 2) ([5,6,7,14],1)True (False (|+) True)Val Truepredicate-typedapplies p to lhs of the tuple and q to the rhs and then ors them together: see !pl @(OrA (Gt 3) (Lt 10) Id) (1,2)True (False (|+) True)Val Truepredicate-typedapplies p to lhs of the tuple and q to the rhs and then Ands them together2pl @(SplitAt 4 "abcdefg" >> Len > 4 &* Len < 5) ()0False ((>>) False | {False (&*) True | (4 > 4)}) Val Falsepredicate-typedapplies p to lhs of the tuple and q to the rhs and then ands them together: see "pl @(AndA (Gt 3) (Lt 10) Id) (1,2)!False (False (&*) True | (1 > 3)) Val Falsepredicate-typedBapplies a function against the second part of a tuple: similar to 39pz @(Second Succ) (12,False) Val (12,True)predicate-typedAapplies a function against the first part of a tuple: similar to 3:pz @(First Succ) (12,True) Val (13,True)predicate-typed similar to 3;"pz @(Pred *** ShowP Id) (13, True)Val (12,"True")+pl @(FlipT (***) Len (Id * 12)) (99,"cdef")/Present (1188,4) ((***) (1188,4) | (99,"cdef")) Val (1188,4),pl @(4 *** "sadf" *** 'LT) ('x',("abv",[1]))CPresent (4,("sadf",LT)) ((***) (4,("sadf",LT)) | ('x',("abv",[1])))Val (4,("sadf",LT))predicate-typed similar to 343pl @(Min &&& Max >> Id >> Fst < Snd) [10,4,2,12,14]True ((>>) True | {2 < 14})Val True!pl @((123 &&& Id) >> Fst + Snd) 4(Present 127 ((>>) 127 | {123 + 4 = 127})Val 127pl @(4 &&& "sadf" &&& 'LT) ()*Present (4,("sadf",LT)) ('(4,("sadf",LT)))Val (4,("sadf",LT))!pl @(Id &&& '() &&& ()) (Just 10).Present (Just 10,((),())) ('(Just 10,((),())))Val (Just 10,((),()))-pl @(Fst &&& Snd &&& Thd &&& ()) (1,'x',True)2Present (1,('x',(True,()))) ('(1,('x',(True,()))))Val (1,('x',(True,())))-pl @(Fst &&& Snd &&& Thd &&& ()) (1,'x',True)2Present (1,('x',(True,()))) ('(1,('x',(True,()))))Val (1,('x',(True,()))).pl @(Fst &&& Snd &&& Thd &&& ()) (1,1.4,"aaa")4Present (1,(1.4,("aaa",()))) ('(1,(1.4,("aaa",()))))Val (1,(1.4,("aaa",())))predicate-typedNcreates a list of overlapping pairs of elements. requires two or more elementspz @Pairs [1,2,3,4]Val [(1,2),(2,3),(3,4)] pz @Pairs []Val [] pz @Pairs [1]Val []pl @Pairs [1,2]'Present [(1,2)] (Pairs [(1,2)] | [1,2]) Val [(1,2)]pl @Pairs [1,2,3]5Present [(1,2),(2,3)] (Pairs [(1,2),(2,3)] | [1,2,3])Val [(1,2),(2,3)]pl @Pairs [1,2,3,4]CPresent [(1,2),(2,3),(3,4)] (Pairs [(1,2),(2,3),(3,4)] | [1,2,3,4])Val [(1,2),(2,3),(3,4)]Apan @(Pairs >> Len >> 'True >> 'False >> FailT _ "xyzzy") "abcde" [Error xyzzy] False|4+- P Pairs [('a','b'),('b','c'),('c','d'),('d','e')]| +- P Len 4| +- True 'True|+- False 'False|`- [Error xyzzy] Fail "xyzzy"predicate-typedduplicate a value into a tuple pl @Dup 4Present (4,4) ('(4,4)) Val (4,4)pl @(Dup >> Id) 4'Present (4,4) ((>>) (4,4) | {Id (4,4)}) Val (4,4)pl @(Dup << Fst * Snd) (4,5)+Present (20,20) ((>>) (20,20) | {'(20,20)}) Val (20,20)pl @(Fst * Snd >> Dup) (4,5)+Present (20,20) ((>>) (20,20) | {'(20,20)}) Val (20,20)3333 None&',-.=>?@AHSUVXko%predicate-typed%tries to extract the values from the   constructor)pz @(These' >> Second Succ) (These 1 'a') Val (1,'b')pz @(That' >> Succ) (This 'a')Fail "That' found This"$pz @(These' >> Second Succ) (That 8)Fail "These' found That"predicate-typed"tries to extract a value from the   constructorpz @(That' >> Succ) (That 20)Val 21pz @(That' >> Succ) (This 'a')Fail "That' found This"predicate-typed"tries to extract a value from the   constructorpz @(This' >> Succ) (This 20)Val 21pz @(This' >> Succ) (That 'a')Fail "This' found That"predicate-typedunassoc using  "pz @Unassoc (These 123 (This 'x'))Val (This (These 123 'x'))pz @Unassoc (99,('a',True))Val ((99,'a'),True)2pz @Unassoc (This 10 :: These Int (These Bool ()))Val (This (This 10))pz @Unassoc (Right (Right 123))Val (Right 123):pz @Unassoc (Left 'x' :: Either Char (Either Bool Double))Val (Left (Left 'x'))pl @Unassoc (10,('c',True))CPresent ((10,'c'),True) (Unassoc ((10,'c'),True) | (10,('c',True)))Val ((10,'c'),True)predicate-typed assoc using   pz @Assoc (This (These 123 'x'))Val (These 123 (This 'x'))pz @Assoc ((99,'a'),True)Val (99,('a',True))pz @Assoc ((99,'a'),True)Val (99,('a',True))7pz @Assoc (Right "Abc" :: Either (Either () ()) String)Val (Right (Right "Abc"))pz @Assoc (Left (Left 'x'))Val (Left 'x')pl @Assoc ((10,'c'),True)APresent (10,('c',True)) (Assoc (10,('c',True)) | ((10,'c'),True))Val (10,('c',True))&pl @(Assoc >> Unassoc) ((10,'c'),True)\Present ((10,'c'),True) ((>>) ((10,'c'),True) | {Unassoc ((10,'c'),True) | (10,('c',True))})Val ((10,'c'),True)predicate-typedextract the These value from a   otherwise fail with a message if there is no These value then p! is passed the whole context only,pz @(TheseFail "oops" Id) (These "abc" 20.4)Val ("abc",20.4)%pz @(TheseFail "oops" Id) (That "aa") Fail "oops"Opz @(TheseFail (PrintT "found %s fst=%d" '(ShowP Snd,Fst)) Snd) (123,That "xy") Fail "found That \"xy\" fst=123")pz @(TheseFail (MEmptyT _) Id) (That 222)Fail "" predicate-typedextract the That value from a   otherwise fail with a messageif there is no That value then p! is passed the whole context only$pz @(ThatFail "oops" Id) (That 20.4)Val 20.4$pz @(ThatFail "oops" Id) (This "aa") Fail "oops"Npz @(ThatFail (PrintT "found %s fst=%d" '(ShowP Snd,Fst)) Snd) (123,This "xy") Fail "found This \"xy\" fst=123"(pz @(ThatFail (MEmptyT _) Id) (This 222)Fail "" predicate-typedextract the This value from a   otherwise fail with a messageif there is no This value then p! is passed the whole context only$pz @(ThisFail "oops" Id) (This 20.4)Val 20.4$pz @(ThisFail "oops" Id) (That "aa") Fail "oops"Npz @(ThisFail (PrintT "found %s fst=%d" '(ShowP Snd,Fst)) Snd) (123,That "xy") Fail "found That \"xy\" fst=123"(pz @(ThisFail (MEmptyT _) Id) (That 222)Fail ""*pl @(ThisFail "sdf" Id) (This (SG.Sum 12)) Present Sum {getSum = 12} (This)Val (Sum {getSum = 12})*pl @(ThisFail "sdf" Id) (That (SG.Sum 12))Error sdf (ThisFail That) Fail "sdf"!pl @(ThisFail "sdf" Id) (That 12)Error sdf (ThisFail That) Fail "sdf" predicate-typed extract the These value from an   otherwise use the default value if there is no These value then p! is passed the whole context only0pz @(TheseDef '(1 % 4,"zz") Id) (These 20.4 "x")Val (102 % 5,"x")+pz @(TheseDef '(1 % 4,"zz") Id) (This 20.4)Val (1 % 4,"zz")*pz @(TheseDef '(1 % 4,"zz") Id) (That "x")Val (1 % 4,"zz")Tpz @(TheseDef '(PrintT "found %s fst=%d" '(ShowP Snd, Fst),999) Snd) (123,This "xy")%Val ("found This \"xy\" fst=123",999)9pz @(TheseDef (MEmptyT (SG.Sum _, String)) Id) (This 222)Val (Sum {getSum = 0},"")7pz @(TheseDef (MEmptyT _) Id) (These (SG.Sum 222) "aa")Val (Sum {getSum = 222},"aa")-pl @(TheseDef '("xyz",'True) Id) (This "abc")$Present ("xyz",True) (TheseDef This)Val ("xyz",True)-pl @(TheseDef '("xyz",'True) Id) (That False)$Present ("xyz",True) (TheseDef That)Val ("xyz",True)4pl @(TheseDef '("xyz",'True) Id) (These "abc" False)&Present ("abc",False) (TheseDef These)Val ("abc",False) predicate-typedextract the That value from an   otherwise use the default valueif there is no That value then p! is passed the whole context only$pz @(ThatDef (1 % 4) Id) (That 20.4) Val (102 % 5)$pz @(ThatDef (1 % 4) Id) (This "aa") Val (1 % 4))pz @(ThatDef (1 % 4) Id) (These "aa" 2.3) Val (1 % 4)Npz @(ThatDef (PrintT "found %s fst=%d" '(ShowP Snd, Fst)) Snd) (123,This "xy")Val "found This \"xy\" fst=123"'pz @(ThatDef (MEmptyT _) Id) (This 222)Val ()6pz @(ThatDef (MEmptyT (SG.Sum _)) Id) (These 'x' 1120)Val (Sum {getSum = 0}) predicate-typedextract the This value from an  C otherwise use the default value if there is no This value then p! is passed the whole context only$pz @(ThisDef (1 % 4) Id) (This 20.4) Val (102 % 5)$pz @(ThisDef (1 % 4) Id) (That "aa") Val (1 % 4))pz @(ThisDef (1 % 4) Id) (These 2.3 "aa") Val (1 % 4)Npz @(ThisDef (PrintT "found %s fst=%d" '(ShowP Snd, Fst)) Snd) (123,That "xy")Val "found That \"xy\" fst=123"'pz @(ThisDef (MEmptyT _) Id) (That 222)Val ()5pz @(ThisDef (MEmptyT (SG.Sum _)) Id) (These 222 'x')Val (Sum {getSum = 0})/pl @(ThisDef (MEmptyT _) Id) (This (SG.Sum 12))(Present Sum {getSum = 12} (ThisDef This)Val (Sum {getSum = 12})&pl @(ThisDef (MEmptyT _) Id) (That 12)Present () (ThisDef That)Val ()predicate-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 preserved&pz @(ZipThese Fst Snd) ("aBc", [1..5])7Val [These 'a' 1,These 'B' 2,These 'c' 3,That 4,That 5])pz @(ZipThese Fst Snd) ("aBcDeF", [1..3])DVal [These 'a' 1,These 'B' 2,These 'c' 3,This 'D',This 'e',This 'F']"pz @(ZipThese Id Reverse) "aBcDeF"YVal [These 'a' 'F',These 'B' 'e',These 'c' 'D',These 'D' 'c',These 'e' 'B',These 'F' 'a']pz @(ZipThese Id '[]) "aBcDeF";Val [This 'a',This 'B',This 'c',This 'D',This 'e',This 'F']pz @(ZipThese '[] Id) "aBcDeF";Val [That 'a',That 'B',That 'c',That 'D',That 'e',That 'F']pz @(ZipThese '[] '[]) "aBcDeF"Val []Ipl @(ZipThese Fst Snd >> Map (TheseIn Id Id Fst)) (['w'..'y'],['a'..'f'])zPresent "wxydef" ((>>) "wxydef" | {Map "wxydef" | [These 'w' 'a',These 'x' 'b',These 'y' 'c',That 'd',That 'e',That 'f']}) Val "wxydef"]pl @(("sdf" &&& Id) >> ZipThese Fst Snd >> Map (TheseIn (Id &&& 0) (C "x" &&& Id) Id)) [1..5]Present [('s',1),('d',2),('f',3),('x',4),('x',5)] ((>>) [('s',1),('d',2),('f',3),('x',4),('x',5)] | {Map [('s',1),('d',2),('f',3),('x',4),('x',5)] | [These 's' 1,These 'd' 2,These 'f' 3,That 4,That 5]})-Val [('s',1),('d',2),('f',3),('x',4),('x',5)]predicate-typedTheseId: given a  F returns a tuple but you need to provide default values for both sides'pl @(TheseId "xyz" 'True ) (This "abc")8Present ("abc",True) (TheseIn ("abc",True) | This "abc")Val ("abc",True)&pl @(TheseId "xyz" 'True) (That False):Present ("xyz",False) (TheseIn ("xyz",False) | That False)Val ("xyz",False)-pl @(TheseId "xyz" 'True) (These "abc" False)APresent ("abc",False) (TheseIn ("abc",False) | These "abc" False)Val ("abc",False)predicate-typed similar to >?1pz @(TheseIn Id Len (Fst + Length Snd)) (This 13)Val 13Fpz @(TheseIn Id Len (Fst + Length Snd)) (That "this is a long string")Val 21=pz @(TheseIn Id Len (Fst + Length Snd)) (These 20 "somedata")Val 28pz @(TheseIn (MkLeft _ Id) (MkRight _ Id) (If (Fst > Length Snd) (MkLeft _ Fst) (MkRight _ Snd))) (That "this is a long string")#Val (Right "this is a long string")pz @(TheseIn (MkLeft _ Id) (MkRight _ Id) (If (Fst > Length Snd) (MkLeft _ Fst) (MkRight _ Snd))) (These 1 "this is a long string")#Val (Right "this is a long string")pz @(TheseIn (MkLeft _ Id) (MkRight _ Id) (If (Fst > Length Snd) (MkLeft _ Fst) (MkRight _ Snd))) (These 100 "this is a long string")Val (Left 100)6pl @(TheseIn "this" "that" "these") (This (SG.Sum 12))8Present "this" (TheseIn "this" | This Sum {getSum = 12}) Val "this"Apl @(TheseIn (Id &&& 999) ("no value" &&& Id) Id) (These "Ab" 13)5Present ("Ab",13) (TheseIn ("Ab",13) | These "Ab" 13) Val ("Ab",13)=pl @(TheseIn (Id &&& 999) ("no value" &&& Id) Id) (This "Ab")3Present ("Ab",999) (TheseIn ("Ab",999) | This "Ab")Val ("Ab",999);pl @(TheseIn (Id &&& 999) ("no value" &&& Id) Id) (That 13);Present ("no value",13) (TheseIn ("no value",13) | That 13)Val ("no value",13)predicate-typed predicate on  pl @IsThese (This 12)False (IsThese | This 12) Val Falsepz @IsThese (These 1 'a')Val Truepl @IsThese (These 'x' 12)True (IsThese | These 'x' 12)Val Truepl @IsThese (That (SG.Sum 12))*False (IsThese | That (Sum {getSum = 12})) Val False!pl @IsThese (These 1 (SG.Sum 12)),True (IsThese | These 1 (Sum {getSum = 12}))Val Truepredicate-typed predicate on  pl @IsThat (This 12)False (IsThat | This 12) Val Falsepredicate-typed predicate on  pz @IsThis (This "aBc")Val Truepz @IsThis (These 1 'a') Val Falsepl @IsThis (This 12)True (IsThis | This 12)Val Truepredicate-typed  constructorpz @(MkThese Fst Snd) (44,'x')Val (These 44 'x')pl @(MkThese Id 'True) 'x'/Present These 'x' True (MkThese These 'x' True)Val (These 'x' True)predicate-typed  constructorpz @(MkThat _ Id) 44 Val (That 44)Apz @(MkThat _ "Abc" <> MkThis _ '[1,2] <> MkThese [3,4] "def") ()Val (These [1,2,3,4] "Abcdef")pl @(MkThat () Id) 'x'"Present That 'x' (MkThat That 'x')Val (That 'x')predicate-typed  constructorpl @(MkThis () Id) 'x'"Present This 'x' (MkThis This 'x')Val (This 'x')pl @(MkThis () Fst) ('x',True)"Present This 'x' (MkThis This 'x')Val (This 'x')pz @(MkThis _ Id) 44 Val (This 44)predicate-typed  constructor)pz @(Proxy Int >> MkThis' UnproxyT 10) [] Val (This 10)predicate-typed similar to >@ but additionally provides p, q and r5 the original input as the first element in the tupleFpz @(TheseX ((L11 + Snd) >> ShowP Id) (ShowP Id) L22 Snd) (9,This 123) Val "132"Apz @(TheseX '(Snd,"fromthis") '(Negate 99,Snd) Snd Id) (This 123)Val (123,"fromthis")Hpz @(TheseX '(Snd,"fromthis") '(Negate 99,Snd) Snd Id) (That "fromthat")Val (-99,"fromthat")Npz @(TheseX '(Snd,"fromthis") '(Negate 99,Snd) Snd Id) (These 123 "fromthese")Val (123,"fromthese")ipl @(TheseX (PrintF "a=%d" (Snd >> Succ)) ("b=" <> Snd) (PrintT "a=%d b=%s" Snd) Id) (These @Int 9 "rhs")#Present "a=9 b=rhs" (TheseX(These))Val "a=9 b=rhs"bpl @(TheseX (PrintF "a=%d" (Snd >> Succ)) ("b=" <> Snd) (PrintT "a=%d b=%s" Snd) Id) (This @Int 9)Present "a=10" (TheseX(This)) Val "a=10"fpl @(TheseX (PrintF "a=%d" (Snd >> Succ)) ("b=" <> Snd) (PrintT "a=%d b=%s" Snd) Id) (That @Int "rhs")Present "b=rhs" (TheseX(That)) Val "b=rhs"predicate-typed similar to  (pz @(ZipThese Id Tail >> Theres) [1..10]Val [2,3,4,5,6,7,8,9,10]predicate-typed similar to  'pz @(ZipThese Id Tail >> Heres) [1..10]Val [1,2,3,4,5,6,7,8,9,10]predicate-typed similar to  (pz @(ZipThese Id Tail >> Theses) [1..10]<Val [(1,2),(2,3),(3,4),(4,5),(5,6),(6,7),(7,8),(8,9),(9,10)]predicate-typed similar to  7pl @Thats [This 1, This 10,That 'x', This 99, That 'y'];Present "xy" ((>>) "xy" | {Snd "xy" | ([1,10,99],"xy",[])})Val "xy"predicate-typed similar to  >pz @(Thiss) [That 1, This 'a', These 'b' 33, This 'd', That 4]Val "ad",pz @(Thiss) [That 1, This 'a', These 'b' 33]Val "a"(pz @(Thiss) [That 1, That 9, These 1 33]Val []predicate-typed similar to  ,. returns a 3-tuple with the results so use r p n to extractZpz @PartitionThese [This 'a', That 2, This 'c', These 'z' 1, That 4, These 'a' 2, That 99]%Val ("ac",[2,4,99],[('z',1),('a',2)])Qpl @PartitionThese [This 4, That 'x', That 'y',These 3 'b', This 99, These 5 'x']Present ([4,99],"xy",[(3,'b'),(5,'x')]) (PartitionThese ([4,99],"xy",[(3,'b'),(5,'x')]) | [This 4,That 'x',That 'y',These 3 'b',This 99,These 5 'x'])#Val ([4,99],"xy",[(3,'b'),(5,'x')])Tpl @PartitionThese [This 1,That 'x',This 4,That 'y',These 9 'z',This 10,These 8 'y']Present ([1,4,10],"xy",[(9,'z'),(8,'y')]) (PartitionThese ([1,4,10],"xy",[(9,'z'),(8,'y')]) | [This 1,That 'x',This 4,That 'y',These 9 'z',This 10,These 8 'y'])%Val ([1,4,10],"xy",[(9,'z'),(8,'y')])           None%&',-.=>?@AHSUVXkoX_predicate-typed - function where you need to provide the type t of the result&pz @(FromString (Identity _) Id) "abc"Val (Identity "abc")(pz @(FromString (Seq.Seq Char) Id) "abc"Val (fromList "abc")`predicate-typed - function where you need to provide the type t of the resultapredicate-typed"very simple conversion to a stringbpredicate-typedsimilar to case insensitive   for stringscpredicate-typedsimilar to case insensitive   for strings pl @(IsInfixCI "aB" Id) "xyzAbw"True (IsInfixCI | aB xyzAbw)Val True!pz @(IsInfixCI "abc" "axAbCd") ()Val Truedpredicate-typedsimilar to case insensitive   for strings"pz @(IsPrefixCI "abc" "aBcbCd") ()Val Trueepredicate-typed similar to   for strings pl @(IsSuffixC "bw" Id) "xyzabw"True (IsSuffixC | bw xyzabw)Val True pl @(IsSuffixC "bw" Id) "xyzbaw"False (IsSuffixC | bw xyzbaw) Val False!pz @(IsSuffixC "bCd" "aBcbCd") ()Val Truefpredicate-typed similar to   for stringspl @(IsInfixC "ab" Id) "xyzabw"True (IsInfixC | ab xyzabw)Val Truepl @(IsInfixC "aB" Id) "xyzAbw"False (IsInfixC | aB xyzAbw) Val Falsepl @(IsInfixC "ab" Id) "xyzbaw"False (IsInfixC | ab xyzbaw) Val False&pl @(IsInfixC Fst Snd) ("ab","xyzabw")True (IsInfixC | ab xyzabw)Val Truegpredicate-typed similar to   for strings pl @(IsPrefixC "xy" Id) "xyzabw"True (IsPrefixC | xy xyzabw)Val True pl @(IsPrefixC "ab" Id) "xyzbaw"False (IsPrefixC | ab xyzbaw) Val False!pz @(IsPrefixC "abc" "aBcbCd") () Val Falsehpredicate-typed similar to AB!pz @(StripR "xyz" Id) "Hello xyz"Val (Just "Hello ")#pz @(StripR "xyz" Id) "xyzHelloxyw" Val Nothingpz @(StripR "xyz" Id) "" Val Nothingpz @(StripR "xyz" "xyz") () Val (Just "")ipredicate-typed similar to AC pz @(StripL "xyz" Id) "xyzHello"Val (Just "Hello"))pz @(StripL "xyz" Id) (T.pack "xyzHello")Val (Just "Hello") pz @(StripL "xyz" Id) "xywHello" Val Nothingjpredicate-typed similar to  $pz @(Snd >> TrimBoth) (20," abc ") Val "abc"+pz @(Snd >> TrimBoth) (20,T.pack " abc ") Val "abc" pz @(" " >> TrimBoth) ()Val ""pz @("" >> TrimBoth) ()Val ""kpredicate-typed similar to  !pz @(Snd >> TrimR) (20," abc ") Val " abc"pz @(" abc " >> TrimR) () Val " abc"pz @("" >> TrimR) ()Val ""lpredicate-typed similar to  !pz @(Snd >> TrimL) (20," abc ") Val "abc "_`abcdefghijkljlkhigfedcba_` None&',-.=>?@AHSUVXkoS*predicate-typedA replacement function ([String] -> String)" which yields the groups Used by   and   Requires Text.Show.Functions:m + Text.Show.Functionsimport Data.List (intercalate)pz @(ReplaceAll "^(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)$" (ReplaceFn3 Fst) Snd) (\ys -> intercalate " | " $ map (show . succ . readNote @Int "invalid int") ys, "141.201.1.22")Val "142 | 202 | 2 | 23"predicate-typedA replacement function (String -> String)& that yields the whole match Used by   and   Requires Text.Show.Functions:m + Text.Show.FunctionsQpz @(ReplaceAll "\\." (ReplaceFn2 Fst) Snd) (\x -> x <> ":" <> x, "141.201.1.22")Val "141.:.201.:.1.:.22"predicate-typedA replacement function (String -> [String] -> String)7 which returns the whole match and the groups Used by   and   Requires Text.Show.Functionspredicate-typedSimple replacement string: see  and predicate-typed"replace all occurrences of string p with q in r@pl @(ReplaceAllString 'ROverWrite "abc" "def" Id) "123abc456abc"EPresent "123def456def" (ReplaceAll (abc) 123abc456abc | 123def456def)Val "123def456def"Epl @(ReplaceAllString' '[] 'ROverWrite "abc" "def" Id) "123AbC456abc"EPresent "123AbC456def" (ReplaceAll (abc) 123AbC456abc | 123AbC456def)Val "123AbC456def"Ppl @(ReplaceAllString' '[ 'Caseless ] 'ROverWrite "abc" "def" Id) "123AbC456abc"RPresent "123def456def" (ReplaceAll' ['Caseless] (abc) 123AbC456abc | 123def456def)Val "123def456def">pl @(ReplaceAllString 'RPrepend "abc" "def" Id) "123AbC456abc"KPresent "123AbC456defabc" (ReplaceAll (abc) 123AbC456abc | 123AbC456defabc)Val "123AbC456defabc"@pl @(ReplaceAllString 'ROverWrite "abc" "def" Id) "123AbC456abc"EPresent "123AbC456def" (ReplaceAll (abc) 123AbC456abc | 123AbC456def)Val "123AbC456def"=pl @(ReplaceAllString 'RAppend "abc" "def" Id) "123AbC456abc"KPresent "123AbC456abcdef" (ReplaceAll (abc) 123AbC456abc | 123AbC456abcdef)Val "123AbC456abcdef"predicate-typed#replace first occurrence of string p with q in r@pl @(ReplaceOneString 'ROverWrite "abc" "def" Id) "123abc456abc"EPresent "123def456abc" (ReplaceOne (abc) 123abc456abc | 123def456abc)Val "123def456abc"pz @(Rescan "^Date\\((\\d+[+-]\\d{4})\\)" >> Head >> Snd >> Id !! 0 >> ReplaceOneString 'RPrepend "\\d{3}[+-]" "." Id >> ParseTimeP ZonedTime "%s%Q%z") "Date(1530144000123+0530)"!Val 2018-06-28 05:30:00.123 +0530pz @(Rescan "^Date\\((\\d+[+-]\\d{4})\\)" >> Head >> Snd >> Id !! 0 >> ReplaceOneString 'RPrepend "\\d{3}[+-]" "." Id >> ParseTimeP ZonedTime "%s%Q%z") "Date(1593460089052+0800)"!Val 2020-06-30 03:48:09.052 +0800pz @(Rescan "^Date\\((\\d+)(\\d{3}[+-]\\d{4})\\)" >> Head >> Snd >> (Id !! 0 <> "." <> Id !! 1) >> ParseTimeP ZonedTime "%s%Q%z") "Date(1593460089052+0800)"!Val 2020-06-30 03:48:09.052 +0800 predicate-typedreplaces regex s with a string s1 inside the value: see   and  >pz @(ReplaceAllString 'ROverWrite "\\." ":" Id) "141.201.1.22"Val "141:201:1:22"predicate-typed*splits a string on a regex delimiter: see  "pz @(Resplit "\\.") "141.201.1.22"Val ["141","201","1","22"]!pl @(Resplit "\\.") "123.2.3.5.6"TPresent ["123","2","3","5","6"] (Resplit (\.) ["123","2","3","5","6"] | 123.2.3.5.6)Val ["123","2","3","5","6"]ipl @(Map' (ReadP Int Id) (Resplit "\\.") >> '(Id, '(Len == 4, All (0 <..> 0xff)))) "141.214.125.1.2.3333"Present ([141,214,125,1,2,3333],(False,False)) ((>>) ([141,214,125,1,2,3333],(False,False)) | {'([141,214,125,1,2,3333],(False,False))})*Val ([141,214,125,1,2,3333],(False,False))jpl @(Map' (ReadP Int Id) (Resplit "\\.") >> Id &&& ((Len == 4) &&& All (0 <..> 0xff))) "141.214.125.1.2.6"|Present ([141,214,125,1,2,6],(False,True)) ((>>) ([141,214,125,1,2,6],(False,True)) | {'([141,214,125,1,2,6],(False,True))})&Val ([141,214,125,1,2,6],(False,True))epl @(Resplit "\\." >> Map (ReadP Int Id) >> Id &&& ((Len == 4) &&& All (0 <..> 0xff))) "141.214.125."+Error ReadP Int () (Map(i=3, a="") excnt=1)Fail "ReadP Int ()"predicate-typed*splits a string on a regex delimiter: see  5pl @(Resplit' '[ 'Caseless ] "aBc" Id) "123AbC456abc"UPresent ["123","456",""] (Resplit' ['Caseless] (aBc) ["123","456",""] | 123AbC456abc)Val ["123","456",""]7pz @(Resplit' '[] (Singleton Fst) Snd) (':', "12:13:1")Val ["12","13","1"]predicate-typedsee  ?pz @(RescanRanges "^(\\d{2}):(\\d{2}):(\\d{2})$" Id) "13:05:25"!Val [((0,8),[(0,2),(3,5),(6,8)])]predicate-typedsee  6pz @(Rescan "^(\\d{2}):(\\d{2}):(\\d{2})$") "13:05:25"#Val [("13:05:25",["13","05","25"])]Wpz @(Rescan "^(\\d{2}):(\\d{2}):(\\d{2})$" >> L2 Head >> Map (ReadP Int Id)) "13:05:25" Val [13,5,25]Jpl @(Rescan "(\\d+)\\D?" >> Map (Second (ReadP Int (OneP)))) "123-444-987"Present [("123-",123),("444-",444),("987",987)] ((>>) [("123-",123),("444-",444),("987",987)] | {Map [("123-",123),("444-",444),("987",987)] | [("123-",["123"]),("444-",["444"]),("987",["987"])]})+Val [("123-",123),("444-",444),("987",987)]pl @(Rescan ".(.)") "aBcd"VPresent [("aB",["B"]),("cd",["d"])] (Rescan (.(.)) [("aB",["B"]),("cd",["d"])] | aBcd)Val [("aB",["B"]),("cd",["d"])]+pl @(Rescan "\\d{1,3}(\\.)?") "123.8.99.21"Present [("123.",["."]),("8.",["."]),("99.",["."]),("21",[])] (Rescan (\d{1,3}(\.)?) [("123.",["."]),("8.",["."]),("99.",["."]),("21",[])] | 123.8.99.21)9Val [("123.",["."]),("8.",["."]),("99.",["."]),("21",[])]Epl @(Map' Fst (Rescan "." << ShowP Id) >> Filter (Same "2") Id) 12324PPresent ["2","2"] ((>>) ["2","2"] | {Fst ["2","2"] | (["2","2"],["1","3","4"])}) Val ["2","2"]pl @(Rescan "(\\d)+?") "1234"Present [("1",["1"]),("2",["2"]),("3",["3"]),("4",["4"])] (Rescan ((\d)+?) [("1",["1"]),("2",["2"]),("3",["3"]),("4",["4"])] | 1234)5Val [("1",["1"]),("2",["2"]),("3",["3"]),("4",["4"])]pl @(Rescan "(\\d)+") "1234"APresent [("1234",["4"])] (Rescan ((\d)+) [("1234",["4"])] | 1234)Val [("1234",["4"])]Epl @(Rescan "(\\d{1,3})(\\.(\\d{1,3}))+?") "1.2.3.4" -- overcapturingPresent [("1.2",["1",".2","2"]),("3.4",["3",".4","4"])] (Rescan ((\d{1,3})(\.(\d{1,3}))+?) [("1.2",["1",".2","2"]),("3.4",["3",".4","4"])] | 1.2.3.4)3Val [("1.2",["1",".2","2"]),("3.4",["3",".4","4"])]pl @(Rescan "^(\\d)+?$") "1234"DPresent [("1234",["4"])] (Rescan (^(\d)+?$) [("1234",["4"])] | 1234)Val [("1234",["4"])]4pl @(Rescan "(\\d{1,3})(\\.(\\d{1,3}))+?") "1.2.3.4"Present [("1.2",["1",".2","2"]),("3.4",["3",".4","4"])] (Rescan ((\d{1,3})(\.(\d{1,3}))+?) [("1.2",["1",".2","2"]),("3.4",["3",".4","4"])] | 1.2.3.4)3Val [("1.2",["1",".2","2"]),("3.4",["3",".4","4"])]Bpl @(Rescan "(\\d{1,3})(?:\\.(\\d{1,3}))+?") "1.2.3.4" -- bizzare!Present [("1.2",["1","2"]),("3.4",["3","4"])] (Rescan ((\d{1,3})(?:\.(\d{1,3}))+?) [("1.2",["1","2"]),("3.4",["3","4"])] | 1.2.3.4))Val [("1.2",["1","2"]),("3.4",["3","4"])]Lpl @(Rescan "^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$") "1.2.3.4"Present [("1.2.3.4",["1","2","3","4"])] (Rescan (^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$) [("1.2.3.4",["1","2","3","4"])] | 1.2.3.4)#Val [("1.2.3.4",["1","2","3","4"])]+pl @(Rescan "([[:xdigit:]]{2})") "wfeb12az"Present [("fe",["fe"]),("b1",["b1"]),("2a",["2a"])] (Rescan (([[:xdigit:]]{2})) [("fe",["fe"]),("b1",["b1"]),("2a",["2a"])] | wfeb12az)/Val [("fe",["fe"]),("b1",["b1"]),("2a",["2a"])]predicate-typedRruns a regex matcher returning the original values and optionally any groups: see  >pl @(Rescan' '[ 'Anchored ] "([[:xdigit:]]{2})" Id) "wfeb12az"MError Regex no results (Rescan' ['Anchored] (([[:xdigit:]]{2})) | "wfeb12az")Fail "Regex no results"Epz @(Rescan' '[] Snd "13:05:25") ('a',"^(\\d{2}):(\\d{2}):(\\d{2})$")#Val [("13:05:25",["13","05","25"])]predicate-typed5runs a regular expression and returns a boolean: see  ,pz @(Re "^\\d{2}:\\d{2}:\\d{2}$") "13:05:25"Val True#pl @(Re "\\d{4}-\\d{3}") "1234-123""True (Re (\d{4}-\d{3}) | 1234-123)Val True#pl @(Re "\\d{4}-\\d{3}") "1234-1x3"#False (Re (\d{4}-\d{3}) | 1234-1x3) Val False9pl @(Re "(?i)ab") "aB" -- runtime [use 'Caseless instead]True (Re ((?i)ab) | aB)Val Truepl @(Re "ab") "aB"False (Re (ab) | aB) Val False4pl @(Re "^\\d{1,3}(?:\\.\\d{1,3}){3}$") "123.1.1.21"2True (Re (^\d{1,3}(?:\.\d{1,3}){3}$) | 123.1.1.21)Val TruePpl @(Guard "regex failed" (Re "^\\d+(?:\\.\\d+)?$") >> ReadP Double Id) "13.345"4Present 13.345 ((>>) 13.345 | {ReadP Double 13.345}) Val 13.345Lpl @(Guard "regex failed" (Re "^\\d+(?:\\.\\d+)?$") >> ReadP Double Id) "13".Present 13.0 ((>>) 13.0 | {ReadP Double 13.0})Val 13.0Xpl @(ExitWhen "regex failed" (Not (Re "^\\d+(?:\\.\\d+)?$")) >> ReadP Double Id) "-13.4"$Error regex failed (Guard | "-13.4")Fail "regex failed"pl @(Re "\\d{4}\\") "ayx"GError Regex failed to compile (Re (\d{4}\) ([],[]):\ at end of pattern)Fail "Regex failed to compile"pl @(Re "^\\d+$") "123\nx"False (Re (^\d+$) | 123x) Val Falsebpl @(Re "(?m)^\\d+$") "123\nx" -- (?m) anchors match beginning/end of line instead of whole stringTrue (Re ((?m)^\d+$) | 123x)Val True%pl @(Catch (Re "\\d+(") 'False) "123"7False (Catch caught exception[Regex failed to compile]) Val False$pl @(Catch (Re "\\d+") 'False) "123"True (Catch did not fire)Val Truepredicate-typedNruns a regular expression with given regex options and returns a boolean: see  .pl @(Re' '[ 'Caseless, 'Dotall ] "ab" Id) "aB")True (Re' ['Caseless, 'Dotall] (ab) | aB)Val True1pl @(Re' '[ 'Caseless, 'Dotall ] "ab." Id) "aB\n")True (Re' ['Caseless, 'Dotall] (ab.) | aB)Val True(pl @(Re' '[ 'Caseless ] "ab." Id) "aB\n"!False (Re' ['Caseless] (ab.) | aB) Val False None&',-.=>?@AHSUVXko predicate-typedprint for lists -- use  as it is safer than Qpl @(PrintL 4 "%s %s %s %s" '[W "xyz", ShowP Fst, ShowP Snd, Thd]) (123,'x',"ab")\Present "xyz 123 'x' ab" ((>>) "xyz 123 'x' ab" | {PrintI [xyz 123 'x' ab] | s=%s %s %s %s})Val "xyz 123 'x' ab"Kpz @(PrintL 1 "%05d" '[Id]) 123 -- tick is required for a one element lis) Val "00123"+pz @(PrintL 2 "%d %05d" [Fst,Snd]) (29,123)Val "29 00123":pl @(PrintL 3 "first=%d second=%d third=%d" Id) [10,11,12]Present "first=10 second=11 third=12" ((>>) "first=10 second=11 third=12" | {PrintI [first=10 second=11 third=12] | s=first=%d second=%d third=%d})!Val "first=10 second=11 third=12":pl @(PrintL 2 "first=%d second=%d third=%d" Id) [10,11,12]PError toITupleListC: expected exactly 2 values (ToITupleList(2) instead found 3)/Fail "toITupleListC: expected exactly 2 values":pl @(PrintL 4 "first=%d second=%d third=%d" Id) [10,11,12]PError toITupleListC: expected exactly 4 values (ToITupleList(4) instead found 3)/Fail "toITupleListC: expected exactly 4 values"1pl @(PrintL 4 "%03d.%03d.%03d.%03d" Id) [1,2,3,4]gPresent "001.002.003.004" ((>>) "001.002.003.004" | {PrintI [001.002.003.004] | s=%03d.%03d.%03d.%03d})Val "001.002.003.004"3pl @(PrintL 4 "%03d.%03d.%03d.%03d" Id) [1,2,3,4,5]PError toITupleListC: expected exactly 4 values (ToITupleList(4) instead found 5)/Fail "toITupleListC: expected exactly 4 values"/pl @(PrintL 4 "%03d.%03d.%03d.%03d" Id) [1,2,3]PError toITupleListC: expected exactly 4 values (ToITupleList(4) instead found 3)/Fail "toITupleListC: expected exactly 4 values"1pl @(PrintL 4 "%03d.%03d.%03d.%03d" Id) [1,2,3,4]gPresent "001.002.003.004" ((>>) "001.002.003.004" | {PrintI [001.002.003.004] | s=%03d.%03d.%03d.%03d})Val "001.002.003.004"*pl @(PrintL 4 "%d %4d %-d %03d" Id) [1..4]ZPresent "1 2 3 004" ((>>) "1 2 3 004" | {PrintI [1 2 3 004] | s=%d %4d %-d %03d})Val "1 2 3 004"predicate-typed(prints inductive tuples in reverse order4pz @(PrintI "d=%d s=%s f=%f") (1.73,("abc",(12,())))Val "d=12 s=abc f=1.73"-pz @(PrintI "d=%d s=%s f=%f") ("abc",(12,()));Fail "PrintI(IO e=printf: argument list ended prematurely)")pz @(PrintI "d=%s s=%d") ("abc",('x',()))3Fail "PrintI(IO e=printf: bad formatting char 's')"/pz @(PrintI "%s %s %d") (123,("sss",("bb",())))Val "bb sss 123"predicate-typed-print for flat n-tuples of size two or larger;pl @(PrintT "%d %s %s %s" '(Fst, Snd, Snd,Snd)) (10,"Asdf")ePresent "10 Asdf Asdf Asdf" ((>>) "10 Asdf Asdf Asdf" | {PrintI [10 Asdf Asdf Asdf] | s=%d %s %s %s})Val "10 Asdf Asdf Asdf"+pl @(PrintT "%c %d %s" Id) ('x', 10,"Asdf")JPresent "x 10 Asdf" ((>>) "x 10 Asdf" | {PrintI [x 10 Asdf] | s=%c %d %s})Val "x 10 Asdf",pz @(PrintT "fst=%s snd=%03d" Id) ("ab",123)Val "fst=ab snd=123"8pz @(PrintT "fst=%s snd=%03d thd=%s" Id) ("ab",123,"xx")Val "fst=ab snd=123 thd=xx"Cpl @(PrintT "%s %d %c %s" '(W "xyz", Fst, Snd, Thd)) (123,'x',"ab")VPresent "xyz 123 x ab" ((>>) "xyz 123 x ab" | {PrintI [xyz 123 x ab] | s=%s %d %c %s})Val "xyz 123 x ab"$pl @(PrintT "%d %c %s" Id) (123,'x')]Error PrintI(IO e=printf: argument list ended prematurely) (PrintI %d %c %s | ('x',(123,())));Fail "PrintI(IO e=printf: argument list ended prematurely)"-pl @(PrintT "%d %c %s" Id) (123,'x',"abc",11)nError PrintI(IO e=printf: formatting string ended prematurely) (PrintI %d %c %s | (11,("abc",('x',(123,())))))?Fail "PrintI(IO e=printf: formatting string ended prematurely)"0pl @(PrintT "lhs = %d rhs = %s" Id) (123,"asdf")tPresent "lhs = 123 rhs = asdf" ((>>) "lhs = 123 rhs = asdf" | {PrintI [lhs = 123 rhs = asdf] | s=lhs = %d rhs = %s})Val "lhs = 123 rhs = asdf"&pl @(PrintT "d=%03d s=%s" Id) (9,"ab")PPresent "d=009 s=ab" ((>>) "d=009 s=ab" | {PrintI [d=009 s=ab] | s=d=%03d s=%s})Val "d=009 s=ab"<pl @(PrintT "d=%03d s=%s c=%c f=%4.2f" Id) (9,"ab",'x',1.54)~Present "d=009 s=ab c=x f=1.54" ((>>) "d=009 s=ab c=x f=1.54" | {PrintI [d=009 s=ab c=x f=1.54] | s=d=%03d s=%s c=%c f=%4.2f})Val "d=009 s=ab c=x f=1.54"0pl @(PrintT "d=%03d s=%s" Id) (9, "ab",'x',1.54)pError PrintI(IO e=printf: formatting string ended prematurely) (PrintI d=%03d s=%s | (1.54,('x',("ab",(9,())))))?Fail "PrintI(IO e=printf: formatting string ended prematurely)"9pl @(PrintT "lhs = %d rhs = %s c=%d" Id) (123,"asdf",'x')Present "lhs = 123 rhs = asdf c=120" ((>>) "lhs = 123 rhs = asdf c=120" | {PrintI [lhs = 123 rhs = asdf c=120] | s=lhs = %d rhs = %s c=%d}) Val "lhs = 123 rhs = asdf c=120":pl @(PrintT "hello d=%d %c %s" '(12, C "z", "someval")) ()sPresent "hello d=12 z someval" ((>>) "hello d=12 z someval" | {PrintI [hello d=12 z someval] | s=hello d=%d %c %s})Val "hello d=12 z someval":pl @(PrintT "ipaddress %03d.%03d.%03d.%03d" '(1,2,3,4)) ()Present "ipaddress 001.002.003.004" ((>>) "ipaddress 001.002.003.004" | {PrintI [ipaddress 001.002.003.004] | s=ipaddress %03d.%03d.%03d.%03d})Val "ipaddress 001.002.003.004" predicate-typed3uses inductive tuples to replace variable argumentspredicate-typed8uses PrintF (unsafe) to format output for a single valuepz @(PrintF "value=%03d" Id) 12Val "value=012"!pz @(PrintF "%s" Fst) ("abc",'x') Val "abc"!pz @(PrintF "%d" Fst) ("abc",'x')4Fail "PrintF (IO e=printf: bad formatting char 'd')""pl @(PrintF "someval %d" Id) "!23"HError PrintF (IO e=printf: bad formatting char 'd') ("!23" s=someval %d)4Fail "PrintF (IO e=printf: bad formatting char 'd')"pl @(PrintF "%-6s" Id) 1234AError PrintF (IO e=printf: bad formatting char 's') (1234 s=%-6s)4Fail "PrintF (IO e=printf: bad formatting char 's')"pl @(PrintF "%06x" Id) 12344Present "0004d2" (PrintF [0004d2] | p=1234 | s=%06x) Val "0004d2".pl @(Msg (PrintF "digits=%d" Len) Head) [1..4]'Present 1 (digits=4 Head 1 | [1,2,3,4])Val 1.pl @(PrintF "ask%%dfas%%kef%05d hey %%" Id) 35iPresent "ask%dfas%kef00035 hey %" (PrintF [ask%dfas%kef00035 hey %] | p=35 | s=ask%%dfas%%kef%05d hey %%)Val "ask%dfas%kef00035 hey %"-pl @(Fail () (PrintF "someval int=%d" Id)) 45Error someval int=45Fail "someval int=45"predicate-typedIRead but returns the Maybe of the value and any remaining unparsed stringpz @(ReadMaybe Int Id) "123x"Val (Just (123,"x"))pz @(ReadMaybe Int Id) "123"Val (Just (123,""))pz @(ReadMaybe Int Id) "x123" Val Nothingpredicate-typed uses the   of the given type t and p$ which points to the content to readpz @(ReadP Rational Id) "4 % 5" Val (4 % 5)[pz @(Between (ReadP Day "2017-04-11") (ReadP Day "2018-12-30") (ReadP Day Id)) "2018-10-12"Val True[pz @(Between (ReadP Day "2017-04-11") (ReadP Day "2018-12-30") (ReadP Day Id)) "2016-10-12" Val False!pl @(ReadP Rational Id) "123 % 4"-Present 123 % 4 (ReadP Ratio Integer 123 % 4) Val (123 % 4)"pl @(ReadP Rational Id) "x123 % 4")Error ReadP Ratio Integer (x123 % 4) ([])%Fail "ReadP Ratio Integer (x123 % 4)"pl @(ReadP Day Id) "1999-11-30")Present 1999-11-30 (ReadP Day 1999-11-30)Val 1999-11-30pl @(ReadP Day Id) "1999-02-29"!Error ReadP Day (1999-02-29) ([])Fail "ReadP Day (1999-02-29)"#pl @(ReadP TimeOfDay Id) "14:59:20"+Present 14:59:20 (ReadP TimeOfDay 14:59:20) Val 14:59:20predicate-typed uses the   of the given type t and p$ which points to the content to readpredicate-typed similar to  pz @(ShowP Id) [4,8,3,9]Val "[4,8,3,9]"pz @(ShowP Id) 'x' Val "'x'"pz @(ShowP (42 -% 10)) 'x'Val "(-21) % 5"  None&',-.=>?@AHSUVXko? predicate-typedFcreate a Proxy z from proxy z where z is the expression pointed to by p' : Proxify alway returns Val (Proxy @z)Bpz @(Proxify Fst) ([True],13) ^!? acts . _Val . only (Proxy @Bool)Just ()8pz @(Proxify (MkJust 1)) () ^!? acts . _Val . to typeRepJust IntDpz @(Proxify (FailT [Double] "abc")) () ^!? acts . _Val . to typeRep Just Double3pz @(Proxify "abc") () ^!? acts . _Val . to typeRep Just CharTeval (Proxy @(Proxify Id)) defOpts ([] @Double) ^!? acts . ttVal . _Val . to typeRep Just DoubleWeval (Proxy @(Proxify Id)) defOpts ([] @Int) ^? _Id . ttVal . _Val == Just (Proxy @Int)Truejeval (Proxy @(Proxify Id)) defOpts ([] @Int) ^? _Wrapped @(Identity _) . ttVal . _Val == Just (Proxy @Int)Truedeval (Proxy @(Proxify Id)) defOpts ([] @Int) ^? folded @Identity . ttVal . _Val == Just (Proxy @Int)Truepredicate-typedapplies Proxy p to Proxy q and Proxy r/ and returns a Proxy: needs kind signatures on pApz @(PApp2 (Proxy '(,)) (Proxy 2) (Proxy 'True) >> Pop0 Id ()) () Val (2,True)gpz @('(Snd, PApp2 (Proxy (+)) L11 L12) >> Pop0 Snd Fst) ((Proxy @Fst,Proxy @(Length Snd)),(5,"abcdef"))Val 11Ipz @(PApp2 (Proxy (+)) Fst Snd >> Pop0 Id ()) (Proxy @(W 3),Proxy @(W 7))Val 10Upz @(PApp2 Fst Snd Thd >> Pop0 Id ()) (Proxy @(&&&), Proxy @(W "abc"), Proxy @(W 13))Val ("abc",13)predicate-typedapplies Proxy p to Proxy q/ and returns a Proxy: needs kind signatures on pTpz @(PApp Fst Snd >> Pop0 Id '("abcdef",99)) (Proxy @('(,) (Fst >> Len)), Proxy @16) Val (6,16)Wpz @('(Id,PApp (Proxy ('(,) (Fst >> Len))) (Proxy 16)) >> Pop0 Snd Fst) ("abcdefg",101) Val (7,16)pz @('(Id,PApp (Proxy '(,)) (Proxy (Fst >> Len))) >> Second (PApp Id (Proxy 16)) >> Pop0 Snd Fst) ("abcdefg",101) -- or can call PApp2 Val (7,16)pz @(PApp (PApp (Proxy ('(,) :: GL.Nat -> GL.Symbol -> (GL.Nat,GL.Symbol))) (Proxy 1)) (Proxy "abc")) () ^!? acts . _Val . to typeRepJust ('(,) Nat Symbol 1 "abc")Qpz @(PApp (Proxy '(,)) (Proxy 4) >> PApp Id (Proxy Fst) >> Pop0 Id (W '(1,2))) () Val (4,1)Xpz @(PApp (Proxy '(,)) (Proxy 4) >> PApp Id (Proxy Fst) >> Pop0 Id '( 'True,"hello")) () Val (4,True)Opan @(PApp (Proxy (MsgI "hello ")) Fst >> Pop0 Id '(1,2,3)) (Proxy @"there",())P (>>) "there"| +- P PApp|`- P Pop0 | hello '"there" | +- P '(,,) | | | +- P '1 | | | +- P '2 | | | `- P '3 | `- P hello '"there" Val "there"Fpz @(PApp (Proxy Proxy) (Proxy "abc") >> Pop0 Id () >> Pop0 Id () ) () Val "abc"qpz @(PApp (Proxy '(,,)) (Proxy 10) >> PApp Id (Proxy "ss") >> PApp Id (Proxy Fst) >> Pop0 Id '(13 % 44,C "x")) ()Val (10,"ss",13 % 44)vpz @('(Id,PApp (Proxy '(,,)) (Proxy 10) >> PApp Id (Proxy "ss") >> PApp Id (Proxy Fst)) >> Pop0 Snd Fst) (13 % 44,'x')Val (10,"ss",13 % 44)predicate-typedApplies Proxy p to Proxy q and Proxy r+ and runs in the environment pointed to by s : needs kind signatures on p6pz @(Pop2' (Proxy '(,)) (Proxy 1) (Proxy "sss") ()) () Val (1,"sss")Npz @(Pop2' (Proxy '(,)) (Proxy L31) (Proxy (Fst % Snd)) '(11,99,'("ss",3))) ()Val ("ss",1 % 9)_pz @(Pop2' Fst Snd Thd (L4 Id)) (Proxy @'(,), Proxy @L31, Proxy @(Fst % Snd), (11,99,("ss",3)))Val ("ss",1 % 9)predicate-typed apply Proxy p to q and r+ then run in the environment pointed to by s : needs kind signatures on p0pz @(Pop2 (Proxy '(,)) Fst 14 Id) ([1..4],'True)Val ([1,2,3,4],14)9pz @(Pop2' (Proxy Pure) (Proxy SG.Sum) (Proxy Id) Id) 123Val (Sum {getSum = 123})predicate-typed apply Proxy p to Proxy q* and run in the environment pointed to by r : needs kind signatures on p;pz @(Pop1' (Proxy ((<>) Snd)) (Proxy Fst) Id) ("abc","def") Val "defabc"^pz @(Pop1' (Proxy ((>>) Snd)) (Proxy (Resplit "\\." >> Map (ReadP Int Id))) Id) (1,"123.33.5")Val [123,33,5]Fpz @(Pop1' (Proxy (Lift Snd)) (Proxy Fst) Id) ((True,2),("abc",1 % 4))Val 2Ppz @(Pop1' Fst Snd Thd) (Proxy @(Lift Snd), Proxy @Fst,((True,2),("abc",1 % 4)))Val 2Rpz @(Pop1' Fst Snd '( '( 'True,2),'("abc",1 % 4))) (Proxy @(Lift Snd), Proxy @Fst)Val 24pz @(Pop1' (Proxy MEmptyT) (Proxy (SG.Sum _)) ()) ()Val (Sum {getSum = 0})Epz @(Pop1' (Proxy MEmptyT) (PApp (Proxy SG.Sum) (Proxy Float)) ()) ()Val (Sum {getSum = 0.0})Dpz @(Pop1' (Proxy Proxy) (Proxy Fst) () >> Pop0 Id '("abc",1234)) () Val "abc")pz @(Pop1' (Proxy ToEnum) 'Proxy 100) 'a'Val 'd'9pz @(Pop1' (Proxy ToEnum) 'Proxy 120) (undefined :: Char)Val 'x'predicate-typedapplies Proxy p to q" in the environment pointed to by r : needs kind signatures on p=pz @(Pop1 Fst L22 Snd) (Proxy @Length,(False,('x',"abcdef")))Val 65pz @(Proxy Length >> Pop1 IdT Snd '(1,'[1,2,3,4])) ()Val 4Ipz @(LiftA2 (Pop1 Fst Snd Id) (MkJust (Proxy (Lift Succ))) (MkJust 1)) () Val (Just 2)Epz @(LiftA2 (Pop1 Fst Snd Id) (MkJust (Proxy ((*) 4))) (MkJust 3)) () Val (Just 12)@pz @(Pop1 Fst Snd Id <$> MkJust (Proxy ((*) 4)) <:> MkJust 3) () Val (Just 12)Epz @(Pop1 Fst Snd Id <$> Fst <:> Snd) (Just (Proxy @((*) 4)), Just 3) Val (Just 12).pz @(Proxy (Lift "asdf") >> Pop1 Id 123 Id) () Val "asdf"&pz @(Pop1 Id "abc" ()) (Proxy @(K 99))Val 99+pz @(Pop1 Id "abc" ()) (Proxy @(Flip K 99)) Val "abc",pz @(Pop1 (Proxy ('(,) 'True)) Len "abc") () Val (True,3)predicate-typedrun the proxy p" in the environment pointed to by q*pl @(Pop0 (Proxy '(Head,Len)) "abcdef") ()!Present ('a',6) (Pop0 | '('a',6)) Val ('a',6)+pz @(Pop0 Id "abcdef") (Proxy @'(Head,Len)) Val ('a',6)+pl @(Pop0 Fst Snd) (Proxy @Snd,("dd","ee")),Present "ee" (Pop0 | Snd "ee" | ("dd","ee"))Val "ee";pz @(Pop0 Fst L22) (Proxy @(Fst <> Snd),(True,("dd","ee"))) Val "ddee"Epz @(Pop0 Id () <> "def") (Proxy @"abc") -- Proxy works for any kind! Val "abcdef"Kpz @(Pop0 Id () <> "def") (Nothing @(W "abc")) -- Proxy works for any kind! Val "abcdef"#pz @(Pop0 Id (C "A")) (Proxy @Succ)Val 'B'3pz @(Pop0 Fst Snd) (Proxy @(All1 Even),[1,5,2,3,4]) Val FalseGpz @(Pop0 Fst Snd) (Proxy @(Partition Even Snd),(True,[8,1,5,2,3,4,6]))Val ([8,2,4,6],[1,5,3]))pl @(Proxy Snd >> Pop0 Id '( 'True,2)) ().Present 2 ((>>) 2 | {Pop0 | Snd 2 | (True,2)})Val 23pl @(Proxy (Fst <> Snd) >> Pop0 Id '("aa","bb")) ()=Present "aabb" ((>>) "aabb" | {Pop0 | "aa" <> "bb" = "aabb"}) Val "aabb"#pz @(Pop0 Fst Snd) (Proxy @Succ,EQ)Val GT/pz @(Pop0 Fst Snd) (Proxy @(FMap Succ),Just 23) Val (Just 24)-pz @(Pop0 Id (1 ... 12)) (Proxy @(FMap Succ))!Val [2,3,4,5,6,7,8,9,10,11,12,13]>pz @(Pop0 Id '( 'True, MkJust 12)) (Proxy @(FMap $ FMap Succ))Val (True,Just 13)epz @('(Id, PApp (Proxy '(,)) (Proxy 4)) >> Second (PApp Id (Proxy Fst)) >> Pop0 Snd Fst) ("abc",True) Val (4,"abc")2pz @(Pop1 (Proxy Proxy) "abc" () >> Pop0 Id ()) () Val "abc"Ppz @(Proxy (Proxy (Proxy "asdff")) >> Pop0 Id () >> Pop0 Id () >> Pop0 Id ()) () Val "asdff"predicate-typed,makes a proxy from a two parameter container3pz @(Pop1' (Proxy EmptyT) Proxy2T 123) (Left "ASf") Val (Left "")0pz @(Pop1' (Proxy EmptyT) Proxy2T 123) (Right 1) Val (Left "")=pz @((Id $$ "asdf") >> Pop1' (Proxy EmptyT) Proxy2T 123) Left Val (Left "")>pz @((Id $$ "asdf") >> Pop1' (Proxy EmptyT) Proxy2T 123) Right Val (Left "")>pz @(Pop1' (Proxy EmptyT) ((Id $$ "ss") >> Proxy2T) 123) Right Val (Left "")=pz @(Pop1' (Proxy EmptyT) ((Id $$ "ss") >> Proxy2T) 123) Left Val (Left "")predicate-typed,makes a proxy from a one parameter container.pz @(Pop1' (Proxy EmptyT) Proxy1T 123) Nothing Val Nothing0pz @(Pop1' (Proxy EmptyT) Proxy1T 123) (Just 10) Val Nothing9pz @((Id $$ ()) >> Pop1' (Proxy EmptyT) Proxy1T 123) Just Val Nothingpredicate-typedcmakes a proxy from a simple type: similar to the P instance for 'Proxy but requires a show instance2pz @(Pop1' (Proxy FromInteger) ProxyT 123) (4 % 0) Val (123 % 1)4pz @(Pop1' (Proxy MEmptyT) ProxyT ()) (SG.Product 4)Val (Product {getProduct = 1})?pz @((Id $$ 44) >> Pop1' (Proxy MEmptyT) ProxyT ()) SG.ProductVal (Product {getProduct = 1})`pz @((ProxyT << Fst) >> FMap Head) ([True],13) ^!? acts . _Val . to typeRep -- Proxify is easier Just Bool  None&',-.=>?@AHSUVXkopredicate-typed,a type level predicate for a negative numberpredicate-typed,a type level predicate for a positive numberpredicate-typed:a type level predicate for all negative elements in a list!pz @AllNegative [-1,-5,-10,-2,-3]Val Truepredicate-typed:a type level predicate for all positive elements in a listpz @AllPositive [1,5,10,2,3]Val Truepz @AllPositive [0,1,5,10,2,3] Val Falsepz @AllPositive [3,1,-5,10,2,3] Val Falsepredicate-typed5a type level predicate for a strictly decreasing listpredicate-typed6a type level predicate for a monotonic decreasing listpredicate-typed5a type level predicate for a strictly increasing listpz @Asc' [1,2,3,4,5,5,7] Val False pz @Asc' []Val Truepz @Asc' [-10]Val Truepredicate-typed6a type level predicate for a monotonic increasing listpl @Asc "aaacdef"True ((>>) True | {All(6)})Val Truepz @Asc [1,2,3,4,5,5,7]Val Truepz @Asc "axacdef" Val Falsepredicate-typed;compare two strings ignoring case using the given ordering opredicate-typed,compare two values using the given ordering opl @(Lt 4) 123False (123 < 4) Val False pl @(Lt 4) 1 True (1 < 4)Val Truepl @(Negate 7 <..> 20) (-4)True (-7 <= -4 <= 20)Val Truepl @(Negate 7 <..> 20) 21False (21 <= 20) Val Falsepredicate-typed8compare two strings ignoring case and return an ordering pz @(Fst ===~ Snd) ("abC","aBc")Val EQ!pz @(Fst ===~ Snd) ("abC","DaBc")Val LT0pl @(Fst ===~ Snd &&& Fst ==! Snd) ("abc","abc")Present (EQ,EQ) ('(EQ,EQ)) Val (EQ,EQ) pl @(Fst ===~ Snd) ("aBc","AbC")Present EQ ((===~) aBc = AbC)Val EQpl @("Abc" ===~ Id) "abc"Present EQ ((===~) Abc = abc)Val EQpl @("Abc" ==~ Id) "abc"True (Abc ==~ abc)Val Truepl @(Fst ==~ Snd) ("aBc","AbC")True (aBc ==~ AbC)Val True-pl @(Fst ==~ Snd && Fst == Snd) ("Abc","Abc")True (True && True)Val Truepredicate-typed similar to   but using a tuple as inputpredicate-typed similar to  pz @(Fst ==! Snd) (10,9)Val GT#pz @(14 % 3 ==! Fst -% Snd) (-10,7)Val GTpz @(Fst ==! Snd) (10,11)Val LT1pz @(Snd ==! (L12 >> Head)) (('x',[10,12,13]),10)Val EQpl @("aa" ==! Id) "aaaa" Present LT ((==!) "aa" < "aaaa")Val LTDpl @(Pairs >> Map (First (Succ >> Succ) >> Fst ==! Snd)) [1,2,3,6,8]\Present [GT,GT,LT,EQ] ((>>) [GT,GT,LT,EQ] | {Map [GT,GT,LT,EQ] | [(1,2),(2,3),(3,6),(6,8)]})Val [GT,GT,LT,EQ]<pl @((Ones << ShowP Id) >> Map' (Fst ==! Snd) Pairs) 1234223Present [LT,LT,LT,GT,EQ,LT] ((>>) [LT,LT,LT,GT,EQ,LT] | {Map [LT,LT,LT,GT,EQ,LT] | [("1","2"),("2","3"),("3","4"),("4","2"),("2","2"),("2","3")]})Val [LT,LT,LT,GT,EQ,LT]pl @("Abc" ==! Id) "abc" Present LT ((==!) "Abc" < "abc")Val LTpl @(Fst ==! Snd) (3,12)Present LT ((==!) 3 < 12)Val LTpl @(Fst ==! Snd) ("aBc","AbC") Present GT ((==!) "aBc" > "AbC")Val GTpl @(Snd ==! Fst) ("aBc","AbC") Present LT ((==!) "AbC" < "aBc")Val LTpredicate-typed.case-insensitive compare if string expression p is not equal to qpredicate-typed.case-insensitive compare if string expression p is less than q predicate-typed.case-insensitive compare if string expression p is less than or equal to q!predicate-typed.case-insensitive compare if string expression p is equal to q"predicate-typed.case-insensitive compare if string expression p is greater than or equal to q#predicate-typed.case-insensitive compare if string expression p is greater than q$predicate-typedcompare if expression p is not equal to q pl @(Fst /= Snd) ("ab","xyzabw")True ("ab" /= "xyzabw")Val True%predicate-typedcompare if expression p is less than q&predicate-typedcompare if expression p is less than or equal to q)pl @(Not (Fst >> Len <= 6)) ([2..7],True)"False (Not ((>>) True | {6 <= 6})) Val False#pl @(Fst >> Len <= 6) ([2..7],True)True ((>>) True | {6 <= 6})Val True#pl @(Length Fst <= 6) ([2..7],True) True (6 <= 6)Val True%pl @(Fst >> (Len <= 6)) ([2..7],True)True ((>>) True | {6 <= 6})Val True'predicate-typedcompare if expression p is equal to q pl @(Fst == Snd) ("ab","xyzabw")False ("ab" == "xyzabw") Val Falsepl @(Fst == Snd) ("aBc","AbC")False ("aBc" == "AbC") Val Falsepz @(Fst == Snd) ("aBc","aBc")Val Truepl @(Id == "Abc") "abc"False ("abc" == "Abc") Val Falsepl @(Fst == Snd) (True,False)False (True == False) Val False.pl @(Not Id *** Id >> Fst == Snd) (True,False)#True ((>>) True | {False == False})Val True(predicate-typedcompare if expression p is greater than or equal to q)predicate-typedcompare if expression p is greater than qpl @(Id > "xx") "abc"False ("abc" > "xx") Val Falsepl @(Id > "aa") "abc"True ("abc" > "aa")Val Truepl @(Fst > Snd) (True,False)True (True > False)Val True*predicate-typedcompare if expression p is not equal to q+predicate-typedcompare if expression p is less than to q,predicate-typedcompare if expression p is less than or equal to q-predicate-typedcompare if expression p is equal to q.predicate-typedcompare if expression p is greater than or equal to q/predicate-typedcompare if expression p is greater than q pl @(Gt 4) 5 True (5 > 4)Val True  !"#$%&'()*+,-./ )('$&%#"! /.-,+*4444 4!4"4#4$4%4&4'4(4)4None%&',-.;=>?@AHSUVXko(p'ppredicate-typed,calculate the amount to roundup to the next npl @(RoundUp Fst Snd) (3,9)Present 0 (RoundUp 3 9 = 0)Val 0pl @(RoundUp Fst Snd) (3,10)Present 2 (RoundUp 3 10 = 2)Val 2pl @(RoundUp Fst Snd) (3,11)Present 1 (RoundUp 3 11 = 1)Val 1pl @(RoundUp Fst Snd) (3,12)Present 0 (RoundUp 3 12 = 0)Val 0pl @(RoundUp 3 0) ()Present 0 (RoundUp 3 0 = 0)Val 0pl @(RoundUp 0 10) () Error RoundUp 'n' cannot be zero!Fail "RoundUp 'n' cannot be zero"qpredicate-typedreverse spz @(UnShowBaseN 2) [1,0,0,1,0]Val 18pz @(UnShowBaseN 2) [1,1,1]Val 7pz @(UnShowBaseN 16) [7,0,3,1] Val 28721pz @(UnShowBaseN 16) [0]Val 0pz @(UnShowBaseN 16) []Val 0rpredicate-typedconvert to bits$pl @(ToBits 123 >> UnShowBaseN 2) ()<Present 123 ((>>) 123 | {UnShowBaseN | 2 | [1,1,1,1,0,1,1]})Val 123spredicate-typedODisplay a number at base >= 2 but just show as a list of ints: ignores the sign0pl @(ShowBaseN 16 Id) (256*256*2+256*14+16*7+11)/Present [2,0,14,7,11] (ShowBaseN | 16 | 134779)Val [2,0,14,7,11]tpredicate-typed-Display a number at base 2 to 36, similar to   but passes the sign throughpz @(ShowBase 16) 4077 Val "fed"pz @(ShowBase 16) (-255) Val "-ff"pz @(ShowBase 2) 147Val "10010011"/pz @(Lift (ShowBase 2) (Negate 147)) "whatever"Val "-10010011"pl @(ShowBase 16) (-123)'Present "-7b" (ShowBase(16) -7b | -123) Val "-7b"pl @(ShowBase 16) 123$Present "7b" (ShowBase(16) 7b | 123)Val "7b"pl @(ShowBase 16) 65504*Present "ffe0" (ShowBase(16) ffe0 | 65504) Val "ffe0"upredicate-typed2Read a number using base 2 through a maximum of 36pz @(ReadBase Int 16) "00feD"Val 4077pz @(ReadBase Int 16) "-ff" Val (-255)pz @(ReadBase Int 2) "10010011"Val 147pz @(ReadBase Int 8) "Abff"Fail "invalid base 8"Ipl @(ReadBase Int 16 >> GuardSimple (Id > 0xffff) >> ShowBase 16) "12344"=Present "12344" ((>>) "12344" | {ShowBase(16) 12344 | 74564}) Val "12344":set -XBinaryLiteralsJpz @(ReadBase Int 16 >> GuardSimple (Id > 0b10011111) >> ShowBase 16) "7f"Fail "(127 > 159)"pl @(ReadBase Int 16) "fFe0"/Present 65504 (ReadBase(Int,16) 65504 | "fFe0") Val 65504pl @(ReadBase Int 16) "-ff",Present -255 (ReadBase(Int,16) -255 | "-ff") Val (-255)pl @(ReadBase Int 16) "ff")Present 255 (ReadBase(Int,16) 255 | "ff")Val 255pl @(ReadBase Int 22) "zzz"6Error invalid base 22 (ReadBase(Int,22) as=zzz err=[])Fail "invalid base 22"<pl @((ReadBase Int 16 &&& Id) >> First (ShowBase 16)) "fFe0"YPresent ("ffe0","fFe0") ((>>) ("ffe0","fFe0") | {(***) ("ffe0","fFe0") | (65504,"fFe0")})Val ("ffe0","fFe0")pl @(ReadBase Int 2) "101111"*Present 47 (ReadBase(Int,2) 47 | "101111")Val 47wpredicate-typed similar to  pz @(Signum Id) (-14)Val (-1)pz @(Signum Id) 14Val 1pz @(Signum Id) 0Val 0xpredicate-typed similar to  ypredicate-typed similar to  pz @(Map Even) [9,-4,12,1,2,3]&Val [False,True,True,False,True,False]%pz @(Map '(Even,Odd)) [9,-4,12,1,2,3]SVal [(False,True),(True,False),(True,False),(False,True),(True,False),(False,True)]zpredicate-typed similar to  {predicate-typed similar to  |predicate-typed similar to  pz @(QuotRem Fst Snd) (10,3) Val (3,1)pz @(QuotRem Fst Snd) (10,-3) Val (-3,1)pz @(QuotRem Fst Snd) (-10,-3) Val (3,-1)pz @(QuotRem Fst Snd) (-10,3) Val (-3,-1)pz @(QuotRem Fst Snd) (10,0)Fail "QuotRem zero denominator"pl @(QuotRem (Negate Id) 7) 23+Present (-3,-2) (-23 `quotRem` 7 = (-3,-2)) Val (-3,-2)pl @(QuotRem Fst Snd) (10,-3))Present (-3,1) (10 `quotRem` -3 = (-3,1)) Val (-3,1)}predicate-typed similar to  pz @(DivMod Fst Snd) (10,3) Val (3,1)pz @(DivMod Fst Snd) (10,-3) Val (-4,-2)pz @(DivMod Fst Snd) (-10,3) Val (-4,2)pz @(DivMod Fst Snd) (-10,-3) Val (3,-1)pz @(DivMod Fst Snd) (10,0)Fail "DivMod zero denominator"pl @(DivMod (Negate Id) 7) 23(Present (-4,5) (-23 `divMod` 7 = (-4,5)) Val (-4,5)pl @(DivMod Fst Snd) (10,-3)*Present (-4,-2) (10 `divMod` -3 = (-4,-2)) Val (-4,-2)pl @(DivMod Fst Snd) (10,0)Error DivMod zero denominatorFail "DivMod zero denominator"1pl @(DivMod (9 - Fst) (Snd >> Last)) (10,[12,13])*Present (-1,12) (-1 `divMod` 13 = (-1,12)) Val (-1,12)~predicate-typed similar to DEpz @(Mod Fst Snd) (10,3)Val 1pz @(Mod Fst Snd) (10,0)Fail "Mod zero denominator"predicate-typed similar to  pz @(Div Fst Snd) (10,4)Val 2pz @(Div Fst Snd) (10,0)Fail "Div zero denominator"predicate-typed similar to  pz @(Abs Id) (-14)Val 14pz @(Abs Snd) ("xx",14)Val 14pz @(Abs Id) 0Val 0pz @(Abs (Negate 44)) "aaa"Val 44predicate-typed similar to  pz @(Negate Id) 14 Val (-14)pz @(Negate (Fst * Snd)) (14,3) Val (-42)pz @(Negate (15 -% 4)) "abc" Val (15 % 4)pz @(Negate (15 % 3)) ()Val ((-5) % 1)pz @(Negate (Fst % Snd)) (14,3)Val ((-14) % 3)predicate-typednegate a ratiopl @'[1 % 1 ,3 -% 2,3 -% 1] ()KPresent [1 % 1,(-3) % 2,(-3) % 1] ('[1 % 1,(-3) % 2,(-3) % 1] (1 % 1) | ())Val [1 % 1,(-3) % 2,(-3) % 1]Kpl @('[1 % 1 ,Negate (33 % 7), 21 % 4,Signum (7 -% 5)] >> Map (Floor _)) ()^Present [1,-5,5,-1] ((>>) [1,-5,5,-1] | {Map [1,-5,5,-1] | [1 % 1,(-33) % 7,21 % 4,(-1) % 1]})Val [1,-5,5,-1]Mpl @('[1 % 1 ,Negate (33 % 7), 21 % 4,Signum (7 -% 5)] >> Map (Ceiling _)) ()^Present [1,-4,6,-1] ((>>) [1,-4,6,-1] | {Map [1,-4,6,-1] | [1 % 1,(-33) % 7,21 % 4,(-1) % 1]})Val [1,-4,6,-1]Npl @('[1 % 1 ,Negate (33 % 7), 21 % 4,Signum (7 -% 5)] >> Map (Truncate _)) ()^Present [1,-4,5,-1] ((>>) [1,-4,5,-1] | {Map [1,-4,5,-1] | [1 % 1,(-33) % 7,21 % 4,(-1) % 1]})Val [1,-4,5,-1]pl @(5 % 1 / 3 -% 1) 'x'.Present (-5) % 3 (5 % 1 / (-3) % 1 = (-5) % 3)Val ((-5) % 3)pl @(5 -% 1 / Fst) (3,'x').Present (-5) % 3 ((-5) % 1 / 3 % 1 = (-5) % 3)Val ((-5) % 3)predicate-typed creates a   valuepz @(Id < 21 % 5) (-3.1)Val Truepz @(Id < 21 % 5) 4.5 Val Falsepz @(Fst % Snd) (13,2) Val (13 % 2)pz @(13 % Id) 0Fail "(%) zero denominator"pz @(4 % 3 + 5 % 7) "asfd" Val (43 % 21)pz @(4 -% 7 * 5 -% 3) "asfd" Val (20 % 21)pz @(Negate (14 % 3)) ()Val ((-14) % 3)pz @(14 % 3) () Val (14 % 3)=pz @(Negate (14 % 3) ==! Lift (FromIntegral _) (Negate 5)) ()Val GTpz @(14 -% 3 ==! 5 -% 1) "aa"Val GT)pz @(Negate (14 % 3) ==! Negate 5 % 2) ()Val LTpz @(14 -% 3 * 5 -% 1) () Val (70 % 3)pz @(14 % 3 ==! 5 % 1) ()Val LTpz @(15 % 3 / 4 % 2) () Val (5 % 2)predicate-typeddivide for integrals9pz @(On (+) (Id * Id) >> (Id ** (DivI Double 1 2))) (3,4)Val 5.0predicate-typedfractional divisionpz @(Fst / Snd) (13,2)Val 6.5pz @(ToRational 13 / Id) 0Fail "(/) zero denominator"pz @(12 % 7 / 14 % 5 + Id) 12.4Val (3188 % 245) predicate-typed(addition, multiplication and subtractionpz @(Fst * Snd) (13,5)Val 65*pz @(Fst + 4 * Length Snd - 4) (3,"hello")Val 19predicate-typed similar to  2pz @(Fst `LogBase` Snd >> Truncate Int) (10,12345)Val 4predicate-typedsimilar to 'GHC.Float.(**)'pz @(Fst ** Snd) (10,4) Val 10000.0Kpz @'(IsPrime,Id ^ 3,(FromIntegral _) ** (Lift (FromRational _) (1 % 2))) 4Val (False,64,2.0)predicate-typedsimilar to 'GHC.Real.(^)'pz @(Fst ^ Snd) (10,4) Val 10000predicate-typed+multiply two values together pointed to by p and qpredicate-typed,subtracts two values together pointed to by p and qpredicate-typed'adds two values together pointed to by p and qpredicate-typed - function where you need to provide the type t of the resultpz @(Floor Int) (23 % 5)Val 4predicate-typed - function where you need to provide the type t of the resultpredicate-typed - function where you need to provide the type t of the resultpz @(Ceiling Int) (23 % 5)Val 5predicate-typed - function where you need to provide the type t of the resultpredicate-typed - function where you need to provide the type t of the resultpz @(Truncate Int) (23 % 5)Val 4predicate-typed - function where you need to provide the type t of the result:pl @(Truncate' (Fst >> UnproxyT) Snd) (Proxy @Integer,2.3)Present 2 (Truncate 2 | 2.3)Val 2$pl @(Truncate' Fst Snd) (1::Int,2.3)Present 2 (Truncate 2 | 2.3)Val 2predicate-typed - function where you need to provide the type t of the result pz @(FromRational Rational) 23.5 Val (47 % 2) pl @(FromRational Float) (4 % 5)&Present 0.8 (FromRational 0.8 | 4 % 5)Val 0.8predicate-typed - function where you need to provide the type t of the result%pl @(FromRational' Fst Snd) (1,2 % 5)&Present 0.4 (FromRational 0.4 | 2 % 5)Val 0.4predicate-typed  functionpz @(ToRational Id) 23.5 Val (47 % 2).pl @((ToRational 123 &&& Id) >> Fst + Snd) 4.2=Present 636 % 5 ((>>) 636 % 5 | {123 % 1 + 21 % 5 = 636 % 5}) Val (636 % 5)Apl @(Fst >= Snd || Snd > 23 || 12 -% 5 <= ToRational Fst) (12,13)True (False || True)Val Truepl @(ToRational 14) ()'Present 14 % 1 (ToRational 14 % 1 | 14) Val (14 % 1)%pl @(ToRational 5 / ToRational 3) 'x'%Present 5 % 3 (5 % 1 / 3 % 1 = 5 % 3) Val (5 % 3)predicate-typed - function where you need to provide the type t of the result pz @(FromIntegral (SG.Sum _)) 23Val (Sum {getSum = 23})2pz @(Pop1' (Proxy FromIntegral) 'Proxy 44) (1 % 0) Val (44 % 1)predicate-typed - function where you need to provide the type t of the resultpz @(FromInteger (SG.Sum _)) 23Val (Sum {getSum = 23})#pz @(44 >> FromInteger Rational) 12 Val (44 % 1)pz @(FromInteger Rational) 12 Val (12 % 1)>pl @((Lift (FromInteger _) 12 &&& Id) >> Fst + Snd) (SG.Min 7)BPresent Min {getMin = 19} ((>>) Min {getMin = 19} | {getMin = 19})Val (Min {getMin = 19})2pl @(Lift (FromInteger _) 12 <> Id) (SG.Product 7)uPresent Product {getProduct = 84} (Product {getProduct = 12} <> Product {getProduct = 7} = Product {getProduct = 84})Val (Product {getProduct = 84})+pl @(Fst >> FromInteger (SG.Sum _)) (3,"A")?Present Sum {getSum = 3} ((>>) Sum {getSum = 3} | {getSum = 3})Val (Sum {getSum = 3}))pl @(Lift (FromInteger DiffTime) 123) 'x'-Present 123s ((>>) 123s | {FromInteger 123s})Val 123s)pqrstuvwxyz{|}~)wyx~}|{zpuvtsqr88788766None%&',-.=>?@AHSUVXkoZ" predicate-typed similar to  pz @(STimes 4 Id) (SG.Sum 3)Val (Sum {getSum = 12})pz @(STimes 4 Id) "ab"Val "abababab"pl @(STimes 4 Id) (SG.Sum 13)dPresent Sum {getSum = 52} (STimes 4 p=Sum {getSum = 13} Sum {getSum = 52} | n=4 | Sum {getSum = 13})Val (Sum {getSum = 52})"pl @(STimes Fst Snd) (4,['x','y'])<Present "xyxyxyxy" (STimes 4 p="xy" "xyxyxyxy" | n=4 | "xy")Val "xyxyxyxy"pl @(STimes Fst Snd) (4,"abc")FPresent "abcabcabcabc" (STimes 4 p="abc" "abcabcabcabc" | n=4 | "abc")Val "abcabcabcabc"pl @(STimes 4 Id) "abc"FPresent "abcabcabcabc" (STimes 4 p="abc" "abcabcabcabc" | n=4 | "abc")Val "abcabcabcabc"predicate-typed$creates a mempty value for the proxypl @('Proxy >> MEmptyP) "abc"#Present "" ((>>) "" | {MEmptyT ""})Val ""predicate-typed similar to  !pz @(MEmptyT (SG.Sum Int)) ()Val (Sum {getSum = 0})&pl @(MEmptyT _ ||| Ones) (Right "abc")9Present ["a","b","c"] ((|||) Right ["a","b","c"] | "abc")Val ["a","b","c"]&pl @(MEmptyT _ ||| Ones) (Left ["ab"])#Present [] ((|||) Left [] | ["ab"])Val []pl @(MEmptyT (Maybe ())) 'x'!Present Nothing (MEmptyT Nothing) Val Nothing/pl @(MEmptyT (SG.Sum _) >> Unwrap >> Id + 4) () Present 4 ((>>) 4 | {0 + 4 = 4})Val 4Opz @(FMap (MEmptyT (SG.Product Int))) [Identity (-13), Identity 4, Identity 99]PVal [Product {getProduct = 1},Product {getProduct = 1},Product {getProduct = 1}])pl @(FMap (MEmptyT (SG.Sum _))) (Just ())?Present Just (Sum {getSum = 0}) (FMap MEmptyT Sum {getSum = 0})Val (Just (Sum {getSum = 0}))predicate-typed similar to  !$pl @(MEmptyT' Id) (Just (SG.Sum 12))!Present Nothing (MEmptyT Nothing) Val Nothingpredicate-typed similar to  "=pz @(ToNEList >> SConcat Id) [SG.Sum 44, SG.Sum 12, SG.Sum 3]Val (Sum {getSum = 59})Qpz @(Map '(Pure SG.Sum Id, Pure SG.Max Id) >> ToNEList >> SConcat Id) [7,6,1,3,5](Val (Sum {getSum = 22},Max {getMax = 7})predicate-typed similar to  #1pz @(MConcat Id) [SG.Sum 44, SG.Sum 12, SG.Sum 3]Val (Sum {getSum = 59})epz @(Map '(Pure SG.Sum Id, Pure SG.Max Id) >> MConcat Id) [7 :: Int,6,1,3,5] -- monoid so need eg Int(Val (Sum {getSum = 22},Max {getMax = 7})predicate-typed?semigroup append both sides of a tuple (ie uncurry (<>)) using " and then unwraps the final resultpz @(Sap (SG.Sum _)) (4,5)Val 9pz @(Sap (SG.Sum _)) (13,44)Val 57pz @(Sap SG.Any) (True,False)Val Truepz @(Sap SG.All) (True,False) Val Falsepz @(Sap (SG.Max _)) (10,12)Val 12pz @(Sap (SG.Sum _)) (10,12)Val 22pz @(Sap (S _)) ("abc","def") Val "abcdef"?pz @(Fst <> Snd) ("abc","def") -- same as above but more direct Val "abcdef"predicate-typedsynonym for wrapping a monoidpredicate-typed similar to  $pz @(Fst <> Snd) ("abc","def") Val "abcdef" pz @("abcd" <> "ef" <> Id) "ghi"Val "abcdefghi" pz @("abcd" <> "ef" <> Id) "ghi"Val "abcdefghi"4pz @(Wrap (SG.Sum _) Id <> (10 >> FromInteger _)) 13Val (Sum {getSum = 23}):pz @(Wrap (SG.Product _) Id <> Lift (FromInteger _) 10) 13 Val (Product {getProduct = 130})<pz @('(10 >> FromInteger _,"def") <> Id) (SG.Sum 12, "_XYZ")!Val (Sum {getSum = 22},"def_XYZ")  6None%&',-.=>?@AHPSUVX_ko Z= predicate-typed%zip cartesian product for lists: see F for Applicative version>pz @(ZipCartesian (EnumFromTo Fst Snd) ('LT ... 'GT) ) (10,11)5Val [(10,LT),(10,EQ),(10,GT),(11,LT),(11,EQ),(11,GT)]*pz @(ZipCartesian '[ '() ] (1 ... 5)) True(Val [((),1),((),2),((),3),((),4),((),5)] predicate-typed similar to GHpz @Nub "abcdbc" Val "abcd" pz @Nub []Val []pz @Nub [1,4,1,1,1,1,1] Val [1,4]predicate-typed similar to   pl @(IsSuffix '[2,3] Id) [1,2,3]True (IsSuffix | [2,3] [1,2,3])Val True pl @(IsSuffix '[2,3] Id) [2,3,4] False (IsSuffix | [2,3] [2,3,4]) Val Falsepredicate-typed similar to  pl @(IsInfix '[2,3] Id) [1,2,3]True (IsInfix | [2,3] [1,2,3])Val True!pl @(IsInfix '[2,3] Id) [1,2,1,3]!False (IsInfix | [2,3] [1,2,1,3]) Val Falsepredicate-typed similar to   pl @(IsPrefix '[2,3] Id) [2,3,4]True (IsPrefix | [2,3] [2,3,4])Val True pl @(IsPrefix '[2,3] Id) [1,2,3] False (IsPrefix | [2,3] [1,2,3]) Val Falsepredicate-typed similar to GIpz @Max [10,4,5,12,3,4]Val 12 pz @Max []Fail "empty list"predicate-typed similar to GJpz @Min [10,4,5,12,3,4]Val 3 pz @Min []Fail "empty list"predicate-typed similar to GKpz @Product [10,4,5,12,3,4] Val 28800pz @Product []Val 1predicate-typed similar to GLpz @Sum [10,4,5,12,3,4]Val 38 pz @Sum []Val 0pz @(1 ... 10 >> Sum) ()Val 55predicate-typed similar to GMpz @(EmptyT Maybe) () Val Nothingpz @(EmptyT []) ()Val []"pz @(C "x" >> EmptyT []) (13,True)Val ""-pz @(Fst >> EmptyT (Either String)) (13,True) Val (Left "")predicate-typed"zip two lists with the same lengthpl @(Zip '[1,2,3] "abc") ()WPresent [(1,'a'),(2,'b'),(3,'c')] (Zip [(1,'a'),(2,'b'),(3,'c')] | p=[1,2,3] | q="abc")Val [(1,'a'),(2,'b'),(3,'c')]pl @(Zip '[1,2,3] "ab") ()3Error Zip(3,2) length mismatch (p=[1,2,3] | q="ab")Fail "Zip(3,2) length mismatch"pl @(Zip '[1,2] "abc") ()2Error Zip(2,3) length mismatch (p=[1,2] | q="abc")Fail "Zip(2,3) length mismatch"pl @(Zip "abc" Id) [1..7]<Error Zip(3,7) length mismatch (p="abc" | q=[1,2,3,4,5,6,7])Fail "Zip(3,7) length mismatch"predicate-typed4zip two lists optionally padding the right hand side$pl @(ZipR (C "Z") '[1,2,3] "abc") ()XPresent [(1,'a'),(2,'b'),(3,'c')] (ZipR [(1,'a'),(2,'b'),(3,'c')] | p=[1,2,3] | q="abc")Val [(1,'a'),(2,'b'),(3,'c')]#pl @(ZipR (C "Z") '[1,2,3] "ab") ()WPresent [(1,'a'),(2,'b'),(3,'Z')] (ZipR [(1,'a'),(2,'b'),(3,'Z')] | p=[1,2,3] | q="ab")Val [(1,'a'),(2,'b'),(3,'Z')]"pl @(ZipR (C "Z") '[1,2,3] "a") ()VPresent [(1,'a'),(2,'Z'),(3,'Z')] (ZipR [(1,'a'),(2,'Z'),(3,'Z')] | p=[1,2,3] | q="a")Val [(1,'a'),(2,'Z'),(3,'Z')]"pl @(ZipR (C "Z") '[1,2] "abc") ():Error ZipR(2,3) rhs would be truncated (p=[1,2] | q="abc")'Fail "ZipR(2,3) rhs would be truncated"'pl @(ZipR (C "Y") (EmptyT _) Id) "abcd"8Error ZipR(0,4) rhs would be truncated (p=[] | q="abcd")'Fail "ZipR(0,4) rhs would be truncated"predicate-typed3zip two lists optionally padding the left hand sidepl @(ZipL 99 '[1,2,3] "abc") ()XPresent [(1,'a'),(2,'b'),(3,'c')] (ZipL [(1,'a'),(2,'b'),(3,'c')] | p=[1,2,3] | q="abc")Val [(1,'a'),(2,'b'),(3,'c')]pl @(ZipL 99 '[1,2] "abc") ()XPresent [(1,'a'),(2,'b'),(99,'c')] (ZipL [(1,'a'),(2,'b'),(99,'c')] | p=[1,2] | q="abc")Val [(1,'a'),(2,'b'),(99,'c')]pl @(ZipL 99 '[1] "abc") ()XPresent [(1,'a'),(99,'b'),(99,'c')] (ZipL [(1,'a'),(99,'b'),(99,'c')] | p=[1] | q="abc")Val [(1,'a'),(99,'b'),(99,'c')]pl @(ZipL 99 '[1,2,3] "ab") ();Error ZipL(3,2) rhs would be truncated (p=[1,2,3] | q="ab")'Fail "ZipL(3,2) rhs would be truncated"!pl @(ZipL 99 Id "abcdefg") [1..4]Present [(1,'a'),(2,'b'),(3,'c'),(4,'d'),(99,'e'),(99,'f'),(99,'g')] (ZipL [(1,'a'),(2,'b'),(3,'c'),(4,'d'),(99,'e'),(99,'f'),(99,'g')] | p=[1,2,3,4] | q="abcdefg")@Val [(1,'a'),(2,'b'),(3,'c'),(4,'d'),(99,'e'),(99,'f'),(99,'g')]7pl @(ZipL (99 % 4) '[1 % 1 , 2 % 1 , 3 % 1] Id) "abcde"Present [(1 % 1,'a'),(2 % 1,'b'),(3 % 1,'c'),(99 % 4,'d'),(99 % 4,'e')] (ZipL [(1 % 1,'a'),(2 % 1,'b'),(3 % 1,'c'),(99 % 4,'d'),(99 % 4,'e')] | p=[1 % 1,2 % 1,3 % 1] | q="abcde")CVal [(1 % 1,'a'),(2 % 1,'b'),(3 % 1,'c'),(99 % 4,'d'),(99 % 4,'e')]#pl @(ZipL "X" (EmptyT _) Id) "abcd"tPresent [("X",'a'),("X",'b'),("X",'c'),("X",'d')] (ZipL [("X",'a'),("X",'b'),("X",'c'),("X",'d')] | p=[] | q="abcd")-Val [("X",'a'),("X",'b'),("X",'c'),("X",'d')]predicate-typed<Zip two lists to their maximum length using optional padding/pz @(ZipPad (C "Z") 99 Fst Snd) ("abc", [1..5])-Val [('a',1),('b',2),('c',3),('Z',4),('Z',5)]3pz @(ZipPad (C "Z") 99 Fst Snd) ("abcdefg", [1..5])?Val [('a',1),('b',2),('c',3),('d',4),('e',5),('f',99),('g',99)]1pz @(ZipPad (C "Z") 99 Fst Snd) ("abcde", [1..5])-Val [('a',1),('b',2),('c',3),('d',4),('e',5)],pz @(ZipPad (C "Z") 99 Fst Snd) ("", [1..5])-Val [('Z',1),('Z',2),('Z',3),('Z',4),('Z',5)]-pz @(ZipPad (C "Z") 99 Fst Snd) ("abcde", [])2Val [('a',99),('b',99),('c',99),('d',99),('e',99)]predicate-typedlike  %-pz @(ZipWith Id (1...5) (C "a" ... C "e")) ()-Val [(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e')]Cpz @(ZipWith (ShowP Fst <> ShowP Snd) (1...5) (C "a" ... C "e")) ()(Val ["1'a'","2'b'","3'c'","4'd'","5'e'"]<pz @(ZipWith (MkThese Fst Snd) (1...6) (C "a" ... C "f")) ()MVal [These 1 'a',These 2 'b',These 3 'c',These 4 'd',These 5 'e',These 6 'f']8pz @(ZipWith (MkThese Fst Snd) '[] (C "a" ... C "f")) ()#Fail "ZipWith(0,6) length mismatch"<pz @(ZipWith (MkThese Fst Snd) (1...3) (C "a" ... C "f")) ()#Fail "ZipWith(3,6) length mismatch"predicate-typed(creates an empty list for the given typepz @(Id :+ EmptyList _) 99Val [99]predicate-typed creates a singleton from a valuepz @(Singleton (C "aBc")) ()Val "a"pz @(Singleton Id) False Val [False]#pz @(Singleton Snd) (False,"hello") Val ["hello"]predicate-typedreverses using  &pz @ReverseL (T.pack "AbcDeF") Val "FeDcbA"pz @ReverseL "AbcDeF" Val "FeDcbA"pl @ReverseL ("asfd" :: T.Text))Present "dfsa" (ReverseL "dfsa" | "asfd") Val "dfsa"predicate-typed similar to GNpz @Reverse [1,2,4] Val [4,2,1]pz @Reverse "AbcDeF" Val "FeDcbA" predicate-typedsimple sort: similar to OP!predicate-typed like SortOn but descending order%pl @(SortOnDesc Id Id) [10,4,2,12,14].Present [14,12,10,4,2] (SortBy [14,12,10,4,2])Val [14,12,10,4,2]9pl @(SortOnDesc Fst Snd) ((),[('z',1),('a',10),('m',22)])HPresent [('z',1),('m',22),('a',10)] (SortBy [('z',1),('m',22),('a',10)])Val [('z',1),('m',22),('a',10)]"predicate-typed similar to  'Jpz @(SortOn Fst Id) [(10,"abc"), (3,"def"), (4,"gg"), (10,"xyz"), (1,"z")]6Val [(1,"z"),(3,"def"),(4,"gg"),(10,"abc"),(10,"xyz")]!pl @(SortOn Id Id) [10,4,2,12,14].Present [2,4,10,12,14] (SortBy [2,4,10,12,14])Val [2,4,10,12,14]*pl @(SortOn (Negate Id) Id) [10,4,2,12,14].Present [14,12,10,4,2] (SortBy [14,12,10,4,2])Val [14,12,10,4,2]3pl @(SortOn Fst Id) (zip "cabdaz" [10,4,2,12,14,1])zPresent [('a',4),('a',14),('b',2),('c',10),('d',12),('z',1)] (SortBy [('a',4),('a',14),('b',2),('c',10),('d',12),('z',1)])8Val [('a',4),('a',14),('b',2),('c',10),('d',12),('z',1)]-pl @(SortOn (FailS "asdf") Id) [10,4,2,12,14]9Error asdf(4) (Partition(i=0, a=(10,4)) excnt=4 | SortBy)Fail "asdf(4)">pl @(SortOn Snd Snd) ((),[('z',14),('a',10),('m',22),('a',1)])ZPresent [('a',1),('a',10),('z',14),('m',22)] (SortBy [('a',1),('a',10),('z',14),('m',22)])(Val [('a',1),('a',10),('z',14),('m',22)]5pl @(SortOn Fst Snd) ((),[('z',1),('a',10),('m',22)])HPresent [('a',10),('m',22),('z',1)] (SortBy [('a',10),('m',22),('z',1)])Val [('a',10),('m',22),('z',1)]@pl @(SortOn Fst Id) [('z',1),('a',10),('m',22),('a',9),('m',10)]jPresent [('a',10),('a',9),('m',22),('m',10),('z',1)] (SortBy [('a',10),('a',9),('m',22),('m',10),('z',1)])0Val [('a',10),('a',9),('m',22),('m',10),('z',1)]?pl @(SortOn Id Id) [('z',1),('a',10),('m',22),('a',9),('m',10)]jPresent [('a',9),('a',10),('m',10),('m',22),('z',1)] (SortBy [('a',9),('a',10),('m',10),('m',22),('z',1)])0Val [('a',9),('a',10),('m',10),('m',22),('z',1)]#predicate-typedsort a list (stable)<pz @(SortBy (Snd ==! Fst) Id) [(10,"ab"),(4,"x"),(20,"bbb")]"Val [(20,"bbb"),(10,"ab"),(4,"x")]!pz @(SortBy 'LT Id) [1,5,2,4,7,0]Val [1,5,2,4,7,0]!pz @(SortBy 'GT Id) [1,5,2,4,7,0]Val [0,7,4,2,5,1]_pz @(SortBy ((L11 ==! L21) <> (L12 ==! L22)) Id) [(10,"ab"),(4,"x"),(20,"bbb"),(4,"a"),(4,"y")]2Val [(4,"a"),(4,"x"),(4,"y"),(10,"ab"),(20,"bbb")]_pz @(SortBy ((L11 ==! L21) <> (L22 ==! L12)) Id) [(10,"ab"),(4,"x"),(20,"bbb"),(4,"a"),(4,"y")]2Val [(4,"y"),(4,"x"),(4,"a"),(10,"ab"),(20,"bbb")]Ipl @(SortBy (Swap >> OrdA' Fst Fst) Snd) ((),[('z',1),('a',10),('m',22)])HPresent [('z',1),('m',22),('a',10)] (SortBy [('z',1),('m',22),('a',10)])Val [('z',1),('m',22),('a',10)]=pl @(SortBy (OrdA' Reverse Reverse) Id) ["az","by","cx","aa"]<Present ["aa","cx","by","az"] (SortBy ["aa","cx","by","az"])Val ["aa","cx","by","az"]npl @(SortBy (If (Fst==5 && Snd==3) (FailT _ (PrintT "pivot=%d value=%d" Id)) 'GT) Snd) ((), [5,7,3,1,6,2,1,3])CError pivot=5 value=3(2) (Partition(i=1, a=(5,3)) excnt=2 | SortBy)Fail "pivot=5 value=3(2)"ppl @(SortBy (If (Fst==50 && Snd==3) (FailT _ (PrintT "pivot=%d value=%d" Id)) OrdA) Snd) ((), [5,7,3,1,6,2,1,3])4Present [1,1,2,3,3,5,6,7] (SortBy [1,1,2,3,3,5,6,7])Val [1,1,2,3,3,5,6,7]$predicate-typed ( equivalent4pz @Unzip3 (zip3 [1..5] "abcd" (cycle [True,False])).Val ([1,2,3,4],"abcd",[True,False,True,False])%predicate-typed ) equivalentpz @Unzip (zip [1..5] "abcd")Val ([1,2,3,4],"abcd")&predicate-typed4takes the init of a list-like container: similar to GQpz @Init "abcd" Val "abc"pz @Init (T.pack "abcd") Val "abc" pz @Init []Fail "Init(empty)"pl @Init [1..5]0Present [1,2,3,4] (Init [1,2,3,4] | [1,2,3,4,5]) Val [1,2,3,4] pl @Init []Error Init(empty)Fail "Init(empty)"'predicate-typed4takes the last of a list-like container: similar to GRpz @Last "abcd"Val 'd' pz @Last []Fail "Last(empty)"pl @Last [1,2,3]Present 3 (Last 3 | [1,2,3])Val 3(predicate-typed4takes the tail of a list-like container: similar to GSpz @Tail "abcd" Val "bcd"pl @Tail [1..5]0Present [2,3,4,5] (Tail [2,3,4,5] | [1,2,3,4,5]) Val [2,3,4,5] pl @Tail []Error Tail(empty)Fail "Tail(empty)")predicate-typed4takes the head of a list-like container: similar to GTpz @Head "abcd"Val 'a' pl @Head []Error Head(empty)Fail "Head(empty)"$pl @(Fst >> Head >> Le 6) ([], True)Error Head(empty)Fail "Head(empty)"pl @Head [1,2,3]Present 1 (Head 1 | [1,2,3])Val 1*predicate-typedfilters a list q removing those elements in p#pz @(Remove '[5] '[1,5,5,2,5,2]) () Val [1,2,2])pz @(Remove '[0,1,1,5] '[1,5,5,2,5,2]) () Val [2,2]$pz @(Remove '[99] '[1,5,5,2,5,2]) ()Val [1,5,5,2,5,2]'pz @(Remove '[99,91] '[1,5,5,2,5,2]) ()Val [1,5,5,2,5,2]!pz @(Remove Id '[1,5,5,2,5,2]) []Val [1,5,5,2,5,2]Fpz @(Remove '[] '[1,5,5,2,5,2]) 44 -- works if you make this a number!Val [1,5,5,2,5,2]+predicate-typedfilters a list q keeping those elements in p!pz @(Keep '[5] '[1,5,5,2,5,2]) () Val [5,5,5]'pz @(Keep '[0,1,1,5] '[1,5,5,2,5,2]) () Val [1,5,5,5],predicate-typedsplits a list pointed to by p into lists of size n with a gap of iPpz @(Unfoldr (If Null (MkNothing _) (MkJust '(Take 3 Id,Drop 2 Id))) Id) [1..10],Val [[1,2,3],[3,4,5],[5,6,7],[7,8,9],[9,10]]pz @(ChunksOf' 3 2 Id) [1..10],Val [[1,2,3],[3,4,5],[5,6,7],[7,8,9],[9,10]]-predicate-typedsplits a list pointed to by p into lists of size npz @(ChunksOf 2) "abcdef"Val ["ab","cd","ef"]pz @(ChunksOf 2) "abcdefg"Val ["ab","cd","ef","g"]pz @(ChunksOf 2) ""Val []pz @(ChunksOf 2) "a" Val ["a"]=pz @(PadR (Len + RoundUp 5 Len) 999 Id >> ChunksOf 5) [1..17]CVal [[1,2,3,4,5],[6,7,8,9,10],[11,12,13,14,15],[16,17,999,999,999]]=pz @(PadR (Len + RoundUp 5 Len) 999 Id >> ChunksOf 5) [1..15]/Val [[1,2,3,4,5],[6,7,8,9,10],[11,12,13,14,15]].predicate-typeddrop n values from a list p : similar to  */predicate-typedtake n values from a list p : similar to  +pz @(Take 3 Id) "abcdef" Val "abc"pz @(Take 3 Id) "ab"Val "ab"pz @(Take 10 Id) "abcdef" Val "abcdef"pz @(Take 0 Id) "abcdef"Val ""pz @(Take 10 Id) ""Val ""0predicate-typed similar to GU pz @(SplitAt 4 Id) "hello world"Val ("hell","o world")!pz @(SplitAt 20 Id) "hello world"Val ("hello world","") pz @(SplitAt 0 Id) "hello world"Val ("","hello world")'pz @(SplitAt Snd Fst) ("hello world",4)Val ("hell","o world"))pz @(SplitAt (Negate 2) Id) "hello world"Val ("hello wor","ld")Bpl @(Snd >> SplitAt 2 Id >> Len *** Len >> Fst > Snd) ('x',[1..5])False ((>>) False | {2 > 3}) Val False1predicate-typed split a list p5 into parts using the lengths in the type level list ns*pz @(SplitAts '[2,3,1,1] Id) "hello world"Val ["he","llo"," ","w","orld"]$pz @(SplitAts '[2] Id) "hello world"Val ["he","llo world"]+pz @(SplitAts '[10,1,1,5] Id) "hello world"Val ["hello worl","d","",""]"pl @(SplitAts '[1,3,4] Id) [1..12]Present [[1],[2,3,4],[5,6,7,8],[9,10,11,12]] (SplitAts [[1],[2,3,4],[5,6,7,8],[9,10,11,12]] | ns=[1,3,4] | [1,2,3,4,5,6,7,8,9,10,11,12])(Val [[1],[2,3,4],[5,6,7,8],[9,10,11,12]];pl @(SplitAts '[3,1,1,1] Id >> Filter (Not Null) Id) [1..4]ZPresent [[1,2,3],[4]] ((>>) [[1,2,3],[4]] | {Fst [[1,2,3],[4]] | ([[1,2,3],[4]],[[],[]])})Val [[1,2,3],[4]]2predicate-typed right pad q with n values from ppl @(PadR 5 8 Id) [1..3]8Present [1,2,3,8,8] (PadR 5 pad=8 [1,2,3,8,8] | [1,2,3])Val [1,2,3,8,8]pl @(PadR 5 0 Id) [1..5]<Present [1,2,3,4,5] (PadR 5 pad=0 [1,2,3,4,5] | [1,2,3,4,5])Val [1,2,3,4,5]pl @(PadR 5 0 Id) [1..6]BPresent [1,2,3,4,5,6] (PadR 5 pad=0 [1,2,3,4,5,6] | [1,2,3,4,5,6])Val [1,2,3,4,5,6]3predicate-typed left pad q with n values from ppl @(PadL 5 0 Id) [1..3]8Present [0,0,1,2,3] (PadL 5 pad=0 [0,0,1,2,3] | [1,2,3])Val [0,0,1,2,3]pz @(PadL 5 999 Id) [12,13]Val [999,999,999,12,13]#pz @(PadR 5 Fst '[12,13]) (999,'x')Val [12,13,999,999,999]&pz @(PadR 2 Fst '[12,13,14]) (999,'x')Val [12,13,14]pl @(PadL 10 0 Id) [1..3]MPresent [0,0,0,0,0,0,0,1,2,3] (PadL 10 pad=0 [0,0,0,0,0,0,0,1,2,3] | [1,2,3])Val [0,0,0,0,0,0,0,1,2,3]4predicate-typedsplit a list into single valuespz @Ones [4,8,3,9]Val [[4],[8],[3],[9]] pz @Ones []Val []5predicate-typed similar to  ,pz @Tails [4,8,3,9]$Val [[4,8,3,9],[8,3,9],[3,9],[9],[]] pz @Tails []Val [[]]pl @Tails "abcd"NPresent ["abcd","bcd","cd","d",""] (Tails ["abcd","bcd","cd","d",""] | "abcd")Val ["abcd","bcd","cd","d",""]6predicate-typed similar to  -pz @Inits [4,8,3,9]$Val [[],[4],[4,8],[4,8,3],[4,8,3,9]] pz @Inits []Val [[]]7predicate-typed . function!pz @(Elem Fst Snd) ('x',"abcdxy")Val True!pz @(Elem Fst Snd) ('z',"abcdxy") Val Falsepl @(Elem Id '[2,3,4]) 2True (2 `elem` [2,3,4])Val Truepl @(Elem Id '[2,3,4]) 6False (6 `elem` [2,3,4]) Val Falsepl @(Elem Id '[13 % 2]) 6.5True (13 % 2 `elem` [13 % 2])Val True#pl @(Elem Id '[13 % 2, 12 % 1]) 6.5$True (13 % 2 `elem` [13 % 2,12 % 1])Val True!pl @(Elem Id '[13 % 2, 12 % 1]) 6$False (6 % 1 `elem` [13 % 2,12 % 1]) Val False8predicate-typedintercalate two lists;pz @(Intercalate '["aB"] '["xxxx","yz","z","www","xyz"]) ()5Val ["xxxx","aB","yz","aB","z","aB","www","aB","xyz"]-pz @(Intercalate '[W 99,Negate 98] Id) [1..5]+Val [1,99,-98,2,99,-98,3,99,-98,4,99,-98,5]%pz @(Intercalate '[99,100] Id) [1..5]+Val [1,99,100,2,99,100,3,99,100,4,99,100,5]3pl @(Intercalate Fst Snd) ([0,1], [12,13,14,15,16])rPresent [12,0,1,13,0,1,14,0,1,15,0,1,16] (Intercalate [12,0,1,13,0,1,14,0,1,15,0,1,16] | [0,1] | [12,13,14,15,16])$Val [12,0,1,13,0,1,14,0,1,15,0,1,16]Kpl @((Pure [] (Negate Len) &&& Id) >> Intercalate Fst Snd) [12,13,14,15,16]Present [12,-5,13,-5,14,-5,15,-5,16] ((>>) [12,-5,13,-5,14,-5,15,-5,16] | {Intercalate [12,-5,13,-5,14,-5,15,-5,16] | [-5] | [12,13,14,15,16]}) Val [12,-5,13,-5,14,-5,15,-5,16]9predicate-typed similar to GVpl @(Span (Lt 4) Id) [1..11]7Present ([1,2,3],[4,5,6,7,8,9,10,11]) (Break cnt=(3,8))!Val ([1,2,3],[4,5,6,7,8,9,10,11]):predicate-typed similar to GW(pz @(Break (Ge 3) Id) [10,4,1,7,3,1,3,5]Val ([],[10,4,1,7,3,1,3,5])(pz @(Break (Lt 3) Id) [10,4,1,7,3,1,3,5]Val ([10,4],[1,7,3,1,3,5])pl @(Break (Gt 2) Id) [1..11]7Present ([1,2],[3,4,5,6,7,8,9,10,11]) (Break cnt=(2,9))!Val ([1,2],[3,4,5,6,7,8,9,10,11])Kpl @(Break (If (Gt 2) 'True (If (Gt 4) (FailT _ "ASfd") 'False)) Id) [1..8]/Present ([1,2],[3,4,5,6,7,8]) (Break cnt=(2,6))Val ([1,2],[3,4,5,6,7,8])_pl @(Break (Case 'False '[Gt 2,Gt 4] '[W 'True, FailT _ "ASfd"] Id) Id) [1..8] -- case version/Present ([1,2],[3,4,5,6,7,8]) (Break cnt=(2,6))Val ([1,2],[3,4,5,6,7,8])9pl @(Break (If (Gt 2) (FailT _ "ASfd") 'False) Id) [1..8]-Error ASfd (If True | Break predicate failed) Fail "ASfd"Bpl @(Break Snd Id) (zip [1..] [False,False,False,True,True,False])YPresent ([(1,False),(2,False),(3,False)],[(4,True),(5,True),(6,False)]) (Break cnt=(3,3))CVal ([(1,False),(2,False),(3,False)],[(4,True),(5,True),(6,False)])8pl @(Break Snd Id) (zip [1..] [False,False,False,False])HPresent ([(1,False),(2,False),(3,False),(4,False)],[]) (Break cnt=(4,0))2Val ([(1,False),(2,False),(3,False),(4,False)],[])4pl @(Break Snd Id) (zip [1..] [True,True,True,True])DPresent ([],[(1,True),(2,True),(3,True),(4,True)]) (Break cnt=(0,4)).Val ([],[(1,True),(2,True),(3,True),(4,True)]);predicate-typed similar to GX*pz @(Filter (Gt 4) Id) [10,1,3,5,-10,12,1] Val [10,5,12]<predicate-typed similar to = but returns the value and countpz @GroupCnt [1,3,4,5,1,5,5])Val [(1,1),(3,1),(4,1),(5,1),(1,1),(5,2)]&pz @(Sort >> GroupCnt) [1,3,4,5,1,5,5]Val [(1,2),(3,1),(4,1),(5,3)]"pz @(Sort >> GroupCnt) "xyabxaaaz"-Val [('a',4),('b',1),('x',2),('y',1),('z',1)]=predicate-typed similar to GYpz @Group [1,3,4,5,1,5,5]Val [[1],[3],[4],[5],[1],[5,5]]#pz @(Sort >> Group) [1,3,4,5,1,5,5]Val [[1,1],[3],[4],[5,5,5]]>predicate-typed version of <# that retains the original orderingpz @GroupCntStable "bababab"Val [('b',4),('a',3)]pz @GroupCntStable "fedbfefa"-Val [('f',3),('e',2),('d',1),('b',1),('a',1)]pz @GroupCntStable "fedc"%Val [('f',1),('e',1),('d',1),('c',1)]pz @GroupCntStable "ffff" Val [('f',4)]pz @GroupCntStable ""Val []?predicate-typed similar to GZ-pz @(GroupBy (Fst == Snd) Id) [1,3,4,5,1,5,5]Val [[1],[3],[4],[5],[1],[5,5]]1pz @(GroupBy (Fst == Snd) Id) [1,1,1,3,4,5,1,5,5]#Val [[1,1,1],[3],[4],[5],[1],[5,5]]#pz @(GroupBy (Fst == Snd) Id) [5,5] Val [[5,5]]#pz @(GroupBy (Fst == Snd) Id) [1,2] Val [[1],[2]]!pz @(GroupBy (Fst == Snd) Id) [1] Val [[1]] pz @(GroupBy (Fst == Snd) Id) []Val [],pz @(GroupBy (Fst < Snd) Id) [1,2,3,4,4,1,2]Val [[1,2,3,4],[4],[1,2]]-pz @(GroupBy (Fst /= Snd) Id) [1,2,3,4,4,4,1]Val [[1,2,3,4],[4],[4,1]]1pan @(GroupBy (Fst == Snd) Id) "hello goodbye""<P GroupBy ["h","e","ll","o"," ","g","oo","d","b","y","e"]|+- P Id "hello goodbye"|+- False i=0: 'h' == 'e'|+- False i=1: 'e' == 'l'|+- True i=2: 'l' == 'l'|+- False i=3: 'l' == 'o'|+- False i=4: 'o' == ' '|+- True i=5: ' ' == ' '|+- True i=6: ' ' == ' '|+- True i=7: ' ' == ' '|+- False i=8: ' ' == 'g'|+- False i=9: 'g' == 'o'|+- True i=10: 'o' == 'o'|+- False i=11: 'o' == 'd'|+- False i=12: 'd' == 'b'|+- False i=13: 'b' == 'y'|`- False i=14: 'y' == 'e'6Val ["h","e","ll","o"," ","g","oo","d","b","y","e"]@predicate-typed$partition values based on a function=pz @(PartitionBy Ordering (Id ==! 0) Id) [17,3,-12,0,1,0,-3]7Val (fromList [(LT,[-3,-12]),(EQ,[0,0]),(GT,[1,3,17])])Zpz @(PartitionBy Char (Mod Id 16 >> ShowBase 16 >> Head) Id) [-4,-2,5,0,15,12,-1,2,-3,4,0]lVal (fromList [('0',[0,0]),('2',[2]),('4',[4]),('5',[5]),('c',[12,-4]),('d',[-3]),('e',[-2]),('f',[-1,15])])zpl @(PartitionBy Ordering (Case (FailT _ "asdf") '[Id < 2, Id == 2, Id > 2] '[ 'LT, 'EQ, 'GT] Id) Id) [-4,2,5,6,7,1,2,3,4]Present fromList [(LT,[1,-4]),(EQ,[2,2]),(GT,[4,3,7,6,5])] (PartitionBy fromList [(LT,[1,-4]),(EQ,[2,2]),(GT,[4,3,7,6,5])] | s=[-4,2,5,6,7,1,2,3,4])8Val (fromList [(LT,[1,-4]),(EQ,[2,2]),(GT,[4,3,7,6,5])])pl @(PartitionBy Ordering (Case (FailT _ "xyzxyzxyzzyyysyfsyfydf") '[Id < 2, Id == 2, Id > 3] '[ 'LT, 'EQ, 'GT] Id) Id) [-4,2,5,6,7,1,2,3,4]<Error xyzxyzxyzzyyysyfsyfydf (PartitionBy(i=7, a=3) excnt=1)Fail "xyzxyzxyzzyyysyfsyfydf"fpz @(PartitionBy Ordering (Case 'EQ '[Id < 0, Id > 0] '[ 'LT, 'GT] Id) Id) [-4,-2,5,6,7,0,-1,2,-3,4,0]?Val (fromList [(LT,[-3,-1,-2,-4]),(EQ,[0,0]),(GT,[4,2,7,6,5])])Apredicate-typed similar to &[ for non-empty listspz @(All1 Even) [2,4,6]Val True#pz @(All1 Even) [2,3,3,7,2,8,1,5,9] Val Falsepz @(All1 Even) [] Val Falsepz @(All1 Even) [1] Val Falsepz @(All1 Even) [2]Val TrueBpredicate-typed[counts number on matches and non matches: ie All is length snd==0 and Any is length fst > 0$pz @(Quant Even) [2,3,3,7,2,8,1,5,9] Val (3,6)pz @(Quant (Gt 10)) [2,8,1,5,9] Val (0,5)pz @(Quant (Gt 10)) [] Val (0,0)pz @(Quant (Same 4)) [3] Val (0,1)pz @(Quant (Same 4)) [4] Val (1,0)Cpredicate-typed similar to  /,pz @(Partition (Ge 3) Id) [10,4,1,7,3,1,3,5]Val ([10,4,7,3,3,5],[1,1])-pz @(Partition IsPrime Id) [10,4,1,7,3,1,3,5]Val ([7,3,3,5],[10,4,1,1]).pz @(Partition (Ge 300) Id) [10,4,1,7,3,1,3,5]Val ([],[10,4,1,7,3,1,3,5])0pz @(Partition (Id < 300) Id) [10,4,1,7,3,1,3,5]Val ([10,4,1,7,3,1,3,5],[])+pl @(Partition (Lt 2) Id >> Id) [1,2,3,4,5]EPresent ([1],[2,3,4,5]) ((>>) ([1],[2,3,4,5]) | {Id ([1],[2,3,4,5])})Val ([1],[2,3,4,5])!pl @(Partition (Gt 3) Id) [1..10]dPresent ([4,5,6,7,8,9,10],[1,2,3]) (Partition ([4,5,6,7,8,9,10],[1,2,3]) | s=[1,2,3,4,5,6,7,8,9,10])Val ([4,5,6,7,8,9,10],[1,2,3])pl @(Partition Even Id) [1..6]IPresent ([2,4,6],[1,3,5]) (Partition ([2,4,6],[1,3,5]) | s=[1,2,3,4,5,6])Val ([2,4,6],[1,3,5])Bpl @(Partition Even Id >> Null *** (Len > 4) >> Fst == Snd) [1..6]#True ((>>) True | {False == False})Val True@pl @(Partition (ExitWhen "ExitWhen" (Gt 10) >> Gt 2) Id) [1..11].Error ExitWhen (Partition(i=10, a=11) excnt=1)Fail "ExitWhen""pl @(Partition IsPrime Id) [1..15]Present ([2,3,5,7,11,13],[1,4,6,8,9,10,12,14,15]) (Partition ([2,3,5,7,11,13],[1,4,6,8,9,10,12,14,15]) | s=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15])-Val ([2,3,5,7,11,13],[1,4,6,8,9,10,12,14,15])Dpredicate-typedrotate a list p n unitspz @(Rotate 0 Id) [1,2,3,4] Val [1,2,3,4]$pz @(Rotate (Negate 1) Id) [1,2,3,4] Val [4,1,2,3]pz @(Rotate 2 Id) [1,2,3,4] Val [3,4,1,2]$pz @(Map (Rotate Id "abcd")) [-3..7]RVal ["bcda","cdab","dabc","abcd","bcda","cdab","dabc","abcd","bcda","cdab","dabc"]Epredicate-typed similar to  0pz @Unsnoc [1,2,3,4]Val (Just ([1,2,3],4)) pz @Unsnoc [] Val Nothingpz @Unsnoc ("xyz" :: T.Text)Val (Just ("xy",'z'))pl @Unsnoc ("asfd" :: T.Text);Present Just ("asf",'d') (Unsnoc Just ("asf",'d') | "asfd")Val (Just ("asf",'d'))pl @Unsnoc ("" :: T.Text)%Present Nothing (Unsnoc Nothing | "") Val Nothingpl @Unsnoc [1..5]DPresent Just ([1,2,3,4],5) (Unsnoc Just ([1,2,3,4],5) | [1,2,3,4,5])Val (Just ([1,2,3,4],5))Fpredicate-typed similar to  1pz @Uncons [1,2,3,4]Val (Just (1,[2,3,4])) pz @Uncons [] Val Nothingpz @Uncons (Seq.fromList "abc")Val (Just ('a',fromList "bc"))pz @Uncons ("xyz" :: T.Text)Val (Just ('x',"yz"))pl @Uncons ("asfd" :: T.Text);Present Just ('a',"sfd") (Uncons Just ('a',"sfd") | "asfd")Val (Just ('a',"sfd"))pl @Uncons ("" :: T.Text)%Present Nothing (Uncons Nothing | "") Val NothingKpl @Uncons [1..5] -- with Typeable would need to specify the type of [1..5]DPresent Just (1,[2,3,4,5]) (Uncons Just (1,[2,3,4,5]) | [1,2,3,4,5])Val (Just (1,[2,3,4,5]))Gpredicate-typedsimilar to snocpz @(Snd +: Fst) (99,[1,2,3,4])Val [1,2,3,4,99]pz @(Fst +: Snd) ([],5)Val [5]pz @(EmptyT [] +: 5) 5Val [5]pl @('[1,2,3] +: 4) ()4Present [1,2,3,4] ((+:) [1,2,3,4] | p=[1,2,3] | q=4) Val [1,2,3,4]pl @(Snd +: Fst) (4,[1,2,3])4Present [1,2,3,4] ((+:) [1,2,3,4] | p=[1,2,3] | q=4) Val [1,2,3,4]pl @("abc" +: C "x") ().Present "abcx" ((+:) "abcx" | p="abc" | q='x') Val "abcx"&pl @(Fst +: Snd) ("abc" :: T.Text,'x').Present "abcx" ((+:) "abcx" | p="abc" | q='x') Val "abcx"Hpredicate-typedsimilar to conspz @(Fst :+ Snd) (99,[1,2,3,4])Val [99,1,2,3,4]pz @(Snd :+ Fst) ([],5)Val [5]$pz @(123 :+ EmptyList _) "somestuff" Val [123]$pl @(FlipT (:+) Fst Snd) ([1..5],99)CPresent [99,1,2,3,4,5] ((:+) [99,1,2,3,4,5] | p=99 | q=[1,2,3,4,5])Val [99,1,2,3,4,5]pl @(Fst :+ Snd) (99,[1..5])CPresent [99,1,2,3,4,5] ((:+) [99,1,2,3,4,5] | p=99 | q=[1,2,3,4,5])Val [99,1,2,3,4,5]pl @(4 :+ '[1,2,3]) ()4Present [4,1,2,3] ((:+) [4,1,2,3] | p=4 | q=[1,2,3]) Val [4,1,2,3]pl @(Fst :+ Snd) (4,[1,2,3])4Present [4,1,2,3] ((:+) [4,1,2,3] | p=4 | q=[1,2,3]) Val [4,1,2,3]pl @(FlipT (:+) '[1,2,3] 5) ()4Present [5,1,2,3] ((:+) [5,1,2,3] | p=5 | q=[1,2,3]) Val [5,1,2,3]Ipredicate-typedsimilar to (++)&pz @(Fst ++ Snd) ([9,10,11],[1,2,3,4])Val [9,10,11,1,2,3,4]pz @(Snd ++ Fst) ([],[5])Val [5]'pz @(C "xyz" :+ W "ab" ++ W "cdefg") ()Val "xabcdefg"(pz @([1,2,3] ++ EmptyList _) "somestuff" Val [1,2,3]>   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHI>HGIFE)(&'#"! %$ CBA@=?<>;:9876543210-,D/.*+ G5H5I5None&',-.456=>?@AHPSUVXko predicate-typed similar to \]Npz @(BiMap Succ Head) (Left @_ @String 12) -- needs a type signature for Right Val (Left 13)#pz @(BiMap Succ Head) (Right "xyz")Val (Right 'x')Gpz @(FMap (BiMap Succ Head)) [Right "xyz",Left 'a',Right "ab",Left 'x']+Val [Right 'x',Left 'b',Right 'a',Left 'y']Fpz @(FMap (BiMap Succ Pred)) [These 12 'b', This 1, That 'd',That 'e']+Val [These 13 'a',This 2,That 'c',That 'd']#pz @(BiMap Succ Pred) (True,12,'b')Val (True,13,'a')Tpl @(FMap $ BiMap Succ (Not Id)) [This @Int @Bool 1, This 2,That True,These 4 False]Present [This 2,This 3,That False,These 5 True] (FMap BiMap(L) Succ 2 | 1 | BiMap(L) Succ 3 | 2 | BiMap(R) Not (Id True) | BiMap(B) Succ 5 | 4 | Not (Id False))+Val [This 2,This 3,That False,These 5 True]-pl @(BiMap Succ (Not Id)) (This @Int @Bool 1)$Present This 2 (BiMap(L) Succ 2 | 1) Val (This 2)0pl @(BiMap Succ (Not Id)) (That @Int @Bool True)+Present That False (BiMap(R) Not (Id True))Val (That False)3pl @(BiMap Succ (Not Id)) (These @Int @Bool 1 True);Present These 2 False (BiMap(B) Succ 2 | 1 | Not (Id True))Val (These 2 False)Upan @(FMap $ BiMap Succ (Not Id)) [This @Int @Bool 1, This 2,That True,These 4 False]OP FMap BiMap(L) Succ 2 | BiMap(L) Succ 3 | BiMap(R) Not | BiMap(B) Succ 5 | Not|+- P BiMap(L) Succ 2| || `- P Succ 2|+- P BiMap(L) Succ 3| || `- P Succ 3|+- P BiMap(R) Not| || `- False Not| || `- True Id True|`- P BiMap(B) Succ 5 | Not | +- P Succ 5 | `- True Not | `- False Id False+Val [This 2,This 3,That False,These 5 True]+pl @(BiMap Succ Head) (EEmpty @Int @String) Present EEmpty (BiMap <skipped>) Val EEmpty-pl @(BiMap Succ Head) (ELeft @Int @String 10)(Present ELeft 11 (BiMap(L) Succ 11 | 10)Val (ELeft 11)1pl @(BiMap Succ Head) (ERight @Int @String "xyz").Present ERight 'x' (BiMap(R) Head 'x' | "xyz")Val (ERight 'x')3pl @(BiMap Succ Head) (EBoth @Int @String 10 "xyz")?Present EBoth 11 'x' (BiMap(B) Succ 11 | 10 | Head 'x' | "xyz")Val (EBoth 11 'x')Kpan @(FMap $ BiMap Succ Head) [EEmpty,ELeft 10,ERight "abc",EBoth 10 "xyz"][P FMap BiMap <skipped> | BiMap(L) Succ 11 | BiMap(R) Head 'a' | BiMap(B) Succ 11 | Head 'x'|+- P BiMap <skipped>|+- P BiMap(L) Succ 11| || `- P Succ 11|+- P BiMap(R) Head 'a'| || `- P Head 'a'| `- P BiMap(B) Succ 11 | Head 'x' | +- P Succ 11 | `- P Head 'x'-Val [EEmpty,ELeft 11,ERight 'a',EBoth 11 'x']predicate-typed similar to  2.pan @(LiftA2 Id (MkJust 12) (MkJust "abc")) () P LiftA2 Id (12,"abc")|+- P MkJust Just 12| | | `- P '12|+- P MkJust Just "abc"| || `- P '"abc"|`- P Id (12,"abc")Val (Just (12,"abc"))/pan @(LiftA2 Swap (MkJust 12) (MkNothing _)) ()P LiftA2 <skipped>|+- P MkJust Just 12| | | `- P '12|`- P MkNothing Val NothingKpz @(LiftA2 (ShowP Fst <> "---" <> ShowP Snd) Fst Snd) (Just 10, Just True)Val (Just "10---True")3pz @(LiftA2 (Fst + Snd) Fst Snd) (Just 10, Just 13) Val (Just 23)'pz @(LiftA2 Fst '["x","y"] '[1,2,3]) ()Val ["x","x","x","y","y","y"]'pz @(LiftA2 Snd '["x","y"] '[1,2,3]) ()Val [1,2,3,1,2,3]Mpz @(LiftA2 (Pop0 Fst Snd) '[ Proxy Len ] '[ "abc", "def", "aaaaaaaaaaa"]) () Val [3,3,11]bpz @(LiftA2 (Fst * Snd) (FromList (ZipList _) << (10...15)) (FromList (ZipList _) << (1...10))) ()0Val (ZipList {getZipList = [10,22,36,52,70,90]})predicate-typed similar to   :see also fpz @(Flip Map' Id Succ) [1..5]Val [2,3,4,5,6]pz @( Flip '(,) 'True 2) () Val (2,True)pz @( Flip ('(,,) 1) 2 Id) "ab"Val (1,"ab",2)predicate-typedapplicative bind similar to  3v but functions have to be fully saturated: ie Len is ok but not Length can use Proxy to delay evaluation until Pop0(pz @(MkJust '("sdf",Id) <*> MkJust 4) ()Val (Just ("sdf",4))!pz @(MkJust Succ <*> MkJust 4) () Val (Just 5),pz @('[Succ,Id,Pred] <*> "abcdef") undefinedVal "ba`cbadcbedcfedgfe"\pz @(MkJust "abc" <*> MkJust "def") () -- no function to apply so has to choose ie first oneVal (Just "abc")epz @('[1,2] <*> "abcdef") () -- [1,2] <* "abcdef" -- ie skips rhs "abcdef" but still runs the effectsVal [1,2,1,2,1,2,1,2,1,2,1,2]'pz @(MkJust ((*) 3 Id) <*> MkJust 4) () Val (Just 12)?pz @(MkJust ((*) 3 Len) <*> MkJust '["aa","bb","c","d","e"]) () Val (Just 15).pz @(ShowP Id <$> MkJust Succ <*> MkJust 4) ()Val (Just "5") pz @('["x","y"] <*> '[1,2,3]) ()Val ["x","y","x","y","x","y"]predicate-typedsimilar to monad bind operator ^_$pz @(Id >>= HeadMay) (Just "abcdef")Val (Just 'a')*pz @(Uncons >>= (Snd >> HeadMay)) "abcdef"Val (Just 'b')2pz @((1 ... 10) >>= EmptyBool [] Even '[Id,Id]) ()%Val [[2,2],[4,4],[6,6],[8,8],[10,10]]5pz @( (1 ... 10) >>= If Even '[Id,Id] (EmptyT [])) ()Val [2,2,4,4,6,6,8,8,10,10]+pz @(Lookup 0 Id >>= Lookup 1 Id) [[1,2,3]] Val (Just 2)+pz @(Lookup 4 Id >>= Lookup 1 Id) [[1,2,3]] Val Nothing+pz @(Lookup 0 Id >>= Lookup 5 Id) [[1,2,3]] Val NothingOpz @(Lookup 0 Id >>= Lookup 1 Id >>= MaybeBool Even '(Id,"is even!")) [[1,2,3]]Val (Just (2,"is even!"))Opz @(Lookup 0 Id >>= Lookup 1 Id >>= MaybeBool Even '(Id,"is even!")) [[1,5,3]] Val Nothing\pz @((48...55) >>= '[ '[ToEnum Char << Id,ToEnum Char << (Id+3),ToEnum Char << (Id+6)] ]) ()5Val ["036","147","258","369","47:","58;","69<","7:="]Dpz @((48...55) >>= '[ Map (ToEnum Char) << '[ Id, Id+3 ,Id+6 ] ]) ()5Val ["036","147","258","369","47:","58;","69<","7:="]predicate-typedsimilar to monad operator ^`.pz @(FFish Uncons (Snd >> Uncons) "abcdef") ()Val (Just ('b',"cdef")):m + Data.TimeHpz @(FFish (ReadMaybe Day Id >> FMap Fst) (MkJust Succ) "2020-02-02") ()Val (Just 2020-02-03)5pz @(FFish Uncons (Lookup Fst "abcdef") [3,14,12]) ()Val (Just 'd')predicate-typedsee &pz @(Fst <:> Snd) (Just 10, Just True)Val (Just (10,True))$pz @(Fst <:> Snd) ("abc",[10,12,14])VVal [('a',10),('a',12),('a',14),('b',10),('b',12),('b',14),('c',10),('c',12),('c',14)]pz @('[1,2] <:> "abcdef") ()eVal [(1,'a'),(1,'b'),(1,'c'),(1,'d'),(1,'e'),(1,'f'),(2,'a'),(2,'b'),(2,'c'),(2,'d'),(2,'e'),(2,'f')]2pz @(EnumFromTo Fst Snd <:> ('LT ... 'GT)) (10,11)5Val [(10,LT),(10,EQ),(10,GT),(11,LT),(11,EQ),(11,GT)]opz @(MkJust Succ <:> MkJust 4) () -- uses Succ on (): instead use LiftA2 with Pop0 or <*> (see next 2 tests)3Fail "Succ IO e=Prelude.Enum.().succ: bad argument"?pz @(LiftA2 (Pop0 Fst Snd) (MkJust (Proxy Succ)) (MkJust 4)) () Val (Just 5)!pz @(MkJust Succ <*> MkJust 4) () Val (Just 5)predicate-typedruns  2L (,) against two values: LiftA2 is traversable and provides better debugging(pz @(FPair Fst Snd) (Just 10, Just True)Val (Just (10,True))Rpz @(FPair Fst Snd >> FMap (ShowP Fst <> "---" <> ShowP Snd)) (Just 10, Just True)Val (Just "10---True"):pz @(FPair Fst Snd >> FMap (Fst + Snd)) (Just 10, Just 13) Val (Just 23)7pz @(FPair (EnumFromTo Fst Snd) ('LT ... 'GT) ) (10,11)5Val [(10,LT),(10,EQ),(10,GT),(11,LT),(11,EQ),(11,GT)]predicate-typed similar to abpz @('[1,2,3] <&> Succ) () Val [2,3,4]predicate-typed similar to ac#pz @(Len <$> Snd) (1,Just "abcdef") Val (Just 6)=pz @(Len <$> (Id <> Id <> "extra" <$> Snd)) (1,Just "abcdef") Val (Just 17)>pz @(Len <$> (Id <> Id <> "extra" <$> Snd)) (1,Right "abcdef")Val (Right 17):pz @(FMap $ FMap (Succ <$> Id)) (True,Just (These 12 'c'))Val (True,Just (These 12 'd')):pz @(FMap (Second (Succ <$> Id))) [(True, (These 12 'c'))]Val [(True,These 12 'd')]predicate-typed similar to acpl @(FMap Succ) (Right 'a')'Present Right 'b' (FMap Succ 'b' | 'a')Val (Right 'b')pl @(FMap Succ) (Left "Sf")"Present Left "Sf" (FMap <skipped>)Val (Left "Sf")1pz @(FMap (MkDay Id) >> Join) (Just (2020,01,01))Val (Just 2020-01-01)1pz @(FMap (MkDay Id) >> Join) (Just (2020,01,32)) Val Nothingpz @(FMap Succ) (Just LT) Val (Just EQ)pz @(FMap Pred) (Just LT)9Fail "Pred IO e=Prelude.Enum.Ordering.pred: bad argument"pz @(FMap (ShowP Id)) (Just 10)Val (Just "10")@pan @(FMap $ FMap $ FMap Succ) [Just "abcdefG",Nothing,Just "X"]P FMap FMap FMap Succ 'b' | Succ 'c' | Succ 'd' | Succ 'e' | Succ 'f' | Succ 'g' | Succ 'H' | FMap <skipped> | FMap FMap Succ 'Y'|Y+- P FMap FMap Succ 'b' | Succ 'c' | Succ 'd' | Succ 'e' | Succ 'f' | Succ 'g' | Succ 'H'| |W| `- P FMap Succ 'b' | Succ 'c' | Succ 'd' | Succ 'e' | Succ 'f' | Succ 'g' | Succ 'H'| || +- P Succ 'b'| || +- P Succ 'c'| || +- P Succ 'd'| || +- P Succ 'e'| || +- P Succ 'f'| || +- P Succ 'g'| || `- P Succ 'H'|+- P FMap <skipped>|`- P FMap FMap Succ 'Y' | `- P FMap Succ 'Y' | `- P Succ 'Y'%Val [Just "bcdefgH",Nothing,Just "Y"]!pan @(FMap (FromEnum > 97)) "abc""P FMap 97 > 97 | 98 > 97 | 99 > 97|+- False 97 > 97| || +- P FromEnum 97| | | `- P '97|+- True 98 > 97| || +- P FromEnum 98| | | `- P '97|`- True 99 > 97 | +- P FromEnum 99 | `- P '97Val [False,True,True]'pan @(FMap (FromEnum > 97 >> Id)) "abc" )P FMap (>>) False | (>>) True | (>>) True|+- P (>>) False| || +- False 97 > 97| | || | +- P FromEnum 97| | || | `- P '97| || `- P Id False|+- P (>>) True| || +- True 98 > 97| | || | +- P FromEnum 98| | || | `- P '97| || `- P Id True|`- P (>>) True | +- True 99 > 97 | | | +- P FromEnum 99 | | | `- P '97 | `- P Id TrueVal [False,True,True]pan @(FMap IdBool) (Just True) P FMap IdBool|`- True IdBoolVal (Just True),pz @(FMap (Pure (Either String) Id)) [1,2,4]Val [Right 1,Right 2,Right 4]!pl @(FMap (Pure [] Id)) (Just 10)'Present Just [10] (FMap Pure [10] | 10)Val (Just [10])%pl @(FMap (Pure SG.Sum Id)) (Just 20)CPresent Just (Sum {getSum = 20}) (FMap Pure Sum {getSum = 20} | 20)Val (Just (Sum {getSum = 20}))Npz @(FMap (Coerce (SG.Sum Integer))) [Identity (-13), Identity 4, Identity 99];Val [Sum {getSum = -13},Sum {getSum = 4},Sum {getSum = 99}]<pz @(FMap (Coerce (SG.Sum Integer))) (Just (Identity (-13)))Val (Just (Sum {getSum = -13})):pz @(FMap (Coerce (SG.Sum Int))) (Nothing @(Identity Int)) Val Nothing3pl @(FMap (Coerce (SG.Sum Int))) (Just (10 :: Int))EPresent Just (Sum {getSum = 10}) (FMap Coerce Sum {getSum = 10} | 10)Val (Just (Sum {getSum = 10}))=pz @(Proxy Char >> FMap Succ) () ^!? acts . _Val . to typeRep Just Charpredicate-typed>Lift a no arg Adt to a function of one argument (for use with  and )"pl @(Lift Len Snd) (True,"abcdef")'Present 6 ((>>) 6 | {Len 6 | "abcdef"})Val 6predicate-typed similar to  !:types dont need to match on rhs!'pl @(RDot '[L1,L2,L3,K "xxx"] Id) 12345Present "xxx" (K '"xxx") Val "xxx"*pl @(RDot '[L1,L2,L3,K '("abc",Id)] Id) ()"Present ("abc",()) (K '("abc",()))Val ("abc",())1pl @(Dot '[K "skip",L6,Lift Dup,Lift Succ] Id) ()Present "skip" (K '"skip") Val "skip"7pl @(L3 $ L2 $ L1 $ K Id "dud") ((1,("X",9,'a')),(3,4))#Present 'a' (Thd 'a' | ("X",9,'a'))Val 'a'Apl @((L3 $ L2 $ L1 $ K Id "dud") >> Pred) ((1,("X",9,'a')),(3,4)))Present '`' ((>>) '`' | {Pred '`' | 'a'})Val '`'pl @(K "ss" $ L3 $ L3 $ Fst) ()Present "ss" (K '"ss")Val "ss"predicate-typedreversed version of .pl @(RDot '[L1,L2,L3] Id) ((1,(2,9,10)),(3,4))Present 10 (Thd 10 | (2,9,10))Val 10,pl @(RDot '[L1,L2] Id) (('a',2),(True,"zy"))Present 2 (Snd 2 | ('a',2))Val 2predicate-typedcompose simple functions-pl @(Dot '[L3,L2,L1] Id) ((1,(2,9,10)),(3,4))Present 10 (Thd 10 | (2,9,10))Val 10predicate-typedrun an expression p% and on failure print a custom error s+ using the error string and the input value=pz @(Catch' Succ (Second (ShowP Id) >> PrintT "%s %s" Id)) GT<Fail "Succ IO e=Prelude.Enum.Ordering.succ: bad argument GT"=pz @(Catch' Succ (Second (ShowP Id) >> PrintT "%s %s" Id)) LTVal EQGpl @(Catch' (FailT Int "someval") (PrintT "msg=%s caught(%03d)" Id)) 44>Error msg=someval caught(044) (Catch default condition failed)Fail "msg=someval caught(044)"Qpl @(Catch' OneP (Second (ShowP Id) >> PrintT "msg=%s caught(%s)" Id)) [10,12,13]ZError msg=OneP:expected one element(3) caught([10,12,13]) (Catch default condition failed):Fail "msg=OneP:expected one element(3) caught([10,12,13])"Gpl @(Catch' OneP (PrintT "msg=%s caught(%s)" (Second (ShowP Id)))) [10]Present 10 (Catch did not fire)Val 10Hpl @(Catch' OneP (PrintT "msg=%s err s=%s" (Second (ShowP Id)))) [10,11]UError msg=OneP:expected one element(2) err s=[10,11] (Catch default condition failed)5Fail "msg=OneP:expected one element(2) err s=[10,11]"predicate-typedrun an expression p and on failure run qJpz @(Catch Succ (Fst >> Second (ShowP Id) >> PrintT "%s %s" Id >> 'LT)) GTVal LT3pz @(Len > 1 && Catch (Id !! 3 == 66) 'False) [1,2] Val False4pl @(Catch (Resplit "\\d+(") (Snd >> MEmptyP)) "123"<Present [] (Catch caught exception[Regex failed to compile])Val []pl @(Catch OneP 99) [10,11]APresent 99 (Catch caught exception[OneP:expected one element(2)])Val 99pl @(Catch OneP 99) [10]Present 10 (Catch did not fire)Val 10pl @(Catch OneP 'True) [False]"Present False (Catch did not fire) Val False)pl @(Catch OneP 'False) [True,True,False]<False (Catch caught exception[OneP:expected one element(3)]) Val Falsepl @(Catch OneP 'True) []?True (Catch caught exception[OneP:expected one element(empty)])Val Truepredicate-typed run both p and q+ for their effects but ignoring the resultspredicate-typedrun run p and then q* for the effect but using the result from ppredicate-typedrun p for the effect and then run q using that original valuepredicate-typedJjust run the effect ignoring the result passing the original value through@for example for use with Stdout so it doesnt interfere with the a on the rhs unless it failspredicate-typedlike  4@pl @(Traverse (If (Gt 3) (Pure Maybe Id) (EmptyT Maybe))) [1..5]]Present Nothing ((>>) Nothing | {Sequence Nothing | [Nothing,Nothing,Nothing,Just 4,Just 5]}) Val Nothing+pl @(Traverse (MaybeBool (Le 3) Id)) [1..5]\Present Nothing ((>>) Nothing | {Sequence Nothing | [Just 1,Just 2,Just 3,Nothing,Nothing]}) Val Nothing@pl @(Traverse (If (Gt 0) (Pure Maybe Id) (EmptyT Maybe))) [1..5]uPresent Just [1,2,3,4,5] ((>>) Just [1,2,3,4,5] | {Sequence Just [1,2,3,4,5] | [Just 1,Just 2,Just 3,Just 4,Just 5]})Val (Just [1,2,3,4,5])?pl @(Traverse (If (Gt 0) (Pure Maybe Id) (MkNothing _))) [1..5]uPresent Just [1,2,3,4,5] ((>>) Just [1,2,3,4,5] | {Sequence Just [1,2,3,4,5] | [Just 1,Just 2,Just 3,Just 4,Just 5]})Val (Just [1,2,3,4,5]).pl @(Traverse (MaybeBool (Id >= 0) Id)) [1..5]uPresent Just [1,2,3,4,5] ((>>) Just [1,2,3,4,5] | {Sequence Just [1,2,3,4,5] | [Just 1,Just 2,Just 3,Just 4,Just 5]})Val (Just [1,2,3,4,5]).pl @(Traverse (MaybeBool (Id <= 3) Id)) [1..5]\Present Nothing ((>>) Nothing | {Sequence Nothing | [Just 1,Just 2,Just 3,Nothing,Nothing]}) Val Nothingpredicate-typed similar to  5(pz @Sequence [Just 10, Just 20, Just 30]Val (Just [10,20,30]):pz @Sequence [Just 10, Just 20, Just 30, Nothing, Just 40] Val Nothingpredicate-typed9flipped function application for expressions: similar to  :m + Text.Show.Functionspz @(Snd $& Fst) ((*16),4)Val 64pz @("def" $& Id) ("abc"<>) Val "abcdef"pz @('True $& 4 $& Id) (,) Val (4,True)predicate-typedIfunction application for pure functions appearing on the rhs: similar to ./:m + Text.Show.Functionspz @(Fst $$ Snd) ((*16),4)Val 64pz @(Id $$ "def") ("abc"<>) Val "abcdef"pz @(Id $$ 12) (*13)Val 156pz @(Id $$ 7 $$ 3) (*)Val 21pz @(Id $$ 7 $$ 3) (,) Val (7,3)pz @(Id $$ "abc" $$ 'True) (,)Val ("abc",True)&pz @(Id $$ "asdf" $$ 99 $$ C "A") (,,)Val ("asdf",99,'A')#(fmap.fmap) ($ 9999) $ pz @Id (*33) Val 3299672(fmap.fmap) ($ 9999) $ pz @(Id $$ 1 $$ 'True) (,,)Val (1,True,9999).(fmap.fmap.fmap) ($ 8) $ pz @'("xxx",Id) (*33)Val ("xxx",264)#pz @('True $& 4 $& Id $$ "aa") (,,)Val (4,True,"aa")2pz @(Id $$ '(100,120)) (flip randomR (mkStdGen 7))Val (114,320112 40692)*pz @(Id $$ GenPure 12) (randomR ('a','f'))Val ('f',520182 40692)[pz @(Id $$ GenIO) (randomR ('a','f')) ^!? acts . _Val . _1 . nearly 'a' (`elem` ['a'..'f'])Just ();pz @((Id $$ "abc" $$ Wrap (SG.Sum _) 14) >> Id <> Id) These(Val (These "abcabc" (Sum {getSum = 28}))predicate-typed similar to  6pz @Join (Just (Just 20)) Val (Just 20)pz @Join ["ab","cd","","ef"] Val "abcdef"predicate-typed similar to  7pz @Duplicate (20,"abc")Val (20,(20,"abc"))predicate-typed similar to  8pz @Extract (Nothing,Just 20) Val (Just 20)pz @Extract (Identity 20)Val 20pl @Extract (10,"hello")0Present "hello" (Extract "hello" | (10,"hello")) Val "hello"predicate-typed similar to  9#pz @(Fst <|> Snd) (Nothing,Just 20) Val (Just 20)#pz @(Fst <|> Snd) (Just 10,Just 20) Val (Just 10)#pz @(Fst <|> Snd) (Nothing,Nothing) Val Nothing)pl @(Fst <|> Snd) (Just "cdef",Just "ab")EPresent Just "cdef" ((<|>) Just "cdef" | p=Just "cdef" | q=Just "ab")Val (Just "cdef")'pl @(Fst <|> Snd) ("cdef","ab"::String)5Present "cdefab" ((<|>) "cdefab" | p="cdef" | q="ab") Val "cdefab"predicate-typedsimilar to Applicative  :"pl @(Fst *> Snd) (Just 4,Just 'a')6Present Just 'a' ((*>) Just 4 | p=Just 4 | q=Just 'a')Val (Just 'a')pz @('["x","y"] *> '[1,2,3]) ()Val [1,2,3,1,2,3]predicate-typedsimilar to Applicative  ;"pl @(Fst <* Snd) (Just 4,Just 'a')4Present Just 4 ((<*) Just 4 | p=Just 4 | q=Just 'a') Val (Just 4)%pz @(Fst <* Snd) (Just "abc",Just 20)Val (Just "abc")pz @('["x","y"] <* '[1,2,3]) ()Val ["x","x","x","y","y","y"]predicate-typed similar to  < pz @(Fst <$ Snd) ("abc",Just 20)Val (Just "abc")$pl @(Fst <$ Snd) (4,These "xxx" 'a')Present These "xxx" 4 ((<$) 4)Val (These "xxx" 4)pl @(Fst <$ Snd) (4,This 'a')Present This 'a' ((<$) 4)Val (This 'a')pl @(Fst <$ Snd) (4,Just 'a')Present Just 4 ((<$) 4) Val (Just 4)!pl @(Fst <$ Snd) (4,Nothing @Int)Present Nothing ((<$) 4) Val Nothingpl @('True <$ Id) [1..4])Present [True,True,True,True] ((<$) True)Val [True,True,True,True]import Data.Functor.Compose*pl @(C "ab" <$ Id) (Compose $ Just [1..4])(Present Compose (Just "aaaa") ((<$) 'a')Val (Compose (Just "aaaa"))pl @(Snd <$ Fst) (Just 10,'x')Present Just 'x' ((<$) 'x')Val (Just 'x')%%11614111103444None&',-.=>?@AHSUVXko n:predicate-typed%encode a json file with pretty option;predicate-typedencode json with pretty option%pl @(EncodeJson 'False Id) (10,"def").Present "[10,\"def\"]" (EncodeJson [10,"def"])Val "[10,\"def\"]">pl @(EncodeJson 'False Id >> ParseJson (Int,Bool) Id) (1,True)BPresent (1,True) ((>>) (1,True) | {ParseJson (Int,Bool) (1,True)}) Val (1,True)<predicate-typedparse a json file p using the type t8pz @(ParseJsonFile [A.Value] "test1.json" >> Id !! 2) ()}Val (Object (fromList [("lastName",String "Doe"),("age",Number 45.0),("firstName",String "John"),("likesPizza",Bool False)]))=predicate-typedparse json file p using the type t>predicate-typedparse json data using the type t.pl @(ParseJson (Int,String) Id) "[10,\"abc\"]"6Present (10,"abc") (ParseJson (Int,[Char]) (10,"abc"))Val (10,"abc")1pl @(ParseJson (Int,String) Id) "[10,\"abc\",99]"Error ParseJson (Int,[Char])([10,"abc",99]) Error in $: cannot unpack array of length 3 into a tuple of length 2 ([10,"abc",99])sFail "ParseJson (Int,[Char])([10,\"abc\",99]) Error in $: cannot unpack array of length 3 into a tuple of length 2"7pl @(ParseJson (Int,Bool) (FromString _ Id)) "[1,true]"0Present (1,True) (ParseJson (Int,Bool) (1,True)) Val (1,True)1pl @(ParseJson (Int,Bool) Id) (A.encode (1,True))0Present (1,True) (ParseJson (Int,Bool) (1,True)) Val (1,True) pl @(ParseJson () Id) "[1,true]"^Error ParseJson ()([1,true]) Error in $: parsing () failed, expected an empty array ([1,true])TFail "ParseJson ()([1,true]) Error in $: parsing () failed, expected an empty array"?predicate-typedparse json data using the type t:;<=>??>;:=<None%&',-.=>?@AHSUVXko gLpredicate-typed similar to depz @Ors [False,False,False] Val Falsepl @Ors [True,True,True,False]*True (Ors(4) i=0 | [True,True,True,False])Val True pl @Ors []False (Ors(0) | []) Val FalseMpredicate-typed similar to dfpz @Ands [True,True,True]Val Truepl @Ands [True,True,True,False],False (Ands(4) i=3 | [True,True,True,False]) Val False pz @Ands []Val TrueNpredicate-typedZwraps each item in the foldable container and then unwraps the mconcatenated result: uses gh'pz @(FoldMap (SG.Sum _) Id) [44, 12, 3]Val 59+pz @(FoldMap (SG.Product _) Id) [44, 12, 3]Val 1584type Ands' p = FoldMap SG.All p%pz @(Ands' Id) [True,False,True,True] Val Falsepz @(Ands' Id) [True,True,True]Val Truepz @(Ands' Id) []Val Truetype Ors' p = FoldMap SG.Any p!pz @(Ors' Id) [False,False,False] Val Falsepz @(Ors' Id) [] Val False&pz @(Ors' Id) [False,False,False,True]Val True1type AllPositive' = FoldMap SG.All (Map Positive) pz @AllPositive' [3,1,-5,10,2,3] Val False1type AllNegative' = FoldMap SG.All (Map Negative)"pz @AllNegative' [-1,-5,-10,-2,-3]Val True:set -XKindSignaturesZtype Max' (t :: Type) = FoldMap (SG.Max t) Id -- requires t be Bounded for monoid instancepz @(Max' Int) [10,4,5,12,3,4]Val 12(pl @(FoldMap (SG.Sum _) Id) [14,8,17,13]$Present 52 ((>>) 52 | {getSum = 52})Val 52?pl @(FoldMap (SG.Max _) Id) [14 :: Int,8,17,13] -- cos Bounded!$Present 17 ((>>) 17 | {getMax = 17})Val 17fpl @((Len >> (Elem Id '[4,7,1] || (Mod Id 3 >> Same 0))) || (FoldMap (SG.Sum _) Id >> Gt 200)) [1..20]True (False || True)Val Truefpl @((Len >> (Elem Id '[4,7,1] || (Mod Id 3 >> Same 0))) || (FoldMap (SG.Sum _) Id >> Gt 200)) [1..19]PFalse (False || False | ((>>) False | {1 == 0})}) || ((>>) False | {190 > 200})) Val Falseapl @((Len >> (Elem Id '[4,7,1] || (Mod Id 3 >> Same 0))) || (FoldMap (SG.Sum _) Id >> Gt 200)) []True (True || False)Val True[pl @((Len >> (Elem Id '[4,7,1] || (Mod Id 3 >> Same 0))) &&& FoldMap (SG.Sum _) Id) [1..20]"Present (False,210) ('(False,210))Val (False,210)0pl @(FoldMap SG.Any Id) [False,False,True,False]*Present True ((>>) True | {getAny = True})Val True0pl @(FoldMap SG.All Id) [False,False,True,False]-Present False ((>>) False | {getAll = False}) Val False%pl @(FoldMap (SG.Sum _) Id) (Just 13)$Present 13 ((>>) 13 | {getSum = 13})Val 13#pl @(FoldMap (SG.Sum _) Id) [1..10]$Present 55 ((>>) 55 | {getSum = 55})Val 55Opredicate-typed similar to  = using  pz @Null [1,2,3,4] Val False pz @Null []Val Truepz @Null NothingVal TrueQpredicate-typed similar to  >pz @ToList "aBc" Val "aBc"pz @ToList (Just 14)Val [14]pz @ToList NothingVal []pz @ToList (Left "xx")Val []pz @ToList (These 12 "xx") Val ["xx"]*pl @ToList (M.fromList $ zip [0..] "abcd")BPresent "abcd" (ToList fromList [(0,'a'),(1,'b'),(2,'c'),(3,'d')]) Val "abcd"pl @ToList (Just 123)Present [123] (ToList Just 123) Val [123]/pl @ToList (M.fromList (zip ['a'..] [9,2,7,4]))EPresent [9,2,7,4] (ToList fromList [('a',9),('b',2),('c',7),('d',4)]) Val [9,2,7,4]Rpredicate-typed similar to  ? but for a fixed number npz @(Cycle 5 Id) [1,2]Val [1,2,1,2,1]Spredicate-typed similar to  @Tpredicate-typed similar to  A"pz @Concat ["abc","D","eF","","G"] Val "abcDeFG"3pz @(Lift Concat Snd) ('x',["abc","D","eF","","G"]) Val "abcDeFG"Upredicate-typedinvokes  B&requires the OverloadedLists extension:set -XOverloadedLists0pz @(FromListExt (M.Map _ _)) [(4,"x"),(5,"dd")]!Val (fromList [(4,"x"),(5,"dd")])Vpredicate-typedinvokes  B^run @('OMsg "Fred" ':# 'OLite ':# 'OColorOff) @(FromList (Set.Set Int) << '[2,1,5,5,2,5,2]) ()WFred >>> Present fromList [1,2,5] ((>>) fromList [1,2,5] | {FromList fromList [1,2,5]})Val (fromList [1,2,5])Bpl @(FromList (M.Map _ _) >> Id !! C "y") [('x',True),('y',False)][Present False ((>>) False | {IxL('y') False | p=fromList [('x',True),('y',False)] | q='y'}) Val FalseBpl @(FromList (M.Map _ _) >> Id !! C "z") [('x',True),('y',False)]IError (!!) index not found (IxL('z') | fromList [('x',True),('y',False)])Fail "(!!) index not found"-pl @(FromList (M.Map _ _)) [(4,"x"),(5,"dd")]JPresent fromList [(4,"x"),(5,"dd")] (FromList fromList [(4,"x"),(5,"dd")])!Val (fromList [(4,"x"),(5,"dd")])Wpredicate-typedinvokes  C,pz @ToListExt (M.fromList [(1,'x'),(4,'y')])Val [(1,'x'),(4,'y')]pz @ToListExt (T.pack "abc") Val "abc"Xpredicate-typed similar to  D!pz @(IToList _) ("aBc" :: String)Val [(0,'a'),(1,'B'),(2,'c')]"pl @(IToList _) ("abcd" :: String)cPresent [(0,'a'),(1,'b'),(2,'c'),(3,'d')] (IToList(Int) [(0,'a'),(1,'b'),(2,'c'),(3,'d')] | "abcd")%Val [(0,'a'),(1,'b'),(2,'c'),(3,'d')]9pl @(IToList _) (M.fromList $ itoList ("abcd" :: String))Present [(0,'a'),(1,'b'),(2,'c'),(3,'d')] (IToList(Int) [(0,'a'),(1,'b'),(2,'c'),(3,'d')] | fromList [(0,'a'),(1,'b'),(2,'c'),(3,'d')])%Val [(0,'a'),(1,'b'),(2,'c'),(3,'d')]pl @(IToList _) [9,2,7,4]VPresent [(0,9),(1,2),(2,7),(3,4)] (IToList(Int) [(0,9),(1,2),(2,7),(3,4)] | [9,2,7,4])Val [(0,9),(1,2),(2,7),(3,4)]4pl @(IToList _) (M.fromList (zip ['a'..] [9,2,7,4]))Present [('a',9),('b',2),('c',7),('d',4)] (IToList(Char) [('a',9),('b',2),('c',7),('d',4)] | fromList [('a',9),('b',2),('c',7),('d',4)])%Val [('a',9),('b',2),('c',7),('d',4)]pl @(IToList _) (Just 234)6Present [((),234)] (IToList(()) [((),234)] | Just 234)Val [((),234)]!pl @(IToList _) (Nothing @Double)%Present [] (IToList(()) [] | Nothing)Val []pl @(IToList _) [1..5]dPresent [(0,1),(1,2),(2,3),(3,4),(4,5)] (IToList(Int) [(0,1),(1,2),(2,3),(3,4),(4,5)] | [1,2,3,4,5])#Val [(0,1),(1,2),(2,3),(3,4),(4,5)]pl @(IToList _) ['a','b','c']RPresent [(0,'a'),(1,'b'),(2,'c')] (IToList(Int) [(0,'a'),(1,'b'),(2,'c')] | "abc")Val [(0,'a'),(1,'b'),(2,'c')]Zpredicate-typed similar to  = using  Epz @IsEmpty [1,2,3,4] Val Falsepz @IsEmpty []Val Truepz @IsEmpty LT Val Falsepz @IsEmpty EQVal True"pl @IsEmpty ("failed11" :: T.Text)False (IsEmpty | "failed11") Val Falsepl @IsEmpty ("" :: T.Text)True (IsEmpty | "")Val True[predicate-typed create a  F list from a  pz @ToNEList []Fail "empty list"pz @ToNEList [1,2,3,4,5]Val (1 :| [2,3,4,5])LMNOPQRSTUVWXYZ[TSRNWVUQXY[OPZMLNone&',-.=>?@AHSUVXko ƅ |predicate-typedextract the value from a  G or fail with the given message"pz @(JustFail "nope" Id) (Just 99)Val 99 pz @(JustFail "nope" Id) Nothing Fail "nope"8pz @(JustFail (PrintF "oops=%d" Snd) Fst) (Nothing, 123)Fail "oops=123"9pz @(JustFail (PrintF "oops=%d" Snd) Fst) (Just 'x', 123)Val 'x'}predicate-typedextract the value from a  G- otherwise use the default value: similar to 1i$pz @(JustDef (1 % 4) Id) (Just 20.4) Val (102 % 5) pz @(JustDef (1 % 4) Id) Nothing Val (1 % 4)(pz @(JustDef (MEmptyT _) Id) (Just "xy")Val "xy"$pz @(JustDef (MEmptyT _) Id) NothingVal ()-pz @(JustDef (MEmptyT (SG.Sum _)) Id) NothingVal (Sum {getSum = 0})pl @(JustDef 0 Id) (Just 123)Present 123 (JustDef Just)Val 123pl @(JustDef 0 Id) NothingPresent 0 (JustDef Nothing)Val 0pl @(JustDef 99 Id) (Just 12)Present 12 (JustDef Just)Val 12pl @(JustDef 99 Id) NothingPresent 99 (JustDef Nothing)Val 99"pl @(JustDef (99 -% 1) Id) Nothing#Present (-99) % 1 (JustDef Nothing)Val ((-99) % 1)0pl @(JustDef (MEmptyT _) Id) (Just (SG.Sum 123)))Present Sum {getSum = 123} (JustDef Just)Val (Sum {getSum = 123})2pl @(JustDef (MEmptyT _) Id) (Nothing @(SG.Sum _))*Present Sum {getSum = 0} (JustDef Nothing)Val (Sum {getSum = 0})~predicate-typed%Convenient method to convert a value p( to an Alternative based on a predicate bif b is True then pure p else empty$pz @(EmptyBool [] (Id > 4) 'True) 24 Val [True]#pz @(EmptyBool [] (Id > 4) 'True) 1Val []predicate-typed%Convenient method to convert a value p to a  G based on a predicate b if b then Just p else Nothingpz @(MaybeBool (Id > 4) Id) 24 Val (Just 24) pz @(MaybeBool (Id > 4) Id) (-5) Val Nothingpz @(MaybeBool 'True 10) () Val (Just 10)predicate-typed similar to 1j:pl @CatMaybes [Just 'a',Nothing,Just 'c',Just 'd',Nothing]APresent "acd" ((>>) "acd" | {Concat "acd" | ["a","","c","d",""]}) Val "acd"predicate-typedlike 1k.pl @(MapMaybe (MaybeBool (Le 3) Id) Id) [1..5]GPresent [1,2,3] ((>>) [1,2,3] | {Concat [1,2,3] | [[1],[2],[3],[],[]]}) Val [1,2,3].pl @(MapMaybe (MaybeBool (Gt 3) Id) Id) [1..5]@Present [4,5] ((>>) [4,5] | {Concat [4,5] | [[],[],[],[4],[5]]}) Val [4,5]predicate-typed similar to  Hpz @IsNothing (Just 123) Val Falsepz @IsNothing NothingVal True6pl @(Not IsNothing &&& ('Just Id >> Id + 12)) (Just 1)Present (True,13) ('(True,13)) Val (True,13)5pl @(Not IsNothing &&& ('Just Id >> Id + 12)) NothingError 'Just(empty) ('(,))Fail "'Just(empty)"predicate-typed similar to  Ipz @IsJust Nothing Val Falsepz @IsJust (Just 'a')Val Truepredicate-typed similar to 1l"provides a Proxy to the result of q- but does not provide the surrounding context3pz @(MaybeIn "foundnothing" (ShowP Pred)) (Just 20)Val "19"2pz @(MaybeIn "found nothing" (ShowP Pred)) NothingVal "found nothing">pl @(MaybeIn 'True Id) (Nothing @Bool) -- need @() else breaks$True (MaybeIn(Nothing) True | Proxy)Val True.pl @(MaybeIn (FailT _ "failed4") Id) (Just 10)"Present 10 (MaybeIn(Just) 10 | 10)Val 10;pl @(MaybeIn 'False Id) (Nothing @Bool) -- breaks otherwise&False (MaybeIn(Nothing) False | Proxy) Val False'pl @(MaybeIn MEmptyP Id) (Just [1,2,3])1Present [1,2,3] (MaybeIn(Just) [1,2,3] | [1,2,3]) Val [1,2,3])pl @(MaybeIn MEmptyP Id) (Nothing @[Int])(Present [] (MaybeIn(Nothing) [] | Proxy)Val []+pl @(MaybeIn (FailP "err") Succ) (Just 116)%Present 117 (MaybeIn(Just) 117 | 116)Val 117$pl @(MaybeIn 99 Succ) (Nothing @Int)(Present 99 (MaybeIn(Nothing) 99 | Proxy)Val 992pl @(MaybeIn (FailP "someval") Succ) (Nothing @()) Error someval (MaybeIn(Nothing))Fail "someval"(pl @(MaybeIn 'True 'False) (Nothing @())$True (MaybeIn(Nothing) True | Proxy)Val True&pl @(MaybeIn 'True 'False) (Just "aa")"False (MaybeIn(Just) False | "aa") Val False4pl @(MaybeIn MEmptyP (Fst ==! Snd)) (Just ('x','z')))Present LT (MaybeIn(Just) LT | ('x','z'))Val LT:pl @(MaybeIn MEmptyP (Fst ==! Snd)) (Nothing @(Char,Char))(Present EQ (MaybeIn(Nothing) EQ | Proxy)Val EQ6pl @(MaybeIn (FailP "failed20") 'False) (Nothing @Int)!Error failed20 (MaybeIn(Nothing))Fail "failed20"Cpl @(MaybeIn ('False >> FailS "failed21") 'False) (Nothing @Double))Error failed21 (False | MaybeIn(Nothing))Fail "failed21"-pl @(MaybeIn (FailP "err") Id) (Nothing @Int)Error err (MaybeIn(Nothing)) Fail "err",pl @(MaybeIn (FailP "err") Id) (Nothing @())Error err (MaybeIn(Nothing)) Fail "err"6pl @(MaybeIn MEmptyP Id) (Just (M.fromList [(1,'a')]))RPresent fromList [(1,'a')] (MaybeIn(Just) fromList [(1,'a')] | fromList [(1,'a')])Val (fromList [(1,'a')])1pl @(MaybeIn MEmptyP Id) (Nothing @(M.Map () ())):Present fromList [] (MaybeIn(Nothing) fromList [] | Proxy)Val (fromList [])/pl @(MaybeIn MEmptyP Ones) (Just @String "abc");Present ["a","b","c"] (MaybeIn(Just) ["a","b","c"] | "abc")Val ["a","b","c"]pl @(MaybeIn 99 Id) (Just 12)"Present 12 (MaybeIn(Just) 12 | 12)Val 12pl @(MaybeIn 99 Id) Nothing(Present 99 (MaybeIn(Nothing) 99 | Proxy)Val 99"pl @(MaybeIn (99 -% 1) Id) Nothing6Present (-99) % 1 (MaybeIn(Nothing) (-99) % 1 | Proxy)Val ((-99) % 1)#pl @(MaybeIn 123 Id) (Nothing @Int)*Present 123 (MaybeIn(Nothing) 123 | Proxy)Val 123pl @(MaybeIn 123 Id) (Just 9)Present 9 (MaybeIn(Just) 9 | 9)Val 9,pl @(Uncons >> MaybeIn '(1,MEmptyT _) Id) []@Present (1,[]) ((>>) (1,[]) | {MaybeIn(Nothing) (1,[]) | Proxy}) Val (1,[])3pl @(MaybeIn MEmptyP (ShowP Id >> Ones)) (Just 123)9Present ["1","2","3"] (MaybeIn(Just) ["1","2","3"] | 123)Val ["1","2","3"]:pl @(MaybeIn MEmptyP (ShowP Id >> Ones)) (Nothing @String)(Present [] (MaybeIn(Nothing) [] | Proxy)Val [].pl @(MaybeIn MEmptyP Ones) (Just @String "ab")2Present ["a","b"] (MaybeIn(Just) ["a","b"] | "ab") Val ["a","b"],pl @(MaybeIn MEmptyP Ones) (Nothing @String)(Present [] (MaybeIn(Nothing) [] | Proxy)Val []predicate-typedmn constructorpz @(MkJust Id) 44 Val (Just 44)predicate-typed%constructs a Nothing for a given typepredicate-typed%constructs a Nothing for a given typepredicate-typed similar to 12pz @(Just' >> Succ) (Just 20)Val 21pz @(Just' >> Succ) NothingFail "Just' found Nothing" |}~ }|~None&',-.=>?@AHSUVXko UH predicate-typedtype operator version of Rpl @((Id !!? C "d") > MkJust 99 || Length Id <= 3) (M.fromList $ zip "abcd" [1..])7False (False || False | (Just 4 > Just 99) || (4 <= 3)) Val FalseQpz @((Id !!? C "d") > MkJust 2 || Length Id <= 3) (M.fromList $ zip "abcd" [1..])Val Truepredicate-typed J leveraging  K: see )pz @(Lookup 2 Id) ["abc","D","eF","","G"]Val (Just "eF")*pz @(Lookup 20 Id) ["abc","D","eF","","G"] Val NothingHpl @(FromList (M.Map _ _) >> Lookup (C "y") Id) [('x',True),('y',False)]hPresent Just False ((>>) Just False | {Lookup('y') False | q=fromList [('x',True),('y',False)] | p='y'})Val (Just False)Hpl @(FromList (M.Map _ _) >> Lookup (C "z") Id) [('x',True),('y',False)]8Present Nothing ((>>) Nothing | {Lookup('z') not found}) Val Nothing,pl @(Lookup 1 Id) [('x',14),('y',3),('z',5)]MPresent Just ('y',3) (Lookup(1) ('y',3) | q=[('x',14),('y',3),('z',5)] | p=1)Val (Just ('y',3))-pl @(Lookup 14 Id) [('x',14),('y',3),('z',5)]&Present Nothing (Lookup(14) not found) Val Nothingpl @(Lookup 3 "abcdef") ()3Present Just 'd' (Lookup(3) 'd' | q="abcdef" | p=3)Val (Just 'd') pl @(Lookup 4 '[1,2,3,4,5,6]) ()4Present Just 5 (Lookup(4) 5 | q=[1,2,3,4,5,6] | p=4) Val (Just 5)predicate-typed similar to Go leveraging  K%pz @(Id !! 2) ["abc","D","eF","","G"]Val "eF"&pz @(Id !! 20) ["abc","D","eF","","G"]Fail "(!!) index not found"Fpz @(Id !! "eF") (M.fromList (flip zip [0..] ["abc","D","eF","","G"]))Val 2 pl @(Id !! 3) ("asfd" :: T.Text))Present 'd' (IxL(3) 'd' | p="asfd" | q=3)Val 'd' pl @(Id !! 4) ("asfd" :: T.Text)#Error (!!) index not found (IxL(4))Fail "(!!) index not found" pl @(Id !! MEmptyT _) (Just "a")-Present "a" (IxL(()) "a" | p=Just "a" | q=())Val "a"Vpl @(Id !! MEmptyT _) (Nothing @()) -- had to add @() to keep this happy: ghci is fine$Error (!!) index not found (IxL(()))Fail "(!!) index not found"pl @(Id !! 0) ('a','b','c')0Present 'a' (IxL(0) 'a' | p=('a','b','c') | q=0)Val 'a''pl @(Id !! FailT _ "err") ('a','b','c')Error err (IxL) Fail "err"<pl @(Id !! "d") (M.fromList $ zip (map (:[]) "abcd") [0 ..])MPresent 3 (IxL("d") 3 | p=fromList [("a",0),("b",1),("c",2),("d",3)] | q="d")Val 32pl @(Id !! C "d") (M.fromList $ zip "abcd" [0 ..])MPresent 3 (IxL('d') 3 | p=fromList [('a',0),('b',1),('c',2),('d',3)] | q='d')Val 3'pl @(Id !! C "d") (Set.fromList "abcd")4Present () (IxL('d') () | p=fromList "abcd" | q='d')Val ()8pl @(Id !! HeadFail "failedn" "e") (Set.fromList "abcd")%Error (!!) index not found (IxL('e'))Fail "(!!) index not found"2pl @(Id !! C "d") (M.fromList $ zip "abcd" [0 ..])MPresent 3 (IxL('d') 3 | p=fromList [('a',0),('b',1),('c',2),('d',3)] | q='d')Val 3pl @(Id !! MEmptyT _) (Just 10)*Present 10 (IxL(()) 10 | p=Just 10 | q=())Val 10#pl @(Id !! MEmptyT _) (Nothing @())$Error (!!) index not found (IxL(()))Fail "(!!) index not found"pl @(Id !! 6) ['a'..'z']?Present 'g' (IxL(6) 'g' | p="abcdefghijklmnopqrstuvwxyz" | q=6)Val 'g'pl @(Snd !! Fst) (3,"abcde")*Present 'd' (IxL(3) 'd' | p="abcde" | q=3)Val 'd'pl @(Snd !! Fst) (4,[9,8])#Error (!!) index not found (IxL(4))Fail "(!!) index not found"%pl @(2 &&& Id >> Snd !! Fst) "abcdef"8Present 'c' ((>>) 'c' | {IxL(2) 'c' | p="abcdef" | q=2})Val 'c'1pl @((Len >> Pred) &&& Id >> Snd !! Fst) "abcdef"8Present 'f' ((>>) 'f' | {IxL(5) 'f' | p="abcdef" | q=5})Val 'f'#pl @(Id !! 3) ('a','b','c','d','e')8Present 'd' (IxL(3) 'd' | p=('a','b','c','d','e') | q=3)Val 'd'<pl @(Id !! "s") $ M.fromList [("t",1), ("s", 20), ("s", 99)]@Present 99 (IxL("s") 99 | p=fromList [("s",99),("t",1)] | q="s")Val 992pl @(Id !! C "d") (M.fromList $ zip "abcd" [0 ..])MPresent 3 (IxL('d') 3 | p=fromList [('a',0),('b',1),('c',2),('d',3)] | q='d')Val 3pl @(Id !! FromString _ "d" &&& (Map' (Snd >> Gt 3 >> Coerce SG.Any) (IToList _) >> MConcat Id)) (M.fromList $ zip (map T.singleton "abcdefgh") [0 ..]):Present (3,Any {getAny = True}) ('(3,Any {getAny = True}))Val (3,Any {getAny = True})pl @(Id !! FromString _ "d" &&& (Map' (Snd >> Gt 3 >> Wrap SG.Any Id) (IToList _) >> MConcat Id >> Unwrap)) (M.fromList $ zip (map T.singleton "abcdefgh") [0 ..])Present (3,True) ('(3,True)) Val (3,True)Opl @(Id !! FromString _ "d") (M.fromList $ zip (map T.singleton "abcd") [0 ..])MPresent 3 (IxL("d") 3 | p=fromList [("a",0),("b",1),("c",2),("d",3)] | q="d")Val 3Opl @(Id !! FromString _ "d") (M.fromList $ zip (map T.singleton "abcd") [0 ..])MPresent 3 (IxL("d") 3 | p=fromList [("a",0),("b",1),("c",2),("d",3)] | q="d")Val 3/pl @(Id !! 2 !! 0) [[1..5],[10..14],[100..110]]PPresent 100 (IxL(0) 100 | p=[100,101,102,103,104,105,106,107,108,109,110] | q=0)Val 100/pl @(Id !! 1 !! 7) [[1..5],[10..14],[100..110]]#Error (!!) index not found (IxL(7))Fail "(!!) index not found"(pl @(Id !! 1) [('x',14),('y',3),('z',5)]EPresent ('y',3) (IxL(1) ('y',3) | p=[('x',14),('y',3),('z',5)] | q=1) Val ('y',3))pl @(Id !! 14) [('x',14),('y',3),('z',5)]$Error (!!) index not found (IxL(14))Fail "(!!) index not found"predicate-typed similar to Go leveraging  K1pz @(IxL Id 2 "notfound") ["abc","D","eF","","G"]Val "eF"2pz @(IxL Id 20 "notfound") ["abc","D","eF","","G"]Val "notfound"(pl @(IxL Id 1 (C "x")) ("123" :: T.Text)(Present '2' (IxL(1) '2' | p="123" | q=1)Val '2')pl @(IxL Id 15 (C "x")) ("123" :: T.Text)%Present 'x' (IxL(15) index not found)Val 'x'predicate-typed similar to Go using an  K container.pz @(Ix 4 "not found") ["abc","D","eF","","G"]Val "G"/pz @(Ix 40 "not found") ["abc","D","eF","","G"]Val "not found"`pl @(Fst >> Dup >> (Ix 1 (FailP "failed5") *** Ix 3 (FailP "failed5")) >> Id) ([10,12,3,5],"ss")*Present (12,5) ((>>) (12,5) | {Id (12,5)}) Val (12,5)gpl @(Fst >> Dup >> (Ix 1 (FailP "failed5") *** Ix 3 (FailP "failed5")) >> Fst < Snd) ([10,12,3,5],"ss")False ((>>) False | {12 < 5}) Val Falsegpl @(Fst >> Dup >> (Ix 1 (FailP "failed5") *** Ix 3 (FailP "failed5")) >> Fst > Snd) ([10,12,3,5],"ss")True ((>>) True | {12 > 5})Val TrueGpl @(Snd >> Len &&& Ix 3 (FailP "someval1") >> Fst == Snd) ('x',[1..5])False ((>>) False | {5 == 4}) Val FalseFpl @(Snd >> Len &&& Ix 3 (FailP "someval2") >> Fst < Snd) ('x',[1..5])False ((>>) False | {5 < 4}) Val FalseFpl @(Snd >> Len &&& Ix 3 (FailP "someval3") >> Fst > Snd) ('x',[1..5])True ((>>) True | {5 > 4})Val TrueLpl @(Map Len >> Ix 3 (FailP "lhs") &&& Ix 0 5 >> Fst == Snd) [[1..4],[4..5]]"Error lhs (Ix(3) not found | '(,)) Fail "lhs"Lpl @(Map Len >> Ix 0 (FailP "lhs") &&& Ix 1 5 >> Fst == Snd) [[1..4],[4..5]]False ((>>) False | {4 == 2}) Val FalseXpl @(Map Len >> Ix 1 (FailP "lhs") &&& Ix 3 (FailP "rhs") >> Fst == Snd) [[1..4],[4..5]]"Error rhs (Ix(3) not found | '(,)) Fail "rhs"Ypl @(Map Len >> Ix 10 (FailP "lhs") &&& Ix 1 (FailP "rhs") >> Fst == Snd) [[1..4],[4..5]]#Error lhs (Ix(10) not found | '(,)) Fail "lhs"Ypl @(Map Len >> Ix 0 (FailP "lhs") &&& Ix 10 (FailP "rhs") >> Fst == Snd) [[1..4],[4..5]]#Error rhs (Ix(10) not found | '(,)) Fail "rhs"Mpl @(Map Len >> Ix 10 3 &&& Ix 1 (FailP "rhs") >> Fst == Snd) [[1..4],[4..5]]False ((>>) False | {3 == 2}) Val False@pl @(Map Len >> Ix 3 3 &&& Ix 1 4 >> Fst == Snd) [[1..4],[4..5]]False ((>>) False | {3 == 2}) Val FalseApl @(Map Len >> Ix 10 3 &&& Ix 1 4 >> Fst == Snd) [[1..4],[4..5]]False ((>>) False | {3 == 2}) Val FalseApl @(Map Len >> Ix 10 5 &&& Ix 1 4 >> Fst == Snd) [[1..4],[4..5]]False ((>>) False | {5 == 2}) Val FalseApl @(Map Len >> Ix 10 2 &&& Ix 1 4 >> Fst == Snd) [[1..4],[4..5]]True ((>>) True | {2 == 2})Val Truepredicate-typedindex a value in an  K7 container and if not found fail with the given messageBpl @(LookupFail "someval" 999 Fst) (map SG.Min [1::Int .. 10],'x') Error someval (JustFail Nothing)Fail "someval"Mpl @(LookupFail (PrintF "char=%c" Snd) 49 Fst) (map SG.Min [1::Int ..10],'x')Error char=x (JustFail Nothing) Fail "char=x"predicate-typedindex a value in an  K7 container and if not found fail with the given messagepredicate-typedindex a value in an  K: container and if not found return the given default value&pl @(LookupDef 4 '[1,2,3,4,5,6] Id) 23Present 5 (JustDef Just)Val 5-pl @(LookupDef 4 '[1,2,3,4,5,6] Fst) (23,'x')Present 5 (JustDef Just)Val 5'pl @(LookupDef 99 '[1,2,3,4,5,6] Id) 23Present 23 (JustDef Nothing)Val 23Apl @(LookupDef 4 Fst (MEmptyT _)) (map SG.Min [1::Int .. 10],'x')'Present Min {getMin = 5} (JustDef Just)Val (Min {getMin = 5})Cpl @(LookupDef 999 Fst (MEmptyT _)) (map SG.Min [1::Int .. 10],'x')<Present Min {getMin = 9223372036854775807} (JustDef Nothing)(Val (Min {getMin = 9223372036854775807})predicate-typedindex a value in an  K: container and if not found return the given default value3pl @(LookupDef' Snd Fst (C "xx") Id) (['a'..'e'],2)Present 'c' (JustDef Just)Val 'c'5pl @(LookupDef' Snd Fst (C "xx") Id) (['a'..'e'],999)Present 'x' (JustDef Nothing)Val 'x'+pl @(LookupDef' Snd Fst (C "xx") Id) ([],2)Present 'x' (JustDef Nothing)Val 'x'2pl @(LookupDef' Snd Fst (C "xx") Snd) ('w',([],2))Present 'x' (JustDef Nothing)Val 'x'5pl @(LookupDef' Snd Fst Fst Snd) ('x',(['a'..'e'],2))Present 'c' (JustDef Just)Val 'c'Lpl @(LookupDef' Snd Fst (MEmptyT _) Snd) ('x',(map SG.Min [10..15::Int], 3))(Present Min {getMin = 13} (JustDef Just)Val (Min {getMin = 13})  None%&',-.=>?@AHSUVXko 7predicate-typed get universe of an enum of type tpz @(Universe Ordering) ()Val [LT,EQ,GT]predicate-typed.universe of enum using the type pointed to by ppl @(Universe' Id) LT(Present [LT,EQ,GT] (Universe [LT .. GT])Val [LT,EQ,GT]predicate-typed similar to  LPpz @(EnumFromThenTo (10 >> ToEnum Day) (20 >> ToEnum Day) (70 >> ToEnum Day)) ()RVal [1858-11-27,1858-12-07,1858-12-17,1858-12-27,1859-01-06,1859-01-16,1859-01-26]bpz @(EnumFromThenTo (ReadP Day "2020-01-12") (ReadP Day "2020-02-12") (ReadP Day "2020-08-12")) ()RVal [2020-01-12,2020-02-12,2020-03-14,2020-04-14,2020-05-15,2020-06-15,2020-07-16]predicate-typed similar to  Mpz @(2 ... 5) () Val [2,3,4,5]pz @('LT ... 'GT) ()Val [LT,EQ,GT]Dpz @('Just (MkDay '(2020, 1, 2)) ... 'Just (MkDay '(2020, 1, 7))) ()GVal [2020-01-02,2020-01-03,2020-01-04,2020-01-05,2020-01-06,2020-01-07]predicate-typed similar to  Mpz @(EnumFromTo 'GT 'LT) ()Val []&pz @(EnumFromTo Pred Succ) (SG.Max 10):Val [Max {getMax = 9},Max {getMax = 10},Max {getMax = 11}]jpz @(EnumFromTo 1 20 >> Map '(Id, (If (Id `Mod` 3 == 0) "Fizz" "" <> If (Id `Mod` 5 == 0) "Buzz" ""))) 123Val [(1,""),(2,""),(3,"Fizz"),(4,""),(5,"Buzz"),(6,"Fizz"),(7,""),(8,""),(9,"Fizz"),(10,"Buzz"),(11,""),(12,"Fizz"),(13,""),(14,""),(15,"FizzBuzz"),(16,""),(17,""),(18,"Fizz"),(19,""),(20,"Buzz")]/pl @(EnumFromTo (Pure SG.Min 9) (Pure _ 13)) ()Present [Min {getMin = 9},Min {getMin = 10},Min {getMin = 11},Min {getMin = 12},Min {getMin = 13}] (Min {getMin = 9} ... Min {getMin = 13})^Val [Min {getMin = 9},Min {getMin = 10},Min {getMin = 11},Min {getMin = 12},Min {getMin = 13}]3pl @(EnumFromTo (Wrap (SG.Min _) 9) (Wrap _ 13)) ()Present [Min {getMin = 9},Min {getMin = 10},Min {getMin = 11},Min {getMin = 12},Min {getMin = 13}] (Min {getMin = 9} ... Min {getMin = 13})^Val [Min {getMin = 9},Min {getMin = 10},Min {getMin = 11},Min {getMin = 12},Min {getMin = 13}]predicate-typedbounded  N functionpz @(ToEnumBFail Ordering) 6Fail "ToEnum bounded"pl @(ToEnumBFail Ordering) 1Present EQ (ToEnumBDef EQ | 1)Val EQpl @(ToEnumBFail Ordering) 44.Error ToEnum bounded (ToEnumBDef out of range)Fail "ToEnum bounded"predicate-typedbounded  N functionpz @(ToEnumBDef Ordering LT) 2Val GTpz @(ToEnumBDef Ordering LT) 6Val LT!pl @(ToEnumBDef Ordering 'LT) 123$Present LT (ToEnumBDef out of range)Val LTpl @(ToEnumBDef Ordering 'GT) 1Present EQ (ToEnumBDef EQ | 1)Val EQpredicate-typedunsafe  N functionpz @(ToEnum Char) 120Val 'x'>pl @(Map FromEnum >> Map (Id - 97 >> ToEnum Ordering)) "abcde"YError ToEnum IO e=Prelude.Enum.Ordering.toEnum: bad argument(2) (Map(i=3, a=100) excnt=2)@Fail "ToEnum IO e=Prelude.Enum.Ordering.toEnum: bad argument(2)"=pl @((ToEnum Day *** ToEnum Day) >> EnumFromTo Fst Snd) (0,5)Present [1858-11-17,1858-11-18,1858-11-19,1858-11-20,1858-11-21,1858-11-22] ((>>) [1858-11-17,1858-11-18,1858-11-19,1858-11-20,1858-11-21,1858-11-22] | {1858-11-17 ... 1858-11-22})GVal [1858-11-17,1858-11-18,1858-11-19,1858-11-20,1858-11-21,1858-11-22]pz @(ToEnum (Proxy ())) 0 Val Proxypz @(ToEnum (Proxy ())) 1+Fail "ToEnum IO e=Proxy.toEnum: 0 expected"*pz @(ToEnum (Proxy "sss") >> Pop0 Id ()) 0 Val "sss"predicate-typedunsafe  N0 function that allows you to specify the target p and a pointer to a type tpredicate-typed O functionpz @FromEnum 'x'Val 120predicate-typed O functionpz @(FromEnum' Id) 'x'Val 120.pl @(FromEnum' ("aa" ==! Id) >> Same 1) "aaaa"False ((>>) False | {0 == 1}) Val False8pl @(FromEnum' ("aa" ==! Id) >> ToEnum OrderingP) "aaaa")Present CGt ((>>) CGt | {ToEnum CGt | 0})Val CGt4pl @(Map (FromEnum' Id) >> Map (ToEnum Char)) "abcd"<Present "abcd" ((>>) "abcd" | {Map "abcd" | [97,98,99,100]}) Val "abcd"predicate-typedbounded  P functionpl @(PredB 'GT Id) LTPresent GT (PredB out of range)Val GTpl @(PredB 'LT Id) GTPresent EQ (PredB EQ | GT)Val EQpredicate-typed unbounded  P function pz @Pred 13Val 12 pz @Pred LT9Fail "Pred IO e=Prelude.Enum.Ordering.pred: bad argument"predicate-typed?SuccN n p (unsafe) increments an enum p by the given integral n4pz @(ReadP Day Id >> Id ... SuccN 5 Id) "2020-07-27"GVal [2020-07-27,2020-07-28,2020-07-29,2020-07-30,2020-07-31,2020-08-01]6pz @(ReadP Day Id >> SuccN (Negate 5) Id) "2020-07-27"Val 2020-07-22pl @(SuccN 3 'LT) ()HError SuccN IO e=Prelude.Enum.Ordering.toEnum: bad argument (SuccN 3 LT)<Fail "SuccN IO e=Prelude.Enum.Ordering.toEnum: bad argument"pz @(SuccN 2 'LT) ()Val GTpredicate-typed unbounded  Q function pz @Succ 13Val 14 pz @Succ LTVal EQ pz @Succ GT9Fail "Succ IO e=Prelude.Enum.Ordering.succ: bad argument" pl @Succ 10Present 11 (Succ 11 | 10)Val 11'pl @Succ True -- captures the exception;Error Succ IO e=Prelude.Enum.Bool.succ: bad argument (True)5Fail "Succ IO e=Prelude.Enum.Bool.succ: bad argument"pz @Succ (Proxy @44)Fail "Succ IO e=Proxy.succ"predicate-typedbounded  P functionpz @(PredB' Id) (13 :: Int)Val 12pz @(PredB' Id) LTFail "Pred bounded"pl @(PredB' Id) GTPresent EQ (PredB EQ | GT)Val EQpl @(PredB' Id) LT'Error Pred bounded (PredB out of range)Fail "Pred bounded"predicate-typedbounded  Q functionpz @(SuccB' Id) GTFail "Succ bounded"pz @(SuccB' Id) (13 :: Int)Val 14pz @(SuccB' Id) LTVal EQpredicate-typedbounded  Q functionpz @(SuccB 'LT Id) GTVal LTpz @(SuccB 'LT 'GT) ()Val LTpz @(SuccB 'GT 'LT) ()Val EQpl @(SuccB 'LT Id) GTPresent LT (SuccB out of range)Val LT7None&',-.=>?@AHSUVXko BVpredicate-typed leverages f8 for repeating predicates (passthrough method) same as DoN n p == FoldN n p Id but more efficientpz @(DoN 4 Succ) 'c'Val 'g'pz @(DoN 4 (Id <> " | ")) "abc"Val "abc | | | | "#pz @(DoN 4 (Id <> "|" <> Id)) "abc"EVal "abc|abc|abc|abc|abc|abc|abc|abc|abc|abc|abc|abc|abc|abc|abc|abc"pl @(DoN 4 (Id + 4)) 1$Present 17 ((>>) 17 | {13 + 4 = 17})Val 17pl @(DoN 4 (Id + 7)) 3$Present 31 ((>>) 31 | {24 + 7 = 31})Val 31pl @(DoN 4 9) ()Present 9 ((>>) 9 | {'9})Val 9pl @(DoN 4 "xy") 3"Present "xy" ((>>) "xy" | {'"xy"})Val "xy"predicate-typedccreates a promoted list of predicates and then evaluates them into a list. see PP instance for '[k]pz @(Repeat 4 Succ) 'c' Val "dddd"pz @(Repeat 4 "abc") ()Val ["abc","abc","abc","abc"]pl @(Repeat 4 "xy") 3BPresent ["xy","xy","xy","xy"] ('["xy","xy","xy","xy"] ('"xy") | 3)Val ["xy","xy","xy","xy"]predicate-typed leverages / for repeating expressions (passthrough method)pz @(ParaN 4 Succ) [1..4] Val [2,3,4,5]pz @(ParaN 4 Succ) "azwxm"(Fail "Para:invalid length(5) expected 4"pz @(ParaN 4 Succ) "azwx" Val "b{xy"=pl @(ParaN 5 (Guard "0-255" (Between 0 255 Id))) [1,2,3,4,12]:Present [1,2,3,4,12] (Para(0) [1,2,3,4,12] | [1,2,3,4,12])Val [1,2,3,4,12]?pl @(ParaN 5 (Guard "0-255" (Between 0 255 Id))) [1,2,3,400,12](Error 0-255 (Guard | 400 | Para(3 of 4)) Fail "0-255"Rpz @(ParaN 5 (Guard (PrintF "bad value %d" Id) (Between 0 255 Id))) [1,2,3,400,12]Fail "bad value 400"-pl @(ParaN 4 (PrintF "%03d" Id)) [141,21,3,0]TPresent ["141","021","003","000"] (Para(0) ["141","021","003","000"] | [141,21,3,0])Val ["141","021","003","000"]predicate-typedruns values in parallel unlike f which is serial)pz @(Para '[Id,Id + 1,Id * 4]) [10,20,30]Val [10,21,120],pz @(Para '[Id,Id + 1,Id * 4]) [10,20,30,40](Fail "Para:invalid length(4) expected 3";pl @(Para '[W 'True, Ge 12, W 'False, Lt 2]) [1,2,-99,-999]RPresent [True,False,False,True] (Para(0) [True,False,False,True] | [1,2,-99,-999])Val [True,False,False,True]6pl @(Para '[W 'True, Ge 12, W 'False, Lt 2]) [1,2,-99]'Error Para:invalid length(3) expected 4(Fail "Para:invalid length(3) expected 4"Apl @(Para '[W 'True, Ge 12, W 'False, Lt 2]) [1,2,-99,-999,1,1,2]'Error Para:invalid length(7) expected 4(Fail "Para:invalid length(7) expected 4"predicate-typedunfolds a value applying f until the condition p is true or n times)pl @(IterateNUntil 10 (Id <= 90) Pred) 95qPresent [95,94,93,92,91] ((>>) [95,94,93,92,91] | {Map [95,94,93,92,91] | [(10,95),(9,94),(8,93),(7,92),(6,91)]})Val [95,94,93,92,91](pl @(IterateNUntil 3 (Id <= 90) Pred) 95PPresent [95,94,93] ((>>) [95,94,93] | {Map [95,94,93] | [(3,95),(2,94),(1,93)]})Val [95,94,93]$pl @(IterateNUntil 9999 'False Id) 1?Error Unfoldr (9999,1):recursion limit i=100 (Unfoldr (9999,1))-Fail "Unfoldr (9999,1):recursion limit i=100"predicate-typedunfolds a value applying f while the condition p is true or n times(pl @(IterateNWhile 10 (Id > 90) Pred) 95qPresent [95,94,93,92,91] ((>>) [95,94,93,92,91] | {Map [95,94,93,92,91] | [(10,95),(9,94),(8,93),(7,92),(6,91)]})Val [95,94,93,92,91]'pl @(IterateNWhile 3 (Id > 90) Pred) 95PPresent [95,94,93] ((>>) [95,94,93] | {Map [95,94,93] | [(3,95),(2,94),(1,93)]})Val [95,94,93]predicate-typedunfolds a value applying f while the condition p is true$pl @(IterateWhile (Id > 90) Pred) 947Present [94,93,92,91] (Unfoldr 94 [94,93,92,91] | s=94)Val [94,93,92,91]predicate-typedunfolds a value applying f until the condition p is true$pl @(IterateUntil (Id < 90) Pred) 94=Present [94,93,92,91,90] (Unfoldr 94 [94,93,92,91,90] | s=94)Val [94,93,92,91,90]predicate-typedrun p n times with state s:m + System.Random;pz @(UnfoldN 10 (RandomRNext Int 1 100 Id) Id) (mkStdGen 3)"Val [64,94,33,26,12,8,81,41,21,89]predicate-typed similar to Gp=pz @(Unfoldr (MaybeBool (Not Null) (SplitAt 2 Id)) Id) [1..5]Val [[1,2],[3,4],[5]][pl @(Unfoldr (If Null (MkNothing _) ('(Take 3 Id, Drop 1 Id) >> MkJust Id)) Id) "abcdefghi"Present ["abc","bcd","cde","def","efg","fgh","ghi","hi","i"] (Unfoldr "abcdefghi" ["abc","bcd","cde","def","efg","fgh","ghi","hi","i"] | s="abcdefghi")8Val ["abc","bcd","cde","def","efg","fgh","ghi","hi","i"]Gpl @(Unfoldr (If Null (MkNothing _) (Pure _ (SplitAt 2 Id))) Id) [1..5]QPresent [[1,2],[3,4],[5]] (Unfoldr [1,2,3,4,5] [[1,2],[3,4],[5]] | s=[1,2,3,4,5])Val [[1,2],[3,4],[5]]=pl @(Unfoldr (MaybeBool (Not Null) (SplitAt 2 Id)) Id) [1..5]QPresent [[1,2],[3,4],[5]] (Unfoldr [1,2,3,4,5] [[1,2],[3,4],[5]] | s=[1,2,3,4,5])Val [[1,2],[3,4],[5]]_pl @(Unfoldr (If Null (MkNothing _) (Guard "yy" (Len < 3) >> Pure _ (SplitAt 2 Id))) Id) [1..5]Error yy (Unfoldr [1,2,3,4,5]) Fail "yy"Upl @(Unfoldr (MaybeBool (Not Null) (Guard "yy" (Len < 3) >> SplitAt 2 Id)) Id) [1..5]Error yy (Unfoldr [1,2,3,4,5]) Fail "yy"9pl @(Unfoldr (Guard "xx" (Len > 4) >> Uncons) Id) [1..10])Error xx (Unfoldr [1,2,3,4,5,6,7,8,9,10]) Fail "xx"pl @(Unfoldr Uncons Id) [1..10]qPresent [1,2,3,4,5,6,7,8,9,10] (Unfoldr [1,2,3,4,5,6,7,8,9,10] [1,2,3,4,5,6,7,8,9,10] | s=[1,2,3,4,5,6,7,8,9,10])Val [1,2,3,4,5,6,7,8,9,10]Npan @(Unfoldr (If (Id < 1) (MkNothing _) (MkJust (DivMod Id 2 >> Swap))) Id) 8P Unfoldr 8 [0,0,0,1]| +- P Id 8|+- P i=1: If 'False Just (0,4)|+- P i=2: If 'False Just (0,2)|+- P i=3: If 'False Just (0,1)|+- P i=4: If 'False Just (1,0)|`- P i=5: If 'True Nothing Val [0,0,0,1]predicate-typedFoldl similar to  R'pl @(Foldl (Fst + Snd) 0 (1 ... 10)) ()APresent 55 ((>>) 55 | {Last 55 | [0,1,3,6,10,15,21,28,36,45,55]})Val 55,pz @(Foldl (Snd :+ Fst) '[99] (1 ... 10)) ()Val [10,9,8,7,6,5,4,3,2,1,99]*pl @(Foldl Fst '() (EnumFromTo 1 9999)) ()+Error Scanl list size exceeded (max is 100)Fail "Scanl list size exceeded"Gpl @(Foldl (Guard "someval" (Fst < Snd) >> Snd) Head Tail) [1,4,7,9,16]/Present 16 ((>>) 16 | {Last 16 | [1,4,7,9,16]})Val 16_pl @(Foldl (Guard (PrintT "%d not less than %d" Id) (Fst < Snd) >> Snd) Head Tail) [1,4,7,6,16]Error 7 not less than 6 (Scanl)Fail "7 not less than 6"fpl @(Foldl (If (L11 && (Snd > L12)) '( 'True, Snd) '( 'False, L12)) '( 'True, Head) Tail) [1,4,7,9,16]gPresent (True,16) ((>>) (True,16) | {Last (True,16) | [(True,1),(True,4),(True,7),(True,9),(True,16)]}) Val (True,16)hpl @(Foldl (If (L11 && (Snd > L12)) '( 'True, Snd) '( 'False, L12)) '( 'True, Head) Tail) [1,4,7,9,16,2]uPresent (False,16) ((>>) (False,16) | {Last (False,16) | [(True,1),(True,4),(True,7),(True,9),(True,16),(False,16)]})Val (False,16)0pl @(Foldl (Snd :+ Fst) (MEmptyT [_]) Id) [1..5]jPresent [5,4,3,2,1] ((>>) [5,4,3,2,1] | {Last [5,4,3,2,1] | [[],[1],[2,1],[3,2,1],[4,3,2,1],[5,4,3,2,1]]})Val [5,4,3,2,1]pl @('Just Uncons >> Foldl (If L11 (If (L12 < Snd) '( 'True,Snd) '( 'False, Snd)) Fst) '( 'True,Fst) Snd) [-10,-2,2,3,4,10,9,11]Present (False,9) ((>>) (False,9) | {Last (False,9) | [(True,-10),(True,-2),(True,2),(True,3),(True,4),(True,10),(False,9),(False,9)]}) Val (False,9){pl @('Just Uncons >> Foldl (If L11 (If (L12 < Snd) '( 'True,Snd) '( 'False, Snd)) Fst) '( 'True,Fst) Snd) [-10,2,3,4,10,11]sPresent (True,11) ((>>) (True,11) | {Last (True,11) | [(True,-10),(True,2),(True,3),(True,4),(True,10),(True,11)]}) Val (True,11)predicate-typed-iterates n times keeping only the last resultpz @(FoldN 4 Succ Id) 'c'Val 'g'9pz @(ReadP Day Id >> Id ... FoldN 5 Succ Id) "2020-07-27"GVal [2020-07-27,2020-07-28,2020-07-29,2020-07-30,2020-07-31,2020-08-01]pl @(FoldN 2 Succ Id) LT-Present GT ((>>) GT | {Last GT | [LT,EQ,GT]})Val GTpl @(FoldN 30 Succ Id) LT@Error Succ IO e=Prelude.Enum.Ordering.succ: bad argument (Scanl)9Fail "Succ IO e=Prelude.Enum.Ordering.succ: bad argument"pl @(FoldN 6 Succ Id) 'a'/Present 'g' ((>>) 'g' | {Last 'g' | "abcdefg"})Val 'g'pl @(FoldN 6 Pred Id) 'a'0Present '[' ((>>) '[' | {Last '[' | "a`_^]\\["})Val '['pl @(FoldN 0 Succ Id) LT'Present LT ((>>) LT | {Last LT | [LT]})Val LT+pl @(FoldN 2 Succ Id >> FoldN 2 Pred Id) LT-Present LT ((>>) LT | {Last LT | [GT,EQ,LT]})Val LT2pz @(FoldN 4 (Id <> Id) Id) "abc" -- same as above6Val "abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc"predicate-typedtuple version of pl @(ScanNA Succ) (4,'a')6Present "abcde" (Scanl "abcde" | b='a' | as=[1,2,3,4]) Val "abcde"pl @(ScanNA Tail) (4,"abcd")_Present ["abcd","bcd","cd","d",""] (Scanl ["abcd","bcd","cd","d",""] | b="abcd" | as=[1,2,3,4])Val ["abcd","bcd","cd","d",""]&pl @(Len &&& Id >> ScanNA Tail) "abcd"Present ["abcd","bcd","cd","d",""] ((>>) ["abcd","bcd","cd","d",""] | {Scanl ["abcd","bcd","cd","d",""] | b="abcd" | as=[1,2,3,4]})Val ["abcd","bcd","cd","d",""]predicate-typed(iterates n times keeping all the resultspz @(ScanN 4 Succ Id) 'c' Val "cdefg"+pz @(Dup >> ScanN 4 (Pred *** Succ) Id) 'g'7Val [('g','g'),('f','h'),('e','i'),('d','j'),('c','k')]pz @(ScanN 4 Succ Id) 4Val [4,5,6,7,8]>pz @('(0,1) >> ScanN 20 '(Snd, Fst + Snd) Id >> Map Fst) "sdf"JVal [0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765]pl @(ScanN 2 Succ Id) 40Present [4,5,6] (Scanl [4,5,6] | b=4 | as=[1,2]) Val [4,5,6]pl @(ScanN 5 Id Id) 4BPresent [4,4,4,4,4,4] (Scanl [4,4,4,4,4,4] | b=4 | as=[1,2,3,4,5])Val [4,4,4,4,4,4]9pl @(ScanN 2 Succ Id >> PadR 10 (MEmptyT Ordering) Id) LTPresent [LT,EQ,GT,EQ,EQ,EQ,EQ,EQ,EQ,EQ] ((>>) [LT,EQ,GT,EQ,EQ,EQ,EQ,EQ,EQ,EQ] | {PadR 10 pad=EQ [LT,EQ,GT,EQ,EQ,EQ,EQ,EQ,EQ,EQ] | [LT,EQ,GT]})#Val [LT,EQ,GT,EQ,EQ,EQ,EQ,EQ,EQ,EQ]pl @(ScanN 4 Pred Id) 99GPresent [99,98,97,96,95] (Scanl [99,98,97,96,95] | b=99 | as=[1,2,3,4])Val [99,98,97,96,95]predicate-typed similar to  S.pz @(Scanl (Snd :+ Fst) Fst Snd) ([99],[1..5])AVal [[99],[1,99],[2,1,99],[3,2,1,99],[4,3,2,1,99],[5,4,3,2,1,99]]*pl @(Scanl (Snd :+ Fst) Fst Snd) ([99],[]).Present [[99]] (Scanl [[99]] | b=[99] | as=[]) Val [[99]]None&',-.;=>?@AHSUVXko f+predicate-typed similar to  T,predicate-typed similar to  U-predicate-typed similar to  V.predicate-typedlist n random numbers of type t in range between p and q using generator r : similar to  W,pz @(RandomRList 10 Int 0 6 Id) (mkStdGen 1)1Val ([6,6,5,1,3,0,3,6,5,2],1244126523 1336516156)6pz @(RandomRList 10 _ (C "A") (C "F") Id) (mkStdGen 1)(Val ("EEBCBEFBEF",1244126523 1336516156)/predicate-typed#get the next random number of type t in range between p and q using generator r : similar to  Xwpz @(Foldl (Fst >> Second (RandomRNext Int 1 100 Id) >> '(L21 :+ Fst, L22)) '( MEmptyT [Int] ,Id) (1...5)) (mkStdGen 3)*Val ([12,26,33,94,64],781515869 652912057)Cpz @(UnfoldN 10 (RandomRNext _ (C "A") (C "H") Id) Id) (mkStdGen 3)Val "DBABDDEEEA"0predicate-typedget a list of n random numbers of type t using generator p : similar to  Y(pz @(RandomList 10 Bool Id) (mkStdGen 4)RVal ([True,True,False,True,True,True,True,False,False,True],2036574526 1336516156)1predicate-typed#get the next random number of type t using generator r : similar to  Z4pz @(UnfoldN 5 (RandomNext Bool Id) Id) (mkStdGen 3)Val [True,True,False,True,True]2predicate-typed similar to  [pz @(GenPure Id) 1234 Val 1235 13predicate-typedgenerate a random number: see  \4predicate-typedread a value from stdin6predicate-typedEread in a value of a given type from stdin with a prompt: similar to qr7predicate-typedwrite a string value to stderr8predicate-typedwrite a string value to stdout9predicate-typed"write to file, without overwriting:predicate-typed$write to file, overwriting if needed;predicate-typedappend to a file<predicate-typedget the current time using  ]=predicate-typedget the current time using  ^>predicate-typedBread all the environment variables as key value pairs: similar to  _?predicate-typed)read an environment variable: similar to st,pz @(ReadEnv "PATH" >> 'Just Id >> 'True) ()Val True@predicate-typed similar to  `Apredicate-typed similar to  apz @(DirExists ".") ()Val Truepz @(DirExists "xxy") () Val FalseBpredicate-typed similar to  bCpredicate-typed similar to uvDpredicate-typed similar to qv2pz @(ReadFile "LICENSE" >> 'Just Id >> Len > 0) ()Val Truepz @(FileExists "xyzzy") () Val False+,-./0123456789:;<=>?@ABCDDCB@A;9:87465?>=<32,-+10/.None%&',-.=>?@AHSUVXko Jpredicate-typedadd an index to listpz @IList "abcdef"5Val [(0,'a'),(1,'b'),(2,'c'),(3,'d'),(4,'e'),(5,'f')]predicate-typedadd an index to mappz @(Rescan "^(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)$" >> Map (Snd >> IMap (GuardBool (PrintT "bad value=%d %s" Id) (Snd >> ReadP Int Id < 255)) Id)) "123.222.999.3"Fail "bad value=2 999"pz @(Rescan "^(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)$" >> Map (Snd >> IMap (GuardBool (PrintT "bad value=%d %s" Id) (Snd >> ReadP Int Id < 255)) Id)) "123.222.99.3"Val [[True,True,True,True]]predicate-typedexperimental: sorts then partitions and then sorts each partitions based on the leftmost occurring value in the original list if the existing order of data is fine then use ? as you do not need this=pz @(PartitionsBy (Fst ==! Snd) (L11 == L21) Id) [10,9,9,1,9]Val [[10],[9,9,9],[1]]2pz @(PartitionsBy OrdA (L11 < L21) Id) "efaffabec"Val ["a","f","f","abce","ef"]+pz @(PartitionsBy 'GT 'True Id) "efaffabec"Val ["cebaffafe"],pz @(PartitionsBy 'GT 'False Id) "efaffabec")Val ["e","f","a","f","f","a","b","e","c"]>pz @(PartitionsBy (Fst ==! Snd) (L12 > L22) Id) [10,9,9,1,9,4]Val [[9],[1],[9,10],[4,9]]8pz @(PartitionsBy (L11 ==! L21) (L12 > L22) Id) "eddadc"Val ["d","a","de","cd"]>pz @(PartitionsBy (L11 ==! L21) (L11 < L21) Id) [10,9,9,1,9,4]Val [[9],[1,4,9],[9,10]]predicate-typed$IsLuhn predicate check on last digitpz @IsLuhn [1,2,3,0]Val Truepz @IsLuhn [1,2,3,4] Val False&pz @(GuardSimple IsLuhn) [15,4,3,1,99]>Fail "(IsLuhn map=[90,2,3,8,6] sum=109 ret=9 | [15,4,3,1,99])"pl @IsLuhn [15,4,3,1,99]=False (IsLuhn map=[90,2,3,8,6] sum=109 ret=9 | [15,4,3,1,99]) Val Falsepredicate-typed'prime factorisation of positive numberspz @(PrimeFactors Id) 17Val [17]pz @(PrimeFactors Id) 1Val [1]pz @(PrimeFactors Id) 30 Val [2,3,5]pz @(PrimeFactors Id) 64Val [2,2,2,2,2,2]pz @(PrimeFactors Id) (-30)Fail "PrimeFactors number<=0"predicate-typed get list of n primespz @(Primes Id) 5Val [2,3,5,7,11]predicate-typedget the next prime numberpz @PrimePrev 6Val 5pz @PrimePrev 5Val 3pz @PrimePrev (-206)Val 2pz @(ScanN 6 PrimePrev Id) 11Val [11,7,5,3,2,2,2]predicate-typedget the next prime numberpz @PrimeNext 6Val 7pz @(ScanN 4 PrimeNext Id) 3Val [3,5,7,11,13]predicate-typeda predicate on prime numbers pz @IsPrime 2Val Truepz @(Map '(Id,IsPrime)) [0..12]Val [(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-typed similar to wxpz @InitMay "hello"Val (Just "hell")predicate-typed similar to wypz @TailMay "hello"Val (Just "ello")predicate-typed similar to wzpz @LastMay "hello"Val (Just 'o')predicate-typed similar to w{pl @HeadMay []1Present Nothing ((>>) Nothing | {FMap <skipped>}) Val Nothingpl @HeadMay [99,7,3];Present Just 99 ((>>) Just 99 | {FMap Fst 99 | (99,[7,3])}) Val (Just 99)predicate-typedDtakes the init of a list-like object or fails with the given messagepredicate-typedDtakes the init of a list-like object or uses the given default value"pl @(InitDef '[9,7] Fst) ([],True)Present [9,7] (JustDef Nothing) Val [9,7]&pl @(InitDef '[9,7] Fst) ([1..5],True) Present [1,2,3,4] (JustDef Just) Val [1,2,3,4]&pl @(InitDef '[3] Fst) ([10..15],True)'Present [10,11,12,13,14] (JustDef Just)Val [10,11,12,13,14]predicate-typedDtakes the init of a list-like object or fails with the given messagepredicate-typed=takes the last value of a list-like object or a default valuepl @(LastDef 9 Fst) ([],True)Present 9 (JustDef Nothing)Val 9!pl @(LastDef 9 Fst) ([1..5],True)Present 5 (JustDef Just)Val 5#pl @(LastDef 3 Fst) ([10..15],True)Present 15 (JustDef Just)Val 15pl @(LastDef 0 Id) [1..12]Present 12 (JustDef Just)Val 12pl @(LastDef 0 Id) []Present 0 (JustDef Nothing)Val 0predicate-typedDtakes the tail of a list-like object or fails with the given messageDpl @(TailFail (PrintT "a=%d b=%s" Snd) Fst) ([]::[()],(4,"someval"))&Error a=4 b=someval (JustFail Nothing)Fail "a=4 b=someval"predicate-typedDtakes the tail of a list-like object or uses the given default value"pl @(TailDef '[9,7] Fst) ([],True)Present [9,7] (JustDef Nothing) Val [9,7]&pl @(TailDef '[9,7] Fst) ([1..5],True) Present [2,3,4,5] (JustDef Just) Val [2,3,4,5]&pl @(TailDef '[3] Fst) ([10..15],True)'Present [11,12,13,14,15] (JustDef Just)Val [11,12,13,14,15]predicate-typed8takes the head of a list or fails with the given messagesee b for other supported types eg |}0pz @(HeadFail "oops" Id) ["abc","def","asdfadf"] Val "abc"!pz @(HeadFail "empty list" Id) []Fail "empty list")pl @(HeadFail "zz" Fst >> Le 6) ([],True)Error zz (JustFail Nothing) Fail "zz":pl @((HeadFail "failed1" Fst >> Le 6) || 'False) ([],True)%Error failed1 (JustFail Nothing | ||)Fail "failed1"Ipl @((Fst >> HeadFail "failed2" Id >> Le (6 -% 1)) || 'False) ([-9],True)True (True || False)Val True9pl @(HeadFail "Asdf" Id) ([] :: [()]) -- breaks otherwiseError Asdf (JustFail Nothing) Fail "Asdf"7pl @(HeadFail (PrintF "msg=%s def" Fst) Snd) ("Abc",[])$Error msg=Abc def (JustFail Nothing)Fail "msg=Abc def"predicate-typedDtakes the head of a list-like object or uses the given default valuesee b for other supported types eg |}pz @(HeadDef 444 Id) []Val 444pz @(HeadDef 444 Id) [1..5]Val 1pz @(HeadDef 444 Id) [1..5]Val 10pz @(HeadDef (C "w") Id) (Seq.fromList "abcdef")Val 'a'"pz @(HeadDef (C "w") Id) Seq.emptyVal 'w'1pz @(HeadDef (MEmptyT _) Id) ([] :: [SG.Sum Int])Val (Sum {getSum = 0}):pz @(HeadDef (MEmptyT String) '["abc","def","asdfadf"]) () Val "abc";pz @(HeadDef (MEmptyT _) Snd) (123,["abc","def","asdfadf"]) Val "abc"&pz @(HeadDef (MEmptyT _) Snd) (123,[])Val ()pl @(HeadDef 9 Fst) ([],True)Present 9 (JustDef Nothing)Val 9$pl @(HeadDef 99 Fst) ([10..15],True)Present 10 (JustDef Just)Val 10&pl @(HeadDef 12 Fst >> Le 6) ([],True)False ((>>) False | {12 <= 6}) Val False%pl @(HeadDef 1 Fst >> Le 6) ([],True)True ((>>) True | {1 <= 6})Val True&pl @(HeadDef 10 Fst >> Le 6) ([],True)False ((>>) False | {10 <= 6}) Val False6pl @(HeadDef (MEmptyT _) Id) (map (:[]) ([] :: [Int]))Present [] (JustDef Nothing)Val []<pl @(HeadDef (MEmptyT _) Id) (map (:[]) ([10..14] :: [Int]))Present [10] (JustDef Just)Val [10]#pl @(HeadDef Fst Snd) (99,[10..14])Present 10 (JustDef Just)Val 10&pl @(HeadDef Fst Snd) (99,[] :: [Int])Present 99 (JustDef Nothing)Val 99%pl @(HeadDef 43 Snd) (99,[] :: [Int])Present 43 (JustDef Nothing)Val 43None&',-.=>?@AHSUVXko2jpredicate-typed extract the Right value from an  c otherwise fail with a message if there is no Right value then p/ is passed the Left value and the whole context&pz @(RightFail "oops" Id) (Right 20.4)Val 20.4%pz @(RightFail "oops" Id) (Left "aa") Fail "oops"Npz @(RightFail (PrintT "found left=%s fst=%d" '(Fst,L21)) Snd) (123,Left "xy")Fail "found left=xy fst=123")pz @(RightFail (MEmptyT _) Id) (Left 222)Fail ""predicate-typedextract the Left value from an  c otherwise fail with a messageif there is no Left value then p0 is passed the Right value and the whole context$pz @(LeftFail "oops" Id) (Left 20.4)Val 20.4%pz @(LeftFail "oops" Id) (Right "aa") Fail "oops"Opz @(LeftFail (PrintT "found right=%s fst=%d" '(Fst,L21)) Snd) (123,Right "xy")Fail "found right=xy fst=123")pz @(LeftFail (MEmptyT _) Id) (Right 222)Fail ""Ppl @(LeftFail (PrintF "someval=%d" L21) Snd) (13::Int,Right @(SG.Sum Int) "abc")!Error someval=13 (LeftFail Right)Fail "someval=13"Gpl @(LeftFail (PrintF "someval=%s" Fst) Id) (Right @(SG.Sum Int) "abc")"Error someval=abc (LeftFail Right)Fail "someval=abc"Epl @(LeftFail (PrintF "found rhs=%d" Fst) Id) (Right @String @Int 10)#Error found rhs=10 (LeftFail Right)Fail "found rhs=10"Kpl @(LeftFail (PrintF "found rhs=%d" (Snd >> L22)) L21) ('x',(Right 10,23))#Error found rhs=23 (LeftFail Right)Fail "found rhs=23"Ipl @(LeftFail (PrintF "found rhs=%d" (L2 L22)) L21) ('x',(Left "abc",23))Present "abc" (Left) Val "abc"predicate-typed extract the Right value from an  c : similar to ~ if there is no Right value then p/ is passed the Left value and the whole context&pz @(RightDef (1 % 4) Id) (Right 20.4) Val (102 % 5)%pz @(RightDef (1 % 4) Id) (Left "aa") Val (1 % 4)Mpz @(RightDef (PrintT "found left=%s fst=%d" '(Fst,L21)) Snd) (123,Left "xy")Val "found left=xy fst=123"(pz @(RightDef (MEmptyT _) Id) (Left 222)Val ()1pz @(RightDef (MEmptyT (SG.Sum _)) Id) (Left 222)Val (Sum {getSum = 0})predicate-typedextract the Left value from an  c- otherwise use the default value: similar to ~if there is no Left value then p0 is passed the Right value and the whole context$pz @(LeftDef (1 % 4) Id) (Left 20.4) Val (102 % 5)%pz @(LeftDef (1 % 4) Id) (Right "aa") Val (1 % 4)Npz @(LeftDef (PrintT "found right=%s fst=%d" '(Fst,L21)) Snd) (123,Right "xy")Val "found right=xy fst=123"(pz @(LeftDef (MEmptyT _) Id) (Right 222)Val ()1pz @(LeftDef (MEmptyT (SG.Sum _)) Id) (Right 222)Val (Sum {getSum = 0})predicate-typed~ constructorpz @(MkRight _ Id) 44Val (Right 44)predicate-typed~ constructorpredicate-typed~ constructorpz @(MkLeft _ Id) 44 Val (Left 44)predicate-typed~ constructorpredicate-typed similar to 3 but additionally gives p and q the original input=pz @(EitherX (ShowP (L11 + Snd)) (ShowP Id) Snd) (9,Left 123) Val "132">pz @(EitherX (ShowP (L11 + Snd)) (ShowP Id) Snd) (9,Right 'x')Val "((9,Right 'x'),'x')"@pz @(EitherX (ShowP Id) (ShowP (Second Succ)) Snd) (9,Right 'x')Val "((9,Right 'x'),'y')"predicate-typedConvenient method to convert a p or q to a  c based on a predicate b if b then Right p else Left q0pz @(EitherBool (Fst > 4) L21 L22) (24,(-1,999))Val (Right 999)/pz @(EitherBool (Fst > 4) L21 L22) (1,(-1,999))Val (Left (-1))0pl @(EitherBool (Fst > 10) L21 L22) (7,('x',99))-Present Left 'x' (EitherBool(False) Left 'x')Val (Left 'x')1pl @(EitherBool (Fst > 10) L21 L22) (11,('x',99)),Present Right 99 (EitherBool(True) Right 99)Val (Right 99)+pl @(EitherBool (Gt 10) "found left" 99) 12,Present Right 99 (EitherBool(True) Right 99)Val (Right 99)*pl @(EitherBool (Gt 10) "found left" 99) 7?Present Left "found left" (EitherBool(False) Left "found left")Val (Left "found left")predicate-typed similar to  dApz @PartitionEithers [Left 'a',Right 2,Left 'c',Right 4,Right 99]Val ("ac",[2,4,99])/pz @PartitionEithers [Right 2,Right 4,Right 99]Val ([],[2,4,99])(pz @PartitionEithers [Left 'a',Left 'c'] Val ("ac",[]),pz @PartitionEithers ([] :: [Either () Int]) Val ([],[]);pl @PartitionEithers [Left 4, Right 'x', Right 'y',Left 99]]Present ([4,99],"xy") (PartitionEithers ([4,99],"xy") | [Left 4,Right 'x',Right 'y',Left 99])Val ([4,99],"xy")Npl @PartitionEithers [Left 'x', Right 1,Left 'a', Left 'b',Left 'z', Right 10]sPresent ("xabz",[1,10]) (PartitionEithers ("xabz",[1,10]) | [Left 'x',Right 1,Left 'a',Left 'b',Left 'z',Right 10])Val ("xabz",[1,10])predicate-typedsimilar 3pz @(Pred +++ Id) (Left 13) Val (Left 12)*pz @(ShowP Id +++ Reverse) (Right "hello")Val (Right "olleh")Tpl @(HeadDef 'False Id +++ Id) (Right @[Bool] 1) -- need @[Bool] cos we said 'False!#Present Right 1 ((+++) Right 1 | 1) Val (Right 1)Vpl @(HeadDef 'False Id +++ Id) (Left [True,False]) -- need @[Bool] cos we said 'False!2Present Left True ((+++) Left True | [True,False])Val (Left True) pl @(Not Id +++ Id) (Right True),Present Right True ((+++) Right True | True)Val (Right True)pl @(Not Id +++ Id) (Right 12)&Present Right 12 ((+++) Right 12 | 12)Val (Right 12)lpl @(HeadDef () Id +++ Id) (Right @[()] 1) -- breaks otherwise: Id says () -> () so has to be a list of [()]#Present Right 1 ((+++) Right 1 | 1) Val (Right 1)Vpl @(HeadDef () Id +++ Id) (Right @[()] 1) -- this breaks! cos Left doesnt have a type#Present Right 1 ((+++) Right 1 | 1) Val (Right 1)$pl @(Not Id +++ Id) (Right @Bool 12)&Present Right 12 ((+++) Right 12 | 12)Val (Right 12)predicate-typed similar to  epz @IsRight (Right 123)Val Truepz @IsRight (Left "aa") Val Falsepredicate-typed similar to  fpz @IsLeft (Right 123) Val Falsepz @IsLeft (Left 'a')Val Truepredicate-typedsimilar 3pz @(Pred ||| Id) (Left 13)Val 12%pz @(ShowP Id ||| Id) (Right "hello") Val "hello"'pl @('True ||| 'False) (Left "someval")"True ((|||) Left True | "someval")Val True(pl @('True ||| 'False) (Right "someval")%False ((|||) Right False | "someval") Val False(pl @(ShowP Succ ||| ShowP Id) (Left 123)&Present "124" ((|||) Left "124" | 123) Val "124"*pl @(ShowP Succ ||| ShowP Id) (Right True)*Present "True" ((|||) Right "True" | True) Val "True" pl @(Not Id ||| Id) (Right True)&Present True ((|||) Right True | True)Val Truepl @(Not Id ||| Id) (Left True)False ((|||) Left False | True) Val Falsepredicate-typed!extracts the right value from an  cpz @(Right' >> Succ) (Right 20)Val 21pz @(Right' >> Succ) (Left 'a')Fail "Right' found Left"predicate-typed extracts the left value from an  cpz @(Left' >> Succ) (Left 20)Val 21pz @(Left' >> Succ) (Right 'a')Fail "Left' found Right"22None%&',-.=>?@AHPSUVXko<predicate-typed similar to  gpredicate-typed similar to Tpz @(DiffLocalTime Fst Snd) (read "2020-11-08 12:12:03", read "2020-11-05 15:12:00") Val 248403spredicate-typed similar to  hTpz @(DiffUTCTime Fst Snd) (read "2020-11-08 12:12:03Z", read "2020-11-08 11:12:00Z") Val 3603spredicate-typedconvert  ^) to posix time (seconds since 01-01-1970)Epl @(ReadP UTCTime Id >> UTCTimeToPosix Id) "2020-06-28 22:45:12 UTC"hPresent 1593384312 % 1 ((>>) 1593384312 % 1 | {UTCTimeToPosix 1593384312 % 1 | 2020-06-28 22:45:12 UTC})Val (1593384312 % 1)pz @(Rescan "^Date\\((\\d+)([^\\)]+)\\)" >> Head >> Snd >> ((ReadP Integer (Id !! 0) >> PosixToUTCTime (Id % 1000)) &&& ReadP TimeZone (Id !! 1))) "Date(1530144000000+0530)"#Val (2018-06-28 00:00:00 UTC,+0530)predicate-typed1convert posix time (seconds since 01-01-1970) to  ^"pl @(PosixToUTCTime Id) 1593384312YPresent 2020-06-28 22:45:12 UTC (PosixToUTCTime 2020-06-28 22:45:12 UTC | 1593384312 % 1)Val 2020-06-28 22:45:12 UTC7pl @(PosixToUTCTime Id >> UTCTimeToPosix Id) 1593384312hPresent 1593384312 % 1 ((>>) 1593384312 % 1 | {UTCTimeToPosix 1593384312 % 1 | 2020-06-28 22:45:12 UTC})Val (1593384312 % 1).pl @(PosixToUTCTime (Id % 1000)) 1593384312000YPresent 2020-06-28 22:45:12 UTC (PosixToUTCTime 2020-06-28 22:45:12 UTC | 1593384312 % 1)Val 2020-06-28 22:45:12 UTC(pl @(PosixToUTCTime Id) (3600*4+60*7+12)TPresent 1970-01-01 04:07:12 UTC (PosixToUTCTime 1970-01-01 04:07:12 UTC | 14832 % 1)Val 1970-01-01 04:07:12 UTCpz @(Rescan "^Date\\((\\d+)([^\\)]+)\\)" >> Head >> Snd >> ReadP Integer (Id !! 0) >> PosixToUTCTime (Id % 1000)) "Date(1530144000000+0530)"Val 2018-06-28 00:00:00 UTCpredicate-typed uncreate a  i* returning hour minute seconds picosecondsKpz @(ReadP UTCTime "2019-01-01 12:13:14.1234Z" >> ToTime >> UnMkTime Id) ()Val (12,13,70617 % 5000)Jpz @(ReadP UTCTime Id >> ToTime >> UnMkTime Id) "2020-07-22 08:01:14.127Z"Val (8,1,14127 % 1000)\pz @(ReadP ZonedTime Id >> '(UnMkDay ToDay, UnMkTime ToTime)) "2020-07-11 11:41:12.333+0400"&Val ((2020,7,11),(11,41,12333 % 1000))predicate-typed create a  i) from a three-tuple of year month and day pz @(MkTime '(1,2,3 % 12345)) ()Val 01:02:00.000243013365pz @(MkTime Id) (12,13,65) Val 12:13:65pz @(MkTime Id) (17,3,13) Val 17:03:13predicate-typed create a  i6 from three int values passed in as year month and day'pz @(MkTime' Fst Snd Thd) (13,99,99999)Val 13:99:99999predicate-typedextract  i from DateTime7pz @(ReadP UTCTime Id >> ToTime) "2020-07-06 12:11:13Z" Val 12:11:13predicate-typedextract  j from a DateTime6pz @(ReadP UTCTime Id >> ToDay) "2020-07-06 12:11:13Z"Val 2020-07-06predicate-typedget week number of the year4pz @('Just (MkDay '(2020,7,11)) >> ToWeekYear Id) ()Val 28 predicate-typedget the day of the weekQpz @('Just (MkDay '(2020,7,11)) >> '(UnMkDay Id, ToWeekYear Id,ToWeekDate Id)) ()#Val ((2020,7,11),28,(6,"Saturday")) predicate-typed create a  jY, week number, and the day of the week from three numbers passed in as year month and day/pz @(MkDayExtra '(1,2,3) >> 'Just Id >> Fst) ()Val 0001-02-03'pz @(L1 (Just (MkDayExtra '(1,2,3)))) 1Val 0001-02-03 pz @(MkDayExtra Id) (2019,12,30)Val (Just (2019-12-30,1,1))pz @(MkDayExtra Id) (1999,3,13)Val (Just (1999-03-13,10,6)) predicate-typed create a  jY, week number, and the day of the week from three numbers passed in as year month and day-pz @(MkDayExtra' Fst Snd Thd) (2019,99,99999) Val Nothing predicate-typed uncreate a  j returning year month and day6pz @(UnMkDay Id) (readNote "invalid day" "2019-12-30")Val (2019,12,30) predicate-typed create a  j6 from three int values passed in as year month and day#pz @(MkDay '(1,2,3) >> 'Just Id) ()Val 0001-02-03pz @('Just (MkDay '(1,2,3))) 1Val 0001-02-03pz @(MkDay Id) (2019,12,30)Val (Just 2019-12-30)pz @(MkDay Id) (1999,3,13)Val (Just 1999-03-13) predicate-typed create a  j6 from three int values passed in as year month and day(pz @(MkDay' Fst Snd Thd) (2019,99,99999) Val Nothing predicate-typed]A convenience method to match against many different datetime formats to find the first matchpz @(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") ()Val 2019-03-11 01:22:33pz @(ParseTimes LocalTime Fst Snd) (["%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")Val 2019-03-11 01:22:33npl @(Map (ParseTimes Day '["%Y-%m-%d", "%m/%d/%y", "%b %d %Y"] Id)) ["2001-01-01", "Jan 24 2009", "03/29/0x7"]?Error no match on (03/29/0x7) (Map(i=2, a="03/29/0x7") excnt=1)Fail "no match on (03/29/0x7)"mpl @(Map (ParseTimes Day '["%Y-%m-%d", "%m/%d/%y", "%b %d %Y"] Id)) ["2001-01-01", "Jan 24 2009", "03/29/07"]}Present [2001-01-01,2009-01-24,2007-03-29] (Map [2001-01-01,2009-01-24,2007-03-29] | ["2001-01-01","Jan 24 2009","03/29/07"])&Val [2001-01-01,2009-01-24,2007-03-29] predicate-typed]A convenience method to match against many different datetime formats to find the first match predicate-typed similar to 8pz @(ParseTimeP LocalTime "%F %T") "2019-05-24 05:19:59"Val 2019-05-24 05:19:59Ppz @("2019-05-24 05:19:59" >> ParseTimeP LocalTime "%F %T") (Right "never used")Val 2019-05-24 05:19:59/pl @(ParseTimeP TimeOfDay "%H:%M%S") "14:04:61"4Error ParseTimeP TimeOfDay (%H:%M%S) failed to parse5Fail "ParseTimeP TimeOfDay (%H:%M%S) failed to parse"6pl @(ParseTimeP UTCTime "%F %T") "1999-01-01 12:12:12"xPresent 1999-01-01 12:12:12 UTC (ParseTimeP UTCTime (%F %T) 1999-01-01 12:12:12 UTC | fmt=%F %T | "1999-01-01 12:12:12")Val 1999-01-01 12:12:12 UTC9pz @(ParseTimeP ZonedTime "%s%Q%z") "153014400.000+0530"Val 1974-11-07 05:30:00 +0530 predicate-typed similar to  k where t is the  l type, p is the datetime format and q) points to the content to parse keeping q) as we might want to extract from a tuple predicate-typed3type level expression representing a formatted timeYpz @(FormatTimeP "%F %T") (readNote @LocalTime "invalid localtime" "2019-05-24 05:19:59")Val "2019-05-24 05:19:59"Gpl @(FormatTimeP "%Y-%m-%d") (readNote @Day "invalid day" "2019-08-17")EPresent "2019-08-17" (FormatTimeP (%Y-%m-%d) 2019-08-17 | 2019-08-17)Val "2019-08-17" predicate-typedBtype level expression representing a formatted time similar to  m using a type level  to get the formatting string]pz @(FormatTimeP' Fst Snd) ("the date is %d/%m/%Y", readNote @Day "invalid day" "2019-05-24")Val "the date is 24/05/2019"                  None&',-.=>?@AHSUVXko Gpredicate-typed similar to  JM but uses the root message of the False predicate case as the failure messagepz @(GuardSimple IsLuhn) [1..4]6Fail "(IsLuhn map=[4,6,2,2] sum=14 ret=4 | [1,2,3,4])"pl @IsLuhn [1..4]5False (IsLuhn map=[4,6,2,2] sum=14 ret=4 | [1,2,3,4]) Val False"pz @(GuardSimple IsLuhn) [1,2,3,0] Val [1,2,3,0]&pz @(GuardSimple (Len > 30)) [1,2,3,0]Fail "(4 > 30)"1pl @(Map (GuardSimple (Lt 3) >> 'True)) [1 .. 10]lError (3 < 3) | (4 < 3) | (5 < 3) | (6 < 3) | (7 < 3) | (8 < 3) | (9 < 3) | (10 < 3) (Map(i=2, a=3) excnt=8)UFail "(3 < 3) | (4 < 3) | (5 < 3) | (6 < 3) | (7 < 3) | (8 < 3) | (9 < 3) | (10 < 3)"1pl @(Map (GuardSimple (Ge 1) >> 'True)) [1 .. 10]Present [True,True,True,True,True,True,True,True,True,True] (Map [True,True,True,True,True,True,True,True,True,True] | [1,2,3,4,5,6,7,8,9,10])7Val [True,True,True,True,True,True,True,True,True,True]1pl @(Map (GuardSimple (Lt 3) >> 'True)) [1 .. 10]lError (3 < 3) | (4 < 3) | (5 < 3) | (6 < 3) | (7 < 3) | (8 < 3) | (9 < 3) | (10 < 3) (Map(i=2, a=3) excnt=8)UFail "(3 < 3) | (4 < 3) | (5 < 3) | (6 < 3) | (7 < 3) | (8 < 3) | (9 < 3) | (10 < 3)" Hpredicate-typeduses  J but negates pOpl @(HeadFail "failedn" Id &&& (Len == 1 >> ExitWhen "ExitWhen" Id) >> Fst) [3]+Error ExitWhen (Guard | True | True | '(,))Fail "ExitWhen"Hpl @(Head &&& (Len == 1 >> Not Id >> ExitWhen "ExitWhen" Id) >> Fst) [3](Present 3 ((>>) 3 | {Fst 3 | (3,False)})Val 3Dpl @(Head &&& (Len == 1 >> ExitWhen "ExitWhen" (Not Id)) >> Fst) [3]'Present 3 ((>>) 3 | {Fst 3 | (3,True)})Val 32pl @(ExitWhen "ExitWhen" (Len /= 1) >> Head) [3,1]Error ExitWhen (Guard | [3,1])Fail "ExitWhen"0pl @(ExitWhen "ExitWhen" (Len /= 1) >> Head) [3]#Present 3 ((>>) 3 | {Head 3 | [3]})Val 3@pl @(ExitWhen "ExitWhen" (Len /= 1) >> Head >> Gt (20 -% 1)) [3]&True ((>>) True | {3 % 1 > (-20) % 1})Val TrueBpl @(ExitWhen "ExitWhen" (Len /= 1) >> Head >> Gt (20 -% 1)) [-23],False ((>>) False | {(-23) % 1 > (-20) % 1}) Val False6pl @(Map (ExitWhen "ExitWhen" (Gt 10) >> Gt 2)) [1..5]UPresent [False,False,True,True,True] (Map [False,False,True,True,True] | [1,2,3,4,5]) Val [False,False,True,True,True]5pl @(ExitWhen "err" (Len > 2) >> Map Succ) [12,15,16]Error err (Guard | [12,15,16]) Fail "err"/pl @(ExitWhen "err" (Len > 2) >> Map Succ) [12],Present [13] ((>>) [13] | {Map [13] | [12]})Val [13] Ipredicate-typed boolean guard?pl @(GuardBool (PrintF "bad length = %d" Len) (Len > 9)) [3..8](Error bad length = 6 (GuardBool (6 > 9))Fail "bad length = 6" Jpredicate-typedp7 is the predicate and on failure of the predicate runs prt$pz @(Guard "expected > 3" (Gt 3)) 17Val 17#pz @(Guard "expected > 3" (Gt 3)) 1Fail "expected > 3"1pz @(Guard (PrintF "%d not > 3" Id) (Gt 3)) (-99)Fail "-99 not > 3"4pl @(Map (Guard "someval" (Lt 3) >> 'True)) [1 ..10](Error someval(8) (Map(i=2, a=3) excnt=8)Fail "someval(8)"Cpl @(Guard "someval" (Len == 2) >> (ShowP Id &&& Id)) ([] :: [Int])Error someval (Guard | [])Fail "someval";pl @(Guard "someval" (Len == 2) >> (Id &&& ShowP Id)) [2,3]CPresent ([2,3],"[2,3]") ((>>) ([2,3],"[2,3]") | {'([2,3],"[2,3]")})Val ([2,3],"[2,3]")=pl @(Guard "someval" (Len == 2) >> (ShowP Id &&& Id)) [2,3,4]Error someval (Guard | [2,3,4])Fail "someval"4pl @(Map (Guard "someval" (Lt 3) >> 'True)) [1 ..10](Error someval(8) (Map(i=2, a=3) excnt=8)Fail "someval(8)"3pl @(Guard "oops" (Len > 2) >> Map Succ) [12,15,16]DPresent [13,16,17] ((>>) [13,16,17] | {Map [13,16,17] | [12,15,16]})Val [13,16,17],pl @(Guard "err" (Len > 2) >> Map Succ) [12]Error err (Guard | [12]) Fail "err"Lpl @(Guard (PrintF "err found len=%d" Len) (Len > 5) >> Map Succ) [12,15,16]*Error err found len=3 (Guard | [12,15,16])Fail "err found len=3" Kpredicate-typed leverages u. for repeating predicates (passthrough method)dpz @(GuardsN (PrintT "id=%d must be between 0 and 255, found %d" Id) 4 (0 <..> 0xff)) [121,33,7,256]0Fail "id=3 must be between 0 and 255, found 256"cpz @(GuardsN (PrintT "id=%d must be between 0 and 255, found %d" Id) 4 (0 <..> 0xff)) [121,33,7,44]Val [121,33,7,44]Rpl @(GuardsN (PrintT "guard(%d) %d is out of range" Id) 4 (0 <..> 0xff)) [1,2,3,4]Present [1,2,3,4] (Guards(4)) Val [1,2,3,4]Tpl @(GuardsN (PrintT "guard(%d) %d is out of range" Id) 4 (0 <..> 0xff)) [1,2,3,4,5])Error Guards:invalid length(5) expected 4*Fail "Guards:invalid length(5) expected 4"Ppl @(GuardsN (PrintT "guard(%d) %d is out of range" Id) 4 (0 <..> 0xff)) [1,2,3])Error Guards:invalid length(3) expected 4*Fail "Guards:invalid length(3) expected 4" npredicate-typedfif a predicate fails then then the corresponding symbol and value will be passed to the print functionpz @(GuardsDetail "%s invalid: found %d" '[ '("hours", Between 0 23 Id),'("minutes",Between 0 59 Id),'("seconds",Between 0 59 Id)]) [13,59,61] Fail "seconds invalid: found 61"pz @(GuardsDetail "%s invalid: found %d" '[ '("hours", Between 0 23 Id),'("minutes",Between 0 59 Id),'("seconds",Between 0 59 Id)]) [27,59,12]Fail "hours invalid: found 27"pz @(GuardsDetail "%s invalid: found %d" '[ '("hours", Between 0 23 Id),'("minutes",Between 0 59 Id),'("seconds",Between 0 59 Id)]) [23,59,12]Val [23,59,12] Mpredicate-typed leverages u. for repeating predicates (passthrough method)cpl @(BoolsN (PrintT "id=%d must be between 0 and 255, found %d" Id) 4 (0 <..> 0xff)) [121,33,7,256]FError Bool(3) [id=3 must be between 0 and 255, found 256] (256 <= 255)GFail "Bool(3) [id=3 must be between 0 and 255, found 256] (256 <= 255)"bpl @(BoolsN (PrintT "id=%d must be between 0 and 255, found %d" Id) 4 (0 <..> 0xff)) [121,33,7,44] True (Bools)Val True Npredicate-typedRboolean guard which checks a given a list of predicates against the list of valuesVpl @(BoolsQuick "abc" '[Between 0 23 Id, Between 0 59 Id, Between 0 59 Id]) [12,13,14] True (Bools)Val Truekpl @(BoolsQuick (PrintT "id=%d val=%d" Id) '[Between 0 23 Id, Between 0 59 Id, Between 0 59 Id]) [12,13,14] True (Bools)Val Truekpl @(BoolsQuick (PrintT "id=%d val=%d" Id) '[Between 0 23 Id, Between 0 59 Id, Between 0 59 Id]) [12,13,99]&Error Bool(2) [id=2 val=99] (99 <= 59)'Fail "Bool(2) [id=2 val=99] (99 <= 59)" Opredicate-typedRboolean guard which checks a given a list of predicates against the list of values|pl @(Bools '[ '(W "hh",Between 0 23 Id), '(W "mm",Between 0 59 Id), '(PrintT "<<<%d %d>>>" Id,Between 0 59 Id) ]) [12,93,14]Error Bool(1) [mm] (93 <= 59)Fail "Bool(1) [mm] (93 <= 59)"|pl @(Bools '[ '(W "hh",Between 0 23 Id), '(W "mm",Between 0 59 Id), '(PrintT "<<<%d %d>>>" Id,Between 0 59 Id) ]) [12,13,94]%Error Bool(2) [<<<2 94>>>] (94 <= 59)&Fail "Bool(2) [<<<2 94>>>] (94 <= 59)"|pl @(Bools '[ '(W "hh",Between 0 23 Id), '(W "mm",Between 0 59 Id), '(PrintT "<<<%d %d>>>" Id,Between 0 59 Id) ]) [12,13,14] True (Bools)Val Trueqpl @(Bools '[ '("hours",Between 0 23 Id), '("minutes",Between 0 59 Id), '("seconds",Between 0 59 Id)]) [12,13,14] True (Bools)Val Trueqpl @(Bools '[ '("hours",Between 0 23 Id), '("minutes",Between 0 59 Id), '("seconds",Between 0 59 Id)]) [12,60,14]"Error Bool(1) [minutes] (60 <= 59)#Fail "Bool(1) [minutes] (60 <= 59)"tpl @(Bools '[ '("hours",Between 0 23 Id), '("minutes",Between 0 59 Id), '("seconds",Between 0 59 Id)]) [12,60,14,20](Error Bools:invalid length(4) expected 3)Fail "Bools:invalid length(4) expected 3" Ppredicate-typedGuardsQuick contain a type level list of conditions and one of matching values: on no match will fail using the first parameterZpz @(GuardsQuick (PrintT "arg %d failed with value %d" Id) '[Gt 4, Ge 3, Same 4]) [17,3,5] Fail "arg 2 failed with value 5"]pz @(GuardsQuick (PrintT "arg %d failed with value %d" Id) '[Gt 4, Ge 3, Same 4]) [17,3,5,99]*Fail "Guards:invalid length(4) expected 3"wpl @(GuardsQuick (PrintT "guard(%d) %d is out of range" Id) '[Between 0 11 Id, Between 1 4 Id,Between 3 5 Id]) [10,2,5]Present [10,2,5] (Guards(3)) Val [10,2,5]pl @(GuardsQuick (PrintT "guard(%d) %d is out of range" Id) '[Between 1 31 Id, Between 1 12 Id, Between 1990 2050 Id]) [31,11,1999] Present [31,11,1999] (Guards(3))Val [31,11,1999]~pl @(GuardsQuick (PrintT "guard(%d) %d is out of range" Id) '[Between 1 31 Id, Between 1 12 Id, Between 1990 2050 Id]) [31,11])Error Guards:invalid length(2) expected 3*Fail "Guards:invalid length(2) expected 3"pl @(GuardsQuick (PrintT "guard(%d) %d is out of range" Id) '[Between 1 31 Id, Between 1 12 Id, Between 1990 2050 Id]) [31,13,1999]/Error guard(1) 13 is out of range (Guard(1) 13)"Fail "guard(1) 13 is out of range"pl @(GuardsQuick (PrintT "guard(%d) %d is out of range" Id) '[Between 1 31 Id, Between 1 12 Id, Between 1990 2050 Id]) [0,44,1999]-Error guard(0) 0 is out of range (Guard(0) 0)!Fail "guard(0) 0 is out of range"pl @(GuardsQuick (PrintT "guard(%d) %d is out of range" Id) '[Between 1 31 Id, Between 1 12 Id, Between 1990 2050 Id]) [31,11,2000,1,2])Error Guards:invalid length(5) expected 3*Fail "Guards:invalid length(5) expected 3"cpl @(GuardsQuick (PrintT "guard(%d) err %03d" Id) '[W 'True, Ge 12, W 'False, Lt 2]) [1,2,-99,-999]#Error guard(1) err 002 (Guard(1) 2)Fail "guard(1) err 002"^pl @(GuardsQuick (PrintT "guard(%d) err %03d" Id) '[W 'True, Ge 12, W 'False, Lt 2]) [1,2,-99])Error Guards:invalid length(3) expected 4*Fail "Guards:invalid length(3) expected 4"ipl @(GuardsQuick (PrintT "guard(%d) err %03d" Id) '[W 'True, Ge 12, W 'True, Lt 2]) [1,22,-99,-999,1,1,2])Error Guards:invalid length(7) expected 4*Fail "Guards:invalid length(7) expected 4" Qpredicate-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 listprtP receives (Int,a) as input which is the position and value if there is a failureGpz @(Guards '[ '("arg1 failed",Gt 4), '("arg2 failed", Same 4)]) [17,4] Val [17,4]Gpz @(Guards '[ '("arg1 failed",Gt 4), '("arg2 failed", Same 5)]) [17,4]Fail "arg2 failed"Hpz @(Guards '[ '("arg1 failed",Gt 99), '("arg2 failed", Same 4)]) [17,4]Fail "arg1 failed"epz @(Guards '[ '(PrintT "arg %d failed with value %d" Id,Gt 4), '(PrintT "%d %d" Id, Same 4)]) [17,3] Fail "1 3"pz @(Msg "isbn10" (Resplit "-") >> Concat >> 'Just Unsnoc >> Map (ReadP Int (Singleton Id)) *** If (Singleton Id ==~ "X") 10 (ReadP Int (Singleton Id)) >> ZipWith (Fst * Snd) (1...10 >> Reverse) (Fst +: Snd) >> Sum >> Guard ("mod 0 oops") (Id `Mod` 11 == 0)) "0-306-40614-X"Fail "mod 0 oops"pz @(Resplit "-" >> Concat >> 'Just Unsnoc >> Map (ReadP Int (Singleton Id)) *** If (Singleton Id ==~ "X") 10 (ReadP Int (Singleton Id)) >> ZipWith (Fst * Snd) (1...10 >> Reverse) (Fst +: Snd) >> Sum >> Guard ("mod 0 oops") (Id `Mod` 11 == 0)) "0-306-40611-X"Val 132pz @(Msg "isbn13" (Resplit "-") >> Concat >> Map (ReadP Int (Singleton Id)) >> ZipWith (Fst * Snd) (Cycle 13 [1,3] >> Reverse) Id >> Sum >> '(Id,Id `Mod` 10) >> Guard (PrintT "sum=%d mod 10=%d" Id) (Snd == 0)) "978-0-306-40615-7" Val (100,0)pz @(Resplit "-" >> Concat >> Map (ReadP Int (Singleton Id)) >> ZipWith (Fst * Snd) (Cycle 13 [1,3] >> Reverse) Id >> Sum >> '(Id,Id `Mod` 10) >> Guard (PrintT "sum=%d mod 10=%d" Id) (Snd == 0)) "978-0-306-40615-8"Fail "sum=101 mod 10=1"pz @(Do '[Resplit "-", Concat, ZipWith (Fst * Snd) (Cycle 13 [1,3]) (Map (ReadP Int (Singleton Id))), Sum, Guard (PrintF "%d is not evenly divisible by 10" Id) (Id `Mod` 10 == 0)]) "978-0-7167-0344-9"(Fail "109 is not evenly divisible by 10"pz @(Do '[Resplit "-", Concat, ZipWith (Fst * Snd) (Cycle 13 [1,3]) (Map (ReadP Int (Singleton Id))), Sum, Guard (PrintF "%d is not evenly divisible by 10" Id) (Id `Mod` 10 == 0)]) "978-0-7167-0344-0"Val 100 Rpredicate-typedlike  T5 but allows you to use the value in the error messageapl @(Case'' (PrintF "no match for %03d" Id) '[Same 1, Same 2, Same 3] '["eq1","eq2","eq3"] Id) 15.Error no match for 015 (Case:otherwise failed)Fail "no match for 015"`pl @(Case'' (PrintF "no match for %03d" Id) '[Same 1, Same 2, Same 3] '["eq1","eq2","eq3"] Id) 2!Present "eq2" (Case(0) "eq2" | 2) Val "eq2"rpl @(Case'' (PrintF "no match for %04d" Id) '[Between 0 5 Id, Same 6, Between 7 10 Id] '[ 'LT, 'EQ, 'GT] Id) (-12)/Error no match for -012 (Case:otherwise failed)Fail "no match for -012" Spredicate-typedlike  T- but uses a generic error message (skips the e parameter)@pl @(Case' '[Same 1, Same 2, Same 3] '["eq1","eq2","eq3"] Id) 151Error Case:no match (Case:otherwise failed:Proxy)Fail "Case:no match" Tpredicate-typedtries to match the value r with a condition in ps. and if there is a match calls the associated qs entry else run eOpl @(Case (Snd >> FailP "xx") '[Gt 3, Lt 2, Same 3] '["gt3","lt2","eq3"] Id) 15'Present "gt3" (Case(0 of 2) "gt3" | 15) Val "gt3"Npl @(Case (Snd >> FailP "xx") '[Gt 3, Lt 2, Same 3] '["gt3","lt2","eq3"] Id) 1!Present "lt2" (Case(0) "lt2" | 1) Val "lt2"Npl @(Case (Snd >> FailP "xx") '[Gt 3, Lt 2, Same 3] '["gt3","lt2","eq3"] Id) 3!Present "eq3" (Case(0) "eq3" | 3) Val "eq3"Ypl @(Case (Snd >> FailP "no match") '[Same 1, Same 2, Same 3] '["eq1","eq2","eq3"] Id) 15,Error no match (Case:otherwise failed:Proxy)Fail "no match"ypl @(Case (Fail (Snd >> UnproxyT) (PrintF "no match for %03d" Fst)) '[Same 1, Same 2, Same 3] '["eq1","eq2","eq3"] Id) 15.Error no match for 015 (Case:otherwise failed)Fail "no match for 015"Gpl @(Case "other" '[Same 1, Same 2, Same 3] '["eq1","eq2","eq3"] Id) 15&Present "other" (Case(0) "other" | 15) Val "other"]pl @(Case (ShowP Fst >> Id <> Id <> Id) '[Same 1, Same 2, Same 3] '["eq1","eq2","eq3"] Id) 15(Present "151515" (Case(0) "151515" | 15) Val "151515" opredicate-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 epz @(Case (FailT _ "asdf") '[Lt 4,Lt 10,Same 50] '[PrintF "%d is lt4" Id, PrintF "%d is lt10" Id, PrintF "%d is same50" Id] Id) 50Val "50 is same50"pz @(Case (FailT _ "asdf") '[Lt 4,Lt 10,Same 50] '[PrintF "%d is lt4" Id, PrintF "%d is lt10" Id, PrintF "%d is same50" Id] Id) 9Val "9 is lt10"pz @(Case (FailT _ "asdf") '[Lt 4,Lt 10,Same 50] '[PrintF "%d is lt4" Id, PrintF "%d is lt10" Id, PrintF "%d is same50" Id] Id) 3Val "3 is lt4"pz @(Case (FailT _ "asdf") '[Lt 4,Lt 10,Same 50] '[PrintF "%d is lt4" Id, PrintF "%d is lt10" Id, PrintF "%d is same50" Id] Id) 99 Fail "asdf"pz @(Case (FailS "asdf" >> Snd >> UnproxyT) '[Lt 4,Lt 10,Same 50] '[PrintF "%d is lt4" Id, PrintF "%d is lt10" Id, PrintF "%d is same50" Id] Id) 99 Fail "asdf"Epz @(Case (FailT _ "x") '[Same "a",Same "b"] '["hey","there"] Id) "b" Val "there"Gpz @(Case (FailT _ "x") '[Id == "a",Id == "b"] '["hey","there"] Id) "a" Val "hey"Epz @(Case (FailT _ "x") '[Same "a",Same "b"] '["hey","there"] Id) "c"Fail "x" Upredicate-typedsimilar to an if statement: if p then run q else run r=pz @(If (Gt 4) "greater than 4" "less than or equal to 4") 10Val "greater than 4"<pz @(If (Gt 4) "greater than 4" "less than or equal to 4") 0Val "less than or equal to 4"dpz @(If (Snd == "a") '("xxx",Fst + 13) (If (Snd == "b") '("yyy",Fst + 7) (FailT _ "oops"))) (99,"b")Val ("yyy",106):pl @(If (Len > 2) (Map Succ) (FailS "someval")) [12,15,16](Present [13,16,17] (If 'True [13,16,17])Val [13,16,17]3pl @(Map (If (Lt 3) 'True (FailT _ "err"))) [1..10]$Error err(8) (Map(i=2, a=3) excnt=8) Fail "err(8)"7pl @(Map (If (Lt 3) 'True (FailT _ "someval"))) [1..10](Error someval(8) (Map(i=2, a=3) excnt=8)Fail "someval(8)")pl @(Map (If (Lt 3) 'True 'False)) [1..5]WPresent [True,True,False,False,False] (Map [True,True,False,False,False] | [1,2,3,4,5])!Val [True,True,False,False,False]Cpl @(If (Gt 4) (Fail (Hole _) (PrintF "failing with %d" Id)) ()) 45Error failing with 45 (If True)Fail "failing with 45"Hpl @(If (Gt 4) (Fail (Hole _) (PrintF "failing with %d" Id)) (Id * 7)) 3Present 21 (If 'False 21)Val 21\pl @(If (Gt 4) (Fail (Hole _) (PrintF "failing with %d" Id)) (Id * 7 >> ShowP Id >> Ones)) 3'Present ["2","1"] (If 'False ["2","1"]) Val ["2","1"]Ypl @(If (Gt 4) (Fail (Hole _) (PrintF "failing with %d" Id)) (ShowP (Id * 7) >> Ones)) 19Error failing with 19 (If True)Fail "failing with 19" G H I J K L M N O P Q R S T U U T S R Q P J H G K L I O N MNone&',-.;=>?@AHSUVXko٘ predicate-typedconverts a string  value to title casepz @ToTitle "HeLlO wOrld!"Val "Hello world!"Tdata Color = Red | White | Blue | Green | Black deriving (Show,Eq,Enum,Bounded,Read)%pz @(ToTitle >> ReadP Color Id) "red"Val Red predicate-typedconverts a string  value to upper casepz @ToUpper "HeLlO wOrld!"Val "HELLO WORLD!" predicate-typedconverts a string  value to lower casepz @ToLower "HeLlO wOrld!"Val "hello world!" predicate-typed:predicate for determining if the string is all latin chars predicate-typed:predicate for determining if the string has all separators predicate-typed;predicate for determining if the string is all octal digits predicate-typed9predicate for determining if the string is all hex digitspz @IsHexDigitAll "01efA"Val Truepz @IsHexDigitAll "01egfA" Val False predicate-typed;predicate for determining if a string has all control chars predicate-typed9predicate for determining if a string has all punctuation predicate-typed5predicate for determining if the string is all spacespz @IsSpaceAll "213G" Val Falsepz @IsSpaceAll " "Val Truepz @IsSpaceAll ""Val True predicate-typed5predicate for determining if the string is all digitspz @IsDigitAll "213G" Val Falsepz @IsDigitAll "929"Val True predicate-typed6predicate for determining if a string is all uppercase predicate-typed6predicate for determining if a string is all lowercasepz @IsLowerAll "abc"Val Truepz @IsLowerAll "abcX" Val Falsepz @IsLowerAll (T.pack "abcX") Val Falsepz @IsLowerAll "abcdef213" Val Falsepz @IsLowerAll ""Val True ppredicate-typed(a predicate for determining if a string # belongs to the given character set3pl @('Just Uncons >> IsUpper &* IsLowerAll) "AbcdE">False ((>>) False | {True (&*) False | (IsLowerAll | "bcdE")}) Val False3pl @('Just Uncons >> IsUpper &* IsLowerAll) "Abcde"#True ((>>) True | {True (&*) True})Val True3pl @('Just Uncons >> IsUpper &* IsLowerAll) "xbcde"8False ((>>) False | {False (&*) True | (IsUpper | "x")}) Val False/pl @('Just Uncons >> IsUpper &* IsLowerAll) "X"#True ((>>) True | {True (&*) True})Val Truepz @( '(IsControlAll, IsLatin1All , IsHexDigitAll , IsOctDigitAll , IsDigitAll , IsPunctuationAll , IsSeparatorAll , IsSpaceAll)) "abc134"3Val (False,True,True,False,False,False,False,False)Spl @(SplitAts [1,2,10] Id >> Para '[IsLowerAll, IsDigitAll, IsUpperAll]) "abdefghi"hPresent [True,False,False] ((>>) [True,False,False] | {Para(0) [True,False,False] | ["a","bd","efghi"]})Val [True,False,False]\pl @(SplitAts [1,2,10] Id >> BoolsQuick "" '[IsLowerAll, IsDigitAll, IsUpperAll]) "a98efghi"<Error Bool(2) [] (IsUpperAll | "efghi") (["a","98","efghi"])*Fail "Bool(2) [] (IsUpperAll | \"efghi\")"jpl @(SplitAts [1,2,10] Id >> BoolsQuick "" '[IsLowerAll, IsDigitAll, IsUpperAll || IsLowerAll]) "a98efghi"True ((>>) True | {Bools})Val Truejpl @(SplitAts [1,2,10] Id >> BoolsQuick "" '[IsLowerAll, IsDigitAll, IsUpperAll || IsLowerAll]) "a98efgHi"iError Bool(2) [] (False || False | (IsUpperAll | "efgHi") || (IsLowerAll | "efgHi")) (["a","98","efgHi"])YFail "Bool(2) [] (False || False | (IsUpperAll | \"efgHi\") || (IsLowerAll | \"efgHi\"))" predicate-typedpredicate similar to  q predicate-typedpredicate similar to  r predicate-typedpredicate similar to  s predicate-typedpredicate similar to  tpz @IsHexDigit 'A'Val Truepz @IsHexDigit 'g' Val False predicate-typedpredicate similar to  u predicate-typedpredicate similar to  v predicate-typedpredicate similar to  wpz @IsSpace '\t'Val Truepz @IsSpace ' 'Val Truepz @IsSpace 'x' Val False predicate-typedpredicate similar to  xpz @IsDigit 'g' Val Falsepz @IsDigit '9'Val True predicate-typedpredicate similar to  y predicate-typedpredicate similar to  zpz @IsLower 'X' Val Falsepz @IsLower '1' Val Falsepz @IsLower 'a'Val True {predicate-typedMa predicate for determining if a character belongs to the given character setopz @(Map '(IsControl, IsLatin1, IsHexDigit, IsOctDigit, IsDigit, IsPunctuation, IsSeparator, IsSpace)) "abc134"Val [(False,True,True,False,False,False,False,False),(False,True,True,False,False,False,False,False),(False,True,True,False,False,False,False,False),(False,True,True,True,True,False,False,False),(False,True,True,True,True,False,False,False),(False,True,True,True,True,False,False,False)] predicate-typed.extracts the first character from a non empty  : shorthand for  pz @(C "aBc") ()Val 'a' predicate-typed.extracts the first character from a non empty  pz @(Char1 "aBc") ()Val 'a'  None%&',-.;=>?@AHSUVXkos predicate-typed create a  |3 for type @t with all bits set to zero: similar to  }pz @(ZeroBits Int) ()Val 0 predicate-typed create a  | for type t with the bit at .p@ and all the others set to zero: similar to  ~pz @(Bit Int Id) 0Val 1pz @(Bit Int Id) 3Val 8 predicate-typedcount number of bits at p : similar to  pz @(PopCount Id) 7Val 3pz @(PopCount Id) 8Val 1pz @(PopCount Id) (-7)Val (-3) predicate-typedtest the bit at p using q : similar to flipped version of  pz @(TestBit 2 Id) 7Val Truepz @(TestBit 2 Id) 8 Val False predicate-typedcomplement the bit at p using q : similar to flipped version of  pz @(BitComplement 1 Id) 7Val 5 predicate-typedclear the bit at p using q : similar to flipped version of  pz @(BitClear 2 Id) 7Val 3 predicate-typedset the bit at p using q : similar to flipped version of  pz @(BitSet 0 Id) 8Val 9 predicate-typedrotate right by p using q : similar to flipped version of  pz @(BitRotateR 2 Id) 7Val 1 predicate-typedrotate left by p using q : similar to flipped version of  pz @(BitRotateL 2 Id) 7Val 28 predicate-typed rotate by p using q : similar to flipped version of  pz @(BitRotate 2 Id) 7Val 28 predicate-typedshift right by p using q : similar to flipped version of  pz @(BitShiftR 1 Id) 123Val 61 predicate-typedshift left by p using q : similar to flipped version of  pz @(BitShiftL 1 Id) 123Val 246 predicate-typed shift by p using q : similar to flipped version of  pz @(BitShift 1 7) ()Val 14pz @(BitShift 1 Id) 123Val 246 predicate-typedbitwise xor similar to  pz @(344 .^. 123) ()Val 291 predicate-typedbitwise or similar to  pz @(344 .|. 123) ()Val 379pz @(Fst .|. Snd) (124,33)Val 125 predicate-typedbitwise and similar to  pz @(344 .&. 123) ()Val 88   5 5 7Noneb  % !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~cdgefmnopqrstyz{|}     RSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     _`abcdefghijkl !"#$%&'()*+,-./pqrstuvwxyz{|}~   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHI:;<=>?LMNOPQRSTUVWXYZ[|}~+,-./0123456789:;<=>?@ABCD         G H I J K L M N O P Q R S T U !None,-.=>?HSUVX  $predicate-typedip5 type for reading one of many date time formats from  % &predicate-typedip0 type for reading one of many date formats from  ' .predicate-typedfmt# type for formatting an ip6 address /predicate-typedop4 type for validating an ip6 address using predicates 0predicate-typedip# type for reading in an ip6 address 1predicate-typed%regular expression for an ip4 address 2predicate-typedregular expression for an octet 3predicate-typedfmt# type for formatting an ip4 address 4predicate-typedop1 type for validating an ip4 address using a guard 5predicate-typedop5 type for validating an ip4 address using a predicate 6predicate-typedip> type for reading in an ip4 address using a regular expression 7predicate-typedip# type for reading in an ip4 address 8predicate-typed%regular expression for an ip4 address 9predicate-typed'regular expression for a time component :predicate-typedfmt type for formatting the time ;predicate-typedop- type for validating the time using predicate <predicate-typedop+ type for validating the time using a guard =predicate-typedip type for reading in time >predicate-typedfmt- type for formatting the ssn compatible with  @ ?predicate-typedop type for validating a ssn @predicate-typedip type for reading in a ssn Apredicate-typedfmt2 type for formatting the date time compatible ith  B Bpredicate-typedip type for reading in a date time Cpredicate-typedfmt) type for formatting a credit card using ns as the format Dpredicate-typedop8 type for validating a credit card number by check digit Epredicate-typedipG type for converting a credit card number to a list of singleton digits(   ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E( & ' % $ B A # " !  = < ; : 9 E D C  @ ? > 7 6 4 5 3 2 8 1 0 / . - , + * ) ("None&'-.>HXkK Fpredicate-typed creates a 66 refinement type8$$(refinedTH 123) :: Refined OL (Between 100 125 Id) Int Refined 123 :>$$(refinedTH 99) :: Refined OL (Between 100 125 Id) Int  interactive:8:4: error: * refinedTH: predicate failed with False (100 <= 99) * In the Template Haskell splice $$(refinedTH 99) In the expression: $$(refinedTH 99) :: Refined OL (Between 100 125 Id) Int 9$$(refinedTH 123) :: Refined OAN (Between 100 125 Id) Int Refined 123 Hpredicate-typed creates a )) refinement type>$$(refined2TH 100) :: Refined2 OAN Id (Between 100 125 Id) IntRefined2 100 100 @>$$(refined2TH 99) :: Refined2 OAN Id (Between 100 125 Id) Int  interactive}:127:4: error: * Step 2. False Boolean Check(op) | {100 <= 99} *** Step 1. Success Initial Conversion(ip) (99) *** P Id 99 *** Step 2. False Boolean Check(op) *** Present False 100 <= 99 | +- P Id 99 | +- P '100 | `- P '125 * In the Template Haskell splice $$(refined2TH 99) In the expression: $$(refined2TH 99) :: Refined2 OAN Id (Between 100 125 Id) Int Ipredicate-typed creates a )) refinement type using IO Jpredicate-typed creates a (( refinement typeA$$(refined3TH 100) :: Refined3 OAN Id (Between 100 125 Id) Id IntRefined3 100 100 C>$$(refined3TH 99) :: Refined3 OAN Id (Between 100 125 Id) Id Int  interactive:127:4: error: * Step 2. False Boolean Check(op) | {100 <= 99} *** Step 1. Success Initial Conversion(ip) (99) *** P Id 99 *** Step 2. False Boolean Check(op) *** Present False 100 <= 99 | +- P Id 99 | +- P '100 | `- P '125 * In the Template Haskell splice $$(refined3TH 99) In the expression: $$(refined3TH 99) :: Refined3 OAN Id (Between 100 125 Id) Id Int $$(refined3TH @OL @(Resplit "\\." >> Map (ReadP Int Id)) @(All (0 <..> 0xff) && Len == 4) @(PrintL 4 "%03d.%03d.%03d.%03d" Id) "200.2.3.4")&Refined3 [200,2,3,4] "200.002.003.004" Kpredicate-typed creates a (( refinement type using IO Lpredicate-typed creates a  refinement type>$$(refined5TH 100) :: Refined5 OAN Id (Between 100 125 Id) Int Refined5 100 @>$$(refined5TH 99) :: Refined5 OAN Id (Between 100 125 Id) Int  interactive}:127:4: error: * Step 2. False Boolean Check(op) | {100 <= 99} *** Step 1. Success Initial Conversion(ip) (99) *** P Id 99 *** Step 2. False Boolean Check(op) *** Present False 100 <= 99 | +- P Id 99 | +- P '100 | `- P '125 * In the Template Haskell splice $$(refined5TH 99) In the expression: $$(refined5TH 99) :: Refined5 OAN Id (Between 100 125 Id) Int Mpredicate-typed creates a  refinement type using IO F G H I J K L M F G H I J K L M&NoneK  % !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~cdgefmnopqrstyz{|}     RSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     _`abcdefghijkl !"#$%&'()*+,-./pqrstuvwxyz{|}~   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHI:;<=>?LMNOPQRSTUVWXYZ[|}~+,-./0123456789:;<=>?@ABCD         G H I J K L M N O P Q R S T U F G H I J K L M#None,-.=>?HSUVXs Qpredicate-typed;take any valid Read/Show instance and turn it into a valid K:m + Data.Ratio.newRefined3P (readshow @OZ @Rational) "13 % 3""Right (Refined3 (13 % 3) "13 % 3")/newRefined3P (readshow @OZ @Rational) "13x % 3"JLeft Step 1. Failed Initial Conversion(ip) | ReadP Ratio Integer (13x % 3)CnewRefined3P (readshow' @OZ @Rational @(3 % 1 <..> 5 % 1)) "13 % 3""Right (Refined3 (13 % 3) "13 % 3")MnewRefined3P (Proxy @(ReadShow' OZ Rational (11 -% 2 <..> 3 -% 1))) "-13 % 3"(Right (Refined3 ((-13) % 3) "(-13) % 3")FnewRefined3P (Proxy @(ReadShow' OZ Rational (Id > (15 % 1)))) "13 % 3"-Left Step 2. False Boolean Check(op) | FalseP{newRefined3P (Proxy @(ReadShow' OL Rational (Msg (PrintF "invalid=%3.2f" (FromRational Double)) (Id > (15 % 1))))) "13 % 3"ELeft Step 2. False Boolean Check(op) | {invalid=4.33 13 % 3 > 15 % 1}FnewRefined3P (Proxy @(ReadShow' OZ Rational (Id > (11 % 1)))) "13 % 3"-Left Step 2. False Boolean Check(op) | FalsePFnewRefined3P (readshow @OZ @UTCTime) "2018-10-19 14:53:11.5121359 UTC"RRight (Refined3 2018-10-19 14:53:11.5121359 UTC "2018-10-19 14:53:11.5121359 UTC"):m + Data.Aeson:newRefined3P (readshow @OZ @Value) "String \"jsonstring\"">Right (Refined3 (String "jsonstring") "String \"jsonstring\"")1newRefined3P (readshow @OZ @Value) "Number 123.4".Right (Refined3 (Number 123.4) "Number 123.4") Spredicate-typedSconvert a string from a given base 'i' and store it internally as a base 'j' string+newRefined3P (Proxy @(BaseIJ OZ 16 2)) "fe" Right (Refined3 "11111110" "fe"),newRefined3P (Proxy @(BaseIJ OZ 16 2)) "fge"<Left Step 1. Failed Initial Conversion(ip) | invalid base 16EnewRefined3P (Proxy @(BaseIJ' OL 16 2 (ReadBase Int 2 < 1000))) "ffe"4Left Step 2. False Boolean Check(op) | {4094 < 1000} Upredicate-typed noop false Wpredicate-typed noop true Xpredicate-typed Luhn check)newRefined3P (Proxy @(LuhnT OZ 4)) "1230"!Right (Refined3 [1,2,3,0] "1230"))newRefined3P (Proxy @(LuhnT OL 4)) "1234"hLeft Step 2. False Boolean Check(op) | {True && False | (IsLuhn map=[4,6,2,2] sum=14 ret=4 | [1,2,3,4])}| uses builtin  \predicate-typedTconvert a string from a given base 'i' and store it internally as an base 10 integer newRefined3P (base16 @OZ) "00fe"Right (Refined3 254 "fe")4newRefined3P (basen' @OZ @16 @(100 <..> 400)) "00fe"Right (Refined3 254 "fe")GnewRefined3P (basen' @OZ @16 @(GuardSimple (Id < 400) >> 'True)) "f0fe"5Left Step 2. Failed Boolean Check(op) | (61694 < 400)ZnewRefined3P (basen' @OZ @16 @(GuardBool (PrintF "oops bad hex=%d" Id) (Id < 400))) "f0fe":Left Step 2. Failed Boolean Check(op) | oops bad hex=616940newRefined3P (basen' @OL @16 @(Id < 400)) "f0fe"4Left Step 2. False Boolean Check(op) | {61694 < 400} ^predicate-typedvalidate isbn13-newRefined3P (isbn13 @OZ) "978-0-306-40615-7"=Right (Refined3 [9,7,8,0,3,0,6,4,0,6,1,5,7] "978030640615-7")-newRefined3P (isbn13 @OZ) "978-0-306-40615-8"8Left Step 2. Failed Boolean Check(op) | sum=101 mod 10=1 `predicate-typedvalidate isbn10)newRefined3P (isbn10 @OZ) "0-306-40611-X"7Right (Refined3 ([0,3,0,6,4,0,6,1,1],10) "030640611-X"))newRefined3P (isbn10 @OZ) "0-306-40611-9"2Left Step 2. Failed Boolean Check(op) | mod 0 oops fpredicate-typed'read in an ipv4 address and validate it%newRefined3P (ip4 @OZ) "001.223.14.1"/Right (Refined3 [1,223,14,1] "001.223.014.001")'newRefined3P (ip4 @OL) "001.223.14.999"LLeft Step 2. Failed Boolean Check(op) | octet 3 out of range 0-255 found 999)newRefined3P (ip4 @OZ) "001.223.14.999.1"KLeft Step 2. Failed Boolean Check(op) | Guards:invalid length(5) expected 4%newRefined3P (ip4 @OL) "001.257.14.1"LLeft Step 2. Failed Boolean Check(op) | octet 1 out of range 0-255 found 257 lpredicate-typedread in an ssn$newRefined3P (ssn @OZ) "134-01-2211"+Right (Refined3 [134,1,2211] "134-01-2211")$newRefined3P (ssn @OL) "666-01-2211"vLeft Step 2. Failed Boolean Check(op) | Bool(0) [number for group 0 invalid: found 666] (True && False | (666 /= 666))$newRefined3P (ssn @OL) "667-00-2211"^Left Step 2. Failed Boolean Check(op) | Bool(1) [number for group 1 invalid: found 0] (1 <= 0) rpredicate-typedcredit card with luhn algorithm)newRefined3P (luhn11 @OZ) "1234-5678-901":Left Step 2. Failed Boolean Check(op) | invalid checkdigit)newRefined3P (luhn11 @OZ) "1234-5678-903"8Right (Refined3 [1,2,3,4,5,6,7,8,9,0,3] "1234-5678-903")'pz @(Luhnip >> Luhnop 11) "79927398713"Val True'pz @(Luhnip >> Luhnop 10) "79927398713"&Fail "expected 10 digits but found 11" vpredicate-typedread in a valid datetime=newRefined3P (datetime1 @OL @LocalTime) "2018-09-14 02:57:04":Right (Refined3 2018-09-14 02:57:04 "2018-09-14 02:57:04")=newRefined3P (datetime1 @OL @LocalTime) "2018-09-99 12:12:12"YLeft Step 1. Failed Initial Conversion(ip) | ParseTimeP LocalTime (%F %T) failed to parse xpredicate-typedread in a time and validate it!newRefined3P (hms @OL) "23:13:59"&Right (Refined3 [23,13,59] "23:13:59")!newRefined3P (hms @OL) "23:13:60"ALeft Step 2. Failed Boolean Check(op) | seconds invalid: found 60!newRefined3P (hms @OL) "26:13:59"?Left Step 2. Failed Boolean Check(op) | hours invalid: found 26 predicate-typed8ensures that two numbers are in a given range (emulates 66)%newRefined3P (between @OZ @10 @16) 14Right (Refined3 14 14)%newRefined3P (between @OZ @10 @16) 17-Left Step 2. False Boolean Check(op) | FalseP&newRefined3P (between @OAN @10 @16) 17 1Left Step 2. False Boolean Check(op) | {17 <= 16}3*** Step 1. Success Initial Conversion(ip) (17) ***P Id 17'*** Step 2. False Boolean Check(op) ***False 17 <= 16| +- P Id 17|+- P '10|`- P '16= N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  = v p o m n x i j g h s t r u q Y X w l k y e f z c d { a b | _ ` } ] ^ ~  \ [ S R Q P O N Z W V U T$None,-.=>?HSUVX predicate-typed Luhn check*newRefined2 @OZ @Luhnip @(Luhnop 4) "1230"!Right (Refined2 [1,2,3,0] "1230")*newRefined2 @OL @Luhnip @(Luhnop 4) "1234":Left Step 2. Failed Boolean Check(op) | invalid checkdigit| uses builtin Sconvert a string from a given base 'i' and store it internally as a base 'j' string,newRefined2 @OZ @(BaseIJip 16 2) @'True "fe" Right (Refined2 "11111110" "fe")-newRefined2 @OZ @(BaseIJip 16 2) @'True "fge"<Left Step 1. Failed Initial Conversion(ip) | invalid base 16?newRefined2 @OL @(BaseIJip 16 2) @(ReadBase Int 2 < 1000) "ffe"4Left Step 2. False Boolean Check(op) | {4094 < 1000} predicate-typedTconvert a string from a given base 'i' and store it internally as an base 10 integer0newRefined2 @OZ @(ReadBase Int 16) @'True "00fe"Right (Refined2 254 "00fe")?newRefined2 @OZ @(ReadBase Int 16) @(Between 100 400 Id) "00fe"Right (Refined2 254 "00fe")LnewRefined2 @OZ @(ReadBase Int 16) @(GuardSimple (Id < 400) >> 'True) "f0fe"5Left Step 2. Failed Boolean Check(op) | (61694 < 400)]newRefined2 @OL @(ReadBase Int 16) @(Id < 400) "f0fe" -- todo: why different parens vs braces4Left Step 2. False Boolean Check(op) | {61694 < 400} predicate-typedvalidate isbn13-newRefined2P (isbn13 @OZ) "978-0-306-40615-7"@Right (Refined2 [9,7,8,0,3,0,6,4,0,6,1,5,7] "978-0-306-40615-7")-newRefined2P (isbn13 @OZ) "978-0-306-40615-8"8Left Step 2. Failed Boolean Check(op) | sum=101 mod 10=1 predicate-typedvalidate isbn10)newRefined2P (isbn10 @OZ) "0-306-40611-X"9Right (Refined2 ([0,3,0,6,4,0,6,1,1],10) "0-306-40611-X"))newRefined2P (isbn10 @OZ) "0-306-40611-9"2Left Step 2. Failed Boolean Check(op) | mod 0 oops predicate-typed'read in an ipv4 address and validate it-newRefined2 @OZ @Ip4ip @Ip4op' "001.223.14.1",Right (Refined2 [1,223,14,1] "001.223.14.1")/newRefined2 @OL @Ip4ip @Ip4op' "001.223.14.999"cLeft Step 2. Failed Boolean Check(op) | Bool(3) [octet 3 out of range 0-255 found 999] (999 <= 255)'newRefined2P (ip4 @OL) "001.223.14.999"LLeft Step 2. Failed Boolean Check(op) | octet 3 out of range 0-255 found 999)newRefined2P (ip4 @OL) "001.223.14.999.1"KLeft Step 2. Failed Boolean Check(op) | Guards:invalid length(5) expected 4%newRefined2P (ip4 @OL) "001.257.14.1"LLeft Step 2. Failed Boolean Check(op) | octet 1 out of range 0-255 found 257 predicate-typedcredit card with luhn algorithm4newRefined2 @OZ @Luhnip @(Luhnop 11) "1234-5678-901":Left Step 2. Failed Boolean Check(op) | invalid checkdigit4newRefined2 @OZ @Luhnip @(Luhnop 11) "1234-5678-903"8Right (Refined2 [1,2,3,4,5,6,7,8,9,0,3] "1234-5678-903")'pz @(Luhnip >> Luhnop 11) "79927398713"Val True'pz @(Luhnip >> Luhnop 10) "79927398713"&Fail "expected 10 digits but found 11" predicate-typedread in a valid datetime>newRefined2 @OL @(Dtip LocalTime) @'True "2018-09-14 02:57:04":Right (Refined2 2018-09-14 02:57:04 "2018-09-14 02:57:04")>newRefined2 @OL @(Dtip LocalTime) @'True "2018-09-99 12:12:12"YLeft Step 1. Failed Initial Conversion(ip) | ParseTimeP LocalTime (%F %T) failed to parse predicate-typedread in an ssn+newRefined2 @OZ @Ssnip @Ssnop "134-01-2211"+Right (Refined2 [134,1,2211] "134-01-2211")+newRefined2 @OL @Ssnip @Ssnop "666-01-2211"vLeft Step 2. Failed Boolean Check(op) | Bool(0) [number for group 0 invalid: found 666] (True && False | (666 /= 666))+newRefined2 @OL @Ssnip @Ssnop "667-00-2211"^Left Step 2. Failed Boolean Check(op) | Bool(1) [number for group 1 invalid: found 0] (1 <= 0) predicate-typedread in a time and validate it)newRefined2 @OL @Hmsip @Hmsop' "23:13:59"&Right (Refined2 [23,13,59] "23:13:59"))newRefined2 @OL @Hmsip @Hmsop' "23:13:60"DLeft Step 2. Failed Boolean Check(op) | Bool(2) [seconds] (60 <= 59))newRefined2 @OL @Hmsip @Hmsop' "26:13:59"BLeft Step 2. Failed Boolean Check(op) | Bool(0) [hours] (26 <= 23)% %       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH76543210/.-,IJKLMNOOPQRSTUVWXYZ[\]^_``abcdefghijjklmnopqrstuvwxyz{|}~/[0      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~()  6    !"#$%&'()*+,-./01234567 8 9 : ; < = > ? @ A B C D E ; 4 F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                                                                                                                   ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < * = + > ? @ A B C D E F G H I J K L M N O P Q R S T U V WXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:F;<_=>?bc@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ o     !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                  ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                                                                                                                   ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! " " " " " " " " # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ % % % % % % % %     .  dL   .  >                            .  7   ! " ! # d $ d % . & ' d ( d ) *g + *g ,  - . /  . 0 1 2 3 4 5 6 7 8 9 : ; < = ; > ? @ A > B > C  D  E F  E G  E H  E I  E J > K @ L M N M O M P Q R Q S Q T ' U V W X  Y Z [ \ ] ^ _ ` D a D b D c D d D e D f D g _ h _ i D j k l m D n D o D p D q D r D s _ t . u . v . w . x .d y z * { | M } y ~ y  y y M M d M * * . .< . .R .S .T .U d d y d d * *  . m 1 1 y *  d y U   s ~ ~ ~ ~         Q R .predicate-typed-0.7.4.0-AMxhQNc83qND3FQMGxAFxsPredicate.UtilPredicate.MiscPredicate.TH_OrphansPredicate.CorePredicate.Refined3Predicate.Refined2Predicate.RefinedPredicate.Refined5Predicate.Data.TuplePredicate.Data.ThesePredicate.Data.StringPredicate.Data.RegexPredicate.Data.ReadShowPredicate.Data.ProxyPredicate.Data.OrderingPredicate.Data.NumericPredicate.Data.MonoidPredicate.Data.ListPredicate.Data.LiftedPredicate.Data.JsonPredicate.Data.FoldablePredicate.Data.MaybePredicate.Data.IndexPredicate.Data.EnumPredicate.Data.IteratorPredicate.Data.IOPredicate.Data.ExtraPredicate.Data.EitherPredicate.Data.DateTimePredicate.Data.ConditionPredicate.Data.CharPredicate.Data.BitsPredicate.Examples.CommonPredicate.Util_THPredicate.Examples.Refined3Predicate.Examples.Refined2Paths_predicate_typed Predicate ReplaceImplRefined3Refined2PrintLPrintT Data.CoercecoerceGHC.Base$>> Data.MaybefromJust Control.Arrow&&&StringRefined Data.Functiononsecondfirst*** Data.Alignalign Data.ThesethesemergeTheseWithT stripRight stripLeftGHC.RealmodLiftA2 Data.ListnubmaximumminimumproductsumemptyreversePreludesortinitlasttailheadsplitAtspanbreakfiltergroupgroupByAllData.Bifunctorbimap Control.Monad>>=>=> Data.Functor<&><$> Data.FoldableorandControl.Lens.WrappedWrapped fromMaybe catMaybesmapMaybemaybe GHC.MaybeJust!!unfoldr System.IOreadIOSystem.EnvironmentgetEnvData.ByteStringreadFileSafeinitMaytailMaylastMayheadMay Data.SequenceSeq Data.Either fromRightfromLeftRightLeft|||+++ Data.Time diffLocalTime Date.Time parseTimeM GHC.TypeLitsSymbolData.Text.LensIsText Data.TextPredicate.PreludeRefined5.pretty-terminal-0.1.0.0-5h8HGBvScbYFgk2HEq8jrWSystem.Console.PrettyColorBlackBlueCyanDefaultGreenMagentaRedWhiteYellowSwapCswapCGetColorgetColorSColorRReplace RReplace1 RReplace2 RReplace3GetReplaceFnSubgetReplaceFnSub ReplaceFnSubRPrepend ROverWriteRAppendGetROptsgetROptsROptAnchored AutoCalloutCaseless DollarEndonlyDotallDupnamesExtendedExtra Firstline Multiline NewlineCr NewlineCrlf NewlineLf NoAutoCaptureUngreedyUtf8 NoUtf8CheckGetBoolgetBoolTupleCTupleT getTupleC ExtractL8C ExtractL8T extractL8C ExtractL7C ExtractL7T extractL7C ExtractL6C ExtractL6T extractL6C ExtractL5C ExtractL5T extractL5C ExtractL4C ExtractL4T extractL4C ExtractL3C ExtractL3T extractL3C ExtractL2C ExtractL2T extractL2C ExtractL1C ExtractL1T extractL1CCheckT ApplyConstTJoinTFnTTheseTThatTThisTRightTLeftTMaybeTExtractAFromListExtractTFromTAExtractAFromTAT5_5T5_4T5_3T5_2T5_1T4_4T4_3T4_2T4_1ConsTMapTSumTIfTFlipT%&%%ReverseITupleCReverseITupleTreverseITupleC ToITupleListC ToITupleListP toITupleListC ToITupleC ToITupleP toITupleCLenT IntersperseT<%>RepeatTGetOrdgetOrd OrderingPCGtCGeCEqCLeCLtCNe GetOrdering getOrderingGetThesegetTheseGetLengetLenNotTOrTAndT FailUnlessT FailWhenT ZwischenT showTheseshowTerrorInProgram~>isPrime primeFactors primeStream prettyOrdshowTKnatsymb compileRegex displayROpts unlessNull unlessNullM nullSpacenullIf pureTryTestpureTryTestPred drawTreeU asProxyRight asProxyLeft removeAnsi_Id$fGetLenNonEmpty:|$fGetLenTheseThese$fGetLenTheseThat$fGetLenTheseThis$fGetLenEitherRight$fGetLenEitherLeft$fGetLenMaybeNothing$fGetLenMaybeJust $fGetLen[]: $fGetLen[][]$fGetTheseTheseThese$fGetTheseTheseThat$fGetTheseTheseThis$fGetOrderingGT$fGetOrderingEQ$fGetOrderingLT $fGetOrdCNe $fGetOrdCLt $fGetOrdCLe $fGetOrdCEq $fGetOrdCGe $fGetOrdCGt$fToITupleC(,,,,,,,,,,,)$fToITupleC(,,,,,,,,,,)$fToITupleC(,,,,,,,,,)$fToITupleC(,,,,,,,,)$fToITupleC(,,,,,,,)$fToITupleC(,,,,,,)$fToITupleC(,,,,,)$fToITupleC(,,,,)$fToITupleC(,,,)$fToITupleC(,,)$fToITupleC(,) $fToITupleC()$fToITupleListC12a$fToITupleListC11a$fToITupleListC10a$fToITupleListC9a$fToITupleListC8a$fToITupleListC7a$fToITupleListC6a$fToITupleListC5a$fToITupleListC4a$fToITupleListC3a$fToITupleListC2a$fToITupleListC1a$fToITupleListC0a$fReverseITupleCx(,)ys$fReverseITupleCx()ys$fExtractL1C(,,,,,,,)$fExtractL1C(,,,,,,)$fExtractL1C(,,,,,)$fExtractL1C(,,,,)$fExtractL1C(,,,)$fExtractL1C(,,)$fExtractL1C(,)$fExtractL2C(,,,,,,,)$fExtractL2C(,,,,,,)$fExtractL2C(,,,,,)$fExtractL2C(,,,,)$fExtractL2C(,,,)$fExtractL2C(,,)$fExtractL2C(,)$fExtractL3C(,,,,,,,)$fExtractL3C(,,,,,,)$fExtractL3C(,,,,,)$fExtractL3C(,,,,)$fExtractL3C(,,,)$fExtractL3C(,,)$fExtractL3C(,)$fExtractL4C(,,,,,,,)$fExtractL4C(,,,,,,)$fExtractL4C(,,,,,)$fExtractL4C(,,,,)$fExtractL4C(,,,)$fExtractL4C(,,)$fExtractL4C(,)$fExtractL5C(,,,,,,,)$fExtractL5C(,,,,,,)$fExtractL5C(,,,,,)$fExtractL5C(,,,,)$fExtractL5C(,,,)$fExtractL5C(,,)$fExtractL5C(,)$fExtractL6C(,,,,,,,)$fExtractL6C(,,,,,,)$fExtractL6C(,,,,,)$fExtractL6C(,,,,)$fExtractL6C(,,,)$fExtractL6C(,,)$fExtractL6C(,)$fExtractL7C(,,,,,,,)$fExtractL7C(,,,,,,)$fExtractL7C(,,,,,)$fExtractL7C(,,,,)$fExtractL7C(,,,)$fExtractL7C(,,)$fExtractL7C(,)$fExtractL8C(,,,,,,,)$fExtractL8C(,,,,,,)$fExtractL8C(,,,,,)$fExtractL8C(,,,,)$fExtractL8C(,,,)$fExtractL8C(,,)$fExtractL8C(,) $fTupleC12a $fTupleC11a $fTupleC10a $fTupleC9a $fTupleC8a $fTupleC7a $fTupleC6a $fTupleC5a $fTupleC4a $fTupleC3a $fTupleC2a $fGetNats[]: $fGetNats[][] $fGetSymbs[]:$fGetSymbs[][]$fGetBoolFalse $fGetBoolTrue $fGetROpts[]$fGetROptNoUtf8Check $fGetROptUtf8$fGetROptUngreedy$fGetROptNoAutoCapture$fGetROptNewlineLf$fGetROptNewlineCrlf$fGetROptNewlineCr$fGetROptMultiline$fGetROptFirstline$fGetROptExtra$fGetROptExtended$fGetROptDupnames$fGetROptDotall$fGetROptDollarEndonly$fGetROptCaseless$fGetROptAutoCallout$fGetROptAnchored $fGetROpts:$fGetReplaceFnSubRAppend$fGetReplaceFnSubROverWrite$fGetReplaceFnSubRPrepend$fShowRReplace $fShowSColor$fBoundedSColor$fGetColorDefault$fGetColorWhite$fGetColorCyan$fGetColorMagenta$fGetColorBlue$fGetColorYellow$fGetColorGreen $fGetColorRed$fGetColorBlack$fSwapC(,,,,,,)$fSwapC(,,,,,) $fSwapC(,,,,) $fSwapC(,,,) $fSwapC(,,) $fSwapC(,) $fSwapCArg $fSwapCThese $fSwapCEither$fReadOrderingP$fShowOrderingP $fEqOrderingP$fEnumOrderingP$fBoundedOrderingP $fReadROpt $fShowROpt$fEqROpt $fOrdROpt $fEnumROpt $fBoundedROpt$fReadReplaceFnSub$fShowReplaceFnSub$fEqReplaceFnSub$fBoundedReplaceFnSub$fEnumReplaceFnSub $fEnumSColor $fLiftFixed$fLiftTimeOfDay$fLiftTimeZone$fLiftZonedTime$fLiftLocalTime $fLiftDay$fLiftDiffTime $fLiftUTCTime $fLiftStdGen $fLiftProxyValPFailPFalsePTrueP $fShowValP $fOrdValP$fEqValP $fReadValP $fGenericValPPE_peValP _peString_FailP_FalseP_TrueP_ValP$fShowPE$fReadPE$fEqPE $fGenericPEValFailpeStringpeValP $fMonoidValP$fSemigroupValP $fSemigroupPE $fMonoidPE $fShowVal$fEqVal$fOrdVal $fReadVal $fFunctorVal $fFoldableVal$fTraversableVal $fGenericVal $fGeneric1ValTT_ttValP_ttVal _ttString _ttForest_Fail_Val $fMonoidVal$fSemigroupVal $fMonadVal$fApplicativeVal $fFunctorTT$fReadTT$fShowTT$fEqTT $fFoldableTT$fTraversableTT $fGenericTT $fGeneric1TTOptTOUNVOUVOUNOUBOUOANVOAVOANOABOAOLOZOptCOptOEmptyOWidthOMsg ORecursionOOther:#OColorOColorOn OColorOffOAnsiOUnicodeOZeroOLiteONormalOVerbose MonadEvalrunIOcatchit catchitNFliftEvalhasIOLongShortOther2Other1Color5Color4Color3Color2Color1DebugDZeroDLiteDNormalDVerboseDispAnsiUnicodeHOptsoWidthoDebugoDispoColoroMsg oRecursionoOtheroNoColorPOptsInlineNoInlinettForestttString mkNodeCopymkNode fixTTBoolmkNodeB getValAndPEgetValLRFromTThh getValueLRdefOpts isVerboseshow3show3'lit3 litVerbose showVerboseshowLlitLlitBLlitBS splitAndAlign hasNoTree colorValP colorValBool prtTreePure topMessageprefixNumberToTT prefixMsg_Debug _DVerbosegetOptchkSizechkSize2 formatOMsgsuboptssetOtherEffects badLengthprtTree verboseList_True_False _ValEitherval2P val2PBool ttValBoolttVal $fMonadTT$fApplicativeTT $fMonoidTT $fSemigroupTT $fShowPColor$fSemigroupHOpts $fMonoidHOpts $fMonadEvalIO$fMonadEvalIdentity $fOptCOUNV $fOptCOUV $fOptCOUN $fOptCOUB$fOptCOU $fOptCOANV $fOptCOAV $fOptCOAN $fOptCOAB$fOptCOA$fOptCOL$fOptCOZ$fOptCOVerbose $fOptCONormal $fOptCOLite $fOptCOZero$fOptCOUnicode $fOptCOAnsi$fOptCOColorOff$fOptCOColorOn $fOptCOColor$fOptC:# $fOptCOEmpty $fOptCOOther$fOptCORecursion $fOptCOMsg $fOptCOWidth $fShowInline $fEqInline $fShowDisp$fEqDisp $fReadDisp $fBoundedDisp $fEnumDisp $fReadDebug $fOrdDebug $fShowDebug $fEqDebug $fEnumDebug$fBoundedDebug $fShowLong$fEqLong $fShowHOptsL33L32L31L23L22L21L13L12L11CoercePure&Swap||~||&&~&&DoLDoMapMap'L8L7L6L5L4ThdL3SndL2FstL1Any<..>BetweenOnePFailTFailSIdBoolNotLengthLenUnproxyTWrapWrap'Unwrap<<>>>WidthHoleHideMsgIMsgWIdTIdPPPevalevalBool evalQuickpzplpanpanvpapabpavpupubpuvrunrunsrunPrunPQ runPQBool evalBoolHideevalHide$fPProxyProxyt$fPTheseTheseThese $fPTheseThatx $fPTheseThisx$fPEitherRightx$fPEitherLeftx$fPMaybeNothingMaybe $fPMaybeJustx$fP[]:a$fP[]:a0$fP[][]a$fP()()a$fPNatna$fPOrderingcmpa$fP(,,,,,,,)(,,,,,,,)a$fP(,,,,,,)(,,,,,,)a$fP(,,,,,)(,,,,,)a$fP(,,,,)(,,,,)a$fP(,,,)(,,,)a $fP(,,)(,,)a $fP(,)(,)a $fPSymbolsa $fPBoolba $fPTYPEProxya$fP->[]a $fPTYPE()a $fPTYPEIda $fPTYPEIdTa $fPTYPEMsga $fPTYPEMsgIa $fPTYPEWa $fPTYPEHidex $fPTYPEHolea $fPTYPEWidtha $fPTYPE>>a $fPTYPE>>>x $fPTYPE<x $fPTYPEAllx $fPTYPEAnyx $fPTYPEL1x $fPTYPEFstx $fPTYPEL2x $fPTYPESndx $fPTYPEL3x $fPTYPEThdx $fPTYPEL4x $fPTYPEL5x $fPTYPEL6x $fPTYPEL7x $fPTYPEL8x $fPTYPEMap'x $fPTYPEMapx $fPTYPEDoa $fPTYPEDoLa $fPTYPE&&a $fPTYPE&&~a $fPTYPE||a $fPTYPE||~a $fPTYPE~>a $fPTYPESwapp $fPTYPE$a $fPTYPE&a $fPTYPEPurex$fPTYPECoercea $fPTYPEL11x $fPTYPEL12x $fPTYPEL13x $fPTYPEL21x $fPTYPEL22x $fPTYPEL23x $fPTYPEL31x $fPTYPEL32x $fPTYPEL33x$fShowId $fShowIdT$fShowW $fShowMsg $fShowMsgI $fShowHide $fShowHole $fShowWidth$fShow>> $fShow>>>$fShow<< $fShowUnwrap $fShowWrap' $fShowWrap$fShowUnproxyT $fShowLen $fShowLength $fShowNot $fShowIdBool $fShowFail $fShowFailS $fShowFailT $fShowFailP $fShowOneP $fShowBetween $fShow<..> $fShowAll $fShowAny$fShowL1 $fShowFst$fShowL2 $fShowSnd$fShowL3 $fShowThd$fShowL4$fShowL5$fShowL6$fShowL7$fShowL8 $fShowMap' $fShowMap$fShowDo $fShowDoL$fShow&& $fShow&&~$fShow|| $fShow||~$fShow~> $fShowSwap$fShow$$fShow& $fShowPure $fShowCoerce $fShowL11 $fShowL12 $fShowL13 $fShowL21 $fShowL22 $fShowL23 $fShowL31 $fShowL32 $fShowL33Msg3m3Descm3Shortm3Longm3ValP RResults3RFRTFRTFalseRTTrueFRTTrueTMakeR3'MakeR3 Refined3Cr3Inr3OutunsafeRefined3'unsafeRefined3 genRefined3 genRefined3PmkProxy3 mkProxy3' newRefined3' newRefined3P' newRefined3 newRefined3Peval3Peval3M$fHashableRefined3$fBinaryRefined3$fArbitraryRefined3$fFromJSONRefined3$fToJSONRefined3$fReadRefined3$fIsStringRefined3$fNFDataRefined3 $fShowMsg3$fShowRResults3$fEqMsg3$fLiftRefined3 $fOrdRefined3 $fEqRefined3$fShowRefined3MakeR2Msg2m2Descm2Shortm2Longm2ValP RResults2RTTrue Refined2Cr2Inr2OutunsafeRefined2'unsafeRefined2 genRefined2 genRefined2P newRefined2' newRefined2P' newRefined2 newRefined2Peval2Peval2Mprt2ImplmkProxy2 mkProxy2'$fHashableRefined2$fBinaryRefined2$fArbitraryRefined2$fFromJSONRefined2$fToJSONRefined2$fReadRefined2$fIsStringRefined2$fNFDataRefined2 $fShowMsg2$fShowRResults2$fEqMsg2$fLiftRefined2 $fOrdRefined2 $fEqRefined2$fShowRefined2Msg0m0BoolEm0Shortm0Longm0ValBoolColorRefinedC unRefined genRefinedshowMsg0 newRefined' newRefined unsafeRefinedunsafeRefined'$fToJSONRefined$fArbitraryRefined$fHashableRefined$fBinaryRefined$fFromJSONRefined $fReadRefined$fIsStringRefined $fShowMsg0 $fShowRefined $fLiftRefined $fEqRefined $fOrdRefined$fNFDataRefined$fEqMsg0MakeR5 unRefined5unsafeRefined5'unsafeRefined5 genRefined5 genRefined5P newRefined5' newRefined5P' newRefined5 newRefined5Peval5Peval5M$fHashableRefined5$fBinaryRefined5$fArbitraryRefined5$fFromJSONRefined5$fToJSONRefined5$fReadRefined5$fIsStringRefined5$fLiftRefined5 $fOrdRefined5 $fEqRefined5$fShowRefined5$fNFDataRefined5 ToITupleList ReverseITupleToITuple EachITupleTuple'TupleOnBoth|+OrA&*AndASecondFirstPairsDup $fPTYPEDupx $fPTYPEPairsx $fPTYPE&&&x $fPTYPE***(,) $fPTYPEFirstx$fPTYPESecondx $fPTYPEAndAx $fPTYPE&*x $fPTYPEOrAx $fPTYPE|+x$fPTYPEBoth(,) $fPTYPEOn(,) $fPTYPETuplex$fPTYPETuple'x$fPTYPEEachITuple()$fPTYPEEachITuple(,)$fPTYPEToITuplex$fPTYPEReverseITuple(,)$fPTYPEReverseITuple()$fPTYPEToITupleListxs $fShowDup $fShowPairs $fShow&&& $fShow*** $fShowFirst $fShowSecond $fShowAndA$fShow&* $fShowOrA$fShow|+ $fShowBoth$fShowOn $fShowTuple $fShowTuple'$fShowEachITuple$fShowToITuple$fShowReverseITuple$fShowToITupleListThese'That'This'UnassocAssoc TheseFailThatFailThisFailTheseDefThatDefThisDefZipTheseTheseIdTheseInIsTheseIsThatIsThisMkTheseMkThatMkThat'MkThisMkThis'TheseXTheresHeresThesesThatsThissPartitionThese$fPTYPEPartitionThese[] $fPTYPEThissx $fPTYPEThatsx$fPTYPEThesesx$fPTYPEHeres[]$fPTYPETheres[]$fPTYPETheseXx$fPTYPEMkThis'x$fPTYPEMkThisx$fPTYPEMkThat'x$fPTYPEMkThatx$fPTYPEMkThesea $fPTYPEIsThx$fPTYPEIsThisx$fPTYPEIsThatx$fPTYPEIsThesex$fPTYPETheseInThese$fPTYPETheseIdx$fPTYPEZipThesea$fPTYPEThisDefx$fPTYPEThatDefx$fPTYPETheseDefx$fPTYPEThisFailx$fPTYPEThatFailx$fPTYPETheseFailx $fPTYPEAssocp $fAssocC(,) $fAssocCThese$fAssocCEither$fPTYPEUnassocp$fPTYPEThis'These$fPTYPEThat'These$fPTYPEThese'These$fShowPartitionThese $fShowThiss $fShowThats $fShowTheses $fShowHeres $fShowTheres $fShowTheseX $fShowMkThis' $fShowMkThis $fShowMkThat' $fShowMkThat $fShowMkThese $fShowIsTh $fShowIsThis $fShowIsThat $fShowIsThese $fShowTheseIn $fShowTheseId$fShowZipThese $fShowThisDef $fShowThatDef$fShowTheseDef$fShowThisFail$fShowThatFail$fShowTheseFail $fShowAssoc $fShowUnassoc $fShowThis' $fShowThat' $fShowThese' FromString FromString'ToString IsSuffixCI IsInfixCI IsPrefixCI IsSuffixCIsInfixC IsPrefixCStripRStripLTrimBothTrimRTrimL$fPTYPETrimImplx $fPTYPETrimLx $fPTYPETrimRx$fPTYPETrimBothx$fPTYPEStripImplx$fPTYPEStripLx$fPTYPEStripRx$fPTYPEIsFixImplCx$fPTYPEIsPrefixCx$fPTYPEIsInfixCx$fPTYPEIsSuffixCx$fPTYPEIsPrefixCIx$fPTYPEIsInfixCIx$fPTYPEIsSuffixCIx$fToStringCByteString$fToStringCByteString0$fToStringCText$fToStringCText0 $fToStringC[]$fPTYPEToStringx$fPTYPEFromString'a$fPTYPEFromStringx$fShowTrimImpl $fShowTrimL $fShowTrimR$fShowTrimBoth$fShowStripImpl $fShowStripL $fShowStripR$fShowIsFixImplC$fShowIsPrefixC$fShowIsInfixC$fShowIsSuffixC$fShowIsPrefixCI$fShowIsInfixCI$fShowIsSuffixCI$fShowToString$fShowFromString'$fShowFromString ReplaceFn3 ReplaceFn2 ReplaceFn1 ReplaceFnReplaceOneStringReplaceOneString'ReplaceAllStringReplaceAllString' ReplaceOne ReplaceOne' ReplaceAll ReplaceAll'ResplitResplit' RescanRanges RescanRanges'RescanRescan'ReRe' $fPTYPERe'x $fPTYPERex$fPTYPERescan'x$fPTYPERescanx$fPTYPERescanRanges'x$fPTYPERescanRangesx$fPTYPEResplit'x$fPTYPEResplitx$fPTYPEReplaceImplx$fPTYPEReplaceAll'x$fPTYPEReplaceAllx$fPTYPEReplaceOne'x$fPTYPEReplaceOnex$fPTYPEReplaceAllStringx$fPTYPEReplaceOneStringx$fPTYPEReplaceFnx$fPTYPEReplaceOneString'x$fPTYPEReplaceAllString'x$fPTYPEReplaceFn1x$fPTYPEReplaceFn2x$fPTYPEReplaceFn3x $fShowRe'$fShowRe $fShowRescan' $fShowRescan$fShowRescanRanges'$fShowRescanRanges$fShowResplit' $fShowResplit$fShowReplaceImpl$fShowReplaceAll'$fShowReplaceAll$fShowReplaceOne'$fShowReplaceOne$fShowReplaceAllString'$fShowReplaceAllString$fShowReplaceOneString'$fShowReplaceOneString$fShowReplaceFn$fShowReplaceFn1$fShowReplaceFn2$fShowReplaceFn3PrintIPrintF ReadMaybe ReadMaybe'ReadPReadP'ShowP $fPTYPEShowPx$fPTYPEReadP'x $fPTYPEReadPx$fPTYPEReadMaybe'x$fPTYPEReadMaybex$fPTYPEPrintFx $fPrintC(,) $fPrintC()$fPTYPEPrintIx$fPTYPEPrintTx$fPTYPEPrintLx $fShowShowP $fShowReadP' $fShowReadP$fShowReadMaybe'$fShowReadMaybe $fShowPrintF $fShowPrintT $fShowPrintI $fShowPrintLProxifyPApp2PAppPop2'Pop2Pop1'Pop1Pop0Proxy2TProxy1TProxyT$fPTYPEProxyTx$fPTYPEProxy1Tx$fPTYPEProxy2Tx $fPTYPEPop0x $fPTYPEPop1x $fPTYPEPop1'x $fPTYPEPop2x $fPTYPEPop2'x $fPTYPEPAppx $fPTYPEPApp2x$fPTYPEProxifyx $fShowProxyT $fShowProxy1T $fShowProxy2T $fShowPop0 $fShowPop1 $fShowPop1' $fShowPop2 $fShowPop2' $fShowPApp $fShowPApp2 $fShowProxifyNegativePositive AllNegative AllPositiveDesc'DescAsc'AscCmpICmp===~OrdA'OrdA==!/=~<~<=~==~>=~>~/=<<===>=>NeLtLeSameGeGt $fPTYPEGtx $fPTYPEGex $fPTYPESamex $fPTYPELex $fPTYPELtx $fPTYPENex $fPTYPE==!a $fPTYPEOrdAx $fPTYPEOrdA'x $fPTYPE===~a $fPTYPECmpa $fPTYPE/=x $fPTYPE=x $fPTYPE>x $fPTYPECmpIa $fPTYPE/=~x $fPTYPE<~x $fPTYPE<=~x $fPTYPE==~x $fPTYPE>=~x $fPTYPE>~x $fPTYPEAscx $fPTYPEAsc'x $fPTYPEDescx $fPTYPEDesc'x$fPTYPEAllPositivex$fPTYPEPositivex$fPTYPEAllNegativex$fPTYPENegativex$fShowGt$fShowGe $fShowSame$fShowLe$fShowLt$fShowNe$fShow>$fShow>=$fShow==$fShow<=$fShow<$fShow/=$fShow>~ $fShow>=~ $fShow==~ $fShow<=~$fShow<~ $fShow/=~ $fShow==! $fShowOrdA $fShowOrdA' $fShow===~ $fShowCmp $fShowCmpI $fShowAsc $fShowAsc' $fShowDesc $fShowDesc'$fShowAllPositive$fShowAllNegative$fShowPositive$fShowNegativeRoundUp UnShowBaseNToBits ShowBaseNShowBaseReadBase ReadBase'SignumOddEvenRemQuotQuotRemDivModModDivAbsNegate-%%DivI/LogBase**^*-+FloorFloor'CeilingCeiling'Truncate Truncate' FromRational FromRational' ToRational FromIntegral FromIntegral' FromInteger FromInteger'$fPTYPEFromInteger'a$fPTYPEFromIntegerx$fPTYPEFromIntegral'a$fPTYPEFromIntegralx$fPTYPEToRationalx$fPTYPEFromRational'a$fPTYPEFromRationalx$fPTYPETruncate'x$fPTYPETruncatex$fPTYPECeiling'x$fPTYPECeilingx$fPTYPEFloor'x $fPTYPEFloorx $fPTYPE^a $fPTYPE**a$fPTYPELogBasea$fGetBinOpBAdd$fGetBinOpBSub$fGetBinOpBMult $fPTYPEBina $fPTYPE*x $fPTYPE-x $fPTYPE+x $fPTYPE/a $fPTYPEDivIx $fPTYPE%x$fPTYPENegatex $fPTYPE-%x $fPTYPEAbsx $fPTYPEDiva $fPTYPEModa$fPTYPEDivModa$fPTYPEQuotRema $fPTYPEQuotx $fPTYPERemx $fPTYPEEvenx $fPTYPEOddx$fPTYPESignumx$fPTYPEReadBase'x$fPTYPEReadBasex$fPTYPEShowBasex$fPTYPEShowBaseNx$fPTYPEToBitsx$fPTYPEUnShowBaseNx$fPTYPERoundUpx$fShowFromInteger'$fShowFromInteger$fShowFromIntegral'$fShowFromIntegral$fShowToRational$fShowFromRational'$fShowFromRational$fShowTruncate'$fShowTruncate$fShowCeiling' $fShowCeiling $fShowFloor' $fShowFloor $fReadBinOp $fShowBinOp $fEqBinOp$fShow+$fShow-$fShow*$fShow^$fShow** $fShowLogBase $fShowBin$fShow/ $fShowDivI$fShow%$fShow-% $fShowNegate $fShowAbs $fShowDiv $fShowMod $fShowDivMod $fShowQuotRem $fShowQuot $fShowRem $fShowEven $fShowOdd $fShowSignum$fShowReadBase'$fShowReadBase$fShowShowBase$fShowShowBaseN $fShowToBits$fShowUnShowBaseN $fShowRoundUpSTimesMEmptyPMEmptyTMEmptyT'SConcatMConcatSapS<> $fPTYPE<>x $fPTYPESapx$fPTYPEMConcatx$fPTYPESConcatx$fPTYPEMEmptyT'a$fPTYPEMEmptyTx$fPTYPEMEmptyPx$fPTYPESTimesa$fShow<> $fShowSap $fShowMConcat $fShowSConcat$fShowMEmptyT' $fShowMEmptyT $fShowMEmptyP $fShowSTimes ZipCartesianNubIsSuffixIsInfixIsPrefixMaxMinProductSumEmptyTZipZipRZipLZipPadZipWith EmptyList EmptyList' SingletonReverseLReverseSort SortOnDescSortOnSortByUnzip3UnzipInitLastTailHeadRemoveKeep ChunksOf'ChunksOfDropTakeSplitAtSplitAtsPadRPadLOnesTailsInitsElem IntercalateSpanBreakFilterGroupCntGroupGroupCntStableGroupBy PartitionByAll1Quant PartitionRotateUnsnocUncons+::+++ $fPTYPE++x $fPTYPE:+x $fPTYPE+:x$fPTYPEUnconss$fPTYPEUnsnocs$fPTYPEPartitiona $fPTYPEQuantx $fPTYPEAll1x$fPTYPEPartitionBya$fPTYPEGroupBya$fPTYPEGroupCntStablea $fPTYPEGroupx$fPTYPEFilterx $fPTYPEBreaka $fPTYPESpanx$fPTYPEIntercalatex $fPTYPEElema $fPTYPEInitsx $fPTYPETailsx $fPTYPEOnesx$fPTYPEPadImpla $fPTYPEPadLx $fPTYPEPadRx$fPTYPESplitAtsx$fPTYPESplitAta$fPTYPERotatex $fPTYPETakex $fPTYPEDropx$fPTYPEChunksOf'a$fPTYPEChunksOfx$fPTYPEKeepImplx $fPTYPEKeepx$fPTYPERemovex $fPTYPEHeadx$fPTYPEGroupCntx $fPTYPETailx $fPTYPELastx $fPTYPEInitx $fPTYPEUnzipx$fPTYPEUnzip3x$fPTYPESortByx$fPTYPESortOnx$fPTYPESortOnDescx $fPTYPESortx$fPTYPEReversex$fPTYPEReverseLt$fPTYPESingletonx$fPTYPEEmptyList'x$fPTYPEEmptyListx$fPTYPEZipWitha$fPTYPEZipPada $fPTYPEZipLa $fPTYPEZipRa $fPTYPEZipa$fPTYPEEmptyTx $fPTYPESumx$fPTYPEProductx $fPTYPEMinx $fPTYPEMaxx$fPTYPEIsFixImplx$fPTYPEIsPrefixx$fPTYPEIsInfixx$fPTYPEIsSuffixx $fPTYPENubx$fPTYPEZipCartesianx$fShow++$fShow:+$fShow+: $fShowUncons $fShowUnsnoc $fShowRotate$fShowPartition $fShowQuant $fShowAll1$fShowPartitionBy $fShowGroupBy$fShowGroupCntStable $fShowGroup$fShowGroupCnt $fShowFilter $fShowBreak $fShowSpan$fShowIntercalate $fShowElem $fShowInits $fShowTails $fShowOnes $fShowPadImpl $fShowPadL $fShowPadR$fShowSplitAts $fShowSplitAt $fShowTake $fShowDrop$fShowChunksOf$fShowChunksOf'$fShowKeepImpl $fShowKeep $fShowRemove $fShowHead $fShowTail $fShowLast $fShowInit $fShowUnzip $fShowUnzip3 $fShowSortBy $fShowSortOn$fShowSortOnDesc $fShowSort $fShowReverse$fShowReverseL$fShowSingleton$fShowEmptyList'$fShowEmptyList $fShowZipWith $fShowZipPad $fShowZipL $fShowZipR $fShowZip $fShowEmptyT $fShowSum $fShowProduct $fShowMin $fShowMax$fShowIsFixImpl$fShowIsPrefix $fShowIsInfix$fShowIsSuffix $fShowNub$fShowZipCartesianELREEmptyELeftERightEBothBiMapFlip<*>FFish<:>FPairFMapLiftKRDotDotCatch'Catch>|>>||>SkipTraverseSequence$&$$Join DuplicateExtract<|>*><*<$ $fPTYPE<$x $fPTYPE<*x $fPTYPE*>x $fPTYPE<|>x$fPTYPEExtractt$fPTYPEDuplicatet $fPTYPEJoint $fPTYPE$$x $fPTYPE$&x$fPTYPESequencet $fPTYPESkipa $fPTYPE|>x $fPTYPE>|x $fPTYPE>|>x $fPTYPECatchx$fPTYPECatch'x $fPTYPEDota $fPTYPERDota $fPTYPEKa $fPTYPELiftx $fPTYPEFMapn$fPTYPETraversex $fPTYPE<$>a $fPTYPE<&>x $fPTYPEFPaira $fPTYPE<:>x $fPTYPEFFishx $fPTYPE>>=x $fPTYPE<*>x $fPTYPEFlipx$fPTYPELiftA2x $fPTYPEBiMapn$fBitraversableELR$fBifoldableELR$fBifunctorELR$fShow<$$fShow<*$fShow*> $fShow<|> $fShowExtract$fShowDuplicate $fShowJoin$fShow$$$fShow$&$fShowSequence$fShowTraverse $fShowSkip$fShow|>$fShow>| $fShow>|> $fShowCatch $fShowCatch' $fShowDot $fShowRDot$fShowK $fShowLift $fShowFMap $fShow<$> $fShow<&> $fShowFPair $fShow<:> $fShowFFish $fShow>>= $fShow<*> $fShowFlip $fShowLiftA2 $fShowBiMap $fShowELR$fEqELR$fOrdELR $fFoldableELR $fFunctorELR$fTraversableELREncodeJsonFile EncodeJson ParseJsonFileParseJsonFile' ParseJson ParseJson'$fPTYPEParseJson'x$fPTYPEParseJsonx$fPTYPEParseJsonFile'x$fPTYPEParseJsonFilex$fPTYPEEncodeJsonx$fPTYPEEncodeJsonFilex$fShowParseJson'$fShowParseJson$fShowParseJsonFile'$fShowParseJsonFile$fShowEncodeJson$fShowEncodeJsonFileOrsAndsFoldMapNullNull'ToListCycle ConcatMapConcat FromListExtFromList ToListExtIToListIToList'IsEmptyToNEList$fPTYPEToNEListt$fPTYPEIsEmptyas$fPTYPEIToList'x$fPTYPEIToListx$fPTYPEToListExtl$fPTYPEFromListx$fPTYPEFromListExtl$fPTYPEConcatx$fPTYPEConcatMapx $fPTYPECyclex$fPTYPEToListt $fPTYPENull'x $fPTYPENulla$fPTYPEFoldMapx $fPTYPEAndsx $fPTYPEOrsx$fShowToNEList $fShowIsEmpty$fShowIToList' $fShowIToList$fShowToListExt$fShowFromList$fShowFromListExt $fShowConcat$fShowConcatMap $fShowCycle $fShowToList $fShowNull' $fShowNull $fShowFoldMap $fShowAnds $fShowOrsJustFailJustDef EmptyBool MaybeBool CatMaybesMapMaybe IsNothingIsJustMaybeInMkJust MkNothing MkNothing'Just'$fPTYPEJust'Maybe$fPTYPEMkNothing'a$fPTYPEMkNothingx$fPTYPEMkJustx$fPTYPEMaybeInMaybe$fPTYPEIsJustx$fPTYPEIsNothingx$fPTYPEMapMaybex$fPTYPECatMaybesx$fPTYPEEmptyBoola$fPTYPEMaybeBoolx$fPTYPEJustDefx$fPTYPEJustFailx $fShowJust'$fShowMkNothing'$fShowMkNothing $fShowMkJust $fShowMaybeIn $fShowIsJust$fShowIsNothing$fShowMapMaybe$fShowCatMaybes$fShowMaybeBool$fShowEmptyBool $fShowJustDef$fShowJustFail!!?LookupIxLIx'Ix LookupFail LookupFail' LookupDef LookupDef'$fPTYPELookupDefx$fPTYPELookupFailx $fPTYPEIxx $fPTYPEIx'x $fPTYPEIxLa $fPTYPE!!a$fPTYPELookupa$fPTYPELookupFail'x$fPTYPELookupDef'x $fPTYPE!!?a$fShowLookupDef'$fShowLookupDef$fShowLookupFail'$fShowLookupFail$fShowIx $fShowIx' $fShowIxL$fShow!! $fShowLookup $fShow!!?Universe Universe'EnumFromThenTo... EnumFromTo ToEnumBFail ToEnumBDef ToEnumBDef'ToEnumToEnum'FromEnum FromEnum'PredBPredSuccNSuccPredB'SuccB'SuccB $fPTYPESuccBx$fPTYPESuccB'x $fPTYPESuccx $fPTYPESuccNx $fPTYPEPredx $fPTYPEPredBx$fPTYPEPredB'x$fPTYPEFromEnum'x$fPTYPEFromEnumx$fPTYPEToEnum'x$fPTYPEToEnumx$fPTYPEToEnumBDef'a$fPTYPEToEnumBDefx$fPTYPEToEnumBFailx$fPTYPEEnumFromTox $fPTYPE...x$fPTYPEEnumFromThenTox$fPTYPEUniverse'x$fPTYPEUniversex $fShowSuccB $fShowSuccB' $fShowPredB' $fShowSucc $fShowSuccN $fShowPred $fShowPredB$fShowFromEnum'$fShowFromEnum $fShowToEnum' $fShowToEnum$fShowToEnumBDef'$fShowToEnumBDef$fShowToEnumBFail$fShowEnumFromTo $fShow...$fShowEnumFromThenTo$fShowUniverse'$fShowUniverseDoNRepeatParaNPara IterateNUntil IterateNWhile IterateWhile IterateUntilUnfoldNUnfoldrFoldlFoldNScanNAScanNScanl $fPTYPEScanlx $fPTYPEScanNx$fPTYPEScanNAx $fPTYPEFoldNx $fPTYPEFoldlx$fPTYPEUnfoldra$fPTYPEUnfoldNx$fPTYPEIterateUntilx$fPTYPEIterateWhilex$fPTYPEIterateNWhilex$fPTYPEIterateNUntilx$fPTYPEParaImplx$fPTYPEParaImplx0$fPTYPEParaImplx1 $fPTYPEParax $fPTYPEParaNx$fPTYPERepeata $fPTYPEDoNa $fShowScanl $fShowScanN $fShowScanNA $fShowFoldN $fShowFoldl $fShowUnfoldr $fShowUnfoldN$fShowIterateUntil$fShowIterateWhile$fShowIterateNWhile$fShowIterateNUntil$fShowParaImpl $fShowPara $fShowParaN $fShowRepeat $fShowDoNGenRangeGenNextGenSplit RandomRList RandomRNext RandomList RandomNextGenPureGenIOStdinReadIO'ReadIOStderrStdout WriteFile WriteFile' AppendFileTimeZtTimeUtc ReadEnvAllReadEnvReadDir DirExists FileExistsReadFileBinaryReadFile$fPTYPEReadFilex$fPTYPEReadFileBinaryx$fPTYPEFileExistsx$fPTYPEReadDirx$fPTYPEDirExistsx$fPTYPEReadEnvx$fPTYPEReadEnvAlla$fPTYPETimeUtca$fPTYPETimeZta$fGetFHandleFStderr$fGetFHandleFStdout$fGetModeWFWrite$fGetModeWFWriteForce$fGetModeWFAppend$fGetFHandleFOther$fPTYPEWriteFileImpla$fPTYPEAppendFilex$fPTYPEWriteFile'x$fPTYPEWriteFilex$fPTYPEStdoutx$fPTYPEStderrx $fPTYPEStdinx $fPTYPEGenIOx$fPTYPEGenPurex$fPTYPERandomNextx$fPTYPERandomListx$fPTYPERandomRNextx$fPTYPERandomRListx$fPTYPEGenSplitx$fPTYPEGenNextx$fPTYPEGenRangex$fShowReadFile$fShowReadFileBinary$fShowFileExists$fShowDirExists $fShowReadDir $fShowReadEnv$fShowReadEnvAll $fShowTimeUtc $fShowTimeZt $fReadWFMode $fShowWFMode $fEqWFMode $fReadFHandle $fShowFHandle $fEqFHandle$fShowWriteFileImpl$fShowAppendFile$fShowWriteFile'$fShowWriteFile $fShowStdout $fShowStderr $fShowStdin $fShowGenIO $fShowGenPure$fShowRandomNext$fShowRandomList$fShowRandomRNext$fShowRandomRList$fShowGenSplit $fShowGenNext$fShowGenRangeIListIMap PartitionsByIsLuhn PrimeFactorsPrimes PrimePrev PrimeNextIsPrimeInitMayTailMayLastMayHeadMayInitFailInitDefLastFailLastDefTailFailTailDefHeadFailHeadDef$fPTYPEHeadDefx$fPTYPEHeadFailx$fPTYPETailDefx$fPTYPETailFailx$fPTYPELastDefx$fPTYPELastFailx$fPTYPEInitDefx$fPTYPEInitFailx$fPTYPEHeadMayx$fPTYPELastMayx$fPTYPETailMayx$fPTYPEInitMayx$fPTYPEIsPrimex$fPTYPEPrimeNextx$fPTYPEPrimePrevx$fPTYPEPrimesx$fPTYPEPrimeFactorsx$fPTYPEIsLuhnx$fPTYPEPartitionsByx $fPTYPEIMapx $fPTYPEIListx $fShowHeadDef$fShowHeadFail $fShowTailDef$fShowTailFail $fShowLastDef$fShowLastFail $fShowInitDef$fShowInitFail $fShowHeadMay $fShowLastMay $fShowTailMay $fShowInitMay $fShowIsPrime$fShowPrimeNext$fShowPrimePrev $fShowPrimes$fShowPrimeFactors $fShowIsLuhn$fShowPartitionsBy $fShowIMap $fShowIList RightFailLeftFailRightDefLeftDefMkRightMkRight'MkLeftMkLeft'EitherX EitherBoolPartitionEithersIsRightIsLeftRight'Left'$fPTYPELeft'Either$fPTYPERight'Either$fPTYPE|||Either$fPTYPEIsLeftx$fPTYPEIsRightx$fPTYPE+++Either$fPTYPEPartitionEithers[]$fPTYPEEitherBoola$fPTYPEEitherXx$fPTYPEMkLeft'x$fPTYPEMkLeftx$fPTYPEMkRight'x$fPTYPEMkRightx$fPTYPELeftDefx$fPTYPERightDefx$fPTYPELeftFailx$fPTYPERightFailx $fShowLeft' $fShowRight' $fShow||| $fShowIsLeft $fShowIsRight $fShow+++$fShowPartitionEithers$fShowEitherBool $fShowEitherX $fShowMkLeft' $fShowMkLeft$fShowMkRight' $fShowMkRight $fShowLeftDef$fShowRightDef$fShowLeftFail$fShowRightFailLocalTimeToUTC DiffLocalTime DiffUTCTimeUTCTimeToPosixPosixToUTCTimeUnMkTimeMkTimeMkTime'ToTimeToDay ToWeekYear ToWeekDate MkDayExtra MkDayExtra'UnMkDayMkDayMkDay' ParseTimes ParseTimes' ParseTimeP ParseTimeP' FormatTimeP FormatTimeP'$fPTYPEFormatTimeP'x$fPTYPEFormatTimePx$fPTYPEParseTimeP'a$fPTYPEParseTimePx$fPTYPEParseTimes'a$fPTYPEParseTimesx$fPTYPEMkDay'x $fPTYPEMkDayx$fPTYPEUnMkDayx$fPTYPEMkDayExtra'x$fPTYPEMkDayExtrax$fPTYPEToWeekDatex$fPTYPEToWeekYearx$fToDayCSystemTime $fToDayCRatio $fToDayCDay$fToDayCLocalTime$fToDayCZonedTime$fToDayCUTCTime$fToTimeCSystemTime$fToTimeCRatio$fToTimeCDiffTime$fToTimeCTimeOfDay$fToTimeCLocalTime$fToTimeCZonedTime$fToTimeCUTCTime $fPTYPEToDayx$fPTYPEToTimex$fPTYPEMkTime'x$fPTYPEMkTimex$fPTYPEUnMkTimex$fPTYPEPosixToUTCTimex$fPTYPEUTCTimeToPosixx$fPTYPEDiffUTCTimex$fPTYPELocalTimeToUTCx$fPTYPEDiffLocalTimex$fShowFormatTimeP'$fShowFormatTimeP$fShowParseTimeP'$fShowParseTimeP$fShowParseTimes'$fShowParseTimes $fShowMkDay' $fShowMkDay $fShowUnMkDay$fShowMkDayExtra'$fShowMkDayExtra$fShowToWeekDate$fShowToWeekYear $fShowToDay $fShowToTime $fShowMkTime' $fShowMkTime$fShowUnMkTime$fShowPosixToUTCTime$fShowUTCTimeToPosix$fShowDiffUTCTime$fShowDiffLocalTime$fShowLocalTimeToUTC GuardSimpleExitWhen GuardBoolGuardGuardsN GuardsDetailBoolsN BoolsQuickBools GuardsQuickGuardsCase''Case'CaseIf $fPTYPEIfa$fPTYPECaseImplx$fPTYPECaseImplx0$fPTYPECaseImplx1$fPTYPECaseImplx2$fPTYPECaseImplx3 $fPTYPECase'x$fPTYPECase''x $fPTYPECasex$fPTYPEGuardsImplx$fPTYPEGuardsImplx0$fPTYPEGuardsx$fPTYPEGuardsQuickx$fPTYPEBoolsImplx$fPTYPEBoolsImplx0 $fPTYPEBoolsx$fPTYPEBoolsQuickx$fPTYPEBoolsNx$fPTYPEGuardsDetailImplx$fPTYPEGuardsDetailx$fPTYPEGuardsNx $fPTYPEGuarda$fPTYPEGuardBoola$fPTYPEExitWhenx$fPTYPEGuardSimplea$fShowIf$fShowCaseImpl $fShowCase $fShowCase' $fShowCase''$fShowGuardsImpl $fShowGuards$fShowGuardsQuick $fShowBools$fShowBoolsImpl$fShowBoolsQuick $fShowBoolsN$fShowGuardsDetailImpl$fShowGuardsDetail $fShowGuardsN $fShowGuard$fShowGuardBool$fShowExitWhen$fShowGuardSimpleToTitleToUpperToLower IsLatin1AllIsSeparatorAll IsOctDigitAll IsHexDigitAll IsControlAllIsPunctuationAll IsSpaceAll IsDigitAll IsUpperAll IsLowerAllIsLatin1 IsSeparator IsOctDigit IsHexDigit IsControl IsPunctuationIsSpaceIsDigitIsUpperIsLowerCChar1 $fPTYPEChar1a $fPTYPECx$fPTYPEIsLatin1x$fPTYPEIsSeparatorx$fPTYPEIsOctDigitx$fPTYPEIsHexDigitx$fPTYPEIsControlx$fPTYPEIsPunctuationx$fPTYPEIsSpacex$fPTYPEIsDigitx$fPTYPEIsUpperx$fPTYPEIsLowerx$fGetCharSetCLatin1$fGetCharSetCSeparator$fGetCharSetCOctDigit$fGetCharSetCHexDigit$fGetCharSetCControl$fGetCharSetCPunctuation$fGetCharSetCSpace$fGetCharSetCNumber$fGetCharSetCUpper$fGetCharSetCLower$fPTYPEIsCharSetAlla$fPTYPEIsCharSetx$fPTYPEIsLowerAllx$fPTYPEIsUpperAllx$fPTYPEIsDigitAllx$fPTYPEIsSpaceAllx$fPTYPEIsPunctuationAllx$fPTYPEIsControlAllx$fPTYPEIsHexDigitAllx$fPTYPEIsOctDigitAllx$fPTYPEIsSeparatorAllx$fPTYPEIsLatin1Allx$fPTYPEToLowera$fPTYPEToUppera$fPTYPEToTitlea $fShowChar1$fShowC $fShowIsLower $fShowIsUpper $fShowIsDigit $fShowIsSpace$fShowIsPunctuation$fShowIsControl$fShowIsHexDigit$fShowIsOctDigit$fShowIsSeparator$fShowIsLatin1$fBoundedCharSet $fEnumCharSet $fShowCharSet $fReadCharSet $fOrdCharSet $fEqCharSet$fShowIsCharSetAll$fShowIsCharSet$fShowIsLowerAll$fShowIsUpperAll$fShowIsDigitAll$fShowIsSpaceAll$fShowIsPunctuationAll$fShowIsControlAll$fShowIsHexDigitAll$fShowIsOctDigitAll$fShowIsSeparatorAll$fShowIsLatin1All $fShowToLower $fShowToUpper $fShowToTitleZeroBitsBitPopCountTestBit BitComplementBitClearBitSet BitRotateR BitRotateL BitRotate BitShiftR BitShiftLBitShift.^..|..&. $fPTYPE.&.a $fPTYPE.|.a $fPTYPE.^.a$fBitFunctionCBFComplement$fBitFunctionCBFClear$fBitFunctionCBFSet$fBitFunctionCBFRotateR$fBitFunctionCBFRotateL$fBitFunctionCBFRotate$fBitFunctionCBFShiftR$fBitFunctionCBFShiftL$fBitFunctionCBFShift$fPTYPEBitImpla$fPTYPEBitShiftx$fPTYPEBitShiftLx$fPTYPEBitShiftRx$fPTYPEBitRotatex$fPTYPEBitRotateLx$fPTYPEBitRotateRx$fPTYPEBitSetx$fPTYPEBitClearx$fPTYPEBitComplementx$fPTYPETestBita$fPTYPEPopCounta $fPTYPEBita$fPTYPEZeroBitsa $fShow.&. $fShow.|. $fShow.^.$fShowBitFunction$fEqBitFunction $fShowBitImpl$fShowBitShift$fShowBitShiftL$fShowBitShiftR$fShowBitRotate$fShowBitRotateL$fShowBitRotateR $fShowBitSet$fShowBitClear$fShowBitComplement $fShowTestBit$fShowPopCount $fShowBit$fShowZeroBitsJsonMicrosoftDateTimeLuhn'Luhnop' Ddmmyyyyop' Ddmmyyyyop DdmmyyyyRE DateTimeNip DateTimeFmtsDateNipDateFmts Isbn13fmtIsbn13opIsbn13ip Isbn10fmtIsbn10opIsbn10ipIp6fmtIp6opIp6ip Ip4StrictREOctetREIp4fmtIp4opIp4op'Ip4ip'Ip4ipIp4REHmsREHmsfmtHmsop'HmsopHmsipSsnfmtSsnopSsnipDtfmtDtipLuhnfmtLuhnopLuhnip refinedTH refinedTHIO refined2TH refined2THIO refined3TH refined3THIO refined5TH refined5THIO ReadShowR' ReadShow' ReadShowRReadShowBaseIJ'BaseIJOkNotROkNotOkROkLuhnTLuhnRBetweenNBaseN'BaseNIsbn13Isbn13RIsbn10Isbn10RIp6Ip6RIp4'Ip4R'Ip4Ip4RHms'HmsR'HmsHmsRSsnRSsn DateTimeN DateTimeNRDateN DateTime1Luhn11Luhnluhnluhn'luhn11 datetime1ssnhmsip4ip4'ip6isbn10isbn13base16base16'base2base2'basenbasen'daten datetimenbetweenokoknotreadshow readshow'BaseIJipversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName)pcre-heavy-1.0.0.2-ChCGs8upZiD3exJkt5Gwg8Text.Regex.PCRE.HeavysubgsubGetROptghc-prim GHC.TypesBoolGetSymbsGetNatsbasemapNatflip"these-1.0.1-3UTMdwaa4leJANRBM2TWHZTheseOrderingjamSSGHC.ReadReadPColor showLitImplHKDData.Functor.IdentityIdentity mkNodeImpl validateValP reifyOptssetWidth setMessage setRecursionsetOther setNoColorsetDispsetCreateColorsetDebugotherDef toNodeString colorValLitecolorMeIOpure GHC.Classes Data.TuplesndfstanyallidnotlengthFoldable"lens-4.17.1-4fon9Pm6UyWHUNX2DejVtJ _Wrapped' _Unwrapped'Type Data.ProxyProxyconst eval3MSkip'hashable-1.2.7.0-2SI038axTEd7AEZJ275kpiData.Hashable.ClassHashablebinary-0.8.6.0Data.Binary.ClassBinary(QuickCheck-2.13.2-8nV7osDGiuU4p27xQv2fwBTest.QuickCheck.Arbitrary Arbitrary$aeson-1.4.6.0-7526D9tGKahHh2FW4ZeY7VData.Aeson.Types.FromJSONFromJSONData.Aeson.Types.ToJSONToJSON Data.StringIsStringThatThisAssocCData.These.CombinatorscatTherecatHerecatThesecatThatcatThispartitionThese fromString Data.OldList isSuffixOf isInfixOf isPrefixOf text-1.2.3.1stripstripEnd stripStartsplit scanRangesscan=~PrintCGHC.ShowshowcompareNumeric showIntAtBaseGHC.NumsignumoddevenremquotquotRemdivModdivabsnegateRationalBin GHC.FloatlogBasefloorceilingtruncate fromRational toRational fromIntegral fromIntegerstimesmemptysconcatmconcatGHC.ListzipWithControl.Lens.Internal.Iso reversingsortOnunzip3unzipdroptaketailsinitselem partitionControl.Lens.ConsunsnocunconsliftA2Data.Traversabletraverse sequenceAjoin$comonad-5.0.6-GvBnJAzclaB4q7AeSPsEI2Control.Comonad duplicateextractnulltoListcycle concatMapconcatGHC.ExtsfromListControl.Lens.IndexeditoListControl.Lens.EmptyAsEmptyNonEmptyMaybe isNothingisJustlookupControl.Lens.AtIxedGHC.EnumenumFromThenTo enumFromTotoEnumfromEnumpredsuccfoldlscanl!random-1.1-3ypV4EIycgb35PKjTYYr5q System.RandomgenRangenextrandomRsrandomRrandomsrandommkStdGen newStdGen time-1.8.0.2&Data.Time.LocalTime.Internal.ZonedTime ZonedTime Data.Time.Clock.Internal.UTCTimeUTCTimegetEnvironmentdirectory-1.3.3.0System.Directory listDirectorydoesDirectoryExist doesFileExistEitherpartitionEithersisRightisLeft&Data.Time.LocalTime.Internal.LocalTimelocalTimeToUTC Data.Time.Clock.Internal.UTCDiff diffUTCTime&Data.Time.LocalTime.Internal.TimeOfDay TimeOfDayData.Time.Calendar.DaysDayData.Time.Format.Parse ParseTimeData.Time.Format formatTimeGuardsDetailImplCaseImpl IsCharSetAll GHC.UnicodeisLatin1 Data.Char isSeparator isOctDigit isHexDigit isControl isPunctuationisSpaceisDigitisUpperisLower IsCharSet Data.BitsBitszeroBitsbitpopCounttestBit complementBitclearBitsetBitrotateRrotateLrotateshiftRshiftLshiftxor