Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

- callerFile :: HasCallStack => String
- callerLine :: HasCallStack => Int
- callerLocation :: HasCallStack => String
- safeDigitToInt :: Monad m => Char -> m Int
- safeRead :: (HasCallStack, Read a) => String -> a
- readNoteVerbose :: Read a => String -> String -> a
- safeFromJust :: HasCallStack => Maybe a -> a
- safeFromJustNote :: HasCallStack => String -> Maybe a -> a
- safeHead :: HasCallStack => [a] -> a
- safeTail :: HasCallStack => [a] -> [a]
- safeInit :: HasCallStack => [a] -> [a]
- safeLast :: HasCallStack => [a] -> a
- safeMaximum :: (HasCallStack, Ord a) => [a] -> a
- safeMinimum :: (HasCallStack, Ord a) => [a] -> a
- safeHeadNote :: HasCallStack => String -> [a] -> a
- safeFromRight :: HasCallStack => Either a b -> b
- fromRightNote :: String -> Either a b -> b
- safeFromLeft :: HasCallStack => Either a b -> a
- fromLeftNote :: String -> Either a b -> a
- safeAtArray :: (HasCallStack, IArray a e, Ix i, Show i) => a i e -> i -> e
- atArrayNote :: (IArray a e, Ix i, Show i) => String -> a i e -> i -> e
- safeAt :: HasCallStack => [a] -> Int -> a
- safeError :: HasCallStack => String -> a
- safeFail :: (HasCallStack, Monad m) => String -> m a
- safeUndef :: HasCallStack => a

# 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`

)

callerLocation :: HasCallStack => String Source #

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'`

).

safeFromJust :: HasCallStack => Maybe a -> a Source #

safeFromJustNote :: HasCallStack => String -> Maybe a -> a Source #

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 #

safeHeadNote :: HasCallStack => String -> [a] -> a Source #

safeFromRight :: HasCallStack => Either a b -> b Source #

fromRightNote :: String -> Either a b -> b Source #

safeFromLeft :: HasCallStack => Either a b -> a Source #

fromLeftNote :: String -> Either a b -> a Source #

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

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

safeError :: HasCallStack => String -> a Source #

safeUndef :: HasCallStack => a Source #