| 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 [] | |
| Alternative Maybe | |
| Alternative IO | |
| Alternative U1 | |
| Alternative Option | |
| Alternative Seq | |
| Alternative f => Alternative (Rec1 f) | |
| MonadPlus m => Alternative (WrappedMonad m) | |
| Alternative (Proxy *) | |
| (Alternative f, Alternative g) => Alternative ((:*:) f g) | |
| (Alternative f, Applicative g) => Alternative ((:.:) f g) | |
| (ArrowZero a, ArrowPlus a) => Alternative (WrappedArrow a b) | |
| Alternative f => Alternative (Alt * f) | |
| Alternative f => Alternative (M1 i c 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.
A set of integers.
A Map from keys k to values a.
Instances
| Functor (Map k) | |
| Foldable (Map k) | |
| Traversable (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 | |
| Monoid () | |
| Monoid All | |
| Monoid Any | |
| Monoid IntSet | |
| Monoid [a] | |
| Monoid a => Monoid (Maybe a) | Lift a semigroup into |
| Monoid a => Monoid (IO a) | |
| Monoid a => Monoid (Identity a) | |
| (Ord a, Bounded a) => Monoid (Min a) | |
| (Ord a, Bounded a) => Monoid (Max a) | |
| Monoid m => Monoid (WrappedMonoid m) | |
| Semigroup a => Monoid (Option a) | |
| Monoid a => Monoid (Dual a) | |
| Monoid (Endo a) | |
| Num a => Monoid (Sum a) | |
| Num a => Monoid (Product a) | |
| Monoid (First a) | |
| Monoid (Last a) | |
| Monoid (IntMap a) | |
| Monoid (Seq a) | |
| Ord a => Monoid (Set a) | |
| Monoid b => Monoid (a -> b) | |
| (Monoid a, Monoid b) => Monoid (a, b) | |
| Monoid (Proxy k s) | |
| Ord k => Monoid (Map k v) | |
| (Monoid a, Monoid b, Monoid c) => Monoid (a, b, c) | |
| Monoid a => Monoid (Const k a b) | |
| Alternative f => Monoid (Alt * f a) | |
| (Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d) | |
| (Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e) | |
Non-empty (and non-strict) list type.
Since: 4.9.0.0
Instances
| Monad NonEmpty | |
| Functor NonEmpty | |
| MonadFix NonEmpty | |
| Applicative NonEmpty | |
| Foldable NonEmpty | |
| Traversable NonEmpty | |
| Generic1 NonEmpty | |
| MonadZip NonEmpty | |
| IsList (NonEmpty a) | |
| 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) | |
| Semigroup (NonEmpty a) | |
| type Rep1 NonEmpty | |
| type Rep (NonEmpty a) | |
| type Item (NonEmpty a) | |
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 Void | |
| Ord Version | |
| Ord AsyncException | |
| Ord ArrayException | |
| Ord ExitCode | |
| Ord All | |
| Ord Any | |
| Ord Fixity | |
| Ord Associativity | |
| Ord SourceUnpackedness | |
| Ord SourceStrictness | |
| Ord DecidedStrictness | |
| Ord SomeNat | |
| Ord SomeSymbol | |
| Ord IntSet | |
| Ord a => Ord [a] | |
| Ord a => Ord (Maybe a) | |
| Ord (Ptr a) | |
| Ord (FunPtr a) | |
| Ord (V1 p) | |
| Ord (U1 p) | |
| Ord p => Ord (Par1 p) | |
| Ord a => Ord (Identity a) | |
| Ord a => Ord (Min a) | |
| Ord a => Ord (Max a) | |
| Ord a => Ord (First a) | |
| Ord a => Ord (Last a) | |
| Ord m => Ord (WrappedMonoid m) | |
| Ord a => Ord (Option 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) | |
| 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 b, Ord a) => Ord (Either a b) | |
| Ord (f p) => Ord (Rec1 f p) | |
| Ord (URec Char p) | |
| Ord (URec Double p) | |
| Ord (URec Float p) | |
| Ord (URec Int p) | |
| Ord (URec Word p) | |
| Ord (URec (Ptr ()) p) | |
| (Ord a, Ord b) => Ord (a, b) | |
| Ord a => Ord (Arg a b) | |
| Ord (Proxy k s) | |
| (Ord k, Ord v) => Ord (Map k v) | |
| Ord c => Ord (K1 i c p) | |
| (Ord (g p), Ord (f p)) => Ord ((:+:) f g p) | |
| (Ord (g p), Ord (f p)) => Ord ((:*:) f g p) | |
| Ord (f (g p)) => Ord ((:.:) f g p) | |
| (Ord a, Ord b, Ord c) => Ord (a, b, c) | |
| Ord a => Ord (Const k a b) | |
| Ord (f a) => Ord (Alt k f a) | |
| Ord ((:~:) k a b) | |
| Ord (f p) => Ord (M1 i c f p) | |
| (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d) | |
| (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 | |
| Alternative Seq | |
| MonadPlus 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.