Safe Haskell | Safe-Inferred |
---|
A local Prelude, meant to be imported unqualified.
Synopsis
- data Proxy (t :: k) = Proxy
- data Map k a
- data Set a
- data IntMap a
- data IntSet
- data HashMap k v
- data HashSet a
- (<|>) :: Alternative f => f a -> f a -> f a
- first :: Bifunctor p => (a -> b) -> p a c -> p b c
- second :: Bifunctor p => (b -> c) -> p a b -> p a c
- bimap :: Bifunctor p => (a -> b) -> (c -> d) -> p a c -> p b d
- class Semigroup a => Monoid a where
- class Semigroup a where
- while :: Monad m => m Bool -> m a -> m [a]
- while_ :: Monad m => m Bool -> m a -> m ()
- allM :: Monad m => (a -> m Bool) -> [a] -> m Bool
- anyM :: Monad m => (a -> m Bool) -> [a] -> m Bool
- ifM :: Monad m => m Bool -> m a -> m a -> m a
- andM :: Monad m => [m Bool] -> m Bool
- orM :: Monad m => [m Bool] -> m Bool
- findM :: Monad m => (a -> m Bool) -> [a] -> m (Maybe a)
- partitionM :: Monad m => (a -> m Bool) -> [a] -> m ([a], [a])
- unlessM :: Monad m => m Bool -> m () -> m ()
- whenM :: Monad m => m Bool -> m () -> m ()
- whenJust :: Applicative m => Maybe a -> (a -> m ()) -> m ()
- whenJustM :: Monad m => m (Maybe a) -> (a -> m ()) -> m ()
- foldl' :: Foldable t => (b -> a -> b) -> b -> t a -> b
- mconcatMap :: Monoid b => (a -> b) -> [a] -> b
- concatMapM :: (Monad m, Monoid b) => (a -> m b) -> [a] -> m b
- mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b]
- mapMaybe :: (a -> Maybe b) -> [a] -> [b]
- fromMaybe :: a -> Maybe a -> a
- justm :: Monad m => m (Maybe a) -> (a -> m (Maybe b)) -> m (Maybe b)
- rightm :: Monad m => m (Either err a) -> (a -> m (Either err b)) -> m (Either err b)
- firstJust :: Monad m => m (Maybe a) -> m (Maybe a) -> m (Maybe a)
- firstJusts :: Monad m => [m (Maybe a)] -> m (Maybe a)
- errorStack :: Stack => Text -> a
- errorIO :: Stack => MonadIO m => Text -> m a
- justErr :: err -> Maybe a -> Either err a
- tryJust :: MonadError e m => e -> Maybe a -> m a
- tryRight :: MonadError e m => Either e a -> m a
- class Pretty a
- pretty :: Pretty a => a -> Text
- prettys :: Pretty a => a -> String
- type Lens a b = a :-> b
- (#) :: Lens a b -> Lens b c -> Lens a c
- (#$) :: Lens f a -> f -> a
- (#=) :: Lens f a -> a -> f -> f
- (%=) :: Lens f a -> (a -> a) -> f -> f
- (<#>) :: Functor f => Lens a b -> f a -> f b
- guard :: Alternative f => Bool -> f ()
- zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m ()
- zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c]
- unless :: Applicative f => Bool -> f () -> f ()
- replicateM_ :: Applicative m => Int -> m a -> m ()
- replicateM :: Applicative m => Int -> m a -> m [a]
- forever :: Applicative f => f a -> f b
- foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
- filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
- (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
- (<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
- forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
- msum :: (Foldable t, MonadPlus m) => t (m a) -> m a
- forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
- void :: Functor f => f a -> f ()
- mplus :: MonadPlus m => m a -> m a -> m a
- mzero :: MonadPlus m => m a
- when :: Applicative f => Bool -> f () -> f ()
- liftM :: Monad m => (a1 -> r) -> m a1 -> m r
- ap :: Monad m => m (a -> b) -> m a -> m b
- class (Functor t, Foldable t) => Traversable (t :: Type -> Type) where
- traverse :: Applicative f => (a -> f b) -> t a -> f (t b)
- class Foldable (t :: TYPE LiftedRep -> Type) where
- class Monad m => MonadIO (m :: Type -> Type)
- lift :: (MonadTrans t, Monad m) => m a -> t m a
- liftIO :: MonadIO m => IO a -> m a
- data NonEmpty a = a :| [a]
- data Text
- txt :: String -> Text
- untxt :: Text -> String
- showt :: Show a => a -> Text
Documentation
Proxy
is a type that holds no data, but has a phantom parameter of
arbitrary type (or even kind). Its use is to provide type information, even
though there is no value available of that type (or it may be too costly to
create one).
Historically,
is a safer alternative to the
Proxy
:: Proxy
a
idiom.undefined
:: a
>>>
Proxy :: Proxy (Void, Int -> Int)
Proxy
Proxy can even hold types of higher kinds,
>>>
Proxy :: Proxy Either
Proxy
>>>
Proxy :: Proxy Functor
Proxy
>>>
Proxy :: Proxy complicatedStructure
Proxy
Instances
Generic1 (Proxy :: k -> Type) | |
ApplicativeB (Proxy :: (k -> Type) -> Type) | |
ConstraintsB (Proxy :: (k -> Type) -> Type) | |
DistributiveB (Proxy :: (k -> Type) -> Type) | |
Defined in Barbies.Internal.DistributiveB | |
FunctorB (Proxy :: (k -> Type) -> Type) | |
Defined in Barbies.Internal.FunctorB | |
TraversableB (Proxy :: (k -> Type) -> Type) | |
Defined in Barbies.Internal.TraversableB btraverse :: Applicative e => (forall (a :: k0). f a -> e (g a)) -> Proxy f -> e (Proxy g) # | |
Foldable (Proxy :: TYPE LiftedRep -> Type) | Since: base-4.7.0.0 |
Defined in Data.Foldable fold :: Monoid m => Proxy m -> m # foldMap :: Monoid m => (a -> m) -> Proxy a -> m # foldMap' :: Monoid m => (a -> m) -> Proxy a -> m # foldr :: (a -> b -> b) -> b -> Proxy a -> b # foldr' :: (a -> b -> b) -> b -> Proxy a -> b # foldl :: (b -> a -> b) -> b -> Proxy a -> b # foldl' :: (b -> a -> b) -> b -> Proxy a -> b # foldr1 :: (a -> a -> a) -> Proxy a -> a # foldl1 :: (a -> a -> a) -> Proxy a -> a # elem :: Eq a => a -> Proxy a -> Bool # maximum :: Ord a => Proxy a -> a # minimum :: Ord a => Proxy a -> a # | |
Eq1 (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
Ord1 (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
Defined in Data.Functor.Classes | |
Read1 (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
Defined in Data.Functor.Classes | |
Show1 (Proxy :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Traversable (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
Alternative (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
Applicative (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
Functor (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
Monad (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
MonadPlus (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
NFData1 (Proxy :: TYPE LiftedRep -> Type) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
Hashable1 (Proxy :: Type -> Type) | |
Defined in Data.Hashable.Class | |
FromJSON1 (Proxy :: Type -> Type) | |
ToJSON1 (Proxy :: TYPE LiftedRep -> Type) | |
Defined in Data.Aeson.Types.ToJSON liftToJSON :: (a -> Value) -> ([a] -> Value) -> Proxy a -> Value # liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [Proxy a] -> Value # liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> Proxy a -> Encoding # liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [Proxy a] -> Encoding # | |
Monoid (Proxy s) | Since: base-4.7.0.0 |
Semigroup (Proxy s) | Since: base-4.9.0.0 |
Bounded (Proxy t) | Since: base-4.7.0.0 |
Enum (Proxy s) | Since: base-4.7.0.0 |
Generic (Proxy t) | |
Ix (Proxy s) | Since: base-4.7.0.0 |
Defined in Data.Proxy | |
Read (Proxy t) | Since: base-4.7.0.0 |
Show (Proxy s) | Since: base-4.7.0.0 |
NFData (Proxy a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
Eq (Proxy s) | Since: base-4.7.0.0 |
Ord (Proxy s) | Since: base-4.7.0.0 |
Hashable (Proxy a) | |
Defined in Data.Hashable.Class | |
FromJSON (Proxy a) | |
ToJSON (Proxy a) | |
Defined in Data.Aeson.Types.ToJSON | |
type AllB (c :: k -> Constraint) (Proxy :: (k -> Type) -> Type) | |
Defined in Barbies.Internal.ConstraintsB | |
type Rep1 (Proxy :: k -> Type) | Since: base-4.6.0.0 |
type Rep (Proxy t) | Since: base-4.6.0.0 |
A Map from keys k
to values a
.
The Semigroup
operation for Map
is union
, which prefers
values from the left operand. If m1
maps a key k
to a value
a1
, and m2
maps the same key to a different value a2
, then
their union m1 <> m2
maps k
to a1
.
Instances
Bifoldable Map | Since: containers-0.6.3.1 |
Eq2 Map | Since: containers-0.5.9 |
Ord2 Map | Since: containers-0.5.9 |
Defined in Data.Map.Internal | |
Show2 Map | Since: containers-0.5.9 |
Show Builtins Source # | |
Hashable2 Map | Since: hashable-1.3.4.0 |
Defined in Data.Hashable.Class | |
(OutputableP env key, OutputableP env elt) => OutputableP env (Map key elt) | |
Defined in GHC.Utils.Outputable | |
(Ord k, Arbitrary k) => Arbitrary1 (Map k) | |
Defined in Test.QuickCheck.Arbitrary liftArbitrary :: Gen a -> Gen (Map k a) # liftShrink :: (a -> [a]) -> Map k a -> [Map k a] # | |
Foldable (Map k) | Folds in order of increasing key. |
Defined in Data.Map.Internal fold :: Monoid m => Map k m -> m # foldMap :: Monoid m => (a -> m) -> Map k a -> m # foldMap' :: Monoid m => (a -> m) -> Map k a -> m # foldr :: (a -> b -> b) -> b -> Map k a -> b # foldr' :: (a -> b -> b) -> b -> Map k a -> b # foldl :: (b -> a -> b) -> b -> Map k a -> b # foldl' :: (b -> a -> b) -> b -> Map k a -> b # foldr1 :: (a -> a -> a) -> Map k a -> a # foldl1 :: (a -> a -> a) -> Map k a -> a # elem :: Eq a => a -> Map k a -> Bool # maximum :: Ord a => Map k a -> a # minimum :: Ord a => Map k a -> a # | |
Eq k => Eq1 (Map k) | Since: containers-0.5.9 |
Ord k => Ord1 (Map k) | Since: containers-0.5.9 |
Defined in Data.Map.Internal | |
(Ord k, Read k) => Read1 (Map k) | Since: containers-0.5.9 |
Defined in Data.Map.Internal | |
Show k => Show1 (Map k) | Since: containers-0.5.9 |
Traversable (Map k) | Traverses in order of increasing key. |
Functor (Map k) | |
Ord k => TrieMap (Map k) | |
Defined in GHC.Data.TrieMap | |
Hashable k => Hashable1 (Map k) | Since: hashable-1.3.4.0 |
Defined in Data.Hashable.Class | |
(FromJSONKey k, Ord k) => FromJSON1 (Map k) | |
ToJSONKey k => ToJSON1 (Map k) | |
Defined in Data.Aeson.Types.ToJSON liftToJSON :: (a -> Value) -> ([a] -> Value) -> Map k a -> Value # liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [Map k a] -> Value # liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> Map k a -> Encoding # liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [Map k a] -> Encoding # | |
(Ord k, Arbitrary k, Arbitrary v) => Arbitrary (Map k v) | |
(CoArbitrary k, CoArbitrary v) => CoArbitrary (Map k v) | |
Defined in Test.QuickCheck.Arbitrary coarbitrary :: Map k v -> Gen b -> Gen b # | |
(Data k, Data a, Ord k) => Data (Map k a) | |
Defined in Data.Map.Internal gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Map k a -> c (Map k a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Map k a) # toConstr :: Map k a -> Constr # dataTypeOf :: Map k a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Map k a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Map k a)) # gmapT :: (forall b. Data b => b -> b) -> Map k a -> Map k a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Map k a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Map k a -> r # gmapQ :: (forall d. Data d => d -> u) -> Map k a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Map k a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Map k a -> m (Map k a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Map k a -> m (Map k a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Map k a -> m (Map k a) # | |
Ord k => Monoid (Map k v) | |
Ord k => Semigroup (Map k v) | |
Ord k => IsList (Map k v) | Since: containers-0.5.6.2 |
(Ord k, Read k, Read e) => Read (Map k e) | |
(Show k, Show a) => Show (Map k a) | |
(Binary k, Binary e) => Binary (Map k e) | |
(Ord k, Serialize k, Serialize e) => Serialize (Map k e) | |
(NFData k, NFData a) => NFData (Map k a) | |
Defined in Data.Map.Internal | |
(Outputable key, Outputable elt) => Outputable (Map key elt) | |
Defined in GHC.Utils.Outputable | |
(Eq k, Eq a) => Eq (Map k a) | |
(Ord k, Ord v) => Ord (Map k v) | |
(Hashable k, Hashable v) => Hashable (Map k v) | Since: hashable-1.3.4.0 |
Defined in Data.Hashable.Class | |
(SizeOf k, SizeOf a) => SizeOf (Map k a) Source # | |
(Pretty k, Pretty v) => Pretty (Map k v) Source # | |
(Ord k, Serialize k, Serialize v) => Serialize (Map k v) Source # | |
(FromJSONKey k, Ord k, FromJSON v) => FromJSON (Map k v) | |
(ToJSON v, ToJSONKey k) => ToJSON (Map k v) | |
Defined in Data.Aeson.Types.ToJSON | |
type Key (Map k) | |
Defined in GHC.Data.TrieMap | |
type Item (Map k v) | |
Defined in Data.Map.Internal |
A set of values a
.
Instances
Foldable Set | Folds in order of increasing key. |
Defined in Data.Set.Internal fold :: Monoid m => Set m -> m # foldMap :: Monoid m => (a -> m) -> Set a -> m # foldMap' :: Monoid m => (a -> m) -> Set a -> m # foldr :: (a -> b -> b) -> b -> Set a -> b # foldr' :: (a -> b -> b) -> b -> Set a -> b # foldl :: (b -> a -> b) -> b -> Set a -> b # foldl' :: (b -> a -> b) -> b -> Set a -> b # foldr1 :: (a -> a -> a) -> Set a -> a # foldl1 :: (a -> a -> a) -> Set a -> a # elem :: Eq a => a -> Set a -> Bool # maximum :: Ord a => Set a -> a # | |
Eq1 Set | Since: containers-0.5.9 |
Ord1 Set | Since: containers-0.5.9 |
Defined in Data.Set.Internal | |
Show1 Set | Since: containers-0.5.9 |
Hashable1 Set | Since: hashable-1.3.4.0 |
Defined in Data.Hashable.Class | |
ToJSON1 Set | |
Defined in Data.Aeson.Types.ToJSON | |
OutputableP env a => OutputableP env (Set a) | |
Defined in GHC.Utils.Outputable | |
(Ord a, Arbitrary a) => Arbitrary (Set a) | |
CoArbitrary a => CoArbitrary (Set a) | |
Defined in Test.QuickCheck.Arbitrary coarbitrary :: Set a -> Gen b -> Gen b # | |
(Data a, Ord a) => Data (Set a) | |
Defined in Data.Set.Internal gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Set a -> c (Set a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Set a) # dataTypeOf :: Set a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Set a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Set a)) # gmapT :: (forall b. Data b => b -> b) -> Set a -> Set a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Set a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Set a -> r # gmapQ :: (forall d. Data d => d -> u) -> Set a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Set a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Set a -> m (Set a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Set a -> m (Set a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Set a -> m (Set a) # | |
Ord a => Monoid (Set a) | |
Ord a => Semigroup (Set a) | Since: containers-0.5.7 |
Ord a => IsList (Set a) | Since: containers-0.5.6.2 |
(Read a, Ord a) => Read (Set a) | |
Show a => Show (Set a) | |
Binary a => Binary (Set a) | |
(Ord a, Serialize a) => Serialize (Set a) | |
NFData a => NFData (Set a) | |
Defined in Data.Set.Internal | |
Outputable a => Outputable (Set a) | |
Defined in GHC.Utils.Outputable | |
Eq a => Eq (Set a) | |
Ord a => Ord (Set a) | |
Hashable v => Hashable (Set v) | Since: hashable-1.3.4.0 |
Defined in Data.Hashable.Class | |
ShowVal a => ShowVal (Set a) Source # | |
ToVal a => ToVal (Set a) Source # | |
(Typecheck a, Ord a) => Typecheck (Set a) Source # | |
Pretty a => Pretty (Set a) Source # | |
(Ord a, Serialize a) => Serialize (Set a) Source # | |
(Ord a, FromJSON a) => FromJSON (Set a) | |
ToJSON a => ToJSON (Set a) | |
Defined in Data.Aeson.Types.ToJSON | |
type Item (Set a) | |
Defined in Data.Set.Internal |
A map of integers to values a
.
Instances
Arbitrary1 IntMap | |
Defined in Test.QuickCheck.Arbitrary liftArbitrary :: Gen a -> Gen (IntMap a) # liftShrink :: (a -> [a]) -> IntMap a -> [IntMap a] # | |
Foldable IntMap | Folds in order of increasing key. |
Defined in Data.IntMap.Internal fold :: Monoid m => IntMap m -> m # foldMap :: Monoid m => (a -> m) -> IntMap a -> m # foldMap' :: Monoid m => (a -> m) -> IntMap a -> m # foldr :: (a -> b -> b) -> b -> IntMap a -> b # foldr' :: (a -> b -> b) -> b -> IntMap a -> b # foldl :: (b -> a -> b) -> b -> IntMap a -> b # foldl' :: (b -> a -> b) -> b -> IntMap a -> b # foldr1 :: (a -> a -> a) -> IntMap a -> a # foldl1 :: (a -> a -> a) -> IntMap a -> a # elem :: Eq a => a -> IntMap a -> Bool # maximum :: Ord a => IntMap a -> a # minimum :: Ord a => IntMap a -> a # | |
Eq1 IntMap | Since: containers-0.5.9 |
Ord1 IntMap | Since: containers-0.5.9 |
Defined in Data.IntMap.Internal | |
Read1 IntMap | Since: containers-0.5.9 |
Defined in Data.IntMap.Internal | |
Show1 IntMap | Since: containers-0.5.9 |
Traversable IntMap | Traverses in order of increasing key. |
Functor IntMap | |
TrieMap IntMap | |
Defined in GHC.Data.TrieMap | |
Hashable1 IntMap | Since: hashable-1.3.4.0 |
Defined in Data.Hashable.Class | |
FromJSON1 IntMap | |
ToJSON1 IntMap | |
Defined in Data.Aeson.Types.ToJSON liftToJSON :: (a -> Value) -> ([a] -> Value) -> IntMap a -> Value # liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [IntMap a] -> Value # liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> IntMap a -> Encoding # liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [IntMap a] -> Encoding # | |
Arbitrary a => Arbitrary (IntMap a) | |
CoArbitrary a => CoArbitrary (IntMap a) | |
Defined in Test.QuickCheck.Arbitrary coarbitrary :: IntMap a -> Gen b -> Gen b # | |
Data a => Data (IntMap a) | |
Defined in Data.IntMap.Internal gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> IntMap a -> c (IntMap a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (IntMap a) # toConstr :: IntMap a -> Constr # dataTypeOf :: IntMap a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (IntMap a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (IntMap a)) # gmapT :: (forall b. Data b => b -> b) -> IntMap a -> IntMap a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IntMap a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IntMap a -> r # gmapQ :: (forall d. Data d => d -> u) -> IntMap a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> IntMap a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> IntMap a -> m (IntMap a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IntMap a -> m (IntMap a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IntMap a -> m (IntMap a) # | |
Monoid (IntMap a) | |
Semigroup (IntMap a) | Since: containers-0.5.7 |
IsList (IntMap a) | Since: containers-0.5.6.2 |
Read e => Read (IntMap e) | |
Show a => Show (IntMap a) | |
Binary e => Binary (IntMap e) | |
Serialize e => Serialize (IntMap e) | |
NFData a => NFData (IntMap a) | |
Defined in Data.IntMap.Internal | |
Outputable elt => Outputable (IntMap elt) | |
Defined in GHC.Utils.Outputable | |
Eq a => Eq (IntMap a) | |
Ord a => Ord (IntMap a) | |
Defined in Data.IntMap.Internal | |
Hashable v => Hashable (IntMap v) | Since: hashable-1.3.4.0 |
Defined in Data.Hashable.Class | |
Pretty v => Pretty (IntMap v) Source # | |
FromJSON a => FromJSON (IntMap a) | |
ToJSON a => ToJSON (IntMap a) | |
Defined in Data.Aeson.Types.ToJSON | |
type Key IntMap | |
Defined in GHC.Data.TrieMap | |
type Item (IntMap a) | |
Defined in Data.IntMap.Internal |
A set of integers.
Instances
Arbitrary IntSet | |
CoArbitrary IntSet | |
Defined in Test.QuickCheck.Arbitrary coarbitrary :: IntSet -> Gen b -> Gen b # | |
Data IntSet | |
Defined in Data.IntSet.Internal gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> IntSet -> c IntSet # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c IntSet # toConstr :: IntSet -> Constr # dataTypeOf :: IntSet -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c IntSet) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IntSet) # gmapT :: (forall b. Data b => b -> b) -> IntSet -> IntSet # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IntSet -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IntSet -> r # gmapQ :: (forall d. Data d => d -> u) -> IntSet -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> IntSet -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> IntSet -> m IntSet # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IntSet -> m IntSet # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IntSet -> m IntSet # | |
Monoid IntSet | |
Semigroup IntSet | Since: containers-0.5.7 |
IsList IntSet | Since: containers-0.5.6.2 |
Read IntSet | |
Show IntSet | |
Binary IntSet | |
Serialize IntSet | |
NFData IntSet | |
Defined in Data.IntSet.Internal | |
Outputable IntSet | |
Defined in GHC.Utils.Outputable | |
Eq IntSet | |
Ord IntSet | |
Hashable IntSet | Since: hashable-1.3.4.0 |
Defined in Data.Hashable.Class | |
FromJSON IntSet | |
ToJSON IntSet | |
Defined in Data.Aeson.Types.ToJSON | |
type Item IntSet | |
Defined in Data.IntSet.Internal |
A map from keys to values. A map cannot contain duplicate keys; each key can map to at most one value.
Instances
Bifoldable HashMap | Since: unordered-containers-0.2.11 |
Eq2 HashMap | |
Ord2 HashMap | |
Defined in Data.HashMap.Internal | |
Show2 HashMap | |
NFData2 HashMap | Since: unordered-containers-0.2.14.0 |
Defined in Data.HashMap.Internal | |
Hashable2 HashMap | |
Defined in Data.HashMap.Internal | |
(Lift k, Lift v) => Lift (HashMap k v :: Type) | Since: unordered-containers-0.2.17.0 |
Foldable (HashMap k) | |
Defined in Data.HashMap.Internal fold :: Monoid m => HashMap k m -> m # foldMap :: Monoid m => (a -> m) -> HashMap k a -> m # foldMap' :: Monoid m => (a -> m) -> HashMap k a -> m # foldr :: (a -> b -> b) -> b -> HashMap k a -> b # foldr' :: (a -> b -> b) -> b -> HashMap k a -> b # foldl :: (b -> a -> b) -> b -> HashMap k a -> b # foldl' :: (b -> a -> b) -> b -> HashMap k a -> b # foldr1 :: (a -> a -> a) -> HashMap k a -> a # foldl1 :: (a -> a -> a) -> HashMap k a -> a # toList :: HashMap k a -> [a] # length :: HashMap k a -> Int # elem :: Eq a => a -> HashMap k a -> Bool # maximum :: Ord a => HashMap k a -> a # minimum :: Ord a => HashMap k a -> a # | |
Eq k => Eq1 (HashMap k) | |
Ord k => Ord1 (HashMap k) | |
Defined in Data.HashMap.Internal | |
(Eq k, Hashable k, Read k) => Read1 (HashMap k) | |
Defined in Data.HashMap.Internal | |
Show k => Show1 (HashMap k) | |
Traversable (HashMap k) | |
Functor (HashMap k) | |
NFData k => NFData1 (HashMap k) | Since: unordered-containers-0.2.14.0 |
Defined in Data.HashMap.Internal | |
Hashable k => Hashable1 (HashMap k) | |
Defined in Data.HashMap.Internal | |
(FromJSONKey k, Eq k, Hashable k) => FromJSON1 (HashMap k) | |
ToJSONKey k => ToJSON1 (HashMap k) | |
Defined in Data.Aeson.Types.ToJSON liftToJSON :: (a -> Value) -> ([a] -> Value) -> HashMap k a -> Value # liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [HashMap k a] -> Value # liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> HashMap k a -> Encoding # liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [HashMap k a] -> Encoding # | |
(Data k, Data v, Eq k, Hashable k) => Data (HashMap k v) | |
Defined in Data.HashMap.Internal gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HashMap k v -> c (HashMap k v) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HashMap k v) # toConstr :: HashMap k v -> Constr # dataTypeOf :: HashMap k v -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (HashMap k v)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HashMap k v)) # gmapT :: (forall b. Data b => b -> b) -> HashMap k v -> HashMap k v # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HashMap k v -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HashMap k v -> r # gmapQ :: (forall d. Data d => d -> u) -> HashMap k v -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> HashMap k v -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HashMap k v -> m (HashMap k v) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HashMap k v -> m (HashMap k v) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HashMap k v -> m (HashMap k v) # | |
(Eq k, Hashable k) => Monoid (HashMap k v) | If a key occurs in both maps, the mapping from the first will be the mapping in the result. Examples
|
(Eq k, Hashable k) => Semigroup (HashMap k v) | If a key occurs in both maps, the mapping from the first will be the mapping in the result. Examples
|
(Eq k, Hashable k) => IsList (HashMap k v) | |
(Eq k, Hashable k, Read k, Read e) => Read (HashMap k e) | |
(Show k, Show v) => Show (HashMap k v) | |
(NFData k, NFData v) => NFData (HashMap k v) | |
Defined in Data.HashMap.Internal | |
(Eq k, Eq v) => Eq (HashMap k v) | Note that, in the presence of hash collisions, equal
In general, the lack of substitutivity can be observed with any function that depends on the key ordering, such as folds and traversals. |
(Ord k, Ord v) => Ord (HashMap k v) | The ordering is total and consistent with the |
Defined in Data.HashMap.Internal | |
(Hashable k, Hashable v) => Hashable (HashMap k v) | |
Defined in Data.HashMap.Internal | |
(FromJSON v, FromJSONKey k, Eq k, Hashable k) => FromJSON (HashMap k v) | |
(ToJSON v, ToJSONKey k) => ToJSON (HashMap k v) | |
Defined in Data.Aeson.Types.ToJSON | |
type Item (HashMap k v) | |
Defined in Data.HashMap.Internal |
A set of values. A set cannot contain duplicate values.
Instances
Foldable HashSet | |
Defined in Data.HashSet.Internal fold :: Monoid m => HashSet m -> m # foldMap :: Monoid m => (a -> m) -> HashSet a -> m # foldMap' :: Monoid m => (a -> m) -> HashSet a -> m # foldr :: (a -> b -> b) -> b -> HashSet a -> b # foldr' :: (a -> b -> b) -> b -> HashSet a -> b # foldl :: (b -> a -> b) -> b -> HashSet a -> b # foldl' :: (b -> a -> b) -> b -> HashSet a -> b # foldr1 :: (a -> a -> a) -> HashSet a -> a # foldl1 :: (a -> a -> a) -> HashSet a -> a # elem :: Eq a => a -> HashSet a -> Bool # maximum :: Ord a => HashSet a -> a # minimum :: Ord a => HashSet a -> a # | |
Eq1 HashSet | |
Ord1 HashSet | |
Defined in Data.HashSet.Internal | |
Show1 HashSet | |
NFData1 HashSet | Since: unordered-containers-0.2.14.0 |
Defined in Data.HashSet.Internal | |
Hashable1 HashSet | |
Defined in Data.HashSet.Internal | |
ToJSON1 HashSet | |
Defined in Data.Aeson.Types.ToJSON liftToJSON :: (a -> Value) -> ([a] -> Value) -> HashSet a -> Value # liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [HashSet a] -> Value # liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> HashSet a -> Encoding # liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [HashSet a] -> Encoding # | |
Lift a => Lift (HashSet a :: TYPE LiftedRep) | Since: unordered-containers-0.2.17.0 |
(Data a, Eq a, Hashable a) => Data (HashSet a) | |
Defined in Data.HashSet.Internal gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HashSet a -> c (HashSet a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HashSet a) # toConstr :: HashSet a -> Constr # dataTypeOf :: HashSet a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (HashSet a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HashSet a)) # gmapT :: (forall b. Data b => b -> b) -> HashSet a -> HashSet a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HashSet a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HashSet a -> r # gmapQ :: (forall d. Data d => d -> u) -> HashSet a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> HashSet a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HashSet a -> m (HashSet a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HashSet a -> m (HashSet a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HashSet a -> m (HashSet a) # | |
(Hashable a, Eq a) => Monoid (HashSet a) | \(O(n+m)\) To obtain good performance, the smaller set must be presented as the first argument. Examples
|
(Hashable a, Eq a) => Semigroup (HashSet a) | \(O(n+m)\) To obtain good performance, the smaller set must be presented as the first argument. Examples
|
(Eq a, Hashable a) => IsList (HashSet a) | |
(Eq a, Hashable a, Read a) => Read (HashSet a) | |
Show a => Show (HashSet a) | |
NFData a => NFData (HashSet a) | |
Defined in Data.HashSet.Internal | |
Eq a => Eq (HashSet a) | Note that, in the presence of hash collisions, equal
In general, the lack of substitutivity can be observed with any function that depends on the key ordering, such as folds and traversals. |
Ord a => Ord (HashSet a) | |
Defined in Data.HashSet.Internal | |
Hashable a => Hashable (HashSet a) | |
Defined in Data.HashSet.Internal | |
(Eq a, Hashable a, FromJSON a) => FromJSON (HashSet a) | |
ToJSON a => ToJSON (HashSet a) | |
Defined in Data.Aeson.Types.ToJSON | |
type Item (HashSet a) | |
Defined in Data.HashSet.Internal |
(<|>) :: Alternative f => f a -> f a -> f a infixl 3 #
An associative binary operation
class Semigroup a => Monoid a where #
The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following:
- Right identity
x
<>
mempty
= x- Left identity
mempty
<>
x = x- Associativity
x
(<>
(y<>
z) = (x<>
y)<>
zSemigroup
law)- Concatenation
mconcat
=foldr
(<>
)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 newtype
s and make those instances
of Monoid
, e.g. Sum
and Product
.
NOTE: Semigroup
is a superclass of Monoid
since base-4.11.0.0.
Identity of mappend
>>>
"Hello world" <> mempty
"Hello world"
An associative operation
NOTE: This method is redundant and has the default
implementation
since base-4.11.0.0.
Should it be implemented manually, since mappend
= (<>
)mappend
is a synonym for
(<>
), it is expected that the two functions are defined the same
way. In a future GHC release mappend
will be removed from Monoid
.
Fold a list using the monoid.
For most types, the default definition for mconcat
will be
used, but the function is included in the class definition so
that an optimized version can be provided for specific types.
>>>
mconcat ["Hello", " ", "Haskell", "!"]
"Hello Haskell!"
Instances
The class of semigroups (types with an associative binary operation).
Instances should satisfy the following:
Since: base-4.9.0.0
(<>) :: a -> a -> a infixr 6 #
An associative operation.
>>>
[1,2,3] <> [4,5,6]
[1,2,3,4,5,6]
Reduce a non-empty list with <>
The default definition should be sufficient, but this can be overridden for efficiency.
>>>
import Data.List.NonEmpty (NonEmpty (..))
>>>
sconcat $ "Hello" :| [" ", "Haskell", "!"]
"Hello Haskell!"
stimes :: Integral b => b -> a -> a #
Repeat a value n
times.
Given that this works on a Semigroup
it is allowed to fail if
you request 0 or fewer repetitions, and the default definition
will do so.
By making this a member of the class, idempotent semigroups
and monoids can upgrade this to execute in \(\mathcal{O}(1)\) by
picking stimes =
or stimesIdempotent
stimes =
respectively.stimesIdempotentMonoid
>>>
stimes 4 [1]
[1,1,1,1]
Instances
allM :: Monad m => (a -> m Bool) -> [a] -> m Bool #
A version of all
lifted to a monad. Retains the short-circuiting behaviour.
allM Just [True,False,undefined] == Just False allM Just [True,True ,undefined] == undefined \(f :: Int -> Maybe Bool) xs -> anyM f xs == orM (map f xs)
anyM :: Monad m => (a -> m Bool) -> [a] -> m Bool #
A version of any
lifted to a monad. Retains the short-circuiting behaviour.
anyM Just [False,True ,undefined] == Just True anyM Just [False,False,undefined] == undefined \(f :: Int -> Maybe Bool) xs -> anyM f xs == orM (map f xs)
andM :: Monad m => [m Bool] -> m Bool #
A version of and
lifted to a monad. Retains the short-circuiting behaviour.
andM [Just True,Just False,undefined] == Just False andM [Just True,Just True ,undefined] == undefined \xs -> Just (and xs) == andM (map Just xs)
orM :: Monad m => [m Bool] -> m Bool #
A version of or
lifted to a monad. Retains the short-circuiting behaviour.
orM [Just False,Just True ,undefined] == Just True orM [Just False,Just False,undefined] == undefined \xs -> Just (or xs) == orM (map Just xs)
findM :: Monad m => (a -> m Bool) -> [a] -> m (Maybe a) #
Like find
, but where the test can be monadic.
findM (Just . isUpper) "teST" == Just (Just 'S') findM (Just . isUpper) "test" == Just Nothing findM (Just . const True) ["x",undefined] == Just (Just "x")
partitionM :: Monad m => (a -> m Bool) -> [a] -> m ([a], [a]) #
A version of partition
that works with a monadic predicate.
partitionM (Just . even) [1,2,3] == Just ([2], [1,3]) partitionM (const Nothing) [1,2,3] == Nothing
whenJust :: Applicative m => Maybe a -> (a -> m ()) -> m () Source #
list
foldl' :: Foldable t => (b -> a -> b) -> b -> t a -> b #
Left-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 structure to a single strict result (e.g. sum
).
For a general Foldable
structure this should be semantically identical
to,
foldl' f z =foldl'
f z .toList
Since: base-4.6.0.0
mconcatMap :: Monoid b => (a -> b) -> [a] -> b Source #
This is foldMap
specialized to lists.
concatMapM :: (Monad m, Monoid b) => (a -> m b) -> [a] -> m b Source #
This is actually a mconcatMapM.
A further generalized version would be:
foldMapA :: (Applicative f, Traversable t, Monoid m) => (a -> f m) -> t a -> f m foldMapA f = fmap Foldable.fold . traverse f
mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b] #
A version of mapMaybe
that works with a monadic predicate.
mapMaybe :: (a -> Maybe b) -> [a] -> [b] #
The mapMaybe
function is a version of map
which can throw
out elements. In particular, the functional argument returns
something of type
. If this is Maybe
bNothing
, no element
is added on to the result list. If it is
, then Just
bb
is
included in the result list.
Examples
Using
is a shortcut for mapMaybe
f x
in most cases:catMaybes
$ map
f x
>>>
import Text.Read ( readMaybe )
>>>
let readMaybeInt = readMaybe :: String -> Maybe Int
>>>
mapMaybe readMaybeInt ["1", "Foo", "3"]
[1,3]>>>
catMaybes $ map readMaybeInt ["1", "Foo", "3"]
[1,3]
If we map the Just
constructor, the entire list should be returned:
>>>
mapMaybe Just [1,2,3]
[1,2,3]
fromMaybe :: a -> Maybe a -> a #
The fromMaybe
function takes a default value and a Maybe
value. If the Maybe
is Nothing
, it returns the default value;
otherwise, it returns the value contained in the Maybe
.
Examples
Basic usage:
>>>
fromMaybe "" (Just "Hello, World!")
"Hello, World!"
>>>
fromMaybe "" Nothing
""
Read an integer from a string using readMaybe
. If we fail to
parse an integer, we want to return 0
by default:
>>>
import Text.Read ( readMaybe )
>>>
fromMaybe 0 (readMaybe "5")
5>>>
fromMaybe 0 (readMaybe "")
0
error
justm :: Monad m => m (Maybe a) -> (a -> m (Maybe b)) -> m (Maybe b) Source #
Run the second action only if the first action returns Just.
This is like MaybeT, but using MaybeT itself required lots of annoying explicit lifting.
rightm :: Monad m => m (Either err a) -> (a -> m (Either err b)) -> m (Either err b) Source #
The Either equivalent of justm
. EitherT solves the same problem, but
requires a runEitherT and lots of hoistEithers.
firstJust :: Monad m => m (Maybe a) -> m (Maybe a) -> m (Maybe a) Source #
Return the first action to return Just.
tryJust :: MonadError e m => e -> Maybe a -> m a Source #
I usually call this require
.
tryRight :: MonadError e m => Either e a -> m a Source #
I usually call this require_right
.
pretty
Format values in an eye-pleasing way. Unlike Show, this isn't intended to produce any kind of valid syntax, or even preserve information.
Instances
lens
pure
state
guard :: Alternative f => Bool -> f () #
Conditional failure of Alternative
computations. Defined by
guard True =pure
() guard False =empty
Examples
Common uses of guard
include conditionally signaling an error in
an error monad and conditionally rejecting the current choice in an
Alternative
-based parser.
As an example of signaling an error in the error monad Maybe
,
consider a safe division function safeDiv x y
that returns
Nothing
when the denominator y
is zero and
otherwise. For example:Just
(x `div`
y)
>>>
safeDiv 4 0
Nothing
>>>
safeDiv 4 2
Just 2
A definition of safeDiv
using guards, but not guard
:
safeDiv :: Int -> Int -> Maybe Int safeDiv x y | y /= 0 = Just (x `div` y) | otherwise = Nothing
A definition of safeDiv
using guard
and Monad
do
-notation:
safeDiv :: Int -> Int -> Maybe Int safeDiv x y = do guard (y /= 0) return (x `div` y)
zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m () #
zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c] #
unless :: Applicative f => Bool -> f () -> f () #
The reverse of when
.
replicateM_ :: Applicative m => Int -> m a -> m () #
replicateM :: Applicative m => Int -> m a -> m [a] #
performs the action replicateM
n actact
n
times,
and then returns the list of results:
Examples
>>>
import Control.Monad.State
>>>
runState (replicateM 3 $ state $ \s -> (s, s + 1)) 1
([1,2,3],4)
forever :: Applicative f => f a -> f b #
Repeat an action indefinitely.
Examples
A common use of forever
is to process input from network sockets,
Handle
s, and channels
(e.g. MVar
and
Chan
).
For example, here is how we might implement an echo
server, using
forever
both to listen for client connections on a network socket
and to echo client input on client connection handles:
echoServer :: Socket -> IO () echoServer socket =forever
$ do client <- accept socketforkFinally
(echo client) (\_ -> hClose client) where echo :: Handle -> IO () echo client =forever
$ hGetLine client >>= hPutStrLn client
Note that "forever" isn't necessarily non-terminating.
If the action is in a
and short-circuits after some number of iterations.
then MonadPlus
actually returns forever
mzero
, effectively short-circuiting its caller.
foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b #
The foldM
function is analogous to foldl
, except that its result is
encapsulated in a monad. Note that foldM
works from left-to-right over
the list arguments. This could be an issue where (
and the `folded
function' are not commutative.>>
)
foldM f a1 [x1, x2, ..., xm] == do a2 <- f a1 x1 a3 <- f a2 x2 ... f am xm
If right-to-left evaluation is required, the input list should be reversed.
filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a] #
This generalizes the list-based filter
function.
(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c infixr 1 #
Left-to-right composition of Kleisli arrows.
'(bs
' can be understood as the >=>
cs) ado
expression
do b <- bs a cs b
forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b) #
void :: Functor f => f a -> f () #
discards or ignores the result of evaluation, such
as the return value of an void
valueIO
action.
Examples
Replace the contents of a
with unit:Maybe
Int
>>>
void Nothing
Nothing>>>
void (Just 3)
Just ()
Replace the contents of an
with unit, resulting in an Either
Int
Int
:Either
Int
()
>>>
void (Left 8675309)
Left 8675309>>>
void (Right 8675309)
Right ()
Replace every element of a list with unit:
>>>
void [1,2,3]
[(),(),()]
Replace the second element of a pair with unit:
>>>
void (1,2)
(1,())
Discard the result of an IO
action:
>>>
mapM print [1,2]
1 2 [(),()]>>>
void $ mapM print [1,2]
1 2
mplus :: MonadPlus m => m a -> m a -> m a #
An associative operation. The default definition is
mplus = (<|>
)
when :: Applicative f => Bool -> f () -> f () #
Conditional execution of Applicative
expressions. For example,
when debug (putStrLn "Debugging")
will output the string Debugging
if the Boolean value debug
is True
, and otherwise do nothing.
class (Functor t, Foldable t) => Traversable (t :: Type -> Type) where #
Functors representing data structures that can be transformed to
structures of the same shape by performing an Applicative
(or,
therefore, Monad
) action on each element from left to right.
A more detailed description of what same shape means, the various methods, how traversals are constructed, and example advanced use-cases can be found in the Overview section of Data.Traversable.
For the class laws see the Laws section of Data.Traversable.
traverse :: Applicative f => (a -> f b) -> t a -> f (t b) #
Map each element of a structure to an action, evaluate these actions
from left to right, and collect the results. For a version that ignores
the results see traverse_
.
Examples
Basic usage:
In the first two examples we show each evaluated action mapping to the output structure.
>>>
traverse Just [1,2,3,4]
Just [1,2,3,4]
>>>
traverse id [Right 1, Right 2, Right 3, Right 4]
Right [1,2,3,4]
In the next examples, we show that Nothing
and Left
values short
circuit the created structure.
>>>
traverse (const Nothing) [1,2,3,4]
Nothing
>>>
traverse (\x -> if odd x then Just x else Nothing) [1,2,3,4]
Nothing
>>>
traverse id [Right 1, Right 2, Right 3, Right 4, Left 0]
Left 0
Instances
class Foldable (t :: TYPE LiftedRep -> Type) where #
The Foldable class represents data structures that can be reduced to a summary value one element at a time. Strict left-associative folds are a good fit for space-efficient reduction, while lazy right-associative folds are a good fit for corecursive iteration, or for folds that short-circuit after processing an initial subsequence of the structure's elements.
Instances can be derived automatically by enabling the DeriveFoldable
extension. For example, a derived instance for a binary tree might be:
{-# LANGUAGE DeriveFoldable #-} data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a) deriving Foldable
A more detailed description can be found in the Overview section of Data.Foldable.
For the class laws see the Laws section of Data.Foldable.
foldMap :: Monoid m => (a -> m) -> t a -> m #
Map each element of the structure into a monoid, and combine the
results with (
. This fold is right-associative and lazy in the
accumulator. For strict left-associative folds consider <>
)foldMap'
instead.
Examples
Basic usage:
>>>
foldMap Sum [1, 3, 5]
Sum {getSum = 9}
>>>
foldMap Product [1, 3, 5]
Product {getProduct = 15}
>>>
foldMap (replicate 3) [1, 2, 3]
[1,1,1,2,2,2,3,3,3]
When a Monoid's (
is lazy in its second argument, <>
)foldMap
can
return a result even from an unbounded structure. For example, lazy
accumulation enables Data.ByteString.Builder to efficiently serialise
large data structures and produce the output incrementally:
>>>
import qualified Data.ByteString.Lazy as L
>>>
import qualified Data.ByteString.Builder as B
>>>
let bld :: Int -> B.Builder; bld i = B.intDec i <> B.word8 0x20
>>>
let lbs = B.toLazyByteString $ foldMap bld [0..]
>>>
L.take 64 lbs
"0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24"
Instances
Foldable ZipList | Since: base-4.9.0.0 |
Defined in Control.Applicative fold :: Monoid m => ZipList m -> m # foldMap :: Monoid m => (a -> m) -> ZipList a -> m # foldMap' :: Monoid m => (a -> m) -> ZipList a -> m # foldr :: (a -> b -> b) -> b -> ZipList a -> b # foldr' :: (a -> b -> b) -> b -> ZipList a -> b # foldl :: (b -> a -> b) -> b -> ZipList a -> b # foldl' :: (b -> a -> b) -> b -> ZipList a -> b # foldr1 :: (a -> a -> a) -> ZipList a -> a # foldl1 :: (a -> a -> a) -> ZipList a -> a # elem :: Eq a => a -> ZipList a -> Bool # maximum :: Ord a => ZipList a -> a # minimum :: Ord a => ZipList a -> a # | |
Foldable Complex | Since: base-4.9.0.0 |
Defined in Data.Complex fold :: Monoid m => Complex m -> m # foldMap :: Monoid m => (a -> m) -> Complex a -> m # foldMap' :: Monoid m => (a -> m) -> Complex a -> m # foldr :: (a -> b -> b) -> b -> Complex a -> b # foldr' :: (a -> b -> b) -> b -> Complex a -> b # foldl :: (b -> a -> b) -> b -> Complex a -> b # foldl' :: (b -> a -> b) -> b -> Complex a -> b # foldr1 :: (a -> a -> a) -> Complex a -> a # foldl1 :: (a -> a -> a) -> Complex a -> a # elem :: Eq a => a -> Complex a -> Bool # maximum :: Ord a => Complex a -> a # minimum :: Ord a => Complex a -> a # | |
Foldable Identity | Since: base-4.8.0.0 |
Defined in Data.Functor.Identity fold :: Monoid m => Identity m -> m # foldMap :: Monoid m => (a -> m) -> Identity a -> m # foldMap' :: Monoid m => (a -> m) -> Identity a -> m # foldr :: (a -> b -> b) -> b -> Identity a -> b # foldr' :: (a -> b -> b) -> b -> Identity a -> b # foldl :: (b -> a -> b) -> b -> Identity a -> b # foldl' :: (b -> a -> b) -> b -> Identity a -> b # foldr1 :: (a -> a -> a) -> Identity a -> a # foldl1 :: (a -> a -> a) -> Identity a -> a # elem :: Eq a => a -> Identity a -> Bool # maximum :: Ord a => Identity a -> a # minimum :: Ord a => Identity a -> a # | |
Foldable First | Since: base-4.8.0.0 |
Defined in Data.Foldable fold :: Monoid m => First m -> m # foldMap :: Monoid m => (a -> m) -> First a -> m # foldMap' :: Monoid m => (a -> m) -> First a -> m # foldr :: (a -> b -> b) -> b -> First a -> b # foldr' :: (a -> b -> b) -> b -> First a -> b # foldl :: (b -> a -> b) -> b -> First a -> b # foldl' :: (b -> a -> b) -> b -> First a -> b # foldr1 :: (a -> a -> a) -> First a -> a # foldl1 :: (a -> a -> a) -> First a -> a # elem :: Eq a => a -> First a -> Bool # maximum :: Ord a => First a -> a # minimum :: Ord a => First a -> a # | |
Foldable Last | Since: base-4.8.0.0 |
Defined in Data.Foldable fold :: Monoid m => Last m -> m # foldMap :: Monoid m => (a -> m) -> Last a -> m # foldMap' :: Monoid m => (a -> m) -> Last a -> m # foldr :: (a -> b -> b) -> b -> Last a -> b # foldr' :: (a -> b -> b) -> b -> Last a -> b # foldl :: (b -> a -> b) -> b -> Last a -> b # foldl' :: (b -> a -> b) -> b -> Last a -> b # foldr1 :: (a -> a -> a) -> Last a -> a # foldl1 :: (a -> a -> a) -> Last a -> a # elem :: Eq a => a -> Last a -> Bool # maximum :: Ord a => Last a -> a # | |
Foldable Down | Since: base-4.12.0.0 |
Defined in Data.Foldable fold :: Monoid m => Down m -> m # foldMap :: Monoid m => (a -> m) -> Down a -> m # foldMap' :: Monoid m => (a -> m) -> Down a -> m # foldr :: (a -> b -> b) -> b -> Down a -> b # foldr' :: (a -> b -> b) -> b -> Down a -> b # foldl :: (b -> a -> b) -> b -> Down a -> b # foldl' :: (b -> a -> b) -> b -> Down a -> b # foldr1 :: (a -> a -> a) -> Down a -> a # foldl1 :: (a -> a -> a) -> Down a -> a # elem :: Eq a => a -> Down a -> Bool # maximum :: Ord a => Down a -> a # | |
Foldable First | Since: base-4.9.0.0 |
Defined in Data.Semigroup fold :: Monoid m => First m -> m # foldMap :: Monoid m => (a -> m) -> First a -> m # foldMap' :: Monoid m => (a -> m) -> First a -> m # foldr :: (a -> b -> b) -> b -> First a -> b # foldr' :: (a -> b -> b) -> b -> First a -> b # foldl :: (b -> a -> b) -> b -> First a -> b # foldl' :: (b -> a -> b) -> b -> First a -> b # foldr1 :: (a -> a -> a) -> First a -> a # foldl1 :: (a -> a -> a) -> First a -> a # elem :: Eq a => a -> First a -> Bool # maximum :: Ord a => First a -> a # minimum :: Ord a => First a -> a # | |
Foldable Last | Since: base-4.9.0.0 |
Defined in Data.Semigroup fold :: Monoid m => Last m -> m # foldMap :: Monoid m => (a -> m) -> Last a -> m # foldMap' :: Monoid m => (a -> m) -> Last a -> m # foldr :: (a -> b -> b) -> b -> Last a -> b # foldr' :: (a -> b -> b) -> b -> Last a -> b # foldl :: (b -> a -> b) -> b -> Last a -> b # foldl' :: (b -> a -> b) -> b -> Last a -> b # foldr1 :: (a -> a -> a) -> Last a -> a # foldl1 :: (a -> a -> a) -> Last a -> a # elem :: Eq a => a -> Last a -> Bool # maximum :: Ord a => Last a -> a # | |
Foldable Max | Since: base-4.9.0.0 |
Defined in Data.Semigroup fold :: Monoid m => Max m -> m # foldMap :: Monoid m => (a -> m) -> Max a -> m # foldMap' :: Monoid m => (a -> m) -> Max a -> m # foldr :: (a -> b -> b) -> b -> Max a -> b # foldr' :: (a -> b -> b) -> b -> Max a -> b # foldl :: (b -> a -> b) -> b -> Max a -> b # foldl' :: (b -> a -> b) -> b -> Max a -> b # foldr1 :: (a -> a -> a) -> Max a -> a # foldl1 :: (a -> a -> a) -> Max a -> a # elem :: Eq a => a -> Max a -> Bool # maximum :: Ord a => Max a -> a # | |
Foldable Min | Since: base-4.9.0.0 |
Defined in Data.Semigroup fold :: Monoid m => Min m -> m # foldMap :: Monoid m => (a -> m) -> Min a -> m # foldMap' :: Monoid m => (a -> m) -> Min a -> m # foldr :: (a -> b -> b) -> b -> Min a -> b # foldr' :: (a -> b -> b) -> b -> Min a -> b # foldl :: (b -> a -> b) -> b -> Min a -> b # foldl' :: (b -> a -> b) -> b -> Min a -> b # foldr1 :: (a -> a -> a) -> Min a -> a # foldl1 :: (a -> a -> a) -> Min a -> a # elem :: Eq a => a -> Min a -> Bool # maximum :: Ord a => Min a -> a # | |
Foldable Dual | Since: base-4.8.0.0 |
Defined in Data.Foldable fold :: Monoid m => Dual m -> m # foldMap :: Monoid m => (a -> m) -> Dual a -> m # foldMap' :: Monoid m => (a -> m) -> Dual a -> m # foldr :: (a -> b -> b) -> b -> Dual a -> b # foldr' :: (a -> b -> b) -> b -> Dual a -> b # foldl :: (b -> a -> b) -> b -> Dual a -> b # foldl' :: (b -> a -> b) -> b -> Dual a -> b # foldr1 :: (a -> a -> a) -> Dual a -> a # foldl1 :: (a -> a -> a) -> Dual a -> a # elem :: Eq a => a -> Dual a -> Bool # maximum :: Ord a => Dual a -> a # | |
Foldable Product | Since: base-4.8.0.0 |
Defined in Data.Foldable fold :: Monoid m => Product m -> m # foldMap :: Monoid m => (a -> m) -> Product a -> m # foldMap' :: Monoid m => (a -> m) -> Product a -> m # foldr :: (a -> b -> b) -> b -> Product a -> b # foldr' :: (a -> b -> b) -> b -> Product a -> b # foldl :: (b -> a -> b) -> b -> Product a -> b # foldl' :: (b -> a -> b) -> b -> Product a -> b # foldr1 :: (a -> a -> a) -> Product a -> a # foldl1 :: (a -> a -> a) -> Product a -> a # elem :: Eq a => a -> Product a -> Bool # maximum :: Ord a => Product a -> a # minimum :: Ord a => Product a -> a # | |
Foldable Sum | Since: base-4.8.0.0 |
Defined in Data.Foldable fold :: Monoid m => Sum m -> m # foldMap :: Monoid m => (a -> m) -> Sum a -> m # foldMap' :: Monoid m => (a -> m) -> Sum a -> m # foldr :: (a -> b -> b) -> b -> Sum a -> b # foldr' :: (a -> b -> b) -> b -> Sum a -> b # foldl :: (b -> a -> b) -> b -> Sum a -> b # foldl' :: (b -> a -> b) -> b -> Sum a -> b # foldr1 :: (a -> a -> a) -> Sum a -> a # foldl1 :: (a -> a -> a) -> Sum a -> a # elem :: Eq a => a -> Sum a -> Bool # maximum :: Ord a => Sum a -> a # | |
Foldable Par1 | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => Par1 m -> m # foldMap :: Monoid m => (a -> m) -> Par1 a -> m # foldMap' :: Monoid m => (a -> m) -> Par1 a -> m # foldr :: (a -> b -> b) -> b -> Par1 a -> b # foldr' :: (a -> b -> b) -> b -> Par1 a -> b # foldl :: (b -> a -> b) -> b -> Par1 a -> b # foldl' :: (b -> a -> b) -> b -> Par1 a -> b # foldr1 :: (a -> a -> a) -> Par1 a -> a # foldl1 :: (a -> a -> a) -> Par1 a -> a # elem :: Eq a => a -> Par1 a -> Bool # maximum :: Ord a => Par1 a -> a # | |
Foldable SCC | Since: containers-0.5.9 |
Defined in Data.Graph fold :: Monoid m => SCC m -> m # foldMap :: Monoid m => (a -> m) -> SCC a -> m # foldMap' :: Monoid m => (a -> m) -> SCC a -> m # foldr :: (a -> b -> b) -> b -> SCC a -> b # foldr' :: (a -> b -> b) -> b -> SCC a -> b # foldl :: (b -> a -> b) -> b -> SCC a -> b # foldl' :: (b -> a -> b) -> b -> SCC a -> b # foldr1 :: (a -> a -> a) -> SCC a -> a # foldl1 :: (a -> a -> a) -> SCC a -> a # elem :: Eq a => a -> SCC a -> Bool # maximum :: Ord a => SCC a -> a # | |
Foldable IntMap | Folds in order of increasing key. |
Defined in Data.IntMap.Internal fold :: Monoid m => IntMap m -> m # foldMap :: Monoid m => (a -> m) -> IntMap a -> m # foldMap' :: Monoid m => (a -> m) -> IntMap a -> m # foldr :: (a -> b -> b) -> b -> IntMap a -> b # foldr' :: (a -> b -> b) -> b -> IntMap a -> b # foldl :: (b -> a -> b) -> b -> IntMap a -> b # foldl' :: (b -> a -> b) -> b -> IntMap a -> b # foldr1 :: (a -> a -> a) -> IntMap a -> a # foldl1 :: (a -> a -> a) -> IntMap a -> a # elem :: Eq a => a -> IntMap a -> Bool # maximum :: Ord a => IntMap a -> a # minimum :: Ord a => IntMap a -> a # | |
Foldable Digit | |
Defined in Data.Sequence.Internal fold :: Monoid m => Digit m -> m # foldMap :: Monoid m => (a -> m) -> Digit a -> m # foldMap' :: Monoid m => (a -> m) -> Digit a -> m # foldr :: (a -> b -> b) -> b -> Digit a -> b # foldr' :: (a -> b -> b) -> b -> Digit a -> b # foldl :: (b -> a -> b) -> b -> Digit a -> b # foldl' :: (b -> a -> b) -> b -> Digit a -> b # foldr1 :: (a -> a -> a) -> Digit a -> a # foldl1 :: (a -> a -> a) -> Digit a -> a # elem :: Eq a => a -> Digit a -> Bool # maximum :: Ord a => Digit a -> a # minimum :: Ord a => Digit a -> a # | |
Foldable Elem | |
Defined in Data.Sequence.Internal fold :: Monoid m => Elem m -> m # foldMap :: Monoid m => (a -> m) -> Elem a -> m # foldMap' :: Monoid m => (a -> m) -> Elem a -> m # foldr :: (a -> b -> b) -> b -> Elem a -> b # foldr' :: (a -> b -> b) -> b -> Elem a -> b # foldl :: (b -> a -> b) -> b -> Elem a -> b # foldl' :: (b -> a -> b) -> b -> Elem a -> b # foldr1 :: (a -> a -> a) -> Elem a -> a # foldl1 :: (a -> a -> a) -> Elem a -> a # elem :: Eq a => a -> Elem a -> Bool # maximum :: Ord a => Elem a -> a # | |
Foldable FingerTree | |
Defined in Data.Sequence.Internal fold :: Monoid m => FingerTree m -> m # foldMap :: Monoid m => (a -> m) -> FingerTree a -> m # foldMap' :: Monoid m => (a -> m) -> FingerTree a -> m # foldr :: (a -> b -> b) -> b -> FingerTree a -> b # foldr' :: (a -> b -> b) -> b -> FingerTree a -> b # foldl :: (b -> a -> b) -> b -> FingerTree a -> b # foldl' :: (b -> a -> b) -> b -> FingerTree a -> b # foldr1 :: (a -> a -> a) -> FingerTree a -> a # foldl1 :: (a -> a -> a) -> FingerTree a -> a # toList :: FingerTree a -> [a] # null :: FingerTree a -> Bool # length :: FingerTree a -> Int # elem :: Eq a => a -> FingerTree a -> Bool # maximum :: Ord a => FingerTree a -> a # minimum :: Ord a => FingerTree a -> a # sum :: Num a => FingerTree a -> a # product :: Num a => FingerTree a -> a # | |
Foldable Node | |
Defined in Data.Sequence.Internal fold :: Monoid m => Node m -> m # foldMap :: Monoid m => (a -> m) -> Node a -> m # foldMap' :: Monoid m => (a -> m) -> Node a -> m # foldr :: (a -> b -> b) -> b -> Node a -> b # foldr' :: (a -> b -> b) -> b -> Node a -> b # foldl :: (b -> a -> b) -> b -> Node a -> b # foldl' :: (b -> a -> b) -> b -> Node a -> b # foldr1 :: (a -> a -> a) -> Node a -> a # foldl1 :: (a -> a -> a) -> Node a -> a # elem :: Eq a => a -> Node a -> Bool # maximum :: Ord a => Node a -> a # | |
Foldable Seq | |
Defined in Data.Sequence.Internal fold :: Monoid m => Seq m -> m # foldMap :: Monoid m => (a -> m) -> Seq a -> m # foldMap' :: Monoid m => (a -> m) -> Seq a -> m # foldr :: (a -> b -> b) -> b -> Seq a -> b # foldr' :: (a -> b -> b) -> b -> Seq a -> b # foldl :: (b -> a -> b) -> b -> Seq a -> b # foldl' :: (b -> a -> b) -> b -> Seq a -> b # foldr1 :: (a -> a -> a) -> Seq a -> a # foldl1 :: (a -> a -> a) -> Seq a -> a # elem :: Eq a => a -> Seq a -> Bool # maximum :: Ord a => Seq a -> a # | |
Foldable ViewL | |
Defined in Data.Sequence.Internal fold :: Monoid m => ViewL m -> m # foldMap :: Monoid m => (a -> m) -> ViewL a -> m # foldMap' :: Monoid m => (a -> m) -> ViewL a -> m # foldr :: (a -> b -> b) -> b -> ViewL a -> b # foldr' :: (a -> b -> b) -> b -> ViewL a -> b # foldl :: (b -> a -> b) -> b -> ViewL a -> b # foldl' :: (b -> a -> b) -> b -> ViewL a -> b # foldr1 :: (a -> a -> a) -> ViewL a -> a # foldl1 :: (a -> a -> a) -> ViewL a -> a # elem :: Eq a => a -> ViewL a -> Bool # maximum :: Ord a => ViewL a -> a # minimum :: Ord a => ViewL a -> a # | |
Foldable ViewR | |
Defined in Data.Sequence.Internal fold :: Monoid m => ViewR m -> m # foldMap :: Monoid m => (a -> m) -> ViewR a -> m # foldMap' :: Monoid m => (a -> m) -> ViewR a -> m # foldr :: (a -> b -> b) -> b -> ViewR a -> b # foldr' :: (a -> b -> b) -> b -> ViewR a -> b # foldl :: (b -> a -> b) -> b -> ViewR a -> b # foldl' :: (b -> a -> b) -> b -> ViewR a -> b # foldr1 :: (a -> a -> a) -> ViewR a -> a # foldl1 :: (a -> a -> a) -> ViewR a -> a # elem :: Eq a => a -> ViewR a -> Bool # maximum :: Ord a => ViewR a -> a # minimum :: Ord a => ViewR a -> a # | |
Foldable Set | Folds in order of increasing key. |
Defined in Data.Set.Internal fold :: Monoid m => Set m -> m # foldMap :: Monoid m => (a -> m) -> Set a -> m # foldMap' :: Monoid m => (a -> m) -> Set a -> m # foldr :: (a -> b -> b) -> b -> Set a -> b # foldr' :: (a -> b -> b) -> b -> Set a -> b # foldl :: (b -> a -> b) -> b -> Set a -> b # foldl' :: (b -> a -> b) -> b -> Set a -> b # foldr1 :: (a -> a -> a) -> Set a -> a # foldl1 :: (a -> a -> a) -> Set a -> a # elem :: Eq a => a -> Set a -> Bool # maximum :: Ord a => Set a -> a # | |
Foldable Tree | |
Defined in Data.Tree fold :: Monoid m => Tree m -> m # foldMap :: Monoid m => (a -> m) -> Tree a -> m # foldMap' :: Monoid m => (a -> m) -> Tree a -> m # foldr :: (a -> b -> b) -> b -> Tree a -> b # foldr' :: (a -> b -> b) -> b -> Tree a -> b # foldl :: (b -> a -> b) -> b -> Tree a -> b # foldl' :: (b -> a -> b) -> b -> Tree a -> b # foldr1 :: (a -> a -> a) -> Tree a -> a # foldl1 :: (a -> a -> a) -> Tree a -> a # elem :: Eq a => a -> Tree a -> Bool # maximum :: Ord a => Tree a -> a # | |
Foldable DNonEmpty | |
Defined in Data.DList.DNonEmpty.Internal fold :: Monoid m => DNonEmpty m -> m # foldMap :: Monoid m => (a -> m) -> DNonEmpty a -> m # foldMap' :: Monoid m => (a -> m) -> DNonEmpty a -> m # foldr :: (a -> b -> b) -> b -> DNonEmpty a -> b # foldr' :: (a -> b -> b) -> b -> DNonEmpty a -> b # foldl :: (b -> a -> b) -> b -> DNonEmpty a -> b # foldl' :: (b -> a -> b) -> b -> DNonEmpty a -> b # foldr1 :: (a -> a -> a) -> DNonEmpty a -> a # foldl1 :: (a -> a -> a) -> DNonEmpty a -> a # toList :: DNonEmpty a -> [a] # length :: DNonEmpty a -> Int # elem :: Eq a => a -> DNonEmpty a -> Bool # maximum :: Ord a => DNonEmpty a -> a # minimum :: Ord a => DNonEmpty a -> a # | |
Foldable DList | |
Defined in Data.DList.Internal fold :: Monoid m => DList m -> m # foldMap :: Monoid m => (a -> m) -> DList a -> m # foldMap' :: Monoid m => (a -> m) -> DList a -> m # foldr :: (a -> b -> b) -> b -> DList a -> b # foldr' :: (a -> b -> b) -> b -> DList a -> b # foldl :: (b -> a -> b) -> b -> DList a -> b # foldl' :: (b -> a -> b) -> b -> DList a -> b # foldr1 :: (a -> a -> a) -> DList a -> a # foldl1 :: (a -> a -> a) -> DList a -> a # elem :: Eq a => a -> DList a -> Bool # maximum :: Ord a => DList a -> a # minimum :: Ord a => DList a -> a # | |
Foldable UniqueMap | |
Defined in GHC.Cmm.Dataflow.Collections fold :: Monoid m => UniqueMap m -> m # foldMap :: Monoid m => (a -> m) -> UniqueMap a -> m # foldMap' :: Monoid m => (a -> m) -> UniqueMap a -> m # foldr :: (a -> b -> b) -> b -> UniqueMap a -> b # foldr' :: (a -> b -> b) -> b -> UniqueMap a -> b # foldl :: (b -> a -> b) -> b -> UniqueMap a -> b # foldl' :: (b -> a -> b) -> b -> UniqueMap a -> b # foldr1 :: (a -> a -> a) -> UniqueMap a -> a # foldl1 :: (a -> a -> a) -> UniqueMap a -> a # toList :: UniqueMap a -> [a] # length :: UniqueMap a -> Int # elem :: Eq a => a -> UniqueMap a -> Bool # maximum :: Ord a => UniqueMap a -> a # minimum :: Ord a => UniqueMap a -> a # | |
Foldable LabelMap | |
Defined in GHC.Cmm.Dataflow.Label fold :: Monoid m => LabelMap m -> m # foldMap :: Monoid m => (a -> m) -> LabelMap a -> m # foldMap' :: Monoid m => (a -> m) -> LabelMap a -> m # foldr :: (a -> b -> b) -> b -> LabelMap a -> b # foldr' :: (a -> b -> b) -> b -> LabelMap a -> b # foldl :: (b -> a -> b) -> b -> LabelMap a -> b # foldl' :: (b -> a -> b) -> b -> LabelMap a -> b # foldr1 :: (a -> a -> a) -> LabelMap a -> a # foldl1 :: (a -> a -> a) -> LabelMap a -> a # elem :: Eq a => a -> LabelMap a -> Bool # maximum :: Ord a => LabelMap a -> a # minimum :: Ord a => LabelMap a -> a # | |
Foldable Bag | |
Defined in GHC.Data.Bag fold :: Monoid m => Bag m -> m # foldMap :: Monoid m => (a -> m) -> Bag a -> m # foldMap' :: Monoid m => (a -> m) -> Bag a -> m # foldr :: (a -> b -> b) -> b -> Bag a -> b # foldr' :: (a -> b -> b) -> b -> Bag a -> b # foldl :: (b -> a -> b) -> b -> Bag a -> b # foldl' :: (b -> a -> b) -> b -> Bag a -> b # foldr1 :: (a -> a -> a) -> Bag a -> a # foldl1 :: (a -> a -> a) -> Bag a -> a # elem :: Eq a => a -> Bag a -> Bool # maximum :: Ord a => Bag a -> a # | |
Foldable ModNodeMap | |
Defined in GHC.Driver.Make fold :: Monoid m => ModNodeMap m -> m # foldMap :: Monoid m => (a -> m) -> ModNodeMap a -> m # foldMap' :: Monoid m => (a -> m) -> ModNodeMap a -> m # foldr :: (a -> b -> b) -> b -> ModNodeMap a -> b # foldr' :: (a -> b -> b) -> b -> ModNodeMap a -> b # foldl :: (b -> a -> b) -> b -> ModNodeMap a -> b # foldl' :: (b -> a -> b) -> b -> ModNodeMap a -> b # foldr1 :: (a -> a -> a) -> ModNodeMap a -> a # foldl1 :: (a -> a -> a) -> ModNodeMap a -> a # toList :: ModNodeMap a -> [a] # null :: ModNodeMap a -> Bool # length :: ModNodeMap a -> Int # elem :: Eq a => a -> ModNodeMap a -> Bool # maximum :: Ord a => ModNodeMap a -> a # minimum :: Ord a => ModNodeMap a -> a # sum :: Num a => ModNodeMap a -> a # product :: Num a => ModNodeMap a -> a # | |
Foldable NodeMap | |
Defined in GHC.Driver.Make fold :: Monoid m => NodeMap m -> m # foldMap :: Monoid m => (a -> m) -> NodeMap a -> m # foldMap' :: Monoid m => (a -> m) -> NodeMap a -> m # foldr :: (a -> b -> b) -> b -> NodeMap a -> b # foldr' :: (a -> b -> b) -> b -> NodeMap a -> b # foldl :: (b -> a -> b) -> b -> NodeMap a -> b # foldl' :: (b -> a -> b) -> b -> NodeMap a -> b # foldr1 :: (a -> a -> a) -> NodeMap a -> a # foldl1 :: (a -> a -> a) -> NodeMap a -> a # elem :: Eq a => a -> NodeMap a -> Bool # maximum :: Ord a => NodeMap a -> a # minimum :: Ord a => NodeMap a -> a # | |
Foldable GenWithIsBoot | |
Defined in GHC.Unit.Types fold :: Monoid m => GenWithIsBoot m -> m # foldMap :: Monoid m => (a -> m) -> GenWithIsBoot a -> m # foldMap' :: Monoid m => (a -> m) -> GenWithIsBoot a -> m # foldr :: (a -> b -> b) -> b -> GenWithIsBoot a -> b # foldr' :: (a -> b -> b) -> b -> GenWithIsBoot a -> b # foldl :: (b -> a -> b) -> b -> GenWithIsBoot a -> b # foldl' :: (b -> a -> b) -> b -> GenWithIsBoot a -> b # foldr1 :: (a -> a -> a) -> GenWithIsBoot a -> a # foldl1 :: (a -> a -> a) -> GenWithIsBoot a -> a # toList :: GenWithIsBoot a -> [a] # null :: GenWithIsBoot a -> Bool # length :: GenWithIsBoot a -> Int # elem :: Eq a => a -> GenWithIsBoot a -> Bool # maximum :: Ord a => GenWithIsBoot a -> a # minimum :: Ord a => GenWithIsBoot a -> a # sum :: Num a => GenWithIsBoot a -> a # product :: Num a => GenWithIsBoot a -> a # | |
Foldable SizedSeq | |
Defined in GHC.Data.SizedSeq fold :: Monoid m => SizedSeq m -> m # foldMap :: Monoid m => (a -> m) -> SizedSeq a -> m # foldMap' :: Monoid m => (a -> m) -> SizedSeq a -> m # foldr :: (a -> b -> b) -> b -> SizedSeq a -> b # foldr' :: (a -> b -> b) -> b -> SizedSeq a -> b # foldl :: (b -> a -> b) -> b -> SizedSeq a -> b # foldl' :: (b -> a -> b) -> b -> SizedSeq a -> b # foldr1 :: (a -> a -> a) -> SizedSeq a -> a # foldl1 :: (a -> a -> a) -> SizedSeq a -> a # elem :: Eq a => a -> SizedSeq a -> Bool # maximum :: Ord a => SizedSeq a -> a # minimum :: Ord a => SizedSeq a -> a # | |
Foldable GenClosure | |
Defined in GHC.Exts.Heap.Closures fold :: Monoid m => GenClosure m -> m # foldMap :: Monoid m => (a -> m) -> GenClosure a -> m # foldMap' :: Monoid m => (a -> m) -> GenClosure a -> m # foldr :: (a -> b -> b) -> b -> GenClosure a -> b # foldr' :: (a -> b -> b) -> b -> GenClosure a -> b # foldl :: (b -> a -> b) -> b -> GenClosure a -> b # foldl' :: (b -> a -> b) -> b -> GenClosure a -> b # foldr1 :: (a -> a -> a) -> GenClosure a -> a # foldl1 :: (a -> a -> a) -> GenClosure a -> a # toList :: GenClosure a -> [a] # null :: GenClosure a -> Bool # length :: GenClosure a -> Int # elem :: Eq a => a -> GenClosure a -> Bool # maximum :: Ord a => GenClosure a -> a # minimum :: Ord a => GenClosure a -> a # sum :: Num a => GenClosure a -> a # product :: Num a => GenClosure a -> a # | |
Foldable Coverage | |
Defined in Hedgehog.Internal.Property fold :: Monoid m => Coverage m -> m # foldMap :: Monoid m => (a -> m) -> Coverage a -> m # foldMap' :: Monoid m => (a -> m) -> Coverage a -> m # foldr :: (a -> b -> b) -> b -> Coverage a -> b # foldr' :: (a -> b -> b) -> b -> Coverage a -> b # foldl :: (b -> a -> b) -> b -> Coverage a -> b # foldl' :: (b -> a -> b) -> b -> Coverage a -> b # foldr1 :: (a -> a -> a) -> Coverage a -> a # foldl1 :: (a -> a -> a) -> Coverage a -> a # elem :: Eq a => a -> Coverage a -> Bool # maximum :: Ord a => Coverage a -> a # minimum :: Ord a => Coverage a -> a # | |
Foldable Label | |
Defined in Hedgehog.Internal.Property fold :: Monoid m => Label m -> m # foldMap :: Monoid m => (a -> m) -> Label a -> m # foldMap' :: Monoid m => (a -> m) -> Label a -> m # foldr :: (a -> b -> b) -> b -> Label a -> b # foldr' :: (a -> b -> b) -> b -> Label a -> b # foldl :: (b -> a -> b) -> b -> Label a -> b # foldl' :: (b -> a -> b) -> b -> Label a -> b # foldr1 :: (a -> a -> a) -> Label a -> a # foldl1 :: (a -> a -> a) -> Label a -> a # elem :: Eq a => a -> Label a -> Bool # maximum :: Ord a => Label a -> a # minimum :: Ord a => Label a -> a # | |
Foldable Report | |
Defined in Hedgehog.Internal.Report fold :: Monoid m => Report m -> m # foldMap :: Monoid m => (a -> m) -> Report a -> m # foldMap' :: Monoid m => (a -> m) -> Report a -> m # foldr :: (a -> b -> b) -> b -> Report a -> b # foldr' :: (a -> b -> b) -> b -> Report a -> b # foldl :: (b -> a -> b) -> b -> Report a -> b # foldl' :: (b -> a -> b) -> b -> Report a -> b # foldr1 :: (a -> a -> a) -> Report a -> a # foldl1 :: (a -> a -> a) -> Report a -> a # elem :: Eq a => a -> Report a -> Bool # maximum :: Ord a => Report a -> a # minimum :: Ord a => Report a -> a # | |
Foldable Node | |
Defined in Hedgehog.Internal.Tree fold :: Monoid m => Node m -> m # foldMap :: Monoid m => (a -> m) -> Node a -> m # foldMap' :: Monoid m => (a -> m) -> Node a -> m # foldr :: (a -> b -> b) -> b -> Node a -> b # foldr' :: (a -> b -> b) -> b -> Node a -> b # foldl :: (b -> a -> b) -> b -> Node a -> b # foldl' :: (b -> a -> b) -> b -> Node a -> b # foldr1 :: (a -> a -> a) -> Node a -> a # foldl1 :: (a -> a -> a) -> Node a -> a # elem :: Eq a => a -> Node a -> Bool # maximum :: Ord a => Node a -> a # | |
Foldable Tree | |
Defined in Hedgehog.Internal.Tree fold :: Monoid m => Tree m -> m # foldMap :: Monoid m => (a -> m) -> Tree a -> m # foldMap' :: Monoid m => (a -> m) -> Tree a -> m # foldr :: (a -> b -> b) -> b -> Tree a -> b # foldr' :: (a -> b -> b) -> b -> Tree a -> b # foldl :: (b -> a -> b) -> b -> Tree a -> b # foldl' :: (b -> a -> b) -> b -> Tree a -> b # foldr1 :: (a -> a -> a) -> Tree a -> a # foldl1 :: (a -> a -> a) -> Tree a -> a # elem :: Eq a => a -> Tree a -> Bool # maximum :: Ord a => Tree a -> a # | |
Foldable Hashed | |
Defined in Data.Hashable.Class fold :: Monoid m => Hashed m -> m # foldMap :: Monoid m => (a -> m) -> Hashed a -> m # foldMap' :: Monoid m => (a -> m) -> Hashed a -> m # foldr :: (a -> b -> b) -> b -> Hashed a -> b # foldr' :: (a -> b -> b) -> b -> Hashed a -> b # foldl :: (b -> a -> b) -> b -> Hashed a -> b # foldl' :: (b -> a -> b) -> b -> Hashed a -> b # foldr1 :: (a -> a -> a) -> Hashed a -> a # foldl1 :: (a -> a -> a) -> Hashed a -> a # elem :: Eq a => a -> Hashed a -> Bool # maximum :: Ord a => Hashed a -> a # minimum :: Ord a => Hashed a -> a # | |
Foldable Note Source # | |
Defined in Derive.C.India.Pakhawaj fold :: Monoid m => Note m -> m # foldMap :: Monoid m => (a -> m) -> Note a -> m # foldMap' :: Monoid m => (a -> m) -> Note a -> m # foldr :: (a -> b -> b) -> b -> Note a -> b # foldr' :: (a -> b -> b) -> b -> Note a -> b # foldl :: (b -> a -> b) -> b -> Note a -> b # foldl' :: (b -> a -> b) -> b -> Note a -> b # foldr1 :: (a -> a -> a) -> Note a -> a # foldl1 :: (a -> a -> a) -> Note a -> a # elem :: Eq a => a -> Note a -> Bool # maximum :: Ord a => Note a -> a # | |
Foldable LEvent Source # | |
Defined in Derive.LEvent fold :: Monoid m => LEvent m -> m # foldMap :: Monoid m => (a -> m) -> LEvent a -> m # foldMap' :: Monoid m => (a -> m) -> LEvent a -> m # foldr :: (a -> b -> b) -> b -> LEvent a -> b # foldr' :: (a -> b -> b) -> b -> LEvent a -> b # foldl :: (b -> a -> b) -> b -> LEvent a -> b # foldl' :: (b -> a -> b) -> b -> LEvent a -> b # foldr1 :: (a -> a -> a) -> LEvent a -> a # foldl1 :: (a -> a -> a) -> LEvent a -> a # elem :: Eq a => a -> LEvent a -> Bool # maximum :: Ord a => LEvent a -> a # minimum :: Ord a => LEvent a -> a # | |
Foldable Typed Source # | |
Defined in Derive.ScoreT fold :: Monoid m => Typed m -> m # foldMap :: Monoid m => (a -> m) -> Typed a -> m # foldMap' :: Monoid m => (a -> m) -> Typed a -> m # foldr :: (a -> b -> b) -> b -> Typed a -> b # foldr' :: (a -> b -> b) -> b -> Typed a -> b # foldl :: (b -> a -> b) -> b -> Typed a -> b # foldl' :: (b -> a -> b) -> b -> Typed a -> b # foldr1 :: (a -> a -> a) -> Typed a -> a # foldl1 :: (a -> a -> a) -> Typed a -> a # elem :: Eq a => a -> Typed a -> Bool # maximum :: Ord a => Typed a -> a # minimum :: Ord a => Typed a -> a # | |
Foldable Note Source # | |
Defined in Solkattu.Realize fold :: Monoid m => Note m -> m # foldMap :: Monoid m => (a -> m) -> Note a -> m # foldMap' :: Monoid m => (a -> m) -> Note a -> m # foldr :: (a -> b -> b) -> b -> Note a -> b # foldr' :: (a -> b -> b) -> b -> Note a -> b # foldl :: (b -> a -> b) -> b -> Note a -> b # foldl' :: (b -> a -> b) -> b -> Note a -> b # foldr1 :: (a -> a -> a) -> Note a -> a # foldl1 :: (a -> a -> a) -> Note a -> a # elem :: Eq a => a -> Note a -> Bool # maximum :: Ord a => Note a -> a # | |
Foldable Stroke Source # | |
Defined in Solkattu.Realize fold :: Monoid m => Stroke m -> m # foldMap :: Monoid m => (a -> m) -> Stroke a -> m # foldMap' :: Monoid m => (a -> m) -> Stroke a -> m # foldr :: (a -> b -> b) -> b -> Stroke a -> b # foldr' :: (a -> b -> b) -> b -> Stroke a -> b # foldl :: (b -> a -> b) -> b -> Stroke a -> b # foldl' :: (b -> a -> b) -> b -> Stroke a -> b # foldr1 :: (a -> a -> a) -> Stroke a -> a # foldl1 :: (a -> a -> a) -> Stroke a -> a # elem :: Eq a => a -> Stroke a -> Bool # maximum :: Ord a => Stroke a -> a # minimum :: Ord a => Stroke a -> a # | |
Foldable Note Source # | |
Defined in Solkattu.Solkattu fold :: Monoid m => Note m -> m # foldMap :: Monoid m => (a -> m) -> Note a -> m # foldMap' :: Monoid m => (a -> m) -> Note a -> m # foldr :: (a -> b -> b) -> b -> Note a -> b # foldr' :: (a -> b -> b) -> b -> Note a -> b # foldl :: (b -> a -> b) -> b -> Note a -> b # foldl' :: (b -> a -> b) -> b -> Note a -> b # foldr1 :: (a -> a -> a) -> Note a -> a # foldl1 :: (a -> a -> a) -> Note a -> a # elem :: Eq a => a -> Note a -> Bool # maximum :: Ord a => Note a -> a # | |
Foldable NoteT Source # | |
Defined in Solkattu.Solkattu fold :: Monoid m => NoteT m -> m # foldMap :: Monoid m => (a -> m) -> NoteT a -> m # foldMap' :: Monoid m => (a -> m) -> NoteT a -> m # foldr :: (a -> b -> b) -> b -> NoteT a -> b # foldr' :: (a -> b -> b) -> b -> NoteT a -> b # foldl :: (b -> a -> b) -> b -> NoteT a -> b # foldl' :: (b -> a -> b) -> b -> NoteT a -> b # foldr1 :: (a -> a -> a) -> NoteT a -> a # foldl1 :: (a -> a -> a) -> NoteT a -> a # elem :: Eq a => a -> NoteT a -> Bool # maximum :: Ord a => NoteT a -> a # minimum :: Ord a => NoteT a -> a # | |
Foldable HashSet | |
Defined in Data.HashSet.Internal fold :: Monoid m => HashSet m -> m # foldMap :: Monoid m => (a -> m) -> HashSet a -> m # foldMap' :: Monoid m => (a -> m) -> HashSet a -> m # foldr :: (a -> b -> b) -> b -> HashSet a -> b # foldr' :: (a -> b -> b) -> b -> HashSet a -> b # foldl :: (b -> a -> b) -> b -> HashSet a -> b # foldl' :: (b -> a -> b) -> b -> HashSet a -> b # foldr1 :: (a -> a -> a) -> HashSet a -> a # foldl1 :: (a -> a -> a) -> HashSet a -> a # elem :: Eq a => a -> HashSet a -> Bool # maximum :: Ord a => HashSet a -> a # minimum :: Ord a => HashSet a -> a # | |
Foldable Array | |
Defined in Data.Primitive.Array fold :: Monoid m => Array m -> m # foldMap :: Monoid m => (a -> m) -> Array a -> m # foldMap' :: Monoid m => (a -> m) -> Array a -> m # foldr :: (a -> b -> b) -> b -> Array a -> b # foldr' :: (a -> b -> b) -> b -> Array a -> b # foldl :: (b -> a -> b) -> b -> Array a -> b # foldl' :: (b -> a -> b) -> b -> Array a -> b # foldr1 :: (a -> a -> a) -> Array a -> a # foldl1 :: (a -> a -> a) -> Array a -> a # elem :: Eq a => a -> Array a -> Bool # maximum :: Ord a => Array a -> a # minimum :: Ord a => Array a -> a # | |
Foldable SmallArray | |
Defined in Data.Primitive.SmallArray fold :: Monoid m => SmallArray m -> m # foldMap :: Monoid m => (a -> m) -> SmallArray a -> m # foldMap' :: Monoid m => (a -> m) -> SmallArray a -> m # foldr :: (a -> b -> b) -> b -> SmallArray a -> b # foldr' :: (a -> b -> b) -> b -> SmallArray a -> b # foldl :: (b -> a -> b) -> b -> SmallArray a -> b # foldl' :: (b -> a -> b) -> b -> SmallArray a -> b # foldr1 :: (a -> a -> a) -> SmallArray a -> a # foldl1 :: (a -> a -> a) -> SmallArray a -> a # toList :: SmallArray a -> [a] # null :: SmallArray a -> Bool # length :: SmallArray a -> Int # elem :: Eq a => a -> SmallArray a -> Bool # maximum :: Ord a => SmallArray a -> a # minimum :: Ord a => SmallArray a -> a # sum :: Num a => SmallArray a -> a # product :: Num a => SmallArray a -> a # | |
Foldable KeyMap | |
Defined in Data.Aeson.KeyMap fold :: Monoid m => KeyMap m -> m # foldMap :: Monoid m => (a -> m) -> KeyMap a -> m # foldMap' :: Monoid m => (a -> m) -> KeyMap a -> m # foldr :: (a -> b -> b) -> b -> KeyMap a -> b # foldr' :: (a -> b -> b) -> b -> KeyMap a -> b # foldl :: (b -> a -> b) -> b -> KeyMap a -> b # foldl' :: (b -> a -> b) -> b -> KeyMap a -> b # foldr1 :: (a -> a -> a) -> KeyMap a -> a # foldl1 :: (a -> a -> a) -> KeyMap a -> a # elem :: Eq a => a -> KeyMap a -> Bool # maximum :: Ord a => KeyMap a -> a # minimum :: Ord a => KeyMap a -> a # | |
Foldable IResult | |
Defined in Data.Aeson.Types.Internal fold :: Monoid m => IResult m -> m # foldMap :: Monoid m => (a -> m) -> IResult a -> m # foldMap' :: Monoid m => (a -> m) -> IResult a -> m # foldr :: (a -> b -> b) -> b -> IResult a -> b # foldr' :: (a -> b -> b) -> b -> IResult a -> b # foldl :: (b -> a -> b) -> b -> IResult a -> b # foldl' :: (b -> a -> b) -> b -> IResult a -> b # foldr1 :: (a -> a -> a) -> IResult a -> a # foldl1 :: (a -> a -> a) -> IResult a -> a # elem :: Eq a => a -> IResult a -> Bool # maximum :: Ord a => IResult a -> a # minimum :: Ord a => IResult a -> a # | |
Foldable Result | |
Defined in Data.Aeson.Types.Internal fold :: Monoid m => Result m -> m # foldMap :: Monoid m => (a -> m) -> Result a -> m # foldMap' :: Monoid m => (a -> m) -> Result a -> m # foldr :: (a -> b -> b) -> b -> Result a -> b # foldr' :: (a -> b -> b) -> b -> Result a -> b # foldl :: (b -> a -> b) -> b -> Result a -> b # foldl' :: (b -> a -> b) -> b -> Result a -> b # foldr1 :: (a -> a -> a) -> Result a -> a # foldl1 :: (a -> a -> a) -> Result a -> a # elem :: Eq a => a -> Result a -> Bool # maximum :: Ord a => Result a -> a # minimum :: Ord a => Result a -> a # | |
Foldable Maybe | |
Defined in Data.Strict.Maybe fold :: Monoid m => Maybe m -> m # foldMap :: Monoid m => (a -> m) -> Maybe a -> m # foldMap' :: Monoid m => (a -> m) -> Maybe a -> m # foldr :: (a -> b -> b) -> b -> Maybe a -> b # foldr' :: (a -> b -> b) -> b -> Maybe a -> b # foldl :: (b -> a -> b) -> b -> Maybe a -> b # foldl' :: (b -> a -> b) -> b -> Maybe a -> b # foldr1 :: (a -> a -> a) -> Maybe a -> a # foldl1 :: (a -> a -> a) -> Maybe a -> a # elem :: Eq a => a -> Maybe a -> Bool # maximum :: Ord a => Maybe a -> a # minimum :: Ord a => Maybe a -> a # | |
Foldable Window | |
Defined in System.Console.Terminal.Common fold :: Monoid m => Window m -> m # foldMap :: Monoid m => (a -> m) -> Window a -> m # foldMap' :: Monoid m => (a -> m) -> Window a -> m # foldr :: (a -> b -> b) -> b -> Window a -> b # foldr' :: (a -> b -> b) -> b -> Window a -> b # foldl :: (b -> a -> b) -> b -> Window a -> b # foldl' :: (b -> a -> b) -> b -> Window a -> b # foldr1 :: (a -> a -> a) -> Window a -> a # foldl1 :: (a -> a -> a) -> Window a -> a # elem :: Eq a => a -> Window a -> Bool # maximum :: Ord a => Window a -> a # minimum :: Ord a => Window a -> a # | |
Foldable Vector | |
Defined in Data.Vector fold :: Monoid m => Vector m -> m # foldMap :: Monoid m => (a -> m) -> Vector a -> m # foldMap' :: Monoid m => (a -> m) -> Vector a -> m # foldr :: (a -> b -> b) -> b -> Vector a -> b # foldr' :: (a -> b -> b) -> b -> Vector a -> b # foldl :: (b -> a -> b) -> b -> Vector a -> b # foldl' :: (b -> a -> b) -> b -> Vector a -> b # foldr1 :: (a -> a -> a) -> Vector a -> a # foldl1 :: (a -> a -> a) -> Vector a -> a # elem :: Eq a => a -> Vector a -> Bool # maximum :: Ord a => Vector a -> a # minimum :: Ord a => Vector a -> a # | |
Foldable SimpleDoc | |
Defined in Text.PrettyPrint.Annotated.WL fold :: Monoid m => SimpleDoc m -> m # foldMap :: Monoid m => (a -> m) -> SimpleDoc a -> m # foldMap' :: Monoid m => (a -> m) -> SimpleDoc a -> m # foldr :: (a -> b -> b) -> b -> SimpleDoc a -> b # foldr' :: (a -> b -> b) -> b -> SimpleDoc a -> b # foldl :: (b -> a -> b) -> b -> SimpleDoc a -> b # foldl' :: (b -> a -> b) -> b -> SimpleDoc a -> b # foldr1 :: (a -> a -> a) -> SimpleDoc a -> a # foldl1 :: (a -> a -> a) -> SimpleDoc a -> a # toList :: SimpleDoc a -> [a] # length :: SimpleDoc a -> Int # elem :: Eq a => a -> SimpleDoc a -> Bool # maximum :: Ord a => SimpleDoc a -> a # minimum :: Ord a => SimpleDoc a -> a # | |
Foldable NonEmpty | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => NonEmpty m -> m # foldMap :: Monoid m => (a -> m) -> NonEmpty a -> m # foldMap' :: Monoid m => (a -> m) -> NonEmpty a -> m # foldr :: (a -> b -> b) -> b -> NonEmpty a -> b # foldr' :: (a -> b -> b) -> b -> NonEmpty a -> b # foldl :: (b -> a -> b) -> b -> NonEmpty a -> b # foldl' :: (b -> a -> b) -> b -> NonEmpty a -> b # foldr1 :: (a -> a -> a) -> NonEmpty a -> a # foldl1 :: (a -> a -> a) -> NonEmpty a -> a # elem :: Eq a => a -> NonEmpty a -> Bool # maximum :: Ord a => NonEmpty a -> a # minimum :: Ord a => NonEmpty a -> a # | |
Foldable Maybe | Since: base-2.1 |
Defined in Data.Foldable fold :: Monoid m => Maybe m -> m # foldMap :: Monoid m => (a -> m) -> Maybe a -> m # foldMap' :: Monoid m => (a -> m) -> Maybe a -> m # foldr :: (a -> b -> b) -> b -> Maybe a -> b # foldr' :: (a -> b -> b) -> b -> Maybe a -> b # foldl :: (b -> a -> b) -> b -> Maybe a -> b # foldl' :: (b -> a -> b) -> b -> Maybe a -> b # foldr1 :: (a -> a -> a) -> Maybe a -> a # foldl1 :: (a -> a -> a) -> Maybe a -> a # elem :: Eq a => a -> Maybe a -> Bool # maximum :: Ord a => Maybe a -> a # minimum :: Ord a => Maybe a -> a # | |
Foldable Solo | Since: base-4.15 |
Defined in Data.Foldable fold :: Monoid m => Solo m -> m # foldMap :: Monoid m => (a -> m) -> Solo a -> m # foldMap' :: Monoid m => (a -> m) -> Solo a -> m # foldr :: (a -> b -> b) -> b -> Solo a -> b # foldr' :: (a -> b -> b) -> b -> Solo a -> b # foldl :: (b -> a -> b) -> b -> Solo a -> b # foldl' :: (b -> a -> b) -> b -> Solo a -> b # foldr1 :: (a -> a -> a) -> Solo a -> a # foldl1 :: (a -> a -> a) -> Solo a -> a # elem :: Eq a => a -> Solo a -> Bool # maximum :: Ord a => Solo a -> a # | |
Foldable [] | Since: base-2.1 |
Defined in Data.Foldable fold :: Monoid m => [m] -> m # foldMap :: Monoid m => (a -> m) -> [a] -> m # foldMap' :: Monoid m => (a -> m) -> [a] -> m # foldr :: (a -> b -> b) -> b -> [a] -> b # foldr' :: (a -> b -> b) -> b -> [a] -> b # foldl :: (b -> a -> b) -> b -> [a] -> b # foldl' :: (b -> a -> b) -> b -> [a] -> b # foldr1 :: (a -> a -> a) -> [a] -> a # foldl1 :: (a -> a -> a) -> [a] -> a # elem :: Eq a => a -> [a] -> Bool # maximum :: Ord a => [a] -> a # | |
Foldable (Either a) | Since: base-4.7.0.0 |
Defined in Data.Foldable fold :: Monoid m => Either a m -> m # foldMap :: Monoid m => (a0 -> m) -> Either a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> Either a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Either a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Either a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Either a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Either a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 # toList :: Either a a0 -> [a0] # length :: Either a a0 -> Int # elem :: Eq a0 => a0 -> Either a a0 -> Bool # maximum :: Ord a0 => Either a a0 -> a0 # minimum :: Ord a0 => Either a a0 -> a0 # | |
Foldable (Proxy :: TYPE LiftedRep -> Type) | Since: base-4.7.0.0 |
Defined in Data.Foldable fold :: Monoid m => Proxy m -> m # foldMap :: Monoid m => (a -> m) -> Proxy a -> m # foldMap' :: Monoid m => (a -> m) -> Proxy a -> m # foldr :: (a -> b -> b) -> b -> Proxy a -> b # foldr' :: (a -> b -> b) -> b -> Proxy a -> b # foldl :: (b -> a -> b) -> b -> Proxy a -> b # foldl' :: (b -> a -> b) -> b -> Proxy a -> b # foldr1 :: (a -> a -> a) -> Proxy a -> a # foldl1 :: (a -> a -> a) -> Proxy a -> a # elem :: Eq a => a -> Proxy a -> Bool # maximum :: Ord a => Proxy a -> a # minimum :: Ord a => Proxy a -> a # | |
Foldable (Arg a) | Since: base-4.9.0.0 |
Defined in Data.Semigroup fold :: Monoid m => Arg a m -> m # foldMap :: Monoid m => (a0 -> m) -> Arg a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> Arg a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Arg a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Arg a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Arg a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Arg a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Arg a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Arg a a0 -> a0 # elem :: Eq a0 => a0 -> Arg a a0 -> Bool # maximum :: Ord a0 => Arg a a0 -> a0 # minimum :: Ord a0 => Arg a a0 -> a0 # | |
Foldable (Array i) | Since: base-4.8.0.0 |
Defined in Data.Foldable fold :: Monoid m => Array i m -> m # foldMap :: Monoid m => (a -> m) -> Array i a -> m # foldMap' :: Monoid m => (a -> m) -> Array i a -> m # foldr :: (a -> b -> b) -> b -> Array i a -> b # foldr' :: (a -> b -> b) -> b -> Array i a -> b # foldl :: (b -> a -> b) -> b -> Array i a -> b # foldl' :: (b -> a -> b) -> b -> Array i a -> b # foldr1 :: (a -> a -> a) -> Array i a -> a # foldl1 :: (a -> a -> a) -> Array i a -> a # elem :: Eq a => a -> Array i a -> Bool # maximum :: Ord a => Array i a -> a # minimum :: Ord a => Array i a -> a # | |
Foldable (U1 :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => U1 m -> m # foldMap :: Monoid m => (a -> m) -> U1 a -> m # foldMap' :: Monoid m => (a -> m) -> U1 a -> m # foldr :: (a -> b -> b) -> b -> U1 a -> b # foldr' :: (a -> b -> b) -> b -> U1 a -> b # foldl :: (b -> a -> b) -> b -> U1 a -> b # foldl' :: (b -> a -> b) -> b -> U1 a -> b # foldr1 :: (a -> a -> a) -> U1 a -> a # foldl1 :: (a -> a -> a) -> U1 a -> a # elem :: Eq a => a -> U1 a -> Bool # maximum :: Ord a => U1 a -> a # | |
Foldable (UAddr :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => UAddr m -> m # foldMap :: Monoid m => (a -> m) -> UAddr a -> m # foldMap' :: Monoid m => (a -> m) -> UAddr a -> m # foldr :: (a -> b -> b) -> b -> UAddr a -> b # foldr' :: (a -> b -> b) -> b -> UAddr a -> b # foldl :: (b -> a -> b) -> b -> UAddr a -> b # foldl' :: (b -> a -> b) -> b -> UAddr a -> b # foldr1 :: (a -> a -> a) -> UAddr a -> a # foldl1 :: (a -> a -> a) -> UAddr a -> a # elem :: Eq a => a -> UAddr a -> Bool # maximum :: Ord a => UAddr a -> a # minimum :: Ord a => UAddr a -> a # | |
Foldable (UChar :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => UChar m -> m # foldMap :: Monoid m => (a -> m) -> UChar a -> m # foldMap' :: Monoid m => (a -> m) -> UChar a -> m # foldr :: (a -> b -> b) -> b -> UChar a -> b # foldr' :: (a -> b -> b) -> b -> UChar a -> b # foldl :: (b -> a -> b) -> b -> UChar a -> b # foldl' :: (b -> a -> b) -> b -> UChar a -> b # foldr1 :: (a -> a -> a) -> UChar a -> a # foldl1 :: (a -> a -> a) -> UChar a -> a # elem :: Eq a => a -> UChar a -> Bool # maximum :: Ord a => UChar a -> a # minimum :: Ord a => UChar a -> a # | |
Foldable (UDouble :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => UDouble m -> m # foldMap :: Monoid m => (a -> m) -> UDouble a -> m # foldMap' :: Monoid m => (a -> m) -> UDouble a -> m # foldr :: (a -> b -> b) -> b -> UDouble a -> b # foldr' :: (a -> b -> b) -> b -> UDouble a -> b # foldl :: (b -> a -> b) -> b -> UDouble a -> b # foldl' :: (b -> a -> b) -> b -> UDouble a -> b # foldr1 :: (a -> a -> a) -> UDouble a -> a # foldl1 :: (a -> a -> a) -> UDouble a -> a # elem :: Eq a => a -> UDouble a -> Bool # maximum :: Ord a => UDouble a -> a # minimum :: Ord a => UDouble a -> a # | |
Foldable (UFloat :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => UFloat m -> m # foldMap :: Monoid m => (a -> m) -> UFloat a -> m # foldMap' :: Monoid m => (a -> m) -> UFloat a -> m # foldr :: (a -> b -> b) -> b -> UFloat a -> b # foldr' :: (a -> b -> b) -> b -> UFloat a -> b # foldl :: (b -> a -> b) -> b -> UFloat a -> b # foldl' :: (b -> a -> b) -> b -> UFloat a -> b # foldr1 :: (a -> a -> a) -> UFloat a -> a # foldl1 :: (a -> a -> a) -> UFloat a -> a # elem :: Eq a => a -> UFloat a -> Bool # maximum :: Ord a => UFloat a -> a # minimum :: Ord a => UFloat a -> a # | |
Foldable (UInt :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => UInt m -> m # foldMap :: Monoid m => (a -> m) -> UInt a -> m # foldMap' :: Monoid m => (a -> m) -> UInt a -> m # foldr :: (a -> b -> b) -> b -> UInt a -> b # foldr' :: (a -> b -> b) -> b -> UInt a -> b # foldl :: (b -> a -> b) -> b -> UInt a -> b # foldl' :: (b -> a -> b) -> b -> UInt a -> b # foldr1 :: (a -> a -> a) -> UInt a -> a # foldl1 :: (a -> a -> a) -> UInt a -> a # elem :: Eq a => a -> UInt a -> Bool # maximum :: Ord a => UInt a -> a # | |
Foldable (UWord :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => UWord m -> m # foldMap :: Monoid m => (a -> m) -> UWord a -> m # foldMap' :: Monoid m => (a -> m) -> UWord a -> m # foldr :: (a -> b -> b) -> b -> UWord a -> b # foldr' :: (a -> b -> b) -> b -> UWord a -> b # foldl :: (b -> a -> b) -> b -> UWord a -> b # foldl' :: (b -> a -> b) -> b -> UWord a -> b # foldr1 :: (a -> a -> a) -> UWord a -> a # foldl1 :: (a -> a -> a) -> UWord a -> a # elem :: Eq a => a -> UWord a -> Bool # maximum :: Ord a => UWord a -> a # minimum :: Ord a => UWord a -> a # | |
Foldable (V1 :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => V1 m -> m # foldMap :: Monoid m => (a -> m) -> V1 a -> m # foldMap' :: Monoid m => (a -> m) -> V1 a -> m # foldr :: (a -> b -> b) -> b -> V1 a -> b # foldr' :: (a -> b -> b) -> b -> V1 a -> b # foldl :: (b -> a -> b) -> b -> V1 a -> b # foldl' :: (b -> a -> b) -> b -> V1 a -> b # foldr1 :: (a -> a -> a) -> V1 a -> a # foldl1 :: (a -> a -> a) -> V1 a -> a # elem :: Eq a => a -> V1 a -> Bool # maximum :: Ord a => V1 a -> a # | |
Foldable (Map k) | Folds in order of increasing key. |
Defined in Data.Map.Internal fold :: Monoid m => Map k m -> m # foldMap :: Monoid m => (a -> m) -> Map k a -> m # foldMap' :: Monoid m => (a -> m) -> Map k a -> m # foldr :: (a -> b -> b) -> b -> Map k a -> b # foldr' :: (a -> b -> b) -> b -> Map k a -> b # foldl :: (b -> a -> b) -> b -> Map k a -> b # foldl' :: (b -> a -> b) -> b -> Map k a -> b # foldr1 :: (a -> a -> a) -> Map k a -> a # foldl1 :: (a -> a -> a) -> Map k a -> a # elem :: Eq a => a -> Map k a -> Bool # maximum :: Ord a => Map k a -> a # minimum :: Ord a => Map k a -> a # | |
(Eq (Key m), TrieMap m) => Foldable (GenMap m) | |
Defined in GHC.Data.TrieMap fold :: Monoid m0 => GenMap m m0 -> m0 # foldMap :: Monoid m0 => (a -> m0) -> GenMap m a -> m0 # foldMap' :: Monoid m0 => (a -> m0) -> GenMap m a -> m0 # foldr :: (a -> b -> b) -> b -> GenMap m a -> b # foldr' :: (a -> b -> b) -> b -> GenMap m a -> b # foldl :: (b -> a -> b) -> b -> GenMap m a -> b # foldl' :: (b -> a -> b) -> b -> GenMap m a -> b # foldr1 :: (a -> a -> a) -> GenMap m a -> a # foldl1 :: (a -> a -> a) -> GenMap m a -> a # elem :: Eq a => a -> GenMap m a -> Bool # maximum :: Ord a => GenMap m a -> a # minimum :: Ord a => GenMap m a -> a # | |
TrieMap m => Foldable (ListMap m) | |
Defined in GHC.Data.TrieMap fold :: Monoid m0 => ListMap m m0 -> m0 # foldMap :: Monoid m0 => (a -> m0) -> ListMap m a -> m0 # foldMap' :: Monoid m0 => (a -> m0) -> ListMap m a -> m0 # foldr :: (a -> b -> b) -> b -> ListMap m a -> b # foldr' :: (a -> b -> b) -> b -> ListMap m a -> b # foldl :: (b -> a -> b) -> b -> ListMap m a -> b # foldl' :: (b -> a -> b) -> b -> ListMap m a -> b # foldr1 :: (a -> a -> a) -> ListMap m a -> a # foldl1 :: (a -> a -> a) -> ListMap m a -> a # toList :: ListMap m a -> [a] # length :: ListMap m a -> Int # elem :: Eq a => a -> ListMap m a -> Bool # maximum :: Ord a => ListMap m a -> a # minimum :: Ord a => ListMap m a -> a # | |
TrieMap m => Foldable (MaybeMap m) | |
Defined in GHC.Data.TrieMap fold :: Monoid m0 => MaybeMap m m0 -> m0 # foldMap :: Monoid m0 => (a -> m0) -> MaybeMap m a -> m0 # foldMap' :: Monoid m0 => (a -> m0) -> MaybeMap m a -> m0 # foldr :: (a -> b -> b) -> b -> MaybeMap m a -> b # foldr' :: (a -> b -> b) -> b -> MaybeMap m a -> b # foldl :: (b -> a -> b) -> b -> MaybeMap m a -> b # foldl' :: (b -> a -> b) -> b -> MaybeMap m a -> b # foldr1 :: (a -> a -> a) -> MaybeMap m a -> a # foldl1 :: (a -> a -> a) -> MaybeMap m a -> a # toList :: MaybeMap m a -> [a] # null :: MaybeMap m a -> Bool # length :: MaybeMap m a -> Int # elem :: Eq a => a -> MaybeMap m a -> Bool # maximum :: Ord a => MaybeMap m a -> a # minimum :: Ord a => MaybeMap m a -> a # | |
Foldable (GenLocated l) | |
Defined in GHC.Types.SrcLoc fold :: Monoid m => GenLocated l m -> m # foldMap :: Monoid m => (a -> m) -> GenLocated l a -> m # foldMap' :: Monoid m => (a -> m) -> GenLocated l a -> m # foldr :: (a -> b -> b) -> b -> GenLocated l a -> b # foldr' :: (a -> b -> b) -> b -> GenLocated l a -> b # foldl :: (b -> a -> b) -> b -> GenLocated l a -> b # foldl' :: (b -> a -> b) -> b -> GenLocated l a -> b # foldr1 :: (a -> a -> a) -> GenLocated l a -> a # foldl1 :: (a -> a -> a) -> GenLocated l a -> a # toList :: GenLocated l a -> [a] # null :: GenLocated l a -> Bool # length :: GenLocated l a -> Int # elem :: Eq a => a -> GenLocated l a -> Bool # maximum :: Ord a => GenLocated l a -> a # minimum :: Ord a => GenLocated l a -> a # sum :: Num a => GenLocated l a -> a # product :: Num a => GenLocated l a -> a # | |
Foldable (HsRecField' id) | |
Defined in Language.Haskell.Syntax.Pat fold :: Monoid m => HsRecField' id m -> m # foldMap :: Monoid m => (a -> m) -> HsRecField' id a -> m # foldMap' :: Monoid m => (a -> m) -> HsRecField' id a -> m # foldr :: (a -> b -> b) -> b -> HsRecField' id a -> b # foldr' :: (a -> b -> b) -> b -> HsRecField' id a -> b # foldl :: (b -> a -> b) -> b -> HsRecField' id a -> b # foldl' :: (b -> a -> b) -> b -> HsRecField' id a -> b # foldr1 :: (a -> a -> a) -> HsRecField' id a -> a # foldl1 :: (a -> a -> a) -> HsRecField' id a -> a # toList :: HsRecField' id a -> [a] # null :: HsRecField' id a -> Bool # length :: HsRecField' id a -> Int # elem :: Eq a => a -> HsRecField' id a -> Bool # maximum :: Ord a => HsRecField' id a -> a # minimum :: Ord a => HsRecField' id a -> a # sum :: Num a => HsRecField' id a -> a # product :: Num a => HsRecField' id a -> a # | |
Foldable (Subterms n) | |
Defined in Hedgehog.Internal.Gen fold :: Monoid m => Subterms n m -> m # foldMap :: Monoid m => (a -> m) -> Subterms n a -> m # foldMap' :: Monoid m => (a -> m) -> Subterms n a -> m # foldr :: (a -> b -> b) -> b -> Subterms n a -> b # foldr' :: (a -> b -> b) -> b -> Subterms n a -> b # foldl :: (b -> a -> b) -> b -> Subterms n a -> b # foldl' :: (b -> a -> b) -> b -> Subterms n a -> b # foldr1 :: (a -> a -> a) -> Subterms n a -> a # foldl1 :: (a -> a -> a) -> Subterms n a -> a # toList :: Subterms n a -> [a] # null :: Subterms n a -> Bool # length :: Subterms n a -> Int # elem :: Eq a => a -> Subterms n a -> Bool # maximum :: Ord a => Subterms n a -> a # minimum :: Ord a => Subterms n a -> a # | |
Foldable (Vec n) | |
Defined in Hedgehog.Internal.Gen fold :: Monoid m => Vec n m -> m # foldMap :: Monoid m => (a -> m) -> Vec n a -> m # foldMap' :: Monoid m => (a -> m) -> Vec n a -> m # foldr :: (a -> b -> b) -> b -> Vec n a -> b # foldr' :: (a -> b -> b) -> b -> Vec n a -> b # foldl :: (b -> a -> b) -> b -> Vec n a -> b # foldl' :: (b -> a -> b) -> b -> Vec n a -> b # foldr1 :: (a -> a -> a) -> Vec n a -> a # foldl1 :: (a -> a -> a) -> Vec n a -> a # elem :: Eq a => a -> Vec n a -> Bool # maximum :: Ord a => Vec n a -> a # minimum :: Ord a => Vec n a -> a # | |
Foldable (Note g) Source # | |
Defined in Solkattu.S fold :: Monoid m => Note g m -> m # foldMap :: Monoid m => (a -> m) -> Note g a -> m # foldMap' :: Monoid m => (a -> m) -> Note g a -> m # foldr :: (a -> b -> b) -> b -> Note g a -> b # foldr' :: (a -> b -> b) -> b -> Note g a -> b # foldl :: (b -> a -> b) -> b -> Note g a -> b # foldl' :: (b -> a -> b) -> b -> Note g a -> b # foldr1 :: (a -> a -> a) -> Note g a -> a # foldl1 :: (a -> a -> a) -> Note g a -> a # elem :: Eq a => a -> Note g a -> Bool # maximum :: Ord a => Note g a -> a # minimum :: Ord a => Note g a -> a # | |
Foldable (Elt e) Source # | |
Defined in Util.EList fold :: Monoid m => Elt e m -> m # foldMap :: Monoid m => (a -> m) -> Elt e a -> m # foldMap' :: Monoid m => (a -> m) -> Elt e a -> m # foldr :: (a -> b -> b) -> b -> Elt e a -> b # foldr' :: (a -> b -> b) -> b -> Elt e a -> b # foldl :: (b -> a -> b) -> b -> Elt e a -> b # foldl' :: (b -> a -> b) -> b -> Elt e a -> b # foldr1 :: (a -> a -> a) -> Elt e a -> a # foldl1 :: (a -> a -> a) -> Elt e a -> a # elem :: Eq a => a -> Elt e a -> Bool # maximum :: Ord a => Elt e a -> a # minimum :: Ord a => Elt e a -> a # | |
Foldable (HashMap k) | |
Defined in Data.HashMap.Internal fold :: Monoid m => HashMap k m -> m # foldMap :: Monoid m => (a -> m) -> HashMap k a -> m # foldMap' :: Monoid m => (a -> m) -> HashMap k a -> m # foldr :: (a -> b -> b) -> b -> HashMap k a -> b # foldr' :: (a -> b -> b) -> b -> HashMap k a -> b # foldl :: (b -> a -> b) -> b -> HashMap k a -> b # foldl' :: (b -> a -> b) -> b -> HashMap k a -> b # foldr1 :: (a -> a -> a) -> HashMap k a -> a # foldl1 :: (a -> a -> a) -> HashMap k a -> a # toList :: HashMap k a -> [a] # length :: HashMap k a -> Int # elem :: Eq a => a -> HashMap k a -> Bool # maximum :: Ord a => HashMap k a -> a # minimum :: Ord a => HashMap k a -> a # | |
Foldable (Either e) | |
Defined in Data.Strict.Either fold :: Monoid m => Either e m -> m # foldMap :: Monoid m => (a -> m) -> Either e a -> m # foldMap' :: Monoid m => (a -> m) -> Either e a -> m # foldr :: (a -> b -> b) -> b -> Either e a -> b # foldr' :: (a -> b -> b) -> b -> Either e a -> b # foldl :: (b -> a -> b) -> b -> Either e a -> b # foldl' :: (b -> a -> b) -> b -> Either e a -> b # foldr1 :: (a -> a -> a) -> Either e a -> a # foldl1 :: (a -> a -> a) -> Either e a -> a # elem :: Eq a => a -> Either e a -> Bool # maximum :: Ord a => Either e a -> a # minimum :: Ord a => Either e a -> a # | |
Foldable (These a) | |
Defined in Data.Strict.These fold :: Monoid m => These a m -> m # foldMap :: Monoid m => (a0 -> m) -> These a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> These a a0 -> m # foldr :: (a0 -> b -> b) -> b -> These a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> These a a0 -> b # foldl :: (b -> a0 -> b) -> b -> These a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> These a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> These a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> These a a0 -> a0 # toList :: These a a0 -> [a0] # elem :: Eq a0 => a0 -> These a a0 -> Bool # maximum :: Ord a0 => These a a0 -> a0 # minimum :: Ord a0 => These a a0 -> a0 # | |
Foldable (Pair e) | |
Defined in Data.Strict.Tuple fold :: Monoid m => Pair e m -> m # foldMap :: Monoid m => (a -> m) -> Pair e a -> m # foldMap' :: Monoid m => (a -> m) -> Pair e a -> m # foldr :: (a -> b -> b) -> b -> Pair e a -> b # foldr' :: (a -> b -> b) -> b -> Pair e a -> b # foldl :: (b -> a -> b) -> b -> Pair e a -> b # foldl' :: (b -> a -> b) -> b -> Pair e a -> b # foldr1 :: (a -> a -> a) -> Pair e a -> a # foldl1 :: (a -> a -> a) -> Pair e a -> a # elem :: Eq a => a -> Pair e a -> Bool # maximum :: Ord a => Pair e a -> a # minimum :: Ord a => Pair e a -> a # | |
Foldable (Of a) | |
Defined in Data.Functor.Of fold :: Monoid m => Of a m -> m # foldMap :: Monoid m => (a0 -> m) -> Of a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> Of a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Of a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Of a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Of a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Of a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Of a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Of a a0 -> a0 # elem :: Eq a0 => a0 -> Of a a0 -> Bool # maximum :: Ord a0 => Of a a0 -> a0 # minimum :: Ord a0 => Of a a0 -> a0 # | |
Foldable (These a) | |
Defined in Data.These fold :: Monoid m => These a m -> m # foldMap :: Monoid m => (a0 -> m) -> These a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> These a a0 -> m # foldr :: (a0 -> b -> b) -> b -> These a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> These a a0 -> b # foldl :: (b -> a0 -> b) -> b -> These a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> These a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> These a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> These a a0 -> a0 # toList :: These a a0 -> [a0] # elem :: Eq a0 => a0 -> These a a0 -> Bool # maximum :: Ord a0 => These a a0 -> a0 # minimum :: Ord a0 => These a a0 -> a0 # | |
Foldable f => Foldable (ListT f) | |
Defined in Control.Monad.Trans.List fold :: Monoid m => ListT f m -> m # foldMap :: Monoid m => (a -> m) -> ListT f a -> m # foldMap' :: Monoid m => (a -> m) -> ListT f a -> m # foldr :: (a -> b -> b) -> b -> ListT f a -> b # foldr' :: (a -> b -> b) -> b -> ListT f a -> b # foldl :: (b -> a -> b) -> b -> ListT f a -> b # foldl' :: (b -> a -> b) -> b -> ListT f a -> b # foldr1 :: (a -> a -> a) -> ListT f a -> a # foldl1 :: (a -> a -> a) -> ListT f a -> a # elem :: Eq a => a -> ListT f a -> Bool # maximum :: Ord a => ListT f a -> a # minimum :: Ord a => ListT f a -> a # | |
Foldable f => Foldable (MaybeT f) | |
Defined in Control.Monad.Trans.Maybe fold :: Monoid m => MaybeT f m -> m # foldMap :: Monoid m => (a -> m) -> MaybeT f a -> m # foldMap' :: Monoid m => (a -> m) -> MaybeT f a -> m # foldr :: (a -> b -> b) -> b -> MaybeT f a -> b # foldr' :: (a -> b -> b) -> b -> MaybeT f a -> b # foldl :: (b -> a -> b) -> b -> MaybeT f a -> b # foldl' :: (b -> a -> b) -> b -> MaybeT f a -> b # foldr1 :: (a -> a -> a) -> MaybeT f a -> a # foldl1 :: (a -> a -> a) -> MaybeT f a -> a # elem :: Eq a => a -> MaybeT f a -> Bool # maximum :: Ord a => MaybeT f a -> a # minimum :: Ord a => MaybeT f a -> a # | |
Foldable ((,) a) | Since: base-4.7.0.0 |
Defined in Data.Foldable fold :: Monoid m => (a, m) -> m # foldMap :: Monoid m => (a0 -> m) -> (a, a0) -> m # foldMap' :: Monoid m => (a0 -> m) -> (a, a0) -> m # foldr :: (a0 -> b -> b) -> b -> (a, a0) -> b # foldr' :: (a0 -> b -> b) -> b -> (a, a0) -> b # foldl :: (b -> a0 -> b) -> b -> (a, a0) -> b # foldl' :: (b -> a0 -> b) -> b -> (a, a0) -> b # foldr1 :: (a0 -> a0 -> a0) -> (a, a0) -> a0 # foldl1 :: (a0 -> a0 -> a0) -> (a, a0) -> a0 # elem :: Eq a0 => a0 -> (a, a0) -> Bool # maximum :: Ord a0 => (a, a0) -> a0 # minimum :: Ord a0 => (a, a0) -> a0 # | |
Foldable (Const m :: TYPE LiftedRep -> Type) | Since: base-4.7.0.0 |
Defined in Data.Functor.Const fold :: Monoid m0 => Const m m0 -> m0 # foldMap :: Monoid m0 => (a -> m0) -> Const m a -> m0 # foldMap' :: Monoid m0 => (a -> m0) -> Const m a -> m0 # foldr :: (a -> b -> b) -> b -> Const m a -> b # foldr' :: (a -> b -> b) -> b -> Const m a -> b # foldl :: (b -> a -> b) -> b -> Const m a -> b # foldl' :: (b -> a -> b) -> b -> Const m a -> b # foldr1 :: (a -> a -> a) -> Const m a -> a # foldl1 :: (a -> a -> a) -> Const m a -> a # elem :: Eq a => a -> Const m a -> Bool # maximum :: Ord a => Const m a -> a # minimum :: Ord a => Const m a -> a # | |
Foldable f => Foldable (Ap f) | Since: base-4.12.0.0 |
Defined in Data.Foldable fold :: Monoid m => Ap f m -> m # foldMap :: Monoid m => (a -> m) -> Ap f a -> m # foldMap' :: Monoid m => (a -> m) -> Ap f a -> m # foldr :: (a -> b -> b) -> b -> Ap f a -> b # foldr' :: (a -> b -> b) -> b -> Ap f a -> b # foldl :: (b -> a -> b) -> b -> Ap f a -> b # foldl' :: (b -> a -> b) -> b -> Ap f a -> b # foldr1 :: (a -> a -> a) -> Ap f a -> a # foldl1 :: (a -> a -> a) -> Ap f a -> a # elem :: Eq a => a -> Ap f a -> Bool # maximum :: Ord a => Ap f a -> a # | |
Foldable f => Foldable (Alt f) | Since: base-4.12.0.0 |
Defined in Data.Foldable fold :: Monoid m => Alt f m -> m # foldMap :: Monoid m => (a -> m) -> Alt f a -> m # foldMap' :: Monoid m => (a -> m) -> Alt f a -> m # foldr :: (a -> b -> b) -> b -> Alt f a -> b # foldr' :: (a -> b -> b) -> b -> Alt f a -> b # foldl :: (b -> a -> b) -> b -> Alt f a -> b # foldl' :: (b -> a -> b) -> b -> Alt f a -> b # foldr1 :: (a -> a -> a) -> Alt f a -> a # foldl1 :: (a -> a -> a) -> Alt f a -> a # elem :: Eq a => a -> Alt f a -> Bool # maximum :: Ord a => Alt f a -> a # minimum :: Ord a => Alt f a -> a # | |
Foldable f => Foldable (Rec1 f) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => Rec1 f m -> m # foldMap :: Monoid m => (a -> m) -> Rec1 f a -> m # foldMap' :: Monoid m => (a -> m) -> Rec1 f a -> m # foldr :: (a -> b -> b) -> b -> Rec1 f a -> b # foldr' :: (a -> b -> b) -> b -> Rec1 f a -> b # foldl :: (b -> a -> b) -> b -> Rec1 f a -> b # foldl' :: (b -> a -> b) -> b -> Rec1 f a -> b # foldr1 :: (a -> a -> a) -> Rec1 f a -> a # foldl1 :: (a -> a -> a) -> Rec1 f a -> a # elem :: Eq a => a -> Rec1 f a -> Bool # maximum :: Ord a => Rec1 f a -> a # minimum :: Ord a => Rec1 f a -> a # | |
Foldable (Tagged s) | |
Defined in Data.Tagged fold :: Monoid m => Tagged s m -> m # foldMap :: Monoid m => (a -> m) -> Tagged s a -> m # foldMap' :: Monoid m => (a -> m) -> Tagged s a -> m # foldr :: (a -> b -> b) -> b -> Tagged s a -> b # foldr' :: (a -> b -> b) -> b -> Tagged s a -> b # foldl :: (b -> a -> b) -> b -> Tagged s a -> b # foldl' :: (b -> a -> b) -> b -> Tagged s a -> b # foldr1 :: (a -> a -> a) -> Tagged s a -> a # foldl1 :: (a -> a -> a) -> Tagged s a -> a # elem :: Eq a => a -> Tagged s a -> Bool # maximum :: Ord a => Tagged s a -> a # minimum :: Ord a => Tagged s a -> a # | |
(Foldable f, Foldable g) => Foldable (These1 f g) | |
Defined in Data.Functor.These fold :: Monoid m => These1 f g m -> m # foldMap :: Monoid m => (a -> m) -> These1 f g a -> m # foldMap' :: Monoid m => (a -> m) -> These1 f g a -> m # foldr :: (a -> b -> b) -> b -> These1 f g a -> b # foldr' :: (a -> b -> b) -> b -> These1 f g a -> b # foldl :: (b -> a -> b) -> b -> These1 f g a -> b # foldl' :: (b -> a -> b) -> b -> These1 f g a -> b # foldr1 :: (a -> a -> a) -> These1 f g a -> a # foldl1 :: (a -> a -> a) -> These1 f g a -> a # toList :: These1 f g a -> [a] # null :: These1 f g a -> Bool # length :: These1 f g a -> Int # elem :: Eq a => a -> These1 f g a -> Bool # maximum :: Ord a => These1 f g a -> a # minimum :: Ord a => These1 f g a -> a # | |
Foldable f => Foldable (ErrorT e f) | |
Defined in Control.Monad.Trans.Error fold :: Monoid m => ErrorT e f m -> m # foldMap :: Monoid m => (a -> m) -> ErrorT e f a -> m # foldMap' :: Monoid m => (a -> m) -> ErrorT e f a -> m # foldr :: (a -> b -> b) -> b -> ErrorT e f a -> b # foldr' :: (a -> b -> b) -> b -> ErrorT e f a -> b # foldl :: (b -> a -> b) -> b -> ErrorT e f a -> b # foldl' :: (b -> a -> b) -> b -> ErrorT e f a -> b # foldr1 :: (a -> a -> a) -> ErrorT e f a -> a # foldl1 :: (a -> a -> a) -> ErrorT e f a -> a # toList :: ErrorT e f a -> [a] # null :: ErrorT e f a -> Bool # length :: ErrorT e f a -> Int # elem :: Eq a => a -> ErrorT e f a -> Bool # maximum :: Ord a => ErrorT e f a -> a # minimum :: Ord a => ErrorT e f a -> a # | |
Foldable f => Foldable (ExceptT e f) | |
Defined in Control.Monad.Trans.Except fold :: Monoid m => ExceptT e f m -> m # foldMap :: Monoid m => (a -> m) -> ExceptT e f a -> m # foldMap' :: Monoid m => (a -> m) -> ExceptT e f a -> m # foldr :: (a -> b -> b) -> b -> ExceptT e f a -> b # foldr' :: (a -> b -> b) -> b -> ExceptT e f a -> b # foldl :: (b -> a -> b) -> b -> ExceptT e f a -> b # foldl' :: (b -> a -> b) -> b -> ExceptT e f a -> b # foldr1 :: (a -> a -> a) -> ExceptT e f a -> a # foldl1 :: (a -> a -> a) -> ExceptT e f a -> a # toList :: ExceptT e f a -> [a] # null :: ExceptT e f a -> Bool # length :: ExceptT e f a -> Int # elem :: Eq a => a -> ExceptT e f a -> Bool # maximum :: Ord a => ExceptT e f a -> a # minimum :: Ord a => ExceptT e f a -> a # | |
Foldable f => Foldable (IdentityT f) | |
Defined in Control.Monad.Trans.Identity fold :: Monoid m => IdentityT f m -> m # foldMap :: Monoid m => (a -> m) -> IdentityT f a -> m # foldMap' :: Monoid m => (a -> m) -> IdentityT f a -> m # foldr :: (a -> b -> b) -> b -> IdentityT f a -> b # foldr' :: (a -> b -> b) -> b -> IdentityT f a -> b # foldl :: (b -> a -> b) -> b -> IdentityT f a -> b # foldl' :: (b -> a -> b) -> b -> IdentityT f a -> b # foldr1 :: (a -> a -> a) -> IdentityT f a -> a # foldl1 :: (a -> a -> a) -> IdentityT f a -> a # toList :: IdentityT f a -> [a] # null :: IdentityT f a -> Bool # length :: IdentityT f a -> Int # elem :: Eq a => a -> IdentityT f a -> Bool # maximum :: Ord a => IdentityT f a -> a # minimum :: Ord a => IdentityT f a -> a # | |
Foldable f => Foldable (WriterT w f) | |
Defined in Control.Monad.Trans.Writer.Lazy fold :: Monoid m => WriterT w f m -> m # foldMap :: Monoid m => (a -> m) -> WriterT w f a -> m # foldMap' :: Monoid m => (a -> m) -> WriterT w f a -> m # foldr :: (a -> b -> b) -> b -> WriterT w f a -> b # foldr' :: (a -> b -> b) -> b -> WriterT w f a -> b # foldl :: (b -> a -> b) -> b -> WriterT w f a -> b # foldl' :: (b -> a -> b) -> b -> WriterT w f a -> b # foldr1 :: (a -> a -> a) -> WriterT w f a -> a # foldl1 :: (a -> a -> a) -> WriterT w f a -> a # toList :: WriterT w f a -> [a] # null :: WriterT w f a -> Bool # length :: WriterT w f a -> Int # elem :: Eq a => a -> WriterT w f a -> Bool # maximum :: Ord a => WriterT w f a -> a # minimum :: Ord a => WriterT w f a -> a # | |
Foldable f => Foldable (WriterT w f) | |
Defined in Control.Monad.Trans.Writer.Strict fold :: Monoid m => WriterT w f m -> m # foldMap :: Monoid m => (a -> m) -> WriterT w f a -> m # foldMap' :: Monoid m => (a -> m) -> WriterT w f a -> m # foldr :: (a -> b -> b) -> b -> WriterT w f a -> b # foldr' :: (a -> b -> b) -> b -> WriterT w f a -> b # foldl :: (b -> a -> b) -> b -> WriterT w f a -> b # foldl' :: (b -> a -> b) -> b -> WriterT w f a -> b # foldr1 :: (a -> a -> a) -> WriterT w f a -> a # foldl1 :: (a -> a -> a) -> WriterT w f a -> a # toList :: WriterT w f a -> [a] # null :: WriterT w f a -> Bool # length :: WriterT w f a -> Int # elem :: Eq a => a -> WriterT w f a -> Bool # maximum :: Ord a => WriterT w f a -> a # minimum :: Ord a => WriterT w f a -> a # | |
(Foldable f, Foldable g) => Foldable (Product f g) | Since: base-4.9.0.0 |
Defined in Data.Functor.Product fold :: Monoid m => Product f g m -> m # foldMap :: Monoid m => (a -> m) -> Product f g a -> m # foldMap' :: Monoid m => (a -> m) -> Product f g a -> m # foldr :: (a -> b -> b) -> b -> Product f g a -> b # foldr' :: (a -> b -> b) -> b -> Product f g a -> b # foldl :: (b -> a -> b) -> b -> Product f g a -> b # foldl' :: (b -> a -> b) -> b -> Product f g a -> b # foldr1 :: (a -> a -> a) -> Product f g a -> a # foldl1 :: (a -> a -> a) -> Product f g a -> a # toList :: Product f g a -> [a] # null :: Product f g a -> Bool # length :: Product f g a -> Int # elem :: Eq a => a -> Product f g a -> Bool # maximum :: Ord a => Product f g a -> a # minimum :: Ord a => Product f g a -> a # | |
(Foldable f, Foldable g) => Foldable (Sum f g) | Since: base-4.9.0.0 |
Defined in Data.Functor.Sum fold :: Monoid m => Sum f g m -> m # foldMap :: Monoid m => (a -> m) -> Sum f g a -> m # foldMap' :: Monoid m => (a -> m) -> Sum f g a -> m # foldr :: (a -> b -> b) -> b -> Sum f g a -> b # foldr' :: (a -> b -> b) -> b -> Sum f g a -> b # foldl :: (b -> a -> b) -> b -> Sum f g a -> b # foldl' :: (b -> a -> b) -> b -> Sum f g a -> b # foldr1 :: (a -> a -> a) -> Sum f g a -> a # foldl1 :: (a -> a -> a) -> Sum f g a -> a # elem :: Eq a => a -> Sum f g a -> Bool # maximum :: Ord a => Sum f g a -> a # minimum :: Ord a => Sum f g a -> a # | |
(Foldable f, Foldable g) => Foldable (f :*: g) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => (f :*: g) m -> m # foldMap :: Monoid m => (a -> m) -> (f :*: g) a -> m # foldMap' :: Monoid m => (a -> m) -> (f :*: g) a -> m # foldr :: (a -> b -> b) -> b -> (f :*: g) a -> b # foldr' :: (a -> b -> b) -> b -> (f :*: g) a -> b # foldl :: (b -> a -> b) -> b -> (f :*: g) a -> b # foldl' :: (b -> a -> b) -> b -> (f :*: g) a -> b # foldr1 :: (a -> a -> a) -> (f :*: g) a -> a # foldl1 :: (a -> a -> a) -> (f :*: g) a -> a # toList :: (f :*: g) a -> [a] # length :: (f :*: g) a -> Int # elem :: Eq a => a -> (f :*: g) a -> Bool # maximum :: Ord a => (f :*: g) a -> a # minimum :: Ord a => (f :*: g) a -> a # | |
(Foldable f, Foldable g) => Foldable (f :+: g) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => (f :+: g) m -> m # foldMap :: Monoid m => (a -> m) -> (f :+: g) a -> m # foldMap' :: Monoid m => (a -> m) -> (f :+: g) a -> m # foldr :: (a -> b -> b) -> b -> (f :+: g) a -> b # foldr' :: (a -> b -> b) -> b -> (f :+: g) a -> b # foldl :: (b -> a -> b) -> b -> (f :+: g) a -> b # foldl' :: (b -> a -> b) -> b -> (f :+: g) a -> b # foldr1 :: (a -> a -> a) -> (f :+: g) a -> a # foldl1 :: (a -> a -> a) -> (f :+: g) a -> a # toList :: (f :+: g) a -> [a] # length :: (f :+: g) a -> Int # elem :: Eq a => a -> (f :+: g) a -> Bool # maximum :: Ord a => (f :+: g) a -> a # minimum :: Ord a => (f :+: g) a -> a # | |
Foldable (K1 i c :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => K1 i c m -> m # foldMap :: Monoid m => (a -> m) -> K1 i c a -> m # foldMap' :: Monoid m => (a -> m) -> K1 i c a -> m # foldr :: (a -> b -> b) -> b -> K1 i c a -> b # foldr' :: (a -> b -> b) -> b -> K1 i c a -> b # foldl :: (b -> a -> b) -> b -> K1 i c a -> b # foldl' :: (b -> a -> b) -> b -> K1 i c a -> b # foldr1 :: (a -> a -> a) -> K1 i c a -> a # foldl1 :: (a -> a -> a) -> K1 i c a -> a # elem :: Eq a => a -> K1 i c a -> Bool # maximum :: Ord a => K1 i c a -> a # minimum :: Ord a => K1 i c a -> a # | |
(Foldable f, Foldable g) => Foldable (Compose f g) | Since: base-4.9.0.0 |
Defined in Data.Functor.Compose fold :: Monoid m => Compose f g m -> m # foldMap :: Monoid m => (a -> m) -> Compose f g a -> m # foldMap' :: Monoid m => (a -> m) -> Compose f g a -> m # foldr :: (a -> b -> b) -> b -> Compose f g a -> b # foldr' :: (a -> b -> b) -> b -> Compose f g a -> b # foldl :: (b -> a -> b) -> b -> Compose f g a -> b # foldl' :: (b -> a -> b) -> b -> Compose f g a -> b # foldr1 :: (a -> a -> a) -> Compose f g a -> a # foldl1 :: (a -> a -> a) -> Compose f g a -> a # toList :: Compose f g a -> [a] # null :: Compose f g a -> Bool # length :: Compose f g a -> Int # elem :: Eq a => a -> Compose f g a -> Bool # maximum :: Ord a => Compose f g a -> a # minimum :: Ord a => Compose f g a -> a # | |
(Foldable f, Foldable g) => Foldable (f :.: g) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => (f :.: g) m -> m # foldMap :: Monoid m => (a -> m) -> (f :.: g) a -> m # foldMap' :: Monoid m => (a -> m) -> (f :.: g) a -> m # foldr :: (a -> b -> b) -> b -> (f :.: g) a -> b # foldr' :: (a -> b -> b) -> b -> (f :.: g) a -> b # foldl :: (b -> a -> b) -> b -> (f :.: g) a -> b # foldl' :: (b -> a -> b) -> b -> (f :.: g) a -> b # foldr1 :: (a -> a -> a) -> (f :.: g) a -> a # foldl1 :: (a -> a -> a) -> (f :.: g) a -> a # toList :: (f :.: g) a -> [a] # length :: (f :.: g) a -> Int # elem :: Eq a => a -> (f :.: g) a -> Bool # maximum :: Ord a => (f :.: g) a -> a # minimum :: Ord a => (f :.: g) a -> a # | |
Foldable f => Foldable (M1 i c f) | Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => M1 i c f m -> m # foldMap :: Monoid m => (a -> m) -> M1 i c f a -> m # foldMap' :: Monoid m => (a -> m) -> M1 i c f a -> m # foldr :: (a -> b -> b) -> b -> M1 i c f a -> b # foldr' :: (a -> b -> b) -> b -> M1 i c f a -> b # foldl :: (b -> a -> b) -> b -> M1 i c f a -> b # foldl' :: (b -> a -> b) -> b -> M1 i c f a -> b # foldr1 :: (a -> a -> a) -> M1 i c f a -> a # foldl1 :: (a -> a -> a) -> M1 i c f a -> a # elem :: Eq a => a -> M1 i c f a -> Bool # maximum :: Ord a => M1 i c f a -> a # minimum :: Ord a => M1 i c f a -> a # | |
Bifoldable p => Foldable (Flip p a) | |
Defined in Data.Bifunctor.Flip fold :: Monoid m => Flip p a m -> m # foldMap :: Monoid m => (a0 -> m) -> Flip p a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> Flip p a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Flip p a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Flip p a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Flip p a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Flip p a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Flip p a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Flip p a a0 -> a0 # toList :: Flip p a a0 -> [a0] # length :: Flip p a a0 -> Int # elem :: Eq a0 => a0 -> Flip p a a0 -> Bool # maximum :: Ord a0 => Flip p a a0 -> a0 # minimum :: Ord a0 => Flip p a a0 -> a0 # | |
(Foldable (f a), Foldable (g a)) => Foldable (Product f g a) | |
Defined in Data.Bifunctor.Product fold :: Monoid m => Product f g a m -> m # foldMap :: Monoid m => (a0 -> m) -> Product f g a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> Product f g a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Product f g a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Product f g a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Product f g a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Product f g a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Product f g a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Product f g a a0 -> a0 # toList :: Product f g a a0 -> [a0] # null :: Product f g a a0 -> Bool # length :: Product f g a a0 -> Int # elem :: Eq a0 => a0 -> Product f g a a0 -> Bool # maximum :: Ord a0 => Product f g a a0 -> a0 # minimum :: Ord a0 => Product f g a a0 -> a0 # | |
(Foldable (f a), Foldable (g a)) => Foldable (Sum f g a) | |
Defined in Data.Bifunctor.Sum fold :: Monoid m => Sum f g a m -> m # foldMap :: Monoid m => (a0 -> m) -> Sum f g a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> Sum f g a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Sum f g a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Sum f g a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Sum f g a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Sum f g a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Sum f g a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Sum f g a a0 -> a0 # toList :: Sum f g a a0 -> [a0] # null :: Sum f g a a0 -> Bool # length :: Sum f g a a0 -> Int # elem :: Eq a0 => a0 -> Sum f g a a0 -> Bool # maximum :: Ord a0 => Sum f g a a0 -> a0 # minimum :: Ord a0 => Sum f g a a0 -> a0 # | |
(Foldable f, Bifoldable p) => Foldable (Tannen f p a) | |
Defined in Data.Bifunctor.Tannen fold :: Monoid m => Tannen f p a m -> m # foldMap :: Monoid m => (a0 -> m) -> Tannen f p a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> Tannen f p a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Tannen f p a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Tannen f p a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Tannen f p a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Tannen f p a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Tannen f p a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Tannen f p a a0 -> a0 # toList :: Tannen f p a a0 -> [a0] # null :: Tannen f p a a0 -> Bool # length :: Tannen f p a a0 -> Int # elem :: Eq a0 => a0 -> Tannen f p a a0 -> Bool # maximum :: Ord a0 => Tannen f p a a0 -> a0 # minimum :: Ord a0 => Tannen f p a a0 -> a0 # | |
(Bifoldable p, Foldable g) => Foldable (Biff p f g a) | |
Defined in Data.Bifunctor.Biff fold :: Monoid m => Biff p f g a m -> m # foldMap :: Monoid m => (a0 -> m) -> Biff p f g a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> Biff p f g a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Biff p f g a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Biff p f g a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Biff p f g a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Biff p f g a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Biff p f g a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Biff p f g a a0 -> a0 # toList :: Biff p f g a a0 -> [a0] # null :: Biff p f g a a0 -> Bool # length :: Biff p f g a a0 -> Int # elem :: Eq a0 => a0 -> Biff p f g a a0 -> Bool # maximum :: Ord a0 => Biff p f g a a0 -> a0 # minimum :: Ord a0 => Biff p f g a a0 -> a0 # |
class Monad m => MonadIO (m :: Type -> Type) #
Monads in which IO
computations may be embedded.
Any monad built by applying a sequence of monad transformers to the
IO
monad will be an instance of this class.
Instances should satisfy the following laws, which state that liftIO
is a transformer of monads:
Instances
lift :: (MonadTrans t, Monad m) => m a -> t m a #
Lift a computation from the argument monad to the constructed monad.
liftIO :: MonadIO m => IO a -> m a #
Lift a computation from the IO
monad.
This allows us to run IO computations in any monadic stack, so long as it supports these kinds of operations
(i.e. IO
is the base monad for the stack).
Example
import Control.Monad.Trans.State -- from the "transformers" library printState :: Show s => StateT s IO () printState = do state <- get liftIO $ print state
Had we omitted
, we would have ended up with this error:liftIO
• Couldn't match type ‘IO’ with ‘StateT s IO’ Expected type: StateT s IO () Actual type: IO ()
The important part here is the mismatch between StateT s IO ()
and
.IO
()
Luckily, we know of a function that takes an
and returns an IO
a(m a)
:
,
enabling us to run the program and see the expected results:liftIO
> evalStateT printState "hello" "hello" > evalStateT printState 3 3
nonempty
Non-empty (and non-strict) list type.
Since: base-4.9.0.0
a :| [a] infixr 5 |
Instances
text
A space efficient, packed, unboxed Unicode text type.