-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Hang loose with your lambdas!
--   
--   Combinators for clean, "hanging" lambdas.
@package overhang
@version 1.0.0

module Overhang

-- | Hang on the <a>Left</a> case of an <a>Either</a>.
--   
--   <pre>
--   onLeft e r l = either l r e
--   </pre>
onLeft :: Either a b -> (b -> c) -> (a -> c) -> c

-- | Hang on the <a>Right</a> case of an <a>Either</a>.
--   
--   <pre>
--   onRight e l r = either l r e
--   </pre>
onRight :: Either a b -> (a -> c) -> (b -> c) -> c

-- | Hang on the <a>Just</a> case of a <a>Maybe</a>.
--   
--   <pre>
--   onJust m d j = maybe d j m
--   </pre>
onJust :: Maybe a -> b -> (a -> b) -> b

-- | Hang on the <a>Nothing</a> case of a <a>Maybe</a>. Mostly useful when
--   <tt>b</tt> is some monadic computation.
--   
--   <pre>
--   onNothing m j d = maybe d j m
--   </pre>
onNothing :: Maybe a -> (a -> b) -> b -> b

-- | Hang on function application, a.k.a. non-operator version of
--   <a>&amp;</a>.
--   
--   <pre>
--   onApp = (&amp;)
--   </pre>
onApp :: a -> (a -> b) -> b

-- | Hang on a <a>Functor</a> mapping function, a.k.a. non-operator version
--   of <tt>&lt;&amp;&gt;</tt> from <tt>lens</tt>.
--   
--   <pre>
--   onMap = flip fmap
--   </pre>
onMap :: Functor f => f a -> (a -> b) -> f b

-- | Hang on the <a>ExitSuccess</a> case of an <a>ExitCode</a>. Mostly
--   useful when <tt>b</tt> is some monadic computation.
onExitSuccess :: ExitCode -> (Int -> b) -> b -> b

-- | Hang on the <a>ExitFailure</a> case of an <a>ExitCode</a>.
onExitFailure :: ExitCode -> b -> (Int -> b) -> b

-- | Hang on the <a>True</a> case of <a>bool</a>.
--   
--   <pre>
--   onTrue b f t = bool f t b
--   </pre>
onTrue :: Bool -> a -> a -> a

-- | Hang on the <a>False</a> case of <a>bool</a>.
--   
--   <pre>
--   onFalse b t f = bool f t b
--   </pre>
onFalse :: Bool -> a -> a -> a

-- | Hang on the "left" folding portion of a <a>Bifoldable</a>. A variant
--   of <a>bifor_</a>.
--   
--   <pre>
--   onBiforFirst_ t g f = bifor_ t f g
--   </pre>
onBiforFirst_ :: (Bifoldable t, Applicative f) => t a b -> (b -> f d) -> (a -> f c) -> f ()

-- | Alias for <a>onBiforFirst_</a>.
onBiforFirstM_ :: (Bifoldable t, Applicative f) => t a b -> (b -> f d) -> (a -> f c) -> f ()

-- | Hang on the "left" mapping portion of a <a>Bifunctor</a>.
--   
--   <pre>
--   onBimapFirst t g f = bimap f g t
--   </pre>
onBimapFirst :: Bifunctor t => t a c -> (c -> d) -> (a -> b) -> t b d

-- | Hang on the "right" mapping portion of a <a>Bifunctor</a>.
--   
--   <pre>
--   onBimapSecond t f g = bimap f g t
--   </pre>
onBimapSecond :: Bifunctor t => t a c -> (a -> b) -> (c -> d) -> t b d

-- | Hang on the "left" traversing portion of a <a>Bitraversable</a>. A
--   variant of <a>bifor</a>.
--   
--   <pre>
--   onBiforFirst t g f = bifor t f g
--   </pre>
onBiforFirst :: (Bitraversable t, Applicative f) => t a b -> (b -> f d) -> (a -> f c) -> f (t c d)

-- | Alias for <a>onBiforFirst</a>.
onBiforFirstM :: (Bitraversable t, Applicative f) => t a b -> (b -> f d) -> (a -> f c) -> f (t c d)
