| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Data.FoldApp.Function
Description
Module of variadic functions.
All types used are re-exported.
- class Applicative f => Alternative (f :: * -> *)
- data Bool :: *
- type FoldlApp p r f = FoldlApp (~) p r f
- type FoldrApp p r f = FoldrApp (~) p r f
- data IntMap a :: * -> *
- data IntSet :: *
- data Map k a :: * -> * -> *
- class (Alternative m, Monad m) => MonadPlus (m :: * -> *)
- class Monoid a
- data NonEmpty a :: * -> *
- class Num a
- class Eq a => Ord a
- data Ordering :: *
- data Seq a :: * -> *
- data Set a :: * -> *
- allOf :: FoldrApp Bool Bool f => f
- allOfBy :: FoldlApp a Bool f => (a -> Bool) -> f
- asumOf :: forall a f g. (Alternative f, FoldrApp (f a) (f a) g) => g
- dualAsumOf :: forall a f g. (Alternative f, FoldrApp (f a) (f a) g) => g
- dualFoldOf :: forall a f. (Monoid a, FoldlApp a a f) => f
- dualMsumOf :: forall a m f. (MonadPlus m, FoldrApp (m a) (m a) f) => f
- firstOf :: forall a f. FoldlApp a a f => a -> f
- foldOf :: forall a f. (Monoid a, FoldrApp a a f) => f
- intSetOf :: forall f. FoldlApp Key IntSet f => f
- lastOf :: forall a f. FoldlApp a a f => a -> f
- lazyIntMapOf :: forall a f. FoldlApp (Key, a) (IntMap a) f => f
- lazyMapOf :: forall k a f. (Ord k, FoldlApp (k, a) (Map k a) f) => f
- listOf :: forall a f. FoldrApp a [a] f => f
- maxOf :: forall a f. (Ord a, FoldlApp a a f) => a -> f
- maxOfBy :: forall a f. (Ord a, FoldlApp a a f) => (a -> a -> Ordering) -> a -> f
- minOf :: forall a f. (Ord a, FoldlApp a a f) => a -> f
- minOfBy :: forall a f. (Ord a, FoldlApp a a f) => (a -> a -> Ordering) -> a -> f
- msumOf :: forall a m f. (MonadPlus m, FoldrApp (m a) (m a) f) => f
- nonEmptyOf :: FoldrApp a (NonEmpty a) f => a -> f
- productOf :: forall a f. (Num a, FoldlApp a a f) => f
- reverseNonEmptyOf :: FoldlApp a (NonEmpty a) f => a -> f
- reverseOf :: forall a f. FoldlApp a [a] f => f
- reverseSeqOf :: forall a f. FoldlApp a (Seq a) f => f
- seqOf :: forall a f. FoldlApp a (Seq a) f => f
- setOf :: forall a f. (Ord a, FoldlApp a (Set a) f) => f
- strictIntMapOf :: forall a f. FoldlApp (Key, a) (IntMap a) f => f
- strictMapOf :: forall k a f. (Ord k, FoldlApp (k, a) (Map k a) f) => f
- sumOf :: forall a f. (Num a, FoldlApp a a f) => f
Documentation
class Applicative f => Alternative (f :: * -> *) #
A monoid on applicative functors.
If defined, some and many should be the least solutions
of the equations:
Instances
| Alternative [] | Since: 2.1 |
| Alternative Maybe | Since: 2.1 |
| Alternative IO | Since: 4.9.0.0 |
| Alternative Seq | |
| MonadPlus m => Alternative (WrappedMonad m) | Since: 2.1 |
| ArrowPlus a => Alternative (ArrowMonad a) | Since: 4.6.0.0 |
| (ArrowZero a, ArrowPlus a) => Alternative (WrappedArrow a b) | Since: 2.1 |
| Alternative f => Alternative (Alt * f) | |
type FoldlApp p r f = FoldlApp (~) p r f Source #
Data.FoldApp.FoldlApp with the identity converter chosen.
type FoldrApp p r f = FoldrApp (~) p r f Source #
Data.FoldApp.FoldrAPp with the identity converter chosen.
A map of integers to values a.
Instances
| Functor IntMap | |
| Foldable IntMap | |
| Traversable IntMap | |
| Eq1 IntMap | |
| Ord1 IntMap | |
| Read1 IntMap | |
| Show1 IntMap | |
| IsList (IntMap a) | |
| Eq a => Eq (IntMap a) | |
| Data a => Data (IntMap a) | |
| Ord a => Ord (IntMap a) | |
| Read e => Read (IntMap e) | |
| Show a => Show (IntMap a) | |
| Semigroup (IntMap a) | |
| Monoid (IntMap a) | |
| NFData a => NFData (IntMap a) | |
| type Item (IntMap a) | |
A set of integers.
A Map from keys k to values a.
Instances
| Eq2 Map | |
| Ord2 Map | |
| Show2 Map | |
| Functor (Map k) | |
| Foldable (Map k) | |
| Traversable (Map k) | |
| Eq k => Eq1 (Map k) | |
| Ord k => Ord1 (Map k) | |
| (Ord k, Read k) => Read1 (Map k) | |
| Show k => Show1 (Map k) | |
| Ord k => IsList (Map k v) | |
| (Eq k, Eq a) => Eq (Map k a) | |
| (Data k, Data a, Ord k) => Data (Map k a) | |
| (Ord k, Ord v) => Ord (Map k v) | |
| (Ord k, Read k, Read e) => Read (Map k e) | |
| (Show k, Show a) => Show (Map k a) | |
| Ord k => Semigroup (Map k v) | |
| Ord k => Monoid (Map k v) | |
| (NFData k, NFData a) => NFData (Map k a) | |
| type Item (Map k v) | |
class (Alternative m, Monad m) => MonadPlus (m :: * -> *) #
Monads that also support choice and failure.
The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following laws:
mappend mempty x = x
mappend x mempty = x
mappend x (mappend y z) = mappend (mappend x y) z
mconcat =
foldrmappend mempty
The method names refer to the monoid of lists under concatenation, but there are many other instances.
Some types can be viewed as a monoid in more than one way,
e.g. both addition and multiplication on numbers.
In such cases we often define newtypes and make those instances
of Monoid, e.g. Sum and Product.
Instances
| Monoid Ordering | Since: 2.1 |
| Monoid () | Since: 2.1 |
| Monoid All | Since: 2.1 |
| Monoid Any | Since: 2.1 |
| Monoid IntSet | |
| Monoid [a] | Since: 2.1 |
| Monoid a => Monoid (Maybe a) | Lift a semigroup into Since: 2.1 |
| Monoid a => Monoid (IO a) | Since: 4.9.0.0 |
| Monoid a => Monoid (Dual a) | Since: 2.1 |
| Monoid (Endo a) | Since: 2.1 |
| Num a => Monoid (Sum a) | Since: 2.1 |
| Num a => Monoid (Product a) | Since: 2.1 |
| Monoid (First a) | Since: 2.1 |
| Monoid (Last a) | Since: 2.1 |
| Monoid (IntMap a) | |
| Monoid (Seq a) | |
| Ord a => Monoid (Set a) | |
| Monoid b => Monoid (a -> b) | Since: 2.1 |
| (Monoid a, Monoid b) => Monoid (a, b) | Since: 2.1 |
| Ord k => Monoid (Map k v) | |
| (Monoid a, Monoid b, Monoid c) => Monoid (a, b, c) | Since: 2.1 |
| Alternative f => Monoid (Alt * f a) | Since: 4.8.0.0 |
| (Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d) | Since: 2.1 |
| (Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e) | Since: 2.1 |
Non-empty (and non-strict) list type.
Since: 4.9.0.0
Instances
| Monad NonEmpty | Since: 4.9.0.0 |
| Functor NonEmpty | Since: 4.9.0.0 |
| MonadFix NonEmpty | Since: 4.9.0.0 |
| Applicative NonEmpty | Since: 4.9.0.0 |
| Foldable NonEmpty | Since: 4.9.0.0 |
| Traversable NonEmpty | Since: 4.9.0.0 |
| Eq1 NonEmpty | Since: 4.10.0.0 |
| Ord1 NonEmpty | Since: 4.10.0.0 |
| Read1 NonEmpty | Since: 4.10.0.0 |
| Show1 NonEmpty | Since: 4.10.0.0 |
| MonadZip NonEmpty | Since: 4.9.0.0 |
| IsList (NonEmpty a) | Since: 4.9.0.0 |
| Eq a => Eq (NonEmpty a) | |
| Data a => Data (NonEmpty a) | |
| Ord a => Ord (NonEmpty a) | |
| Read a => Read (NonEmpty a) | |
| Show a => Show (NonEmpty a) | |
| Generic (NonEmpty a) | |
| Generic1 * NonEmpty | |
| type Rep (NonEmpty a) | |
| type Item (NonEmpty a) | |
| type Rep1 * NonEmpty | |
Basic numeric class.
The Ord class is used for totally ordered datatypes.
Instances of Ord can be derived for any user-defined
datatype whose constituent types are in Ord. The declared order
of the constructors in the data declaration determines the ordering
in derived Ord instances. The Ordering datatype allows a single
comparison to determine the precise ordering of two objects.
Minimal complete definition: either compare or <=.
Using compare can be more efficient for complex types.
Instances
| Ord Bool | |
| Ord Char | |
| Ord Double | |
| Ord Float | |
| Ord Int | |
| Ord Integer | |
| Ord Ordering | |
| Ord Word | |
| Ord () | |
| Ord TyCon | |
| Ord BigNat | |
| Ord All | |
| Ord Any | |
| Ord IntSet | |
| Ord a => Ord [a] | |
| Ord a => Ord (Maybe a) | |
| Ord a => Ord (NonEmpty a) | |
| Ord a => Ord (ZipList a) | |
| Ord a => Ord (Dual a) | |
| Ord a => Ord (Sum a) | |
| Ord a => Ord (Product a) | |
| Ord a => Ord (First a) | |
| Ord a => Ord (Last a) | |
| Ord a => Ord (Down a) | Since: 4.6.0.0 |
| Ord a => Ord (IntMap a) | |
| Ord a => Ord (Seq a) | |
| Ord a => Ord (ViewL a) | |
| Ord a => Ord (ViewR a) | |
| Ord a => Ord (Set a) | |
| (Ord a, Ord b) => Ord (a, b) | |
| (Ord k, Ord v) => Ord (Map k v) | |
| (Ord a, Ord b, Ord c) => Ord (a, b, c) | |
| Ord (f a) => Ord (Alt k f a) | |
| Ord ((:~:) k a b) | |
| (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d) | |
| Ord ((:~~:) k1 k2 a b) | Since: 4.10.0.0 |
| (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e) | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) => Ord (a, b, c, d, e, f) | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g) => Ord (a, b, c, d, e, f, g) | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h) => Ord (a, b, c, d, e, f, g, h) | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i) => Ord (a, b, c, d, e, f, g, h, i) | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j) => Ord (a, b, c, d, e, f, g, h, i, j) | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k) => Ord (a, b, c, d, e, f, g, h, i, j, k) | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l) => Ord (a, b, c, d, e, f, g, h, i, j, k, l) | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m) | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n) | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n, Ord o) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) | |
General-purpose finite sequences.
Instances
| Monad Seq | |
| Functor Seq | |
| Applicative Seq | |
| Foldable Seq | |
| Traversable Seq | |
| Eq1 Seq | |
| Ord1 Seq | |
| Read1 Seq | |
| Show1 Seq | |
| MonadZip Seq | |
| Alternative Seq | |
| MonadPlus Seq | |
| UnzipWith Seq | |
| IsList (Seq a) | |
| Eq a => Eq (Seq a) | |
| Data a => Data (Seq a) | |
| Ord a => Ord (Seq a) | |
| Read a => Read (Seq a) | |
| Show a => Show (Seq a) | |
| IsString (Seq Char) | |
| Semigroup (Seq a) | |
| Monoid (Seq a) | |
| NFData a => NFData (Seq a) | |
| type Item (Seq a) | |
A set of values a.
allOfBy :: FoldlApp a Bool f => (a -> Bool) -> f Source #
True if all arguments map to True, False otherwise.
asumOf :: forall a f g. (Alternative f, FoldrApp (f a) (f a) g) => g Source #
Concatentate all arguments with <|>.
dualAsumOf :: forall a f g. (Alternative f, FoldrApp (f a) (f a) g) => g Source #
Concatenate all arguments with <|> in reverse order.
dualFoldOf :: forall a f. (Monoid a, FoldlApp a a f) => f Source #
Concatenate all argments with mappend in reverse order.
dualMsumOf :: forall a m f. (MonadPlus m, FoldrApp (m a) (m a) f) => f Source #
Concatenate all arguments with mplus in reverse order.
foldOf :: forall a f. (Monoid a, FoldrApp a a f) => f Source #
Concatenate all arguments with mappend.
lazyIntMapOf :: forall a f. FoldlApp (Key, a) (IntMap a) f => f Source #
Form a lazy IntMap from all arguments.
lazyMapOf :: forall k a f. (Ord k, FoldlApp (k, a) (Map k a) f) => f Source #
Form a lazy Map from all arguments.
maxOfBy :: forall a f. (Ord a, FoldlApp a a f) => (a -> a -> Ordering) -> a -> f Source #
Return the largest argument by the given comparator.
minOfBy :: forall a f. (Ord a, FoldlApp a a f) => (a -> a -> Ordering) -> a -> f Source #
Return the smallest argument by the given comparator.
msumOf :: forall a m f. (MonadPlus m, FoldrApp (m a) (m a) f) => f Source #
Concatentate all arguments with mplus.
nonEmptyOf :: FoldrApp a (NonEmpty a) f => a -> f Source #
Form a NonEmpty list from all arguments.
reverseNonEmptyOf :: FoldlApp a (NonEmpty a) f => a -> f Source #
Form a NonEmpty list in reverse order from all arguments.
reverseOf :: forall a f. FoldlApp a [a] f => f Source #
Form a list in reverse order from all arguments.
reverseSeqOf :: forall a f. FoldlApp a (Seq a) f => f Source #
Form a Seq in reverse order from all arguments.
strictIntMapOf :: forall a f. FoldlApp (Key, a) (IntMap a) f => f Source #
Form a strict IntMap from all arguments.