Safe Haskell | None |
---|---|
Language | Haskell2010 |
A strict version of the Maybe
type.
Import qualified, as in
import qualified Agda.Utils.Maybe.Strict as Strict
Copyright : (c) 2006-2007 Roman Leshchinskiy (c) 2013 Simon Meier License : BSD-style (see the file LICENSE)
Copyright : (c) 2014 Andreas Abel
Synopsis
- fromJust :: Maybe a -> a
- fromMaybe :: a -> Maybe a -> a
- isJust :: Maybe a -> Bool
- isNothing :: Maybe a -> Bool
- maybe :: b -> (a -> b) -> Maybe a -> b
- data Maybe a
- toStrict :: Maybe a -> Maybe a
- toLazy :: Maybe a -> Maybe a
- listToMaybe :: [a] -> Maybe a
- maybeToList :: Maybe a -> [a]
- catMaybes :: [Maybe a] -> [a]
- mapMaybe :: (a -> Maybe b) -> [a] -> [b]
- unionMaybeWith :: (a -> a -> a) -> Maybe a -> Maybe a -> Maybe a
- unzipMaybe :: Maybe (a, b) -> (Maybe a, Maybe b)
- filterMaybe :: (a -> Bool) -> a -> Maybe a
- forMaybe :: [a] -> (a -> Maybe b) -> [b]
- caseMaybe :: Maybe a -> b -> (a -> b) -> b
- maybeM :: Monad m => m b -> (a -> m b) -> m (Maybe a) -> m b
- fromMaybeM :: Monad m => m a -> m (Maybe a) -> m a
- caseMaybeM :: Monad m => m (Maybe a) -> m b -> (a -> m b) -> m b
- ifJustM :: Monad m => m (Maybe a) -> (a -> m b) -> m b -> m b
- whenJust :: Monad m => Maybe a -> (a -> m ()) -> m ()
- whenJustM :: Monad m => m (Maybe a) -> (a -> m ()) -> m ()
Documentation
Instances
Functor Maybe | |
Applicative Maybe Source # | Note that strict Maybe is an |
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 # | |
Traversable Maybe | |
Eq1 Maybe | |
Ord1 Maybe | |
Defined in Data.Strict.Maybe | |
Read1 Maybe | |
Defined in Data.Strict.Maybe | |
Show1 Maybe | |
NFData1 Maybe | |
Defined in Data.Strict.Maybe | |
Hashable1 Maybe | |
Defined in Data.Strict.Maybe | |
KillRange Range Source # | |
Defined in Agda.Syntax.Position | |
SetRange Range Source # | |
HasRange Range Source # | |
HasRange Interval Source # | |
FreshName Range Source # | |
Defined in Agda.TypeChecking.Monad.Base freshName_ :: MonadFresh NameId m => Range -> m Name Source # | |
EmbPrj Range Source # | Ranges are always deserialised as |
PrettyTCM Range Source # | |
Defined in Agda.TypeChecking.Pretty | |
FromJSON1 Maybe | |
Defined in Data.Aeson.Types.FromJSON liftParseJSON :: (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser (Maybe a) liftParseJSONList :: (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser [Maybe a] | |
ToJSON Range | |
Defined in Agda.Interaction.JSONTop | |
ToJSON1 Maybe | |
Defined in Data.Aeson.Types.ToJSON liftToJSON :: (a -> Value) -> ([a] -> Value) -> Maybe a -> Value liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [Maybe a] -> Value liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> Maybe a -> Encoding liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [Maybe a] -> Encoding | |
EncodeTCM Range Source # | |
Subst Term Range Source # | |
Defined in Agda.TypeChecking.Substitute applySubst :: Substitution' Term -> Range -> Range Source # | |
LensClosure Range MetaInfo Source # | |
Defined in Agda.TypeChecking.Monad.Base | |
LensClosure Range MetaVariable Source # | |
Defined in Agda.TypeChecking.Monad.Base | |
Eq a => Eq (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) # toConstr :: Maybe a -> Constr # dataTypeOf :: Maybe a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe0 (c (Maybe a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe0 (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) # | |
Ord a => Ord (Maybe a) | |
Read a => Read (Maybe a) | |
Show a => Show (Maybe a) | |
Show a => Show (Range' (Maybe a)) Source # | |
Show a => Show (Interval' (Maybe a)) Source # | |
Show a => Show (Position' (Maybe a)) Source # | |
Generic (Maybe a) | |
Semigroup a => Semigroup (Maybe a) | |
Semigroup a => Monoid (Maybe a) | |
Binary a => Binary (Maybe a) | |
NFData a => NFData (Maybe a) | |
Defined in Data.Strict.Maybe | |
Hashable a => Hashable (Maybe a) | |
Defined in Data.Strict.Maybe | |
Null (Maybe a) Source # | |
Pretty a => Pretty (Range' (Maybe a)) Source # | |
Pretty a => Pretty (Interval' (Maybe a)) Source # | |
Pretty a => Pretty (Position' (Maybe a)) Source # | |
KillRange a => KillRange (Maybe a) Source # | |
Defined in Agda.Syntax.Position killRange :: KillRangeT (Maybe a) Source # | |
Apply t => Apply (Maybe t) Source # | |
EmbPrj a => EmbPrj (Maybe a) Source # | |
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 # | |
Instantiate t => Instantiate (Maybe t) Source # | |
Defined in Agda.TypeChecking.Reduce | |
FromJSON a => FromJSON (Maybe a) | |
Defined in Data.Aeson.Types.FromJSON parseJSON :: Value -> Parser (Maybe a) parseJSONList :: Value -> Parser [Maybe a] | |
ToJSON a => ToJSON (Maybe a) | |
Defined in Data.Aeson.Types.ToJSON toEncoding :: Maybe a -> Encoding toJSONList :: [Maybe a] -> Value toEncodingList :: [Maybe a] -> Encoding | |
Generic1 Maybe | |
FreshName (Range, String) Source # | |
Defined in Agda.TypeChecking.Monad.Base freshName_ :: MonadFresh NameId m => (Range, String) -> m Name Source # | |
type Rep (Maybe a) | |
Defined in Data.Strict.Maybe type Rep (Maybe a) = D1 ('MetaData "Maybe" "Data.Strict.Maybe" "strict-0.4.0.1-f888cc3004d6c7748c64073b6cab4c0108c65fbc8693c285f3148e74893fd108" 'False) (C1 ('MetaCons "Nothing" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Just" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a))) | |
type Rep1 Maybe | |
Defined in Data.Strict.Maybe type Rep1 Maybe = D1 ('MetaData "Maybe" "Data.Strict.Maybe" "strict-0.4.0.1-f888cc3004d6c7748c64073b6cab4c0108c65fbc8693c285f3148e74893fd108" 'False) (C1 ('MetaCons "Nothing" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Just" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1)) |
listToMaybe :: [a] -> Maybe a Source #
Analogous to listToMaybe
in Data.Maybe.
maybeToList :: Maybe a -> [a] Source #
Analogous to maybeToList
in Data.Maybe.
unionMaybeWith :: (a -> a -> a) -> Maybe a -> Maybe a -> Maybe a Source #
unionWith
for collections of size <= 1.
filterMaybe :: (a -> Bool) -> a -> Maybe a Source #
Filtering a singleton list.
filterMaybe p a =listToMaybe
(filter
p [a])
forMaybe :: [a] -> (a -> Maybe b) -> [b] Source #
Version of mapMaybe
with different argument ordering.
caseMaybeM :: Monad m => m (Maybe a) -> m b -> (a -> m b) -> m b Source #
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 # | |