Safe Haskell | None |
---|---|
Language | Haskell2010 |
A strict version of the Maybe
type.
Import qualified, as in
import qualified Agda.Utils.Maybe.Strict as Strict
Synopsis
- data Maybe a
- mapMaybe :: (a -> Maybe b) -> [a] -> [b]
- maybe :: b -> (a -> b) -> Maybe a -> b
- isJust :: Maybe a -> Bool
- isNothing :: Maybe a -> Bool
- fromJust :: Maybe a -> a
- fromMaybe :: a -> Maybe a -> a
- maybeToList :: Maybe a -> [a]
- listToMaybe :: [a] -> Maybe a
- catMaybes :: [Maybe a] -> [a]
- class Strict lazy strict | lazy -> strict, strict -> lazy where
- caseMaybeM :: Monad m => m (Maybe a) -> m b -> (a -> m b) -> m b
- fromMaybeM :: Monad m => m a -> m (Maybe a) -> m a
- forMaybe :: [a] -> (a -> Maybe b) -> [b]
- filterMaybe :: (a -> Bool) -> a -> Maybe a
- whenJust :: Monad m => Maybe a -> (a -> m ()) -> m ()
- unionMaybeWith :: (a -> a -> a) -> Maybe a -> Maybe a -> Maybe a
- unzipMaybe :: Maybe (a, b) -> (Maybe a, Maybe b)
- caseMaybe :: Maybe a -> b -> (a -> b) -> b
- maybeM :: Monad m => m b -> (a -> m b) -> m (Maybe a) -> m b
- ifJustM :: Monad m => m (Maybe a) -> (a -> m b) -> m b -> m b
- whenJustM :: Monad m => m (Maybe a) -> (a -> m ()) -> m ()
Documentation
Instances
maybeToList :: Maybe a -> [a] #
listToMaybe :: [a] -> Maybe a #
class Strict lazy strict | lazy -> strict, strict -> lazy where #
Instances
Strict ByteString ByteString | |
Defined in Data.Strict.Classes toStrict :: ByteString -> ByteString # toLazy :: ByteString -> ByteString # | |
Strict Text Text | |
Strict (Maybe a) (Maybe a) | |
Strict (ST s a) (ST s a) | |
Strict (Either a b) (Either a b) | |
Strict (These a b) (These a b) | |
Defined in Data.Strict.Classes | |
Strict (a, b) (Pair a b) | |
Defined in Data.Strict.Classes | |
Strict (StateT s m a) (StateT s m a) | |
Strict (WriterT w m a) (WriterT w m a) | |
Strict (RWST r w s m a) (RWST r w s m a) | |
caseMaybeM :: Monad m => m (Maybe a) -> m b -> (a -> m b) -> m b Source #
forMaybe :: [a] -> (a -> Maybe b) -> [b] Source #
Version of mapMaybe
with different argument ordering.
filterMaybe :: (a -> Bool) -> a -> Maybe a Source #
Filtering a singleton list.
filterMaybe p a =listToMaybe
(filter
p [a])
unionMaybeWith :: (a -> a -> a) -> Maybe a -> Maybe a -> Maybe a Source #
unionWith
for collections of size <= 1.
ifJustM :: Monad m => m (Maybe a) -> (a -> m b) -> m b -> m b Source #
caseMaybeM
with flipped branches.
whenJustM :: Monad m => m (Maybe a) -> (a -> m ()) -> m () Source #
caseMaybeM
without the Nothing
case.
Orphan instances
Applicative Maybe Source # | Note that strict Maybe is an |
Null (Maybe a) Source # | |