Module "Maybe.curry"

Library with some useful functions on the Maybe datatype

Author: Frank Huch (source from the corresponding Hugs module) Bernd Brassel (sequence, mapM)

Version: April 2005


 Exported names:

Functions:
>>- | catMaybes | fromJust | fromMaybe | isJust | isNothing | listToMaybe | mapMaybe | mapMMaybe | maybeToList | sequenceMaybe


 Summary of exported functions:

isJust  :: Maybe a -> Bool  deterministic flexible
          
isNothing  :: Maybe a -> Bool  deterministic flexible
          
fromJust  :: Maybe a -> a  deterministic flexible
          
fromMaybe  :: a -> Maybe a -> a  deterministic flexible
          
maybeToList  :: Maybe a -> [a]  deterministic flexible
          
listToMaybe  :: [a] -> Maybe a  deterministic flexible
          
catMaybes  :: [Maybe a] -> [a]  deterministic 
          
mapMaybe  :: (a -> Maybe b) -> [a] -> [b]  deterministic 
          
(>>-)  :: Maybe a -> (a -> Maybe b) -> Maybe b  deterministic flexible
          Monadic bind for Maybe.
sequenceMaybe  :: [Maybe a] -> Maybe [a]  deterministic flexible
          monadic sequence for maybe
mapMMaybe  :: (a -> Maybe b) -> [a] -> Maybe [b]  deterministic 
          monadic map for maybe

 Imported modules:

Prelude

 Exported datatypes:


 Exported functions:

isJust :: Maybe a -> Bool  deterministic flexible

Further infos:
  • solution complete, i.e., able to compute all solutions

isNothing :: Maybe a -> Bool  deterministic flexible

Further infos:
  • solution complete, i.e., able to compute all solutions

fromJust :: Maybe a -> a  deterministic flexible


fromMaybe :: a -> Maybe a -> a  deterministic flexible

Further infos:
  • solution complete, i.e., able to compute all solutions

maybeToList :: Maybe a -> [a]  deterministic flexible

Further infos:
  • solution complete, i.e., able to compute all solutions

listToMaybe :: [a] -> Maybe a  deterministic flexible

Further infos:
  • solution complete, i.e., able to compute all solutions

catMaybes :: [Maybe a] -> [a]  deterministic 


mapMaybe :: (a -> Maybe b) -> [a] -> [b]  deterministic 


(>>-) :: Maybe a -> (a -> Maybe b) -> Maybe b  deterministic flexible

Monadic bind for Maybe. Maybe can be interpreted as a monad where Nothing is interpreted as the error case by this monadic binding.

Example call:  (maybeValue >>- f)

Parameters:
maybeValue - Nothing or Just x
f - function to be applied to x
Returns:
Nothing if maybeValue is Nothing, otherwise f is applied to x
Further infos:
  • defined as left-associative infix operator with precedence 1

sequenceMaybe :: [Maybe a] -> Maybe [a]  deterministic flexible

monadic sequence for maybe


mapMMaybe :: (a -> Maybe b) -> [a] -> Maybe [b]  deterministic 

monadic map for maybe



Generated by CurryDoc (Version 0.4.1 of June 7, 2007) at Aug 28 15:25:36 2008