Safe Haskell | None |
---|---|
Language | Haskell2010 |
Overloaded null
and empty
for collections and sequences.
Synopsis
- class Null a where
- ifNull :: Null a => a -> b -> (a -> b) -> b
- ifNotNull :: Null a => a -> (a -> b) -> b -> b
- ifNullM :: (Monad m, Null a) => m a -> m b -> (a -> m b) -> m b
- ifNotNullM :: (Monad m, Null a) => m a -> (a -> m b) -> m b -> m b
- whenNull :: (Monad m, Null a) => a -> m () -> m ()
- unlessNull :: (Monad m, Null a) => a -> (a -> m ()) -> m ()
- whenNullM :: (Monad m, Null a) => m a -> m () -> m ()
- unlessNullM :: (Monad m, Null a) => m a -> (a -> m ()) -> m ()
Documentation
Satisfying null empty == True
.
Instances
Testing for null.
ifNotNullM :: (Monad m, Null a) => m a -> (a -> m b) -> m b -> m b Source #
unlessNull :: (Monad m, Null a) => a -> (a -> m ()) -> m () Source #
unlessNullM :: (Monad m, Null a) => m a -> (a -> m ()) -> m () Source #