!%?      !"#$%&'()*+,-./0123456789:;<=> (c) 2014, Andrew G. Seniuk BSD-style (see the file LICENSE) Andrew Seniuk <rasfar@gmail.com> experimentalportableNone+0Note that only ,   and * allow for explicit recursion. The other ,s are in leaf position when they occur in a .Spark the full forcing (rnf) of this subtree.Spark rnfn n of this subtree.+Spark the pattern matching of this subtree.aDon't even unwrap the constructor of this node, if it's type is in the list; otherwise behave as ,. (Note this behaviour is the complement of   behaviour.)  Fully force (rnfo) the whole branch under this node, if the node type matches any of the types in the list; otherwise behave as  . rnfn nS the branch under this node, if the node type matches any of the types in the list. ZMatch any of the types in the list (and continue pattern matching descendants); behave as  N for nodes of type not in the list. (Note this behaviour is the complement of  behaviour.) /Don't even unwrap the constructor of this node.  Fully force (rnf#) the whole branch under this node.rnfn n the branch under this node.6Stop recursing (nothing more forced down this branch).&Continue pattern matching descendants.?Using String instead of TypeRep since I wasn't sure how to avoid mandatory recursion to complete the latter. (Probably it can be done -- :~:B perhaps -- but I was unsure and this is working for the moment.) Inverse of .  .  patstring = patstringprovided that  patstring8 succeeds. (And, only up to subpatterns elided from # (  or  ) or from * ( , ,  ,  ,  or  ) nodes.)# @ABCD?EFGHIJK    @ABCD?EFGHIJK(c) 2014, Andrew G. Seniuk BSD-style (see the file LICENSE) Andrew Seniuk <rasfar@gmail.com> provisional:portable, except mkPat, mkPatN and growPat (which use SYB)NoneHMCompute the union of a list of s.Return L. if the first pattern matches the second (and M otherwise).6Note that matching does not imply spanning. Equality (N) or O / will work there, depending on your intentions.-XXX This doesn't yet handle type-constrained s (,  ,   or   ), because  doesn't.&Compute the intersection of a list of s.-XXX This doesn't yet handle type-constrained s (,  ,   or  ).fGiven an integer depth and a pattern, truncate the pattern to extend to at most this requested depth.2There is no Nil in the Pattern type, but a single  _ node as empty pattern is a dependable way to assure the empty pattern never forces anything.lObtain a lazy pattern, matching the shape of an arbitrary term (value expression). Interior nodes will be , and leaves will be .7Note this gives counter-intuitive results when used on  aX. For example, a rose tree with a single node will have a 3-node /\ shape.) Formally,  is not idempotent on Zs, but rather grows without bound when iterated. This shouldn't be an issue in practise.`Obtain a lazy pattern, matching the shape of an arbitrary term, but only down to at most depth n. Interior nodes will be . Leaf nodes will be N if they were leaves in the host value; otherwise (i.e. if they are at depth n) they will be . Satisfies forcep .  n = forcen n.See caveat in the comment to .YElide all leaves which have no non-leaf sibling. We want the pattern to still match the same value, only less of it. Merely eliding all leaves would, in most cases, cause match failure, so we have to be a bit more subtle. There are some arbitrary decisions about the relaxation route through the lattice. (Refer to the source for details.)=Old version, for temporary compatibility of seqaid demo mode.DGrow all leaves by one level within the shape of the provided value. This creates a new d node, the common root. The argument patterns become the children of the root (order is preserved).!eIntroduce siblings at a node (interior or leaf) of the target. The first argument is target, the second is a path, and the third is a list of subpatterns for insertion, along with the indices of the child before which to insert. If this index is negative, it counts from the right. Indices are always relative to the original target as it was received."$Elide siblings at a node (interior or leaf) of the target. The first argument is target, the second is a path, and the third is a list of child indices for elision. If this index is negative, it counts from the right. Indices are always relative to the original target as it was received.#Select a leaf at random, and elide it. In order to achieve fairness, the node probabilities are weighted by nodes in branch. The path arg can "focus" the stochastic erosion to only consider leaves beneath a given node.PQRSTUVWXY !"#Z[\]^_`$  !"# !"#PQRSTUVWXY !"#Z[\]^_`(c) 2014, Andrew G. Seniuk BSD-style (see the LICENSE file) Andrew Seniuk <rasfar@gmail.com> provisionalGHCNone !"&(=K$%&ab$%&&$%$%&ab(c) 2014, Andrew G. Seniuk BSD-style (see the file LICENSE) Andrew Seniuk <rasfar@gmail.com> provisionalportableNone':A class of types that can be evaluated to arbitrary depth.)) n x y evaluates x to depth n, before returning y.This is used when expression x also appears in y, but mere evaluation of y does not force the embedded x% subexpression as deeply as we wish. The name )+ is used to illustrate the relationship to c : where cP is shallow in the sense that it only evaluates the top level of its argument, ) n' traverses (evaluates) the entire top n levels of the data structure.0A typical use is to ensure any exceptions hidden within lazy fields of a data structure do not leak outside the scope of the exception handler; another is to force evaluation of a data structure in one thread, before passing it to another thread (preventing work moving to the wrong threads). Unlike DeepSeqg, potentially infinite coinductive data types are supported by principled bounding of deep evaluation.It is also useful for diagnostic purposes when trying to understand and manipulate space/time trade-offs in lazy code, and as a less indiscriminate substitute for deepseq. Furthermore, ) can sometimes a better solution than using stict fields in your data structures, because the latter will behave strictly everywhere that its constructors are used, instead of just where its laziness is problematic.oThere may be possible applications to the prevention of resource leaks in lazy streaming, but I'm not certain.** is a variant of )& that is useful in some circumstances. forcen n x = deepseqn n x x forcen n x evaluates x to depth nK, and then returns it. Recall that, in common with all Haskell functions, forcenx only performs evaluation when upstream demand actually occurs, so essentially it turns shallow evaluation into depth-n evaluation.%'()*defghijklmnopqrstuvwxyz{|}~'()*)*'($'()*defghijklmnopqrstuvwxyz{|}~(c) 2014, Andrew G. Seniuk BSD-style (see the file LICENSE) Andrew Seniuk <rasfar@gmail.com> provisionalportableNone+HA class of types that can be evaluated over an arbitrary finite pattern.,Self-composition fuses via > "rnfp/composition" forall p1 p2 x. (.) (, p2) (, p1) x = , (  [p1, p2] ) x @(Other fusion rules, not yet documented, may also be in effect.)--<: evaluates the first argument to the depth specified by a , before returning the second..Quoting from the DeepSeq.hs (deepseq package): "deepseq can be useful for forcing pending exceptions, eradicating space leaks, or forcing lazy I/O to happen. It is also useful in conjunction with parallel Strategies (see the parallel package).  There is no guarantee about the ordering of evaluation. The implementation may evaluate the components of the structure in any order or in parallel. To impose an actual order on evaluation, use pseq from Control.Parallel in the parallel package." Composition fuses (see .)..Self-composition fuses via G "deepseqp_/composition" forall p1 p2 x1 x2. (.) (. p2 x2) (. p1 x1) = . (   [p1, p2] ) (x1,x2) @(Other fusion rules, not yet documented, may also be in effect.)jLifted result, so can cope with undefined values and still take the head in the caller (if call is after c or  for instance)./ a variant of - that is sometimes convenient: !forcep pat x = x `deepseqp pat` x forcep pat x evaluates x to the depth determined by pat, and then returns x . Note that  forcep pat x& only takes effect when the value of  forcep pat xl itself is demanded, so essentially it turns shallow evaluation into evaluation to arbitrary bounded depth.Composition fuses (see 0).0Self-composition fuses via A "forcep_/composition" forall p1 p2 x. (.) (0 p2) (0 p1) x = 0 (  [p1, p2] ) x @(Other fusion rules, not yet documented, may also be in effect.)jLifted result, so can cope with undefined values and still take the head in the caller (if call is after c or  for instance).-+,-./0  +,-./0-/.0+,,+,-./0(c) 2014, Andrew G. Seniuk BSD-style (see the file LICENSE) Andrew Seniuk <rasfar@gmail.com> experimentalGHCNone !"&=HKM 1SOP/SYB hybrid dynamic -.2SOP/Typeable hybrid dynamic -.3SOP-only dynamic -.4SOP/SYB hybrid dynamic /.5SOP/Typeable hybrid dynamic /.6SOP-only dynamic /.7SOP-only dynamic ,*. Takes an SOP generic function yielding R, which extends the pattern dynamically, depending on the type of the value node.8SOP/SYB hybrid dynamic ,. Takes a SYB GenericQ [ argument, which extends the pattern dynamically, depending on the type of the value node.9SOP/Typeable hybrid dynamic ,. Takes a SYB GenericQ [ argument, which extends the pattern dynamically, depending on the type of the value node.123456789'  +,-./0123456789 814736925123456789(c) 2014, Andrew G. Seniuk BSD-style (see the file LICENSE) Andrew Seniuk <rasfar@gmail.com> provisionalGHC (uses SOP)NoneHM:;<:;<:;<:;<(c) 2014, Andrew G. Seniuk BSD-style (see the LICENSE file) Andrew Seniuk <rasfar@gmail.com> provisionalGHCNone !"&(=K==== (c) 2014, Andrew G. Seniuk BSD-style (see the LICENSE file) Andrew Seniuk <rasfar@gmail.com> provisionalGHCNone !"&(=KM >>> > (c) 2014, Andrew G. Seniuk BSD-style (see the LICENSE file) Andrew Seniuk <rasfar@gmail.com> provisionalGHCNone$%&=>&$%=> (c) 2014, Andrew G. Seniuk BSD-style (see the file LICENSE) Andrew Seniuk <rasfar@gmail.com> provisional3portable (but GHC for a few modules using generics)NoneD  !"#$%&'()*+,-./0123456789:;<=>   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHI JKLMNOPQRSTUVWXYZXY[X\]^_`aLbcdefghijklmnopqrXstuvwxyz{|}~^LL L deepseq-bounded-0.5.3Control.DeepSeq.Bounded.PatternControl.DeepSeq.Bounded.PatAlg)Control.DeepSeq.Bounded.Generics.GSeqableControl.DeepSeq.Bounded.NFDataNControl.DeepSeq.Bounded.NFDataP"Control.DeepSeq.Bounded.NFDataPDynControl.DeepSeq.Bounded.Seqable)Control.DeepSeq.Bounded.Generics.GNFDataN)Control.DeepSeq.Bounded.Generics.GNFDataP Control.DeepSeq.Bounded.GenericsControl.DeepSeq.Bounded SeqNodeKindSpark PropagateInsulatePatNodePWPNPRTITWTNTRWIWWWNWSWRPatternRoseNode compilePatshowPat unionPats isSubPatOf intersectPats truncatePatemptyPatmkPatmkPatN shrinkPat shrinkPat_oldgrowPatliftPats splicePats elidePatserodePatgseq_gforce_grnf_NFDataNrnfndeepseqnforcenNFDataPrnfpdeepseqp deepseqp_forcepforcep_ deepseqpDyn deepseqpDyn'' deepseqpDyn' forcepDyn forcepDyn'' forcepDyn'rnfpDyn'rnfpDyn rnfpDyn''rnf_force_seq_grnfngrnfpcompileTypeRepsmytrace compilePat_translateStarNparseInt compilePat' splitPred splitPred'descenddescendT$fNFDataPatNode $fNFDataRose $fFunctorRoseghc-prim GHC.TypesTrueFalse GHC.Classes==baseGHC.BaseflipShapeunion'unionTysnubsort intersectTys intersection'zipWith_ zipWith_'growPat'shapeOfghom probDensRose probDensRose' weightedRose unzipRoseshowRosegrnf_Sgrnf_PGHC.Primseq$fNFDataN(,,,,,,,,)$fNFDataN(,,,,,,,)$fNFDataN(,,,,,,)$fNFDataN(,,,,,)$fNFDataN(,,,,)$fNFDataN(,,,) $fNFDataN(,,) $fNFDataN(,)$fNFDataNArray $fNFDataN[]$fNFDataNVersion$fNFDataNEither$fNFDataNMaybe$fNFDataNComplex$fNFDataNRatio $fNFDataN(->)$fNFDataNFixed$fNFDataNWord64$fNFDataNWord32$fNFDataNWord16$fNFDataNWord8$fNFDataNInt64$fNFDataNInt32$fNFDataNInt16 $fNFDataNInt8 $fNFDataN() $fNFDataNBool $fNFDataNChar$fNFDataNDouble$fNFDataNFloat$fNFDataNInteger $fNFDataNWord $fNFDataNInt deepseqpMPrelude$!forcepM deepseqpM_forcepM_rnfp' patMatchFail patMatchFail'$fNFDataP(,,,,,,)$fNFDataP(,,,,,)$fNFDataP(,,,,)$fNFDataP(,,,) $fNFDataP(,,) $fNFDataP(,)$fNFDataPArray $fNFDataP[]$fNFDataPVersion$fNFDataPEither$fNFDataPMaybe$fNFDataPComplex$fNFDataPRatio $fNFDataP(->)$fNFDataPFixed$fNFDataPWord64$fNFDataPWord32$fNFDataPWord16$fNFDataPWord8$fNFDataPInt64$fNFDataPInt32$fNFDataPInt16 $fNFDataPInt8 $fNFDataP() $fNFDataPBool $fNFDataPChar$fNFDataPDouble$fNFDataPFloat$fNFDataPInteger $fNFDataPWord $fNFDataPInt rnfpDynS' rnfpDynP'rnfpDynSrnfpDynP rnfpDyn''S rnfpDyn''PgrnfnSgrnfnPmytrace'grnfp'grnfpSgrnfpPgrnfpP_validategrnfpP_validate'lenxspatMatchFail''deepseq-1.3.0.2Control.DeepSeqforce$!!deepseqrnfNFData