-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell extras (missing utility functions). -- -- Utility functions that some may feel are missing from Prelude and -- base. -- -- Some functions are taken from the package hinduce-missingh, -- which was written by Robert Hensing and published under the BSD -- 3-clause license. @package hx @version 0.3 -- | Unsafe functions (use for debugging only). module Haskell.X.Unsafe -- | trace x shows and returns x. trace :: Show a => a -> a -- | debug x a shows x and returns a. debug :: Show b => b -> a -> a -- | This is a shorthand for unsafePerformIO. io :: IO a -> a -- | Haskell extra operators. Do not import qualified. module Haskell.X.Ops -- | flip ($), fixity is infixl 1 (like -- >>= but for non-monadic functions) (->>) :: a -> (a -> b) -> b -- | Like ->>, but wraps its result so that it can be used -- in a monad. Fixity is infixl 1. (=>>) :: Monad m => a -> (a -> b) -> m b -- | flip (.), fixity is infixl 9 (same as for -- .), from F#. (|>) :: (a -> b) -> (b -> c) -> (a -> c) -- | An infix synonym for fmap. (<$>) :: Functor f => (a -> b) -> f a -> f b -- | Haskell extra utility functions. Best imported by import qualified -- Haskell.X as X. module Haskell.X -- | Apply a function exhaustively. exhaustively :: Eq a => (a -> a) -> a -> a -- | Apply a function exhaustively. exhaustivelyBy :: (a -> a -> Bool) -> (a -> a) -> a -> a -- | Apply a monadic function exhaustively. exhaustivelyM :: (Eq a, Monad m) => (a -> m a) -> a -> m a -- | Apply a monadic function exhaustively. exhaustivelyByM :: Monad m => (a -> a -> Bool) -> (a -> m a) -> a -> m a -- | Sort a list and leave out duplicates. Like nub . sort but -- faster. uniqSort :: Ord a => [a] -> [a] -- | Sort, then group aggregateBy :: (a -> a -> Ordering) -> [a] -> [[a]] -- | Sort, then group aggregate :: Ord a => [a] -> [[a]] -- | Aggregate an association list, such that keys become unique. -- -- (c) aggregateAL :: Ord a => [(a, b)] -> [(a, [b])] -- | Replace all occurences of a specific thing in a list of things another -- thing. tr :: Eq a => a -> a -> [a] -> [a] -- | Counts how many elements there are in a 4 levels deep list. count4 :: [[[[a]]]] -> Int -- | Counts how many elements there are in a 3 levels deep list. count3 :: [[[a]]] -> Int -- | Counts how many elements there are in a 2 levels deep list. count2 :: [[a]] -> Int -- | Counts how many elements there are in a 1 level deep list. count1 :: [a] -> Int -- | Segments the elements of a 3 levels deep list such that the segments -- contain at least the specified amount of elements, without breaking -- apart any subsegments. segment3 :: Int -> [[[a]]] -> [[a]] -- | Segments the elements of a 2 levels deep list such that the segments -- contain at least the specified amount of elements, without breaking -- apart any subsegments. segment2 :: Int -> [[a]] -> [[a]] -- |
--   breakLast xs == (init xs, last xs)
--   
breakLast :: [a] -> ([a], a) -- | If an Either contains the same types in Left and Right, unify it by -- dropping the Either wrapper. uneither :: Either a a -> a