!u$``      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~             ! " # $ % & ' ( ) * + , - . / 0 1 23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_None"$%&'+,-0345678;<=FKNQSTV]ei,  StrictCheckoThe Curry class witnesses that for any list of arguments, it is always possible to curry/uncurry at that arity  StrictCheckjThis currying mechanism is agnostic to the concrete heterogeneous list type used to carry arguments. The Listu class abstracts over the nil and cons operations of a heterogeneous list: to use your own, just define an instance.  StrictCheckRStrip all arguments from a function type, yielding its (non-function-type) result For example: %Result (Int -> Bool -> Char) ~ Char StrictChecklFor those who don't want to type in unicode, we provide this ASCII synonym for the ellipsis function arrow ("->) StrictCheckGiven a list of argument types and the "rest" of a function type, return a curried function type which takes the specified argument types in order, before returning the given rest For example: ,[Int, Bool] "-> Char ~ Int -> Bool -> CharOThis infix unicode symbol is meant to evoke a function arrow with an ellipsis. StrictCheck>Given a function type, return a list of all its argument types For example: *Args (Int -> Bool -> Char) ~ [Int, Bool] StrictCheckFor any function type function, it is always true that 0function ~ (Args function "-> Result function)#GHC doesn't know this, however, so withCurryIdentityb provides this proof to the enclosed computation, by discharging this wanted equality constraint. StrictCheck(Uncurry all arguments to a function typeThis is a special case of , and may ease type inference. StrictCheckGCurry all arguments to a function from a heterogeneous list to a resultThis is a special case of , and may ease type inference.   None"$%&'+,-0345678;<=FKNQSTV]ei9 StrictCheckA list of inputs given to a function, in abstract form. This lazy structure is evaluated piecewise during the course of producing a function, thus triggering the partial evaluation of the original input to the function. StrictCheckNot exposed in safe API StrictCheckA tree representing all possible destruction sequences for a value Unfolding the contained lists forces a particular random control path for destructing the datatype. StrictCheckNot exposed in safe API StrictCheckjA variant which can be applied to any generator--kept in a newtype to get around lack of impredicativity. StrictCheckExtract the list of Input s from an Inputs StrictCheck!Extract the entropy and subfield-Inputs from a given Input  None"$%&'+,-0345678;<=FKNQSTV]eiWT" StrictCheck)The constraints necessary to generically consume something# StrictCheck?Lazily monomorphize some input value, by converting it into an Input2. This is an incremental version of QuickCheck's  CoArbitrary< typeclass. It can also be seen as a generalization of the NFData class. Instances of Consume= can be derived automatically for any type implementing the Generic class from  GHC.Generics . Using the DeriveAnyClass extension, we can say: import GHC.Generics as GHC import Generics.SOP as SOP data D x y = A | B (x, y) deriving (GHC.Generic, SOP.Generic, Consume)This automatic derivation follows these rules, which you can follow too if you're manually writing an instance for some type which is not Generic:5For each distinct constructor, make a single call to % with a distinct Int, and a list of Input(s, each created by recursively calling $ on every field in that constructor. For abstract types (e.g. sets), the same procedure can be used upon an extracted list representation of the contents.$ StrictCheck Convert an a into an Input/ by recursively destructing it using calls to consume% StrictCheckWReassemble pieces of input into a larger Input: this is to be called on the result of consume-ing subparts of input& StrictCheck5Use the CoArbitrary instance for a type to consume itThis should only be used for "flat" types, i.e. those which contain no interesting consumable substructure, as it's fully strict (non-incremental)' StrictCheck;Consume a type which has no observable structure whatsoeverThis should only be used for types for which there is only one inhabitant, or for which inhabitants cannot be distinguished at all.( StrictCheck/Fully normalize something which can be consumed) StrictCheckGeneric $ "#$%&'() #$%('&")None"$%&'+,-0345678;<=FKNQSTV]eijZ StrictCheckA DZipper. is a suspended traversal through a non-empty  n-ary productOThe position of the traversal within that product is existentially quantified.\ StrictCheck!Newtype allowing us to construct  n-ary products of shrinkers^ StrictCheckStep one to the right in a DZipper , returning Nothing if this is not possible_ StrictCheckGiven an n-ary product of xs, get a list of DZipper?s, each focused in sequence on the values of the input productThis is similar to the  duplicate operation on comonads.` StrictCheck Convert an n-ary product into a DZipper , returning Nothing if the input product is emptya StrictCheck Collapse a DZipper* back into the n-ary product it representsb StrictCheckGiven a list of shrinkers and a list of values-to-be-shrunk, generate a list of shrunken lists-of-values, each inner list being one potential "axis" for shrinkingdThat is, the first element of the result is all the ways the original product could be shrunken by only$ shrinking its first component, etc.c StrictCheck:Fairly interleave a list of lists in a round-robin fashion Z[\]^_`abc \]bcZ[^_`aNone"$%&'+,-0345678;<=FKNQSTV]einRd StrictCheckIn  fromDemand8, this exception is (purely, lazily) thrown whenever a Thunk is encountered. In toDemand(, it is caught and converted back to a Thunk.dedeNone"$%&'+,-0345678;<=FKNQSTV]eigh StrictCheckWe hook into QuickCheck's existing Arbitrary infrastructure by using a newtype to differentiate our special way of generating things.k StrictCheck#Produce an arbitrary value of type bU, such that destructing that value incrementally evaluates some input to a function.Writing instances of Produce7 is very similar to writing instances of QuickCheck's `W. The distinction: when making a recursive call to produce a subfield of a structure, always use m or n, and never a direct call to lr itself. This ensures that the input can potentially be demanded at any step of evaluation of the produced value.0If, in the course of generating a value of type bD, you need to generate a random value of some other type, which is not) going to be a subpart of the resultant b0 (e.g. a length or depth), use a direct call to  arbitrary7 or some other generator which does not consume input.An example instance of Produce: data D a = X a | Y [Int] instance Produce a => Produce (D a) where produce = oneof [ fmap X recur , fmap Y recur ]m StrictCheckGiven an input-consuming producer, wrap it in an outer layer of input consumption, so that this consumption can be interleaved when the producer is called recursively to generate a subfield of a larger produced datatype.n StrictCheckDestruct some inputs to generate an output. This function handles the interleaving of input destruction with output construction. When producing a data type, it should be called to produce each subfield -- *not* produce itself.o StrictCheckCreate an input-consuming producer of input-consuming functions, given an input-consuming producer for results of that function.p StrictCheckCreate an input-consuming producer of input-consuming functions, of any arity. This will usually be used in conjuntion with type application, to specify the type(s) of the argument(s) to the function.q StrictCheck'Destruct a random subpart of the given s, returning the  corresponding to the combined information harvested during this process, and the remaining "leaves" of the inputs yet to be destructedTo maximize the likelihood that different random consumption paths through the same value will diverge (desirable when generating functions with interesting strictness), draws destructs the forest of Inputms as a depth-first random traversal with a budget sampled from a geometric distribution with expectation 1.r StrictCheckActually produce an output, given an input-consuming producer. If a function is to be produced, it will be almost-certainly non-strict. hijklmnopqr klnmophijrqNone"$%&'+,-0345678;<=FKNQSTV]ei StrictCheckThe  FlattenedS type contains all the fields in a piece of data (represented as an n-ary product  from  Generics.SOPP), paired with a way to re-assemble them into a value of the original datatype.Flattened d f xs$ can be read as "some value of type d f2, which has been separated into an n-ary product NP f xs/ and a function which can reconstruct a value d h for any hN, given an n-ary product with matching field types to the one contained here.Pay attention to the kinds! d :: (* -> *) -> *,  f :: * -> *, and  xs :: [*].For types which are literally a collection of fields with no extra information, the reconstruction function merely converts the given list of fields back into a value of the original type. For types which contain extra information in their values (beyond what StrictCheck considers fields), this function should contain that information, and re-attach it to the field values it receives. StrictCheckUse the re-assembly close in a  FlattenedB to yield a value of the original type from which it was derived. StrictCheckIf all the fields in a  Flattened satisfy some constraint, map a function expecting that constraint across all the fields. This may change the functor over which the  Flattened value is parameterized. StrictCheck is to a like  is to b. None&$%&'+,-.0345678:;<=FKNQSTV]efi;@, StrictCheck`The collection of constraints necessary for a type to be given a generic implementation of the  methods StrictCheckThe % used for generic implementations of 1This wraps a sum-of-products representation from  Generics.SOP. StrictCheckThe Shapee of a primitive type should be equivalent to the type itself. However, this does not have the right kind to be used as a Shape.The Prim. newtype solves this problem. By defining the Shape of some primitive type p to be Prim p, you can use the methods  projectPrim,  embedPrim,  matchPrim, and  prettyPrim. to completely fill in the definition of the Shaped class for a primitive type.Note:$ It is only appropriate to use this Shapes representation when a type really is primitive, in that it contains no interesting substructure. If you use the Primw representation inappropriately, StrictCheck will not be able to inspect the richer structure of the type in question. StrictCheckThe Shape% of a spine-strict container (i.e. a Map or Seta) is the same as a container of demands on its elements. However, this does not have the right kind to be used as a Shape.The  Containing. newtype solves this problem. By defining the Shape of some container (C a) to be (C  a), you can use the methods projectContainer and embedContainer to implement project and embedL for your container type (although you will still need to manually define match and render). StrictCheck Rendered f is the fixed-point of f composed with : it alternates between f shapes and  RenderLevel s. Usually, f will be the identity functor , but not always. StrictCheck RenderLevelg is a functor whose outer shape contains all the information about how to pretty-format the outermost ShapeR of some value. We use parametricity to make it difficult to construct incorrect 9 methods, by asking the user merely to produce a single  RenderLevel and stitching nested  RenderLevels into complete  trees. StrictCheck.A prefix constructor, and a list of its fields StrictCheckFAn infix constructor, its associativity and fixity, and its two fields StrictCheckFA record constructor, and a list of its field names paired with fields StrictCheckA custom pretty-printing representation (i.e. for abstract types), which records a fixity and a list of tokens of three varieties: 1) raw strings, 2) qualified strings (from some module), or 3) actual fields, annotated with their fixity StrictCheckA QName is a qualified nameANote: > type ModuleName = String > type DatatypeName = String StrictCheckA value of type f % a has the same structure as an a), but with the structure of the functor fA interleaved at every field (including ones of types other than a4). Read this type aloud as "a interleaved with f's". StrictCheck When a type a is ShapedY, we know how to convert it into a representation parameterized by an arbitrary functor f , so that  Shape a f (the "shape of a parameterized by f:") is structurally identical to the topmost structure of a , but with f! wrapped around any subfields of a.Note that this is not) a recursive representation! The functor f7 in question wraps the original type of the field and not a Shape of that field.For instance, the Shape of  Either a b might be: data EitherShape a b f = LeftShape (f a) | RightShape (f b) instance Shaped (Either a b) where type Shape (Either a b) = EitherShape a b ...rThe shape of a primitive type should be isomorphic to the primitive type, with the functor parameter left unused. StrictCheckThe Shape of an aA is a type isomorphic to the outermost level of structure in an a, parameterized by the functor fD, which is wrapped around any fields (of any type) in the original a. StrictCheckGiven a function to expand any Shaped x into an f x , expand an a into a  Shape a f>That is: convert the top-most level of structure in the given a into a Shape5, calling the provided function on each field in the a to produce the f x- necessary to fill that hole in the produced  Shape a f. Inverse to . StrictCheck!Given a function to collapse any f x into a Shaped x, collapse a  Shape a f into merely an a That is: eliminate the top-most Shape9 by calling the provided function on each field in that  Shape a fE, and using the results to fill in the pieces necessary to build an a. Inverse to . StrictCheck Given two Shapes of the same type a6 but parameterized by potentially different functors f and gE, pattern-match on them to expose a uniform view on their fields (a   (Shape a)M) to a continuation which may operate on those fields to produce some resultIf the two supplied Shapes do not structurally match, only the fields of the first are given to the continuation. If they do match, the fields of the second are also given, along with type-level proof that the types of the two sets of fields align.This very general operation subsumes equality testing, mapping, zipping, shrinking, and many other structural operations over Shaped things.qIt is somewhat difficult to manually write instances for this method, but consulting its generic implementation  may prove helpful.See !Test.StrictCheck.Shaped.Flattened for more information. StrictCheck Convert a Shape a5 whose fields are some unknown constant type into a  filled with that typeThis is a specialized pretty-printing mechanism which allows for displaying counterexamples in a structured format. See the documentation for . StrictCheck-Look inside a single level of an interleaved f % a. Inverse to the  constructor. StrictCheck*Map a function across all the fields in a 4This function may change the functor over which the ShapeI is parameterized. It can assume recursively that all the fields in the Shape are themselves instances of ShapedA (which they should be!). This means that you can nest calls to  translate recursively. StrictCheckThe c version of .; maps an effectful translation over a given Shape. StrictCheck9The equivalent of a fold (catamorphism) over recursively  values Given a function which folds an f containing some  Shape x g into a g x$, recursively fold any interleaved f % a into a g a. StrictCheckThe d version of -; folds an interleaved structure effectfully. StrictCheck;The equivalent of an unfold (anamorphism) over recursively  values"Given a function which unfolds an f x into a g containing some  Shape x f, corecursively unfold any f a into an interleaved g % a. StrictCheckThe d version of 0; unfolds an interleaved structure effectfully. StrictCheckFuse the interleaved f,-structure out of a recursively interleaved f % a*, given some way of fusing a single level f x -> x.This is a special case of . StrictCheckInterleave an f,-structure at every recursive level of some a<, given some way of generating a single level of structure x -> f x.This is a special case of . StrictCheckAn infix synonym for  StrictCheckA higher-kinded  unzipWith', operating over interleaved structures Given a function splitting some f x into a g x and a h x, unzip and entire f % a, structure using this operation, yielding a g % a and a h % a. StrictCheckThe monadic equivalent of  unzipWith.; effectfully unzips an interleaved structure StrictCheck$TODO: document this strange function Convert an f % a[ into a structured pretty-printing representation, suitable for further display/processing StrictCheckGeneric implementation of project for any container type whose Shape is represented as a  Containing newtype StrictCheckGeneric implementation of embed for any container type whose Shape is represented as a  Containing newtype StrictCheckGet the wrapped x out of a Prim x f (inverse to the Prim constructor) StrictCheckGeneric implementation of project for any primitive type whose Shape is is represented as a Prim newtype StrictCheckGeneric implementation of embed for any primitive type whose Shape is is represented as a Prim newtype StrictCheckGeneric implementation of match for any primitive type whose Shape is is represented as a Prim newtype with an underlying Eq instance StrictCheckHelper for writing match1 instances for primitive types which don't have Eq instanceThis generates a  Flattened1 appropriate for using in the implementation of matchG. For more documentation on how to use this, see the documentation of . StrictCheckGeneric implementation of render for any primitive type whose Shape is is represented as a Prim newtype StrictCheck Given some stringO, generate a custom pretty-printing representation which just shows the string StrictCheckGeneric  StrictCheckGeneric  StrictCheckGeneric  StrictCheckGeneric 61 None"$%&'+,-0345678;<=FKNQSTV]ei@ StrictCheck>The type with one inhabitant: the infinite chain of successors StrictCheck Evaluate n constructors of a given Omega value, returning unit None"$%&'+,-0345678;<=FKNQSTV]eiz< StrictCheckA  PosDemandt is a "strictly positive" demand, i.e. one where the topmost level of the demanded value has definitely been forced$This is the one-level unwrapping of Demand=, and is useful to express some invariants in specifications StrictCheckA Demand on some type a$ is the same shape as that original a, but with possible Thunks interleaved into it StrictCheckA Thunk a is either an a or a Thunk&When we interleave this type into the Shape8 of some type, we get the type of demands on that type.Thunk a is isomorphic to a (strict) Maybe a. StrictCheck3Pattern synonym to abbreviate demand manipulation: T = Wrap Thunk StrictCheck3Pattern synonym to abbreviate demand manipulation: E a = Wrap (Eval a) StrictCheckqA bottom value (inhabiting all types) which StrictCheck interprets as an unevaluated subpart of a data structure /toDemand thunk == T fromDemand T == thunk StrictCheck+Tests if a particular value is an implicit |In order to work, this function evaluates its input to weak-head normal form; keep this in mind if you care about laziness. StrictCheck Given an a! whose substructures may contain Gs (i.e. an implicit demand representation), convert it to an explicit  Inverse to . StrictCheckGiven an explicit Demand for some type a!, convert it to a value of type a, substituting a  for each  found in the explicit demand Inverse to . StrictCheck4Shrink a non-zero demand (analogous to QuickCheck's shrink)While QuickCheck's typical shrinkN instances reduce the size of a value by slicing off the top-most structure,  shrinkDemand7 reduces the size of a demand by pruning it's deepest leaves[. This ensures that all resultant shrunken demands are strict sub-demands of the original. StrictCheckEvaluate some value of type a, to the degree specified by the given demandyIf the demand and the value diverge (they pick a different side of a sum), evaluation will stop at this point. Usually, evaluateDemand is only called on demands which are known to be structurally-compatible with the accompanying value, although nothing really goes wrong if this is not true. StrictCheckA very general e$ style function for printing demandsshowPrettyFieldThunkS q t p r returns a function (String -> String)I which appends its input to a pretty-printed representation of a demand.Specifically: * qK is a boolean flag determining if names should be printed as qualified * tC is a string which is to be printed when a thunk is encountered * p4 is the precedence context of this function call * r1 is the 'Rendered Thunk' representing some demand}This is very general, but we expose it in its complexity just in case some person wants to build a different pretty-printer.The precedence-aware pretty-printing algorithm used here is adapted from a solution given by Brian Huffman on StackOverflow:  >https://stackoverflow.com/questions/27471937/43639618#43639618. StrictCheck!Pretty-print a demand for display StrictCheck!Print a demand to standard output %printDemand = putStrLn . prettyDemand StrictCheck*Determine if two demands are exactly equalThis relies on the match method from the ShapedR instance for the two demands, and does not require the underlying types to have Eq2 instances. However, this means that types whose matchN methods are more coarse than their equality will be compared differently by eqDemand[. In particular, the demand representations of functions will all be compared to be equal. StrictCheck"s are compared for equality using $; see its documentation for details None"$%&'+,-0345678;<=FKNQSTV]eiB StrictCheckObserve the demand behaviorin a given evaluation context, of a given unary function,called upon a given input,returning a pair of?the demand on its output exerted by the evaluation context, and$the demand on its input this induced"Suppose we want to see how strict reverse: is when we evaluate its result to weak-head normal form:5(b, a) = observe1 (`seq` ()) (reverse @Int) [1, 2, 3]printDemand b -- output demand_ : _printDemand a -- input demand_ : _ : _ : _ : []AThis tells us that our context did indeed evaluate the result of reverse to force only its first constructor, and that doing so required the entire spine of the list to be evaluated, but did not evaluate any of its elements. StrictCheckObserve the demand behaviorin a given evaluation context of a given uncurried n-ary function@ (taking as input an n-ary product of inputs represented as an   from  Generics.SOP)Dcalled upon all of its inputs (provided as curried ordinary inputs),returning a pair of?the demand on its output exerted by the evaluation context, and:the demands on its inputs this induced, represented as an   from  Generics.SOPFThis is mostly useful for implementing the internals of StrictCheck; 0 is more ergonomic for exploration by end-users. StrictCheckObserve the demand behaviorin a given evaluation context of a given curried n-ary functionDcalled upon all of its inputs (provided as curried ordinary inputs),returning a pair of?the demand on its output exerted by the evaluation context, and:the demands on its inputs this induced, represented as an   from  Generics.SOP0This function is variadic and curried: it takes n + 2 arguments, where nA is the total number of arguments taken by the observed function."Suppose we want to see how strict  zipWith (*)= is when we evaluate its result completely (to normal form):productZip = zipWith ((*) @Int)H(zs, (xs :* ys :* Nil)) = observe normalize productZip [10, 20] [30, 40] printDemand zs -- output demand300 : 800 : []"printDemand xs -- input demand #1 10 : 20 : []"printDemand ys -- input demand #2 30 : 40 : _GIf you haven't thought very carefully about the strictness behavior of zip<, this may be a surprising result; this is part of the fun! StrictCheck1Creates a tuple of an instrumented thunk, and an IOP action whose return value indicates whether that thunk has yet been evaluated.(x, d) <- entangle ()dThunkx()dEval () StrictCheckURecursively instruments a value, returning a tuple of an instrumented value, and an IO action returning a } that corresponds to the portion of the instrumented value which has already been evaluated at the time the action was run.(x, d) <- instrument [1..]printDemand =<< d_length . take 3 $ x3printDemand =<< d _ : _ : _ : _take 2 x[1,2]printDemand =<< d 1 : 2 : _ : _None#$%&'+,-0345678:;<=FKNQSTV]ei StrictCheck<A snapshot of the observed strictness behavior of a functionAn  Evaluation contains the & at which a function was called, the / which were induced upon those inputs, and the * which induced that demand on the inputs. StrictCheckInputs to a function StrictCheckDemands on the input StrictCheckDemand on the result StrictCheckCA function can be checked against a specification if it meets the  StrictCheck constraint StrictCheckA  Strictness_ represents (roughly) how strict a randomly generated function or evaluation context should be5An evaluation context generated with some strictness s (i.e. through ) will consume at most s= constructors of its input, although it might consume fewer. StrictCheck)A demand specification for some function f` is itself a function which manipulates demand values for some function's arguments and resultsA Spec for f( wraps a function which takes, in order:a continuation predict which accepts all of f's argument types in order,*an implicit representation of a demand on f's result (embedded in fS's actual result type using special bottom values, see the documentation for Test.StrictCheck.Demand for details), andall of f's original arguments in orderThe intention is that the Spec will call predictC on some set of demands representing the demands it predicts that f9 will exert on its inputs, given the provided demand on f 's outputs.For example, here is a correct Spec for f: take_spec :: Spec '[Int, [a]] [a] take_spec = Spec $ \predict d n xs -> predict n (if n > length xs then d else d ++ thunk)See the documentation for Test.StrictCheck.Demand] for information about how to manipulate these implicit demand representations when writing Spec"s, and see the documentation for Test.StrictCheck.Examples.Lists. for more examples of writing specifications.  StrictCheck.A newtype for wrapping a comparison on demands$This is useful when constructing an # n-ary product of such comparisons.g StrictCheck1The default comparison of demands: exact equality  StrictCheck(The default way to generate inputs: via k  StrictCheck&The default way to shrink inputs: via h (from Test.QuickCheck's ` typeclass) StrictCheckjThe default way to generate random strictnesses: uniformly choose between 1 and the test configuration's size parameter StrictCheck Unwrap a Spec: constructor, returning the contained CPS-ed specification)Conceptually, this is the inverse to the Spec constructor, but because Spec is variadic, getSpec . Spec and Spec . getSpec5 don't typecheck without additional type annotation. StrictCheckGiven a list of ways to compare demands, a demand specification, and an evaluation of a particular function, determine if the function met the specification, as decided by the comparisons. If so, return the prediction of the specification. StrictCheckChecks if a given , exactly matches the prediction of a given #, returning the prediction of that Spec if notNote: In the case of success this returns Nothing; in the case of failure this returns Just the incorrect prediction. StrictCheckThe most general function for random strictness testing: all of the more convenient such functions can be derived from this oneGiven some function f, this takes as arguments:A iK record describing arguments to pass to the underlying QuickCheck engineAn  n-ary product of \% shrinkers, one for each argument of fAn  n-ary product of j& generators, one for each argument of fA j( generator for strictnesses to be testedA predicate on  s: if the + passes the predicate, it should return Nothing; otherwise, it should return Just some evidence) representing the failure (when checking +s, this evidence comes in the form of a Spec's (incorrect) prediction) the function f to be testedIf all tests succeed, (Nothing, result) is returned, where result is the underlying k type from Test.QuickCheck/. If there is a test failure, it also returns Just the failed  as well as whatever evidence was produced by the predicate. StrictCheckKCheck a function to see whether it exactly meets a strictness specificationIf the function fails to meet the specification, a counterexample is pretty-printed in a box-drawn diagram illustrating how the specification failed to match the real observed behavior of the function. StrictCheckGiven a list of generators for a function's arguments and a generator for random strictnesses (measured in number of constructors evaluated), create a generator for random %s of that function in random contexts StrictCheckYGiven a shrinker for each of the arguments of a function, the function itself, and some . of that function, produce a list of smaller  Evaluations of that functionl StrictCheck9Render a counter-example to a specification (that is, an \ paired with some expected input demands it doesn't match) as a Unicode box-drawing sketch~"#$%&'()\]hijklmnopqr       \]    None"$%&'+,-0345678;<=FKNQSTV]ei" StrictCheckA correct specification for m StrictCheckA naive specification for f, which is wrong StrictCheckA correct specification for f StrictCheck)A functionally correct implementation of f2 which has subtly different strictness properties#This will fail when tested against . StrictCheck!A correct specification of '(++)'  StrictCheckA correct specification of n! StrictCheckA correct specification for o" StrictCheck)A functionally correct implementation of o2 which has subtly different strictness properties#This will fail when tested against !.# StrictCheckA correct specification for p:, demonstrating specifications for higher-order functions$ StrictCheckGiven three lists xs, ys, and zs , compute xs ++ reverse ys ++ zs#, but with more uniform strictnessSpecifically, if ys is shorter than xsK, the work necessary to reverse it will have already occurred by the time xs is traversed.% StrictCheckSpecialization of $: rot xs ys = rotate xs ys []& StrictCheckThe naive version of %: rot' xs ys = xs ++ reverse ys#This is functionally equivalent to %, but not equivalent in strictness behavior.' StrictCheckA previous iteration of (6, this one is also correct, but may be less readable.( StrictCheckA correct specification of %6, this is also the version we presented in the paper.) StrictCheckAn incorrect specification for %0 that miscalculates the number of cells forced.+ StrictCheck"If the tail of the second list is  , replace it with the first list, StrictCheckIf the tail of the list is , replace it with []This is a special case of +.- StrictCheck/Lift an ordinary function to apply to explicit sIt is true that Demand.s are a functor, but they can't be a Haskell q because they're a type family. StrictCheckApply a  on a function to a  on a valueIt is true that Demand;s are an applicative functor, but they can't be a Haskell q because they're a type family/ StrictCheckGiven a unary function, an implicit demand on its result, and its input, compute its actual demand on its input in that context This demand is calculated using %, so it is guaranteed to be correct.0 StrictCheck=Given an implicit demand, convert it to an evaluation context That is,  toContext d a evaluates a to the degree that d- is a defined value. This uses the function X; refer to its documentation for details about how demands are used to evaluate values.1 StrictCheck"Assert at runtime that a value is not a !, failing with an error if it is !"#$%&'()*+,-./01 !"#$%&'()*+,-./01None$$%&'+,-0345678;<=FKNQSTV]ei/r StrictCheckGenerates the proper type signature for a pattern. The first argument is the list of constructor field types, and the second argument is the type of the constructor constructs. This function inserts '->' and  at the correct places.s StrictCheckMTurns a constructor into its corresponding pattern synonym declaration. The t argument is the index of the constructor. For example, Nil would be the 0th constructor, and Cons would be the 1st constructor of the type data List a = Nil | Cons a (List a).2 StrictCheckTemplate Haskell splice to generate pattern synonym declarations for working with explicitly-represented demands on a type whose " is implemented generically as a 22None%$%&'+,-0345678:;<=FKNQSTV]ei_3 StrictCheckA specialized map useful for knapsack. The pair of ints represent the two parameters to each knapsack sub-problem solved along the way. These two parameters determine the subsequence of items each sub-problem is concerned with, and the weight limit.4 StrictCheck>We roll our own map type to avoid dealing with abstract types.5 StrictCheck%A node that contains a key value pair6 StrictCheck An empty node? StrictCheck>The newtype wrapper of index into the knapsack solution table.B StrictCheckVA pattern synonym for extracting demands of each component from the demand of a pair.E StrictCheck8This replaces the thunk in a map partial value with the r) parameter. This is very similar to the cap function in the lists example.F StrictCheck2A helper for building a map from a list of values.G StrictChecklA simplified insert that ignores rebalancing since rebalancing is not important for the spec we will write.H StrictCheck-The lookup function specialized for knapsack.I StrictCheck0This function extracts all of the keys of a map.J StrictCheck1A lookup function that returns the default value `0`y for keys that are not in the map. This saves us from doing repeated pattern matching when querying the solution table.K StrictCheck*Weight parameters to the knapsack problem.L StrictCheckUValue parameters to the knapsack problem, note that this must be the same length as K.M StrictCheck)The weight limit of the knapsack problem.N StrictCheckyOne step of the knapsack computation. This is a direct translation from the recurrence relation of the knapsack problem.O StrictCheck^The fixpoint of the recurrence relation, which is also the solution for the knapsack problem.P StrictCheckThis function computes the nth pre-fixpoint of the knapsack solution, and looks up the value at the specified cell from the pre-fixpoint.Q StrictCheckThis is the same as P], but uses a newtype wrapper for the index into the map since we want to write a customized ` instance for ?.R StrictCheck{This IO action ties the spec together with everything built so far, and runs the StrictCheck randomized testing framework.S StrictCheckXThis is the specification that establishes a property important for the termination of O: given any pre-fixpoint of `pre-solution`, forcing the value at pre-solution[i][j] should not induce a demand at the (i, j) cell of the input that steps to pre-solution, since otherwise this would be an infinite loop in the fixpoint. The value-lazy 4K defined in this module satisfies this property. However, if we make this 4J value-strict using BangPatterns, StrictCheck will report a failure when R is executed.T StrictCheck0A dummy produce instance for the solution table.U StrictCheckVThe customized generator for solution tables that only generates valid pre-fixpoints.V StrictCheck?A dummy produce instance for the index into the solution table.W StrictCheckThe customized generator for ?> that only generates valid keys given the problem parameters.3465?@ABCDEFGHIJKLMNOPQRS4653CDEFGHIJKLMNOBPQ?@ARSu !"#$%&'()**++,,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijjkklmnopqrrstuuvwxyz{|}~                                             ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6789:;<=>?@AWBCCDEFG0HIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgehiehjehkelmenopbcqbr#bstbr uevwenxenyehzeh{|}~(StrictCheck-0.2.0-BGFYQvd8TVwI1ZDhpUUFymTest.StrictCheckTest.StrictCheck.Curry Test.StrictCheck.Internal.InputsTest.StrictCheck.Consume Test.StrictCheck.Internal.Shrink%Test.StrictCheck.Internal.UnevaluatedTest.StrictCheck.Produce!Test.StrictCheck.Shaped.FlattenedTest.StrictCheck.ShapedTest.StrictCheck.Internal.OmegaTest.StrictCheck.DemandTest.StrictCheck.ObserveTest.StrictCheck.Examples.ListsTest.StrictCheck.THTest.StrictCheck.Examples.Map+generics-sop-0.3.2.0-5JX38dNigUk7e65oSELmomGenerics.SOP.NP:*NilNPGenerics.SOP.ConstraintAllGenerics.SOP.BasicFunctorsICurryuncurrycurryListnilconsunconsResult-..->⋯->ArgswithCurryIdentity uncurryAllcurryAll$fListNP$fCurry: $fCurry[]InputsInputVariantvarydestructdraw$fMonoidVariant$fSemigroupVariantGConsumeConsumeconsume constructorconsumePrimitiveconsumeTrivial normalizegConsume$$fConsume(,,,,,,,,,,,,,,,,,,,,,,,,,)#$fConsume(,,,,,,,,,,,,,,,,,,,,,,,,)"$fConsume(,,,,,,,,,,,,,,,,,,,,,,,)!$fConsume(,,,,,,,,,,,,,,,,,,,,,,) $fConsume(,,,,,,,,,,,,,,,,,,,,,)$fConsume(,,,,,,,,,,,,,,,,,,,,)$fConsume(,,,,,,,,,,,,,,,,,,,)$fConsume(,,,,,,,,,,,,,,,,,,)$fConsume(,,,,,,,,,,,,,,,,,)$fConsume(,,,,,,,,,,,,,,,,)$fConsume(,,,,,,,,,,,,,,,)$fConsume(,,,,,,,,,,,,,,)$fConsume(,,,,,,,,,,,,,)$fConsume(,,,,,,,,,,,,)$fConsume(,,,,,,,,,,,)$fConsume(,,,,,,,,,,)$fConsume(,,,,,,,,,)$fConsume(,,,,,,,,)$fConsume(,,,,,,,)$fConsume(,,,,,,)$fConsume(,,,,,)$fConsume(,,,,)$fConsume(,,,) $fConsume(,,) $fConsume(,)$fConsumeIntSet$fConsumeIntMap $fConsumeSet $fConsumeSeq $fConsumeMap $fConsumeTree$fConsumeNonEmpty $fConsume[]$fConsumeEither$fConsumeMaybe$fConsumeOrdering $fConsumeBool $fConsume()$fConsumeComplex$fConsumeInteger$fConsumeRatio$fConsumeFloat$fConsumeDouble $fConsumeInt $fConsumeWord $fConsumeChar$fConsumeProxy $fConsume(->)DZipperShrinknext positionsdzipperdzip axialShrinksfairInterleave Unevaluated$fExceptionUnevaluated$fShowUnevaluatedLazyrunLazyProduceproducebuildrecur returningvariadicdrawsfreely $fProduce[]$fProduceEither$fProduceMaybe$fProduceComplex$fProduceInteger$fProduceRatio$fProduceFloat$fProduceDouble $fProduceInt $fProduceWord $fProduceChar$fProduceOrdering $fProduceBool $fProduce() $fProduce(->)$fArbitraryLazy Flattened unflatten mapFlattenedtraverseFlattenedGShapedGShapeGSPrim Containing ContainerRenderedRWrap RenderLevel ConstructorDInfixDRecordDCustomDQName%WrapShapedShapeprojectembedmatchrenderunwrap translate translateAfoldfoldMunfoldunfoldMfuse interleave unzipWith unzipWithM renderfoldprojectContainerembedContainerunPrim projectPrim embedPrim matchPrimflatPrim renderPrimrenderConstantgProjectgEmbedgMatchgRender$fShaped(,,,,,,)$fShaped(,,,,,)$fShaped(,,,,) $fShaped(,,,) $fShaped(,,) $fShaped(,)$fShapedComplex$fShapedInteger $fShapedRatio $fShapedFloat$fShapedDouble $fShapedInt $fShapedWord $fShapedChar $fShaped(->) $fShaped[]$fShapedEither $fShapedMaybe$fShapedOrdering $fShapedBool $fShaped()$fEqRenderLevel$fOrdRenderLevel$fShowRenderLevel$fFunctorRenderLevel$fEqContaining$fOrdContaining$fShowContaining$fEqPrim $fOrdPrim $fShowPrim $fNumPrimOmegaSucc forceOmega$fProduceOmega$fGenericOmega$fGenericOmega0$fHasDatatypeInfoOmega $fShapedOmega PosDemandDemandThunkEvalTEthunkisThunktoDemand fromDemand shrinkDemandevaluateDemandshowPrettyFieldThunkS prettyDemand printDemandeqDemand $fNumThunk$fApplicativeThunk$fEq% $fEqThunk $fOrdThunk $fShowThunk$fFunctorThunk$fFoldableThunk$fTraversableThunk$fGenericThunkobserve1 observeNPobserveentangle instrument Evaluationinputs inputDemands resultDemand StrictCheck StrictnessSpecDemandComparison genViaProduceshrinkViaArbitrarystrictnessViaSizedgetSpeccompareToSpecWith equalToSpecstrictCheckWithResultsstrictCheckSpecExactevaluationForallshrinkEvalWith$fShowEvaluation$fEqStrictness$fOrdStrictness$fShowStrictness$fNumStrictness length_spectake_spec_too_easy take_spectake' append_spec reverse_speczip_speczip'map_specrotaterotrot'rot_spec rot_spec'rot_simple_spectest_rot replaceThunkcap%$%*specify1 toContext expectTotalderivePatternSynonymsKMapMapBinEmpty $fGenericMap $fShowMap$fEqMap$fOrdMap $fGenericMap0$fHasDatatypeInfoMap $fShapedMapKeygetKeyPair'Empty'Bin'fromListinsertlookupkeys!weightsvalueslimit solutionStepsolution iterSolutioniterSolutionWithKey runMapTestiterSolution_spec $fProduceMap$fArbitraryMap $fProduceKey$fArbitraryKey $fGenericKey $fShowKey$fEqKey$fOrdKey $fGenericKey0$fHasDatatypeInfoKey $fConsumeKey $fShapedKey(QuickCheck-2.11.3-58QsvdIMmwDDNaUIIDmLArTest.QuickCheck.Arbitrary ArbitrarybaseData.TraversabletraverseGHC.Basefmap ApplicativeMonadGHC.Show showsPrecGHC.ListtakecompareEqualityshrinkTest.QuickCheck.TestTest.QuickCheck.GenGendisplayCounterSpec Data.FoldablelengthreversezipmapFunctorpatternTypeDecconstructor2PatternDecghc-prim GHC.TypesInt