chatty-utils-0.7.3.5: Some utilities every serious chatty-based application may need.
Safe HaskellSafe
LanguageHaskell2010

Data.Chatty.None

Description

Provides a typeclass for everything that may carry a void value

Synopsis

Documentation

class None n where Source #

Typeclass for everything that may carry a void value

Methods

none :: n Source #

Instances

Instances details
None Bool Source # 
Instance details

Defined in Data.Chatty.None

Methods

none :: Bool Source #

None Int Source # 
Instance details

Defined in Data.Chatty.None

Methods

none :: Int Source #

None Integer Source # 
Instance details

Defined in Data.Chatty.None

Methods

none :: Integer Source #

None () Source # 
Instance details

Defined in Data.Chatty.None

Methods

none :: () Source #

None Text Source # 
Instance details

Defined in Data.Chatty.None

Methods

none :: Text Source #

None [a] Source # 
Instance details

Defined in Data.Chatty.None

Methods

none :: [a] Source #

None (Maybe a) Source # 
Instance details

Defined in Data.Chatty.None

Methods

none :: Maybe a Source #

None (BST a) Source # 
Instance details

Defined in Data.Chatty.BST

Methods

none :: BST a Source #

None (Focus a) Source # 
Instance details

Defined in Data.Chatty.Focus

Methods

none :: Focus a Source #

None (AVL a) Source # 
Instance details

Defined in Data.Chatty.AVL

Methods

none :: AVL a Source #

None (TST a) Source # 
Instance details

Defined in Data.Chatty.TST

Methods

none :: TST a Source #

Monad m => None (a -> m a) Source # 
Instance details

Defined in Data.Chatty.None

Methods

none :: a -> m a Source #

None (a -> a) Source # 
Instance details

Defined in Data.Chatty.None

Methods

none :: a -> a Source #

None (Graph a b c) Source # 
Instance details

Defined in Data.Chatty.Graph

Methods

none :: Graph a b c Source #

noneM :: (Monad m, None n) => m n Source #

Wrap the void into a monad.

joinMaybe :: None n => Maybe n -> n Source #

Join a maybe into the underlying type. Nothing becomes none.

expandMaybe :: (Eq n, None n) => n -> Maybe n Source #

Wrap the value into a maybe. none becomes Nothing.

cleanMaybe :: (Eq n, None n) => Maybe n -> Maybe n Source #

Clean the maybe by pulling wrapped nones to the outside (as a Nothing).

reduce :: (Eq n, None n) => [n] -> [n] Source #

Eliminate all void elements from the list.

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

Eliminate all Nothings from the list and unjust all remaining values.