util-plus-0.1.0.0: A collection of commonly used utils

Safe HaskellSafe
LanguageHaskell2010

Safe.Plus

Synopsis

Documentation

callerFile :: HasCallStack => String Source #

The filename of the first caller which called a function with implicit parameter (callStack :: CallStack).

callerLine :: HasCallStack => Int Source #

The line number of the first caller which called a function with implicit parameter (callStack :: CallStack).

safeDigitToInt :: Monad m => Char -> m Int Source #

Convert a single digit Char to the corresponding Int. This function fails unless its argument satisfies isHexDigit, but recognises both upper and lower-case hexadecimal digits (i.e. '0'..'9', 'a'..'f', 'A'..'F').

safeHead :: HasCallStack => [a] -> a Source #

safeTail :: HasCallStack => [a] -> [a] Source #

safeInit :: HasCallStack => [a] -> [a] Source #

safeLast :: HasCallStack => [a] -> a Source #

safeMaximum :: (HasCallStack, Ord a) => [a] -> a Source #

safeMinimum :: (HasCallStack, Ord a) => [a] -> a Source #

safeAtArray :: (HasCallStack, IArray a e, Ix i, Show i) => a i e -> i -> e Source #

atArrayNote :: (IArray a e, Ix i, Show i) => String -> a i e -> i -> e Source #

safeAt :: HasCallStack => [a] -> Int -> a Source #