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
- catMaybes :: [Maybe a] -> [a]
- fromMaybe :: a -> Maybe a -> a
- listToMaybe :: [a] -> Maybe a
- maybeToList :: Maybe a -> [a]
- maybe :: b -> (a -> b) -> Maybe a -> b
- isNothing :: Maybe a -> Bool
- mapMaybe :: (a -> Maybe b) -> [a] -> [b]
- fromJust :: Maybe a -> a
- isJust :: Maybe a -> Bool
- 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
EncodeTCM Range Source # | |||||
Pretty TopLevelModuleName Source # | |||||
Defined in Agda.Syntax.TopLevelModuleName pretty :: TopLevelModuleName -> Doc Source # prettyPrec :: Int -> TopLevelModuleName -> Doc Source # prettyList :: [TopLevelModuleName] -> Doc Source # | |||||
HasRange Interval Source # | |||||
HasRange Range Source # | |||||
KillRange Range Source # | |||||
Defined in Agda.Syntax.Position | |||||
SetRange Range Source # | |||||
FreshName Range Source # | |||||
Defined in Agda.TypeChecking.Monad.Base freshName_ :: MonadFresh NameId m => Range -> m Name Source # | |||||
PrettyTCM Range Source # | |||||
Defined in Agda.TypeChecking.Pretty | |||||
PrettyTCM TopLevelModuleName Source # | |||||
Defined in Agda.TypeChecking.Pretty prettyTCM :: MonadPretty m => TopLevelModuleName -> m Doc Source # | |||||
EmbPrj Range Source # | Ranges are always deserialised as | ||||
EmbPrj TopLevelModuleName Source # | |||||
Defined in Agda.TypeChecking.Serialise.Instances.Common icode :: TopLevelModuleName -> S Int32 Source # icod_ :: TopLevelModuleName -> S Int32 Source # value :: Int32 -> R TopLevelModuleName Source # | |||||
Subst Range Source # | |||||
Defined in Agda.TypeChecking.Substitute applySubst :: Substitution' (SubstArg Range) -> Range -> Range Source # | |||||
Sized TopLevelModuleName Source # | |||||
Defined in Agda.Syntax.TopLevelModuleName size :: TopLevelModuleName -> Int Source # natSize :: TopLevelModuleName -> Peano Source # | |||||
Eq1 Maybe | |||||
Defined in Data.Strict.Maybe | |||||
Ord1 Maybe | |||||
Defined in Data.Strict.Maybe liftCompare :: (a -> b -> Ordering) -> Maybe a -> Maybe b -> Ordering | |||||
Read1 Maybe | |||||
Defined in Data.Strict.Maybe liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Maybe a) liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Maybe a] liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Maybe a) liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Maybe a] | |||||
Show1 Maybe | |||||
Defined in Data.Strict.Maybe liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Maybe a -> ShowS liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Maybe a] -> ShowS | |||||
NFData Interval | |||||
Defined in Agda.Syntax.Position | |||||
NFData Position | |||||
Defined in Agda.Syntax.Position | |||||
NFData1 Maybe | |||||
Defined in Data.Strict.Maybe | |||||
Applicative Maybe | Note that strict Maybe is an | ||||
Functor Maybe | |||||
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 | |||||
Traversable Maybe | |||||
Hashable1 Maybe | |||||
Defined in Data.Strict.Maybe liftHashWithSalt :: (Int -> a -> Int) -> Int -> Maybe a -> Int | |||||
FromJSON1 Maybe | |||||
Defined in Data.Aeson.Types.FromJSON | |||||
ToJSON Range Source # | |||||
Defined in Agda.Interaction.JSONTop | |||||
ToJSON1 Maybe | |||||
Defined in Data.Aeson.Types.ToJSON liftToJSON :: (a -> Bool) -> (a -> Value) -> ([a] -> Value) -> Maybe a -> Value # liftToJSONList :: (a -> Bool) -> (a -> Value) -> ([a] -> Value) -> [Maybe a] -> Value # liftToEncoding :: (a -> Bool) -> (a -> Encoding) -> ([a] -> Encoding) -> Maybe a -> Encoding # liftToEncodingList :: (a -> Bool) -> (a -> Encoding) -> ([a] -> Encoding) -> [Maybe a] -> Encoding # liftOmitField :: (a -> Bool) -> Maybe a -> Bool # | |||||
LensClosure MetaInfo Range Source # | |||||
Defined in Agda.TypeChecking.Monad.Base | |||||
LensClosure MetaVariable Range Source # | |||||
Defined in Agda.TypeChecking.Monad.Base | |||||
Generic1 Maybe | |||||
Defined in Data.Strict.Maybe
| |||||
Pretty a => Pretty (Interval' (Maybe a)) Source # | |||||
Pretty a => Pretty (Position' (Maybe a)) Source # | |||||
Pretty a => Pretty (Range' (Maybe a)) Source # | |||||
NamesIn a => NamesIn (Maybe a) Source # | |||||
Defined in Agda.Syntax.Internal.Names | |||||
HasRange (TopLevelModuleName' Range) Source # | |||||
Defined in Agda.Syntax.Position | |||||
KillRange (TopLevelModuleName' Range) Source # | |||||
Defined in Agda.Syntax.Position | |||||
KillRange a => KillRange (Maybe a) Source # | |||||
Defined in Agda.Syntax.Position killRange :: KillRangeT (Maybe a) Source # | |||||
SetRange (TopLevelModuleName' Range) Source # | |||||
Defined in Agda.Syntax.Position | |||||
Instantiate t => Instantiate (Maybe t) Source # | |||||
Defined in Agda.TypeChecking.Reduce | |||||
InstantiateFull t => InstantiateFull (Maybe t) Source # | |||||
Defined in Agda.TypeChecking.Reduce | |||||
Normalise t => Normalise (Maybe t) Source # | |||||
Defined in Agda.TypeChecking.Reduce | |||||
Simplify t => Simplify (Maybe t) Source # | |||||
Defined in Agda.TypeChecking.Reduce | |||||
EmbPrj a => EmbPrj (Maybe a) Source # | |||||
Apply t => Apply (Maybe t) Source # | |||||
Null (Maybe a) Source # | |||||
Binary a => Binary (Maybe a) | |||||
NFData a => NFData (Maybe a) | |||||
Defined in Data.Strict.Maybe | |||||
Semigroup a => Monoid (Maybe a) | |||||
Semigroup a => Semigroup (Maybe a) | |||||
Data a => Data (Maybe a) | |||||
Defined in Data.Strict.Maybe gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Maybe a -> c (Maybe a) gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Maybe a) dataTypeOf :: Maybe a -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Maybe a)) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Maybe a)) gmapT :: (forall b. Data b => b -> b) -> Maybe a -> Maybe a gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Maybe a -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Maybe a -> r gmapQ :: (forall d. Data d => d -> u) -> Maybe a -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> Maybe a -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) | |||||
Generic (Maybe a) | |||||
Defined in Data.Strict.Maybe
| |||||
Read a => Read (Maybe a) | |||||
Defined in Data.Strict.Maybe | |||||
Show a => Show (Maybe a) | |||||
Eq a => Eq (Maybe a) | |||||
Ord a => Ord (Maybe a) | |||||
Hashable a => Hashable (Maybe a) | |||||
Defined in Data.Strict.Maybe hashWithSalt :: Int -> Maybe a -> Int | |||||
FromJSON a => FromJSON (Maybe a) | |||||
Defined in Data.Aeson.Types.FromJSON | |||||
ToJSON a => ToJSON (Maybe a) | |||||
Defined in Data.Aeson.Types.ToJSON | |||||
Strict (Maybe a) (Maybe a) | |||||
FreshName (Range, String) Source # | |||||
Defined in Agda.TypeChecking.Monad.Base freshName_ :: MonadFresh NameId m => (Range, String) -> m Name Source # | |||||
type SubstArg Range Source # | |||||
Defined in Agda.TypeChecking.Substitute | |||||
type Rep1 Maybe | |||||
Defined in Data.Strict.Maybe | |||||
type Rep (Maybe a) | |||||
Defined in Data.Strict.Maybe type Rep (Maybe a) = D1 ('MetaData "Maybe" "Data.Strict.Maybe" "strct-0.5.1-73fd598e" 'False) (C1 ('MetaCons "Nothing" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Just" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a))) |
listToMaybe :: [a] -> Maybe a #
maybeToList :: Maybe a -> [a] #
class Strict lazy strict | lazy -> strict, strict -> lazy where #
Instances
Strict ByteString ByteString | |
Defined in Data.Strict.Classes | |
Strict Text Text | |
Defined in Data.Strict.Classes | |
Strict (Maybe a) (Maybe a) | |
Strict (ST s a) (ST s a) | |
Defined in Data.Strict.Classes | |
Strict (Either a b) (Either a b) | |
Defined in Data.Strict.Classes | |
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) | |
Defined in Data.Strict.Classes | |
Strict (WriterT w m a) (WriterT w m a) | |
Defined in Data.Strict.Classes | |
Strict (RWST r w s m a) (RWST r w s m a) | |
Defined in Data.Strict.Classes |
caseMaybeM :: Monad m => m (Maybe a) -> m b -> (a -> m b) -> m b Source #
fromMaybeM :: Monad m => m a -> m (Maybe a) -> m a Source #
Monadic version of fromMaybe
.
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 # | |