safe alternatives and similar packages
Based on the "Unclassified" category
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of safe or a related project?
A library wrapping
Data.List functions that can throw exceptions, such as
!!. Each unsafe function has up to four variants, e.g. with
- tail :: [a] -> [a], raises an error on
- tailMay :: [a] -> Maybe [a], turns errors into
- tailDef :: [a] -> [a] -> [a], takes a default to return on errors.
- tailNote :: String -> [a] -> [a], takes an extra argument which supplements the error message.
- tailSafe :: [a] -> [a], returns some sensible default if possible,
in the case of
This package is divided into three modules:
Safecontains safe variants of
Safe.Foldablecontains safe variants of
Safe.Exactcreates crashing versions of functions like
zip(errors if the lists are not equal) and
take(errors if there are not enough elements), then wraps them to provide safe variants.