File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -172,31 +172,31 @@ combining adjacent elements using the specified separator.
172172#### ` and `
173173
174174``` purescript
175- and :: forall f. (Foldable f) => f Boolean -> Boolean
175+ and :: forall a f. (Foldable f, BoundedLattice a ) => f a -> a
176176```
177177
178178Test whether all ` Boolean ` values in a data structure are ` true ` .
179179
180180#### ` or `
181181
182182``` purescript
183- or :: forall f. (Foldable f) => f Boolean -> Boolean
183+ or :: forall a f. (Foldable f, BoundedLattice a ) => f a -> a
184184```
185185
186186Test whether any ` Boolean ` value in a data structure is ` true ` .
187187
188188#### ` any `
189189
190190``` purescript
191- any :: forall a f. (Foldable f) => (a -> Boolean ) -> f a -> Boolean
191+ any :: forall a b f. (Foldable f, BoundedLattice b ) => (a -> b ) -> f a -> b
192192```
193193
194194Test whether a predicate holds for any element in a data structure.
195195
196196#### ` all `
197197
198198``` purescript
199- all :: forall a f. (Foldable f) => (a -> Boolean ) -> f a -> Boolean
199+ all :: forall a b f. (Foldable f, BoundedLattice b ) => (a -> b ) -> f a -> b
200200```
201201
202202Test whether a predicate holds for all elements in a data structure.
Original file line number Diff line number Diff line change @@ -157,19 +157,19 @@ intercalate sep xs = (foldl go { init: true, acc: mempty } xs).acc
157157 go { acc = acc } x = { init: false , acc: acc <> sep <> x }
158158
159159-- | Test whether all `Boolean` values in a data structure are `true`.
160- and :: forall f . (Foldable f ) => f Boolean -> Boolean
161- and = foldl (&&) true
160+ and :: forall a f . (Foldable f , BoundedLattice a ) => f a -> a
161+ and = foldl (&&) top
162162
163163-- | Test whether any `Boolean` value in a data structure is `true`.
164- or :: forall f . (Foldable f ) => f Boolean -> Boolean
165- or = foldl (||) false
164+ or :: forall a f . (Foldable f , BoundedLattice a ) => f a -> a
165+ or = foldl (||) bottom
166166
167167-- | Test whether a predicate holds for any element in a data structure.
168- any :: forall a f . (Foldable f ) => (a -> Boolean ) -> f a -> Boolean
168+ any :: forall a b f . (Foldable f , BoundedLattice b ) => (a -> b ) -> f a -> b
169169any p = or <<< foldMap (\x -> [p x])
170170
171171-- | Test whether a predicate holds for all elements in a data structure.
172- all :: forall a f . (Foldable f ) => (a -> Boolean ) -> f a -> Boolean
172+ all :: forall a b f . (Foldable f , BoundedLattice b ) => (a -> b ) -> f a -> b
173173all p = and <<< foldMap (\x -> [p x])
174174
175175-- | Find the sum of the numeric values in a data structure.
You can’t perform that action at this time.
0 commit comments