church-maybe-0.1.0.0: Church encoded Maybe

Safe HaskellSafe
LanguageHaskell2010

Data.Church.Maybe

Documentation

just :: a -> Maybe a Source #

newtype Maybe a Source #

Constructors

Maybe 

Fields

  • unMaybe :: forall r. r -> (a -> r) -> r
     
Instances
Monad Maybe Source # 
Instance details

Defined in Data.Church.Maybe

Methods

(>>=) :: Maybe a -> (a -> Maybe b) -> Maybe b #

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

return :: a -> Maybe a #

fail :: String -> Maybe a #

Functor Maybe Source # 
Instance details

Defined in Data.Church.Maybe

Methods

fmap :: (a -> b) -> Maybe a -> Maybe b #

(<$) :: a -> Maybe b -> Maybe a #

MonadFix Maybe Source # 
Instance details

Defined in Data.Church.Maybe

Methods

mfix :: (a -> Maybe a) -> Maybe a #

Applicative Maybe Source # 
Instance details

Defined in Data.Church.Maybe

Methods

pure :: 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 #

Foldable Maybe Source # 
Instance details

Defined in Data.Church.Maybe

Methods

fold :: 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 #

Traversable Maybe Source # 
Instance details

Defined in Data.Church.Maybe

Methods

traverse :: 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) #

MonadZip Maybe Source # 
Instance details

Defined in Data.Church.Maybe

Methods

mzip :: 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) #

Alternative Maybe Source # 
Instance details

Defined in Data.Church.Maybe

Methods

empty :: Maybe a #

(<|>) :: Maybe a -> Maybe a -> Maybe a #

some :: Maybe a -> Maybe [a] #

many :: Maybe a -> Maybe [a] #

MonadPlus Maybe Source # 
Instance details

Defined in Data.Church.Maybe

Methods

mzero :: Maybe a #

mplus :: Maybe a -> Maybe a -> Maybe a #

NFData1 Maybe Source # 
Instance details

Defined in Data.Church.Maybe

Methods

liftRnf :: (a -> ()) -> Maybe a -> () #

Alt Maybe Source # 
Instance details

Defined in Data.Church.Maybe

Methods

(<!>) :: Maybe a -> Maybe a -> Maybe a #

some :: Applicative Maybe => Maybe a -> Maybe [a] #

many :: Applicative Maybe => Maybe a -> Maybe [a] #

Apply Maybe Source # 
Instance details

Defined in Data.Church.Maybe

Methods

(<.>) :: Maybe (a -> b) -> Maybe a -> Maybe b #

(.>) :: Maybe a -> Maybe b -> Maybe b #

(<.) :: Maybe a -> Maybe b -> Maybe a #

liftF2 :: (a -> b -> c) -> Maybe a -> Maybe b -> Maybe c #

Bind Maybe Source # 
Instance details

Defined in Data.Church.Maybe

Methods

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

join :: Maybe (Maybe a) -> Maybe a #

Semigroup a => Semigroup (Maybe a) Source # 
Instance details

Defined in Data.Church.Maybe

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 # 
Instance details

Defined in Data.Church.Maybe

Methods

mempty :: 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

Instance details

Defined in Data.Church.Maybe

Methods

rnf :: 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 #