úÎ!‡|Ė„      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ(c) Sergey Vinokurov 2019BSD-2 (see LICENSE) sergey@debianSafe ,-=?@AHV  constrainedHCombine constraints for a case when one functors contains the other one. constrainedRCombine constraints of two functors together to form a bigger set of constraints. constrainedUsed to specify values for A type family to indicate absence of any constraints (i.e. empty „). constrainedĸSpecification of constrains that a functor might impose on its elements. For example, sets typically require that their elements are ordered and unboxed vectors require elements to have an instance of special class that allows them to be packed in memory.NB The Ũ type family is associated with a typeclass in order to improve type inference. Whenever a typeclass constraint will be present, instance is guaranteed to exist and typechecker is going to take advantage of that.(c) Sergey Vinokurov 2019BSD-2 (see LICENSE) sergey@debianNone /HVXr% constrainedLike E but allows elements to have constraints on them. Laws are the same. constrained3Combine the elements of a structure using a monoid. constrainedHMap each element of the structure to a monoid, and combine the results. constrained&Right-associative fold of a structure.In the case of lists, ģ, when applied to a binary operator, a starting value (typically the right-identity of the operator), and a list, reduces the list using the binary operator, from right to left: Acfoldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)ˆNote that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, < can produce a terminating expression from an infinite list.For a general 5 structure this should be semantically identical to,  cfoldr f z =  f z . %  constrainedTRight-associative fold of a structure, but with strict application of the operator.! constrained%Left-associative fold of a structure.In the case of lists, !ģ, when applied to a binary operator, a starting value (typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right: Fcfoldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xnyNote that to produce the outermost application of the operator the entire input list must be traversed. This means that ") will diverge if given an infinite list.MAlso note that if you want an efficient left-fold, you probably want to use " instead of !O. The reason for this is that latter does not force the "inner" results (e.g. z f x1F in the above example) before applying them to the operator (e.g. to (f x2)"). This results in a thunk chain O(n)B elements long, which then must be evaluated from the outside-in.For a general 5 structure this should be semantically identical to,  cfoldl f z =   f z . %" constrainedRLeft-associative fold of a structure but with strict application of the operator.ĸThis ensures that each step of the fold is forced to weak head normal form before being applied, avoiding the collection of thunks that would otherwise occur. This is often what you want to strictly reduce a finite list to a single, monolithic result (e.g. ').For a general 5 structure this should be semantically identical to,  cfoldl f z =   f z . %# constrained A variant of N that has no base case, and thus may only be applied to non-empty structures. # f =   f . %$ constrained A variant of !N that has no base case, and thus may only be applied to non-empty structures. $ f =   f . %% constrained4List of elements of a structure, from left to right.& constrainedŦTest whether the structure is empty. The default implementation is optimized for structures that are similar to cons-lists, because there is no general way to do better.' constrained4Returns the size/length of a finite structure as an …‰. The default implementation is optimized for structures that are similar to cons-lists, because there is no general way to do better.( constrained(Does the element occur in the structure?) constrained-The largest element of a non-empty structure.* constrained+The least element of a non-empty structure.+ constrainedThe +9 function computes the sum of the numbers of a structure., constrainedThe ,> function computes the product of the numbers of a structure.- constrainedbMonadic fold over the elements of a structure, associating to the right, i.e. from right to left.. constrainedaMonadic fold over the elements of a structure, associating to the left, i.e. from left to right./ constrainedĨMap each element of a structure to an action, evaluate these actions from left to right, and ignore the results. For a version that doesn't ignore the results see  .0 constrained0 is /P with its arguments flipped. For a version that doesn't ignore the results see .for_ [1..4] print12341 constrained­Map each element of a structure to a monadic action, evaluate these actions from left to right, and ignore the results. For a version that doesn't ignore the results see  .2 constrained2 is 1P with its arguments flipped. For a version that doesn't ignore the results see  .3 constrained†Evaluate each action in the structure from left to right, and ignore the results. For a version that doesn't ignore the results see  .4 constrainedŽEvaluate each monadic action in the structure from left to right, and ignore the results. For a version that doesn't ignore the results see  .5 constrained1The sum of a collection of actions, generalizing . asum [Just Hello, Nothing, Just World] Just Hello6 constrained1The sum of a collection of actions, generalizing .7 constrained>The concatenation of all the elements of a container of lists.8 constrainedYMap a function over all the elements of a container and concatenate the resulting lists.9 constrained9I returns the conjunction of a container of Bools. For the result to be † , the container must be finite; ‡, however, results from a ‡& value finitely far from the left end.: constrained:I returns the disjunction of a container of Bools. For the result to be ‡ , the container must be finite; †, however, results from a †& value finitely far from the left end.; constrainedHDetermines whether any element of the structure satisfies the predicate.< constrainedGDetermines whether all elements of the structure satisfy the predicate.= constrained\The largest element of a non-empty structure with respect to the given comparison function.> constrainedZThe least element of a non-empty structure with respect to the given comparison function.? constrained? is the negation of (.@ constrainedThe @{ function takes a predicate and a structure and returns the leftmost element of the structure matching the predicate, or ˆ if there is no such element.' !"#$%&'()*+,-./0123456789:;<=>?@' !"#$%&'()*+,-./0123456789:;<=>?@(c) Sergey Vinokurov 2019BSD-2 (see LICENSE) sergey@debianNone /8HVXvėU constrainedLike ‰E but allows elements to have constraints on them. Laws are the same: 2cmap id == id cmap (f . g) == cmap f . cmap gUVWUVW(c) Sergey Vinokurov 2019BSD-2 (see LICENSE) sergey@debianNone ,8=>?HV˜l constrainedLike ŠE but allows elements to have constraints on them. Laws are the same: Ictraverse pure == pure ctraverse (f <=< g) == ctraverse f <=< ctraverse g;NB There's no aplicative version because Vectors from the  )http://hackage.haskell.org/package/vectorg package only support monadic traversals. Since they're one of the main motivation for this package, ‹& version of traversals will not exist.o constrainedm with araguments flipped.lmnolmnoŒ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š˜™›˜™œ˜™žŸ žĄĒž ĢžĄĪĨ&constrained-0.1-AMDVpaabrdWEhLMuu6moPSData.ConstrainedData.Foldable.ConstrainedData.Functor.ConstrainedData.Traversable.Constrained Data.FoldableFoldableListfoldrfoldlfoldl'foldr1foldl1Data.TraversabletraversecformapMforM sequenceAsequenceconcatComposeConstraintsUnionConstraints NoConstraints Constrained Constraints$fConstrainedk2TYPEAlt$fConstrainedk2TYPEAp$fConstrainedTYPETYPEProduct$fConstrainedTYPETYPESum$fConstrainedTYPETYPEDual$fConstrainedTYPETYPELast$fConstrainedTYPETYPEFirst$fConstrainedTYPETYPEMax$fConstrainedTYPETYPEMin$fConstrainedTYPETYPEZipList$fConstrainedk2TYPEConst$fConstrainedTYPETYPEEither$fConstrainedTYPETYPEMaybe$fConstrainedTYPETYPE(,)$fConstrainedTYPETYPEIdentity$fConstrainedTYPETYPENonEmpty$fConstrainedTYPETYPE[]$fNoConstraintska$fConstrainedk2TYPESum$fConstrainedk2TYPEProduct$fUnionConstraintsk1k2fga$fConstrainedk2TYPECompose$fComposeConstraintsk2k1k3fga CFoldablecfoldcfoldMapcfoldrcfoldr'cfoldlcfoldl'cfoldr1cfoldl1ctoListcnullclengthcelemcmaximumcminimumcsumcproductcfoldrMcfoldlM ctraverse_cfor_cmapM_cforM_ csequenceA_ csequence_casumcmsumcconcat cconcatMapcandcorcanycall cmaximumBy cminimumBycnotElemcfind$fCFoldableSum$fCFoldableProduct$fCFoldableCompose$fCFoldableAlt $fCFoldableAp$fCFoldableProduct0$fCFoldableSum0$fCFoldableDual$fCFoldableLast$fCFoldableFirst$fCFoldableMax$fCFoldableMin$fCFoldableZipList$fCFoldableConst$fCFoldableEither$fCFoldableMaybe$fCFoldable(,)$fCFoldableIdentity$fCFoldableNonEmpty $fCFoldable[]CFunctorcmapcmap_ $fCFunctorSum$fCFunctorProduct$fCFunctorCompose $fCFunctorAlt $fCFunctorAp$fCFunctorProduct0$fCFunctorSum0$fCFunctorDual$fCFunctorLast$fCFunctorFirst $fCFunctorMax $fCFunctorMin$fCFunctorZipList$fCFunctorConst$fCFunctorEither$fCFunctorMaybe $fCFunctor(,)$fCFunctorIdentity$fCFunctorNonEmpty $fCFunctor[] CTraversable ctraverse csequence$fCTraversableSum$fCTraversableProduct$fCTraversableCompose$fCTraversableAlt$fCTraversableAp$fCTraversableProduct0$fCTraversableSum0$fCTraversableDual$fCTraversableLast$fCTraversableFirst$fCTraversableMax$fCTraversableMin$fCTraversableZipList$fCTraversableConst$fCTraversableEither$fCTraversableMaybe$fCTraversable(,)$fCTraversableIdentity$fCTraversableNonEmpty$fCTraversable[]ghc-prim GHC.Types ConstraintIntTrueFalsebase GHC.MaybeNothingGHC.BaseFunctor Traversable Applicative