eRp      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmno(c) 2017 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>Safepqrpqrpqr5(c) 2017 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>Safe$  !"#$%&'()*$  !"#$%&'()*$  !"#$%&'()*$  !"#$%&'()*(c) 2017 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>None0 st+uv,-./012wxyz{|}~+,-./012+,-./120 st+uv,-./012(c) 2017 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>None0Usage: ins "x" (undefined :: Type)lgeneralizes an expression by making it less defined, starting with smaller changes, then bigger changes:1: change constant to variable 1.1: if a variable of the constant type exists, use it 1.2: if not, introduce new variable 2: change a variable to a new variableAThe above is the ideal, but let's start with a simpler algorithm:1: change constant to holeP0List matches of lists of expressions if possible S[0,1] `matchList` [x,y] = Just [x=0, y=1] [0,1+2] `matchList` [x,y+y] = Nothing>3456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_w      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZxyz{|}~+,-./0123456879:;<=@>?ABCDEFGHIJKLMNOPQRS#=>?@BCDAE9:;<45678FGHNJKLMSPQ34IOR13456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_(c) 2017 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>Nonea Derives a = instance for a given type [.Consider the following Stack datatype: (data Stack a = Stack a (Stack a) | EmptyWriting deriveGeneralizable ''Stack(will automatically derive the following = instance: [instance Generalizable a => Generalizable (Stack a) where expr s@(Stack x y) = constant "Stack" (Stack ->>: s) :$ expr x :$ expr y expr s@Empty = constant "Empty" (Empty -: s) instances s = this "s" s $ let Stack x y = Stack undefined undefined `asTypeOf` s in instances x . instances yThis function needs the TemplateHaskell extension.bSame as a4 but does not warn when instance already exists (a is preferable).c Derives a = instance for a given type [3 cascading derivation of type arguments as well.\gGiven a type name, return the number of arguments taken by that type. Examples in partially broken TH: arity ''Int === Q 0 arity ''Int->Int === Q 0 arity ''Maybe === Q 1 arity ''Either === Q 2 arity ''Int-> === Q 1ZThis works for Data's and Newtype's and it is useful when generating typeclass instances.]^_abc`abcdefghijkl\mnopqrstuabcabc]^_abc`abcdefghijkl\mnopqrstu(c) 2017 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>NonegUse g/ to configure the number of tests performed by check. ]> check `for` 10080 $ \xs -> sort (sort xs) == sort (xs :: [Int]) +++ OK, passed 10080 tests.Don't forget the dollar ($)!hfAllows the user to customize instance information available when generalized. (For advanced users.)iUse i> to provide additional functions to appear in side-conditions. check `withBackground` [constant "isSpace" isSpace] $ \xs -> unwords (words xs) == xs *** Failed! Falsifiable (after 4 tests): " " Generalization: ' ':_ Conditional Generalization: c:_ when isSpace cjUse j1 to configure the maximum condition size allowed.k&Checks a property printing results on stdout > check $ \xs -> sort (sort xs) == sort (xs::[Int]) +++ OK, passed 360 tests. > check $ \xs ys -> xs `union` ys == ys `union` (xs::[Int]) *** Failed! Falsifiable (after 4 tests): [] [0,0] Generalization: [] (x:x:_)l(Check a property printing results on stdout and returning v on success.JThere is no option to silence this function: for silence, you should use  .wxyzghijkl{|}~ghijklklghijwxyzghijkl{|}~(c) 2017 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>Noneow      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZxyz{|}~+,-./0123456879:;<=@>?ABCDEFGHIJKLMNOPQRSo(c) 2017 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>None      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ  !"#$%&'()*3=@>?ABCDJNabcgijklklgijNJ=>?@BCDA3abc      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                 !  "  #  $  %  &  '  (  )  *  +  ,  -  .  /  0  1  2  3  4  5  6  7  8  9  : ;< ;= ;> ;? ;@ ;A ;B ;C ;D ;E ;F ;G ;H IJ IK LM LN LO LP LQ LR LS LT LU VW VX VY V  VZ V[ V\ V] V^ V_ V` Va Vb Vc Vd Ve Vf Vg Vh Vi Vj Vk Vl Vm Vn Vo Vp Vq Vrstuvwwxyz{|}~'extrapolate-0.1.0-IMgeZdbOdKAeCjZsUYF5qTest.ExtrapolateTest.Extrapolate.CoreTest.Extrapolate.TypeBindingTest.Extrapolate.ExprsTest.Extrapolate.DeriveTest.Extrapolate.IOTest.Extrapolate.BasicTest.Extrapolate.UtilsTest.LeanCheckholds&speculate-0.2.6-5vkwUYyBkwMChVI2mOL9GZTest.Speculate.Expr.Core showConstantconstant:$VarConstantExpr+++ argTypes0 argTypes1 argTypes2 argTypes3 argTypes4 argTypes5 argTypes6 argTypes7 argTypes8 argTypes9 argTypes10 argTypes11 argTypes12argTys1argTys2 argTy1of1 argTy1of2 argTy2of2 argTy1of3 argTy2of3 argTy3of3 argTy1of4 argTy2of4 argTy3of4 argTy4of4 argTy1of5 argTy2of5 argTy3of5 argTy4of5 argTy5of5 argTy1of6 argTy2of6 argTy3of6 argTy4of6 argTy5of6 argTy6of6canonicalizeWithgroundsgroundsAndBinds vassignmentsvarsisAssignmentTestfoldunfoldTestableoptions WithOptionWithpropertyoptionOptionMaxTestsExtraInstancesMaxConditionSize Generalizableexpruseful instancesnameOfthistheseusefuns backgroundOfmaxTestsextraInstancesmaxConditionSizeresultscounterExampleGensgeneralizationsCEgeneralizationsCECgeneralizationsCountscounterExampleGenareInstancesOf matchList newMatches expressionsTconditionalGeneralization$fTestable(->)$fTestableBool$fTestableWithOption$fGeneralizable[]$fGeneralizable(,,)$fGeneralizable(,)$fGeneralizableMaybe$fGeneralizableChar$fGeneralizableInteger$fGeneralizableInt$fGeneralizableBool$fGeneralizable() $fShowOptionderiveGeneralizablederiveGeneralizableIfNeededderiveGeneralizableCascading$fEqBla$fOrdBla $fShowBlafor withInstanceswithBackgroundwithConditionSizecheck checkResult $fEqResult $fShowResult$fGeneralizableRatio nubMergeBy nubMergeOnnubMerge MarkerTypecanonicalizeWith1unrepeatedToHole1baseData.Typeable.InternalTypeRepTest.Speculate.Expr.Canon canonicalWith canonicalizeTest.Speculate.Expr.Groundfalse trueRatio trueBindstrueinequalless lessOrEqual condEqualM condEqualequalgroundAndBinds groundBindsTest.Speculate.Expr.EquateunConditionalComparisonconditionalComparisonLTconditionalComparisonLEusefulConditionalEquationunConditionalEquationconditionalEquationusefulImplication unImplication implication unComparison comparisonLE comparisonLTusefulEquationuselessEquation isEquation unEquation phonyEquationequationTest.Speculate.Expr.InstancedefNamespreludeInstancesleEltEeqEtiersEnamesfindInfo isListableisEqOrdEisOrdEisEqEisEqOrdisOrdisEq listableWithordWitheqWithnamelistableeqOrdordeq instanceTypeInstance InstancesTest.Speculate.Expr.MatchhasCanonInstanceOfisCanonInstanceOf hasInstanceOf isInstanceOf unificationunify matchWithmatch2matchrenameBysub assigningassignfillBinds unfoldAppisConstantNamedisSub subexprsVsubexprs isAssignmentunrepeatedVars countVarscountVardepthElengthEconstshasVaratomicConstantsholesarity typeCorrectetyptypevalevaluatefalseEcompareComplexitycompareComplexityThen lexicompare lexicompareByeqExprCommutingshowExpr showPrecExpr showOpExpr showsOpExpr showsPrecExpr$$holeOfTyholevarTest.Speculate.Utils.TypeablemkEqnTyboolTyinsgeneralizations1 resultiers$-| tinstancesOptions getBackgroundgeneralizations productWithcounterExamplescounterExampleisCounterExample countPasses expressionsTTweakestConditionisCounterExampleUnderisVar&leancheck-0.6.4-LgD5obmxq9nKk7KMiFXeCw Test.LeanCheck.Utils.TypeBindinguint4uint3uint2uint1int4int3int2int1nateithmaybstringcharbooldoublefloatintegerintund>-->>>>>>>>>>>>:->>>>>>>>>>>:> ->>>>>>>>>>>: ->>>>>>>>>>:> ->>>>>>>>>>: ->>>>>>>>>:> ->>>>>>>>>: ->>>>>>>>:> ->>>>>>>>: ->>>>>>>:> ->>>>>>>: ->>>>>>:>->>>>>>:->>>>>:>->>>>>:->>>>:>->>>>:->>>:>->>>:->>:>->>:->:>->:-:>-:Test.LeanCheck.Tiers listsOfLengthsetsOfbagsOf noDupListsOf normalizeTdeleteTproductslistsOfproductMaybeWith product3With noDupListConssetConsbagConsTest.LeanCheck.DerivederiveListableCascadingderiveListableTest.LeanCheck.Basic addWeightofWeightcons12cons11cons10cons9cons8cons7cons6Test.LeanCheck.Core==>existsfailswitness witnesses><\\//\/+|suchThatresetdelaycons5cons4cons3cons2cons1cons0 concatMapTconcatTfilterTmapTtiersFractional listIntegraltoTiersListablelisttierstemplate-haskellLanguage.Haskell.TH.SyntaxName typeArityBlaBlederiveGeneralizableXreallyDeriveGeneralizableletintypeConstructorsArgNames lookupValN"reallyDeriveGeneralizableCascading typeConArgstypeConArgsThattypeConCascadingArgsThat normalizeTypenormalizeTypeUnitsisntInstanceOftypeConstructors isTypeSynonymtypeSynonymType|=>| mergeIFnsmergeIwhereI nubMergesghc-prim GHC.TypesTrueResultOK Falsified Exception resultsIOresultIO showResultshowCECshowCEGshowCEprettify