church-maybe-0.1.0.0: Church encoded Maybe

Data.Church.Maybe

# Documentation

just :: a -> Maybe a Source #

newtype Maybe a Source #

Constructors

 Maybe FieldsunMaybe :: forall r. r -> (a -> r) -> r

Instances

 Source # Methods(>>=) :: Maybe a -> (a -> Maybe b) -> Maybe b #(>>) :: Maybe a -> Maybe b -> Maybe b #return :: a -> Maybe a #fail :: String -> Maybe a # Source # Methodsfmap :: (a -> b) -> Maybe a -> Maybe b #(<\$) :: a -> Maybe b -> Maybe a # Source # Methodsmfix :: (a -> Maybe a) -> Maybe a # Source # Methodspure :: a -> Maybe a #(<*>) :: Maybe (a -> b) -> Maybe a -> Maybe b #liftA2 :: (a -> b -> c) -> Maybe a -> Maybe b -> Maybe c #(*>) :: Maybe a -> Maybe b -> Maybe b #(<*) :: Maybe a -> Maybe b -> Maybe a # Source # Methodsfold :: Monoid m => Maybe m -> 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 #toList :: Maybe a -> [a] #null :: Maybe a -> Bool #length :: Maybe a -> Int #elem :: Eq a => a -> Maybe a -> Bool #maximum :: Ord a => Maybe a -> a #minimum :: Ord a => Maybe a -> a #sum :: Num a => Maybe a -> a #product :: Num a => Maybe a -> a # Source # Methodstraverse :: Applicative f => (a -> f b) -> Maybe a -> f (Maybe b) #sequenceA :: Applicative f => Maybe (f a) -> f (Maybe a) #mapM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b) #sequence :: Monad m => Maybe (m a) -> m (Maybe a) # Source # Methodsmzip :: Maybe a -> Maybe b -> Maybe (a, b) #mzipWith :: (a -> b -> c) -> Maybe a -> Maybe b -> Maybe c #munzip :: Maybe (a, b) -> (Maybe a, Maybe b) # Source # Methodsempty :: Maybe a #(<|>) :: Maybe a -> Maybe a -> Maybe a #some :: Maybe a -> Maybe [a] #many :: Maybe a -> Maybe [a] # Source # Methodsmzero :: Maybe a #mplus :: Maybe a -> Maybe a -> Maybe a # Source # MethodsliftRnf :: (a -> ()) -> Maybe a -> () # Source # Methods() :: Maybe a -> Maybe a -> Maybe a #some :: Applicative Maybe => Maybe a -> Maybe [a] #many :: Applicative Maybe => Maybe a -> Maybe [a] # Source # Methods(<.>) :: Maybe (a -> b) -> Maybe a -> Maybe b #(.>) :: Maybe a -> Maybe b -> Maybe b #(<.) :: Maybe a -> Maybe b -> Maybe a # Source # Methods(>>-) :: Maybe a -> (a -> Maybe b) -> Maybe b #join :: Maybe (Maybe a) -> Maybe a # Semigroup a => Semigroup (Maybe a) Source # Methods(<>) :: Maybe a -> Maybe a -> Maybe a #sconcat :: NonEmpty (Maybe a) -> Maybe a #stimes :: Integral b => b -> Maybe a -> Maybe a # Semigroup a => Monoid (Maybe a) Source # Methodsmempty :: Maybe a #mappend :: Maybe a -> Maybe a -> Maybe a #mconcat :: [Maybe a] -> Maybe a # NFData a => NFData (Maybe a) Source # And NFData1 for GHC >=8.2 Methodsrnf :: Maybe a -> () #

maybe :: b -> (a -> b) -> Maybe a -> b Source #

fromMaybe :: a -> Maybe a -> a Source #

catMaybes :: [Maybe a] -> [a] Source #

mapMaybe :: (a -> Maybe b) -> [a] -> [b] Source #