úÎ!‚"z:‰      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ(c) Sjoerd Visscher 2014 BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portable TrustworthyMSXBè0 unfoldable8Return a generator of values of a given depth. Returns ‰M if there are no values of that depth or deeper. The depth is the number of  calls. unfoldableNatural transformations  unfoldable  flips the <|> operator from Š.  unfoldableAn   changes the way an  unfolds. unfoldableJLift a computation from the argument unfolder to the constructed unfolder. unfoldable Variant of / that does multiplication of the constants for <*> and addition for <|>. unfoldableyA variant of Test.QuickCheck.Gen, with failure and a count of the number of recursive positions and parameter positions. unfoldableiUnfolders provide a way to unfold data structures. The methods have default implementations in terms of Š, but you can implement s to act on recursive positions of the data structure, or simply to provide a faster implementation than 'foldr (( |) . f) empty'. unfoldable'Choose one of the values from the list. unfoldableDChoose one of the values from the list and apply the given function. unfoldableGiven a number n, return a number between '0' and 'n - 1'. unfoldableIf an unfolder is monadic,  can be implemented in terms of .  unfoldableIf an unfolder is monadic,  can be implemented in terms of .! unfoldable(If a datatype is enumerable, we can use y to generate a value. This is the function to use if you want to unfold a datatype that has no type arguments (has kind *)." unfoldableIIf a datatype is also bounded, we can choose between all possible values. 'boundedEnum = between minBound maxBound# unfoldable# uses ± to generate a value. It chooses between the lower bound and one of the higher values. This means that f.e. breadth-first unfolding and arbitrary will prefer lower values.$ unfoldable )boundedEnumD = betweenD minBound maxBound& unfoldable5Run an unfolding function with one argument using an  %, given a way to run the transformer.' unfoldable6Run an unfolding function with two arguments using an  %, given a way to run the transformer.( unfoldable8Run an unfolding function with three arguments using an  %, given a way to run the transformer.) unfoldable!Apply a certain function of type  f a -> f a to the result of a . The depth is passed as ‹E, so you can apply a different function at each depth. Because of a forall(, the function needs to be wrapped in a  constructor. See *) for an example how to use this function.* unfoldable Limit the depth of an unfolding.+ unfoldableVChange the order of unfolding to be breadth-first, by maximum depth of the components., unfoldableZChange the order of unfolding to be breadth-first, by the sum of depths of the components.- unfoldable"Don't choose but return all items.. unfoldableDerived instance./ unfoldableDerived instance.0 unfoldableDerived instance.1 unfoldableDerived instance.2 unfoldableDerived instance.3 unfoldableDerived instance.4 unfoldableDerived instance.5 unfoldableDerived instance.6 unfoldableDerived instance.7 unfoldableDerived instance.8 unfoldableDerived instance.9 unfoldableDerived instance.: unfoldableAlways choose the first item.; unfoldable"Don't choose but return all items.< unfoldableDerived instance.= unfoldableDerived instance.> unfoldableChoose randomly.A unfoldableqLimit the depth of the generated data structure by dividing the given size by the number of recursive positions.E unfoldable@Unfolds to a constant numeric value. Useful for counting shapes.I unfoldable;Get the nth value from the sequence of all possible values.N unfoldable"Reverse the list passed to choose.Q unfoldableNApplies a certain function depending on the depth at every recursive position.S unfoldable,Choose between values of a given depth only.-  !"#$%&'()*+,- !#"$% &'(  )*+,(c) Sjoerd Visscher 2014 BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafe8>PUVkcİc unfoldable%Data structures that can be unfolded.For example, given a data type 7data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)a suitable instance would be Šinstance Unfoldable Tree where unfold fa = choose [ pure Empty , Leaf <$> fa , Node <$> unfold fa <*> fa <*> unfold fa ])i.e. it follows closely the instance for Œ1, but instead of matching on an input value, we  from a list of all cases. Instead of manually writing the c instance, you can add a deriving " to your datatype and declare an c* instance without giving a definition for d.;For example the previous example can be simplified to just: ˜{-# LANGUAGE DeriveGeneric #-} import GHC.Generics data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a) deriving Generic1 instance Unfoldable Treed unfoldable`Given a way to generate elements, return a way to generate structures containing those elements.e unfoldable#Unfold the structure, always using () as elements.f unfoldable?Breadth-first unfold, which orders the result by the number of  calls.g unfoldable1Unfold the structure breadth-first, always using () as elements.h unfoldableunfoldrC builds a data structure from a seed value. It can be specified as: /unfoldr f z == fromList (Data.List.unfoldr f z)i unfoldable½Create a data structure using the list as input. This can fail because there might not be a data structure with the same number of element positions as the number of elements in the list.j unfoldable$Always choose the first constructor.k unfoldable#Always choose the last constructor.l unfoldable$Generate all the values depth-first.m unfoldable8Generate all the values upto a given depth, depth-first.n unfoldable&Generate all the values breadth-first.o unfoldable=Generate a random value, can be used as default instance for .p unfoldableEProvides a QuickCheck generator, can be used as default instance for .cdefghijklmnopcdefghijklmnop(c) Sjoerd Visscher 2014 BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafeyî } unfoldable,Data structures with 2 type arguments (kind  * -> * -> *) that can be unfolded.For example, given a data type =data Tree a b = Empty | Leaf a | Node (Tree a b) b (Tree a b)a suitable instance would be ›instance Biunfoldable Tree where biunfold fa fb = choose [ pure Empty , Leaf <$> fa , Node <$> biunfold fa fb <*> fb <*> biunfold fa fb ])i.e. it follows closely the instance for  Bitraversable1, but instead of matching on an input value, we  from a list of all cases.~ unfoldable`Given a way to generate elements, return a way to generate structures containing those elements. unfoldable#Unfold the structure, always using () as elements.€ unfoldable?Breadth-first unfold, which orders the result by the number of  calls. unfoldable1Unfold the structure breadth-first, always using () as elements.‚ unfoldable biunfoldr+ builds a data structure from a seed value.ƒ unfoldable¿Create a data structure using the lists as input. This can fail because there might not be a data structure with the same number of element positions as the number of elements in the lists.„ unfoldable=Generate a random value, can be used as default instance for .… unfoldableEProvides a QuickCheck generator, can be used as default instance for . }~€‚ƒ„… }~€‚ƒ„…         !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€mn‚ƒ„…†‡…ˆ‰Š‹Œ……‘’“”•–%unfoldable-1.0-4Iab4zW5WTH6jbbYigpuAB Data.UnfolderData.UnfoldableData.Biunfoldable Data.FunctorConstantSplitBFSgetBFSWithRec getWithRecNTgetNTDualAgetDualAUnfolderTransformerliftNthsizegetNthNumConst getNumConstArbRandom getRandomUnfolderchoose chooseMap chooseIntchooseMonadDefaultchooseMapMonadDefaultbetween boundedEnumbetweenD boundedEnumDarbUnitalaala2ala3withRec limitDepthbfsbfsBySum $fUnfolderSeq$fUnfolderWriterT$fUnfolderReaderT$fUnfolderStateT$fUnfolderRWST$fUnfolderMaybeT$fUnfolderListT$fUnfolderExceptT$fUnfolderLift$fUnfolderBackwards$fUnfolderReverse$fUnfolderCompose$fUnfolderProduct$fUnfolderMaybe $fUnfolder[]$fUnfolderWrappedArrow$fUnfolderWrappedMonad$fUnfolderRandom$fMonadPlusRandom$fAlternativeRandom $fUnfolderArb$fAlternativeArb$fApplicativeArb $fFunctorArb$fUnfolderNumConst$fAlternativeNumConst$fApplicativeNumConst$fFunctorNumConst $fUnfolderNth$fAlternativeNth$fApplicativeNth $fFunctorNth$fUnfolderTransformerDualA$fUnfolderDualA$fAlternativeDualA$fUnfolderTransformerWithRec$fUnfolderWithRec$fUnfolderTransformerBFS $fUnfolderBFS$fAlternativeBFS$fApplicativeBFS $fFunctorBFS$fFunctorRandom$fApplicativeRandom $fMonadRandom $fEqNumConst$fShowNumConst $fEqDualA $fShowDualA$fFunctorDualA$fApplicativeDualA$fFunctorWithRec$fApplicativeWithRec$fAlternativeWithRec Unfoldableunfoldunfold_unfoldBF unfoldBF_unfoldrfromListleftMost rightMost allDepthFirst allToDepthallBreadthFirst randomDefaultarbitraryDefault$fUnfoldableTree$fUnfoldableSeq$fUnfoldableReverse$fUnfoldableCompose$fUnfoldableSum$fUnfoldableProduct$fUnfoldableConstant$fUnfoldableIdentity$fUnfoldable(,)$fUnfoldableEither$fUnfoldableMaybe$fUnfoldable[] Biunfoldablebiunfold biunfold_ biunfoldBF biunfoldBF_ biunfoldr fromLists$fBiunfoldableConstant$fBiunfoldable(,)$fBiunfoldableEitherbase GHC.MaybeNothingGHC.Base Alternativeghc-prim GHC.TypesIntData.Traversable Traversable GHC.GenericsGeneric1!random-1.1-3ypV4EIycgb35PKjTYYr5q System.Random&QuickCheck-2.14-E1qSA4q2PH0CD7Aisn3R7OTest.QuickCheck.Arbitrary Arbitrary